angr.analyses.forward_analysis.visitors.graph¶
- class angr.analyses.forward_analysis.visitors.graph.GraphVisitor¶
Bases:
GenericA graph visitor takes a node in the graph and returns its successors. Typically, it visits a control flow graph, and returns successors of a CFGNode each time. This is the base class of all graph visitors.
- __init__()¶
- successors(node)¶
Get successors of a node. The node should be in the graph.
- predecessors(node)¶
Get predecessors of a node. The node should be in the graph.
- sort_nodes(nodes=None)¶
Get a list of all nodes sorted in an optimal traversal order.
- Parameters:
nodes (
Collection[TypeVar(NodeType)] |None) – A collection of nodes to sort. If none, all nodes in the graph will be used to sort.- Return type:
- Returns:
A list of sorted nodes.
- back_edges()¶
Get a list of back edges. This function is optional. If not overridden, the traverser cannot achieve an optimal graph traversal order.
- nodes()¶
Return an iterator of nodes following an optimal traversal order.
- reset()¶
Reset the internal node traversal state. Must be called prior to visiting future nodes.
- Returns:
None
- next_node()¶
Get the next node to visit.
- all_successors(node, skip_reached_fixedpoint=False)¶
Returns all successors to the specific node.
- revisit_successors(node, include_self=True)¶
Revisit a node in the future. As a result, the successors to this node will be revisited as well.
- revisit_node(node)¶
Revisit a node in the future. Do not include its successors immediately.