Repository navigation
v2.64.0: cfg_sh2a: SH-2A control-flow graph builder.
cfg_sh2a: SH-2A control-flow graph builder.
New module: ablation/analyzers/cfg_sh2a.py.
3 things that were not possible before in Ablation:
- No CFG for SH-2A. Every other ISA with a lifter backend also had a CFG
module; SH-2A was the only exception. Without a CFG, the structurizer and
DomTree cannot run on SH-2A firmware. - No delay-slot semantics in any CFG builder. SH-2A's delay-slot model
(one instruction always executes after a branch before the branch fires) is
architecturally distinct from all prior CFG modules (ARM, V850, ARC, x86).
cfg_sh2acorrectly attaches the delay-slot instruction to the terminating
block so successor VAs are computed from after the delay slot, not from
after the branch. - No
.flow/.flow_r()interface on SH-2A CFG.dataflow_engine.DomTree
and all backward-dataflow passes require these.cfg_sh2a.CFGadds both
as computed properties.
New:
Block(start, insns, succs, preds): basic block for SH-2A. Delay-slot
instruction is the lastinsnsentry when the terminator has a delay slot.CFG(blocks, entry)with.flowproperty and.flow_r()method for
duck-type compatibility withdataflow_engine.CFG.build_cfg(insns, entry=None) -> CFG: three-pass construction
(leader scan → partition → edge fill).- Delay-slot semantics: WITH delay slot = {bra, bsr, jsr, bt/s, bf/s, rts, rte};
WITHOUT = {bt, bf, rts/n}. BRAF/BSRF/JMP@Rn decode as MISC → open blocks
(documented limitation). - Compatible with
DomTree,LoopInfofromdataflow_enginevia duck typing. - Docs:
docs/module-reference/cfg-sh2a.md.