angr.analyses.s_reaching_definitions.s_rda_model¶
- class angr.analyses.s_reaching_definitions.s_rda_model.SRDAModel¶
Bases:
objectThe model for SRDA.
- __init__(func_graph, func_args, arch, variable_map=None)¶
- add_vvar_use(vvar_id, expr, loc)¶
- Return type:
- Parameters:
vvar_id (int)
expr (VirtualVariable | None)
loc (AILCodeLocation)
- update_after_block_edits(edited_blocks)¶
Incrementally update the model after the statements of
edited_blockswere edited in place (statement indices preserved, e.g. by replacing removed statements withNoOpplaceholders). vvar definitions and explicit vvar uses inside the edited blocks are recomputed from the edited blocks; implicit uses (expr is None, e.g. call-site argument registers) and all unedited blocks are left untouched.This is designed to be equivalent to a full SRDA rebuild on the edited graph for the kind of edits performed by dead-assignment removal: statements are only removed (turned into NoOp) or rewritten in place, never inserted or reordered, and removed vvars are dead (so they are never used elsewhere, including by phi nodes or implicit call-site uses). Tmp tracking is not updated (AILSimplifier does not track tmps).
- Return type:
- canonical_form()¶
An order-insensitive snapshot of the model’s vvar-keyed data, for asserting equivalence between an incrementally-updated model and a freshly-rebuilt one (used by the incremental-update verification harness).
- property all_definitions: Iterator[Definition[VirtualVariable, AILCodeLocation]]¶
- get_all_definitions(block_loc)¶
- Return type:
- Parameters:
block_loc (AILCodeLocation)
- get_all_tmp_definitions(block_loc)¶
- Return type:
- Parameters:
block_loc (Address)
- get_uses_by_location(loc, exprs=False)¶
- Overloads:
self, loc (AILCodeLocation), exprs (Literal[True]) → set[tuple[Definition[atoms.VirtualVariable, AILCodeLocation], Any | None]]
self, loc (AILCodeLocation), exprs (Literal[False]) → set[Definition[atoms.VirtualVariable, AILCodeLocation]]
- Parameters:
loc (AILCodeLocation)
exprs (bool)
- Return type:
set[Definition[VirtualVariable, AILCodeLocation]] | set[tuple[Definition[VirtualVariable, AILCodeLocation], Any | None]]
Retrieve all definitions that are used at a given location.
- Parameters:
loc (
AILCodeLocation) – The code location.exprs (bool)
- Returns:
A set of definitions that are used at the given location.
- Return type:
set[Definition[VirtualVariable, AILCodeLocation]] | set[tuple[Definition[VirtualVariable, AILCodeLocation], Any | None]]
- get_vvar_uses(obj)¶
- Return type:
- Parameters:
obj (VirtualVariable | VirtualVariable)
- get_vvar_uses_with_expr(obj)¶
- Return type:
- Parameters:
obj (VirtualVariable | VirtualVariable)
- get_uses_by_def(def_)¶
- Return type:
- Parameters:
def_ (Definition[VirtualVariable | Tmp, AILCodeLocation])