angr.knowledge_plugins.key_definitions.uses¶
- class angr.knowledge_plugins.key_definitions.uses.Uses¶
Bases:
objectDescribes uses (including the use location and the use expression) for definitions.
- __init__(uses_by_definition=None, uses_by_location=None)¶
- Parameters:
uses_by_definition (DefaultChainMapCOW | None)
uses_by_location (DefaultChainMapCOW | None)
- add_use(definition, codeloc, expr=None)¶
Add a use for a given definition.
- Parameters:
definition (
Definition) – The definition that is used.codeloc (
CodeLocation) – The code location where the use occurs.expr (
Any|None) – The expression that uses the specified definition at this location.
- get_uses(definition)¶
Retrieve the uses of a given definition.
- Parameters:
definition (
Definition) – The definition for which we get the uses.- Return type:
- get_uses_with_expr(definition)¶
Retrieve the uses and the corresponding expressions of a given definition.
- Parameters:
definition (
Definition) – The definition for which we get the uses and the corresponding expressions.- Return type:
set[tuple[CodeLocation,Any|None]]
- remove_use(definition, codeloc, expr=None)¶
Remove one use of a given definition.
- Parameters:
definition (
Definition) – The definition of which to remove the uses.codeloc (
CodeLocation) – The code location where the use is.expr (
Any|None) – The expression that uses the definition at the given location.
- Return type:
- Returns:
None
- remove_uses(definition)¶
Remove all uses of a given definition.
- Parameters:
definition (
Definition) – The definition of which to remove the uses.- Returns:
None
- get_uses_by_location(codeloc, exprs=False)¶
Retrieve all definitions that are used at a given location.
- Parameters:
codeloc (
CodeLocation) – The code location.exprs (bool)
- Return type:
set[Definition] |set[tuple[Definition,Any|None]]- Returns:
A set of definitions that are used at the given location.
- get_uses_by_insaddr(ins_addr, exprs=False)¶
Retrieve all definitions that are used at a given location specified by the instruction address.
- Parameters:
- Return type:
set[Definition] |set[tuple[Definition,Any|None]]- Returns:
A set of definitions that are used at the given location.
- copy()¶
Copy the instance.
- Return type:
- Returns:
Return a new <Uses> instance containing the same data.