``class BasicBlockEdge`` represents the edges that connect basic blocks in graph view. :cvar type: The :py:meth:`enums.BranchType` of the edge; Whether the edge is a true branch, false branch, unconditional, etc. :cvar source: The basic block that the edge originates from. :cvar target: The ba
| 34 | |
| 35 | @dataclass(frozen=True) |
| 36 | class BasicBlockEdge: |
| 37 | """ |
| 38 | ``class BasicBlockEdge`` represents the edges that connect basic blocks in graph view. |
| 39 | |
| 40 | :cvar type: The :py:meth:`enums.BranchType` of the edge; Whether the edge is a true branch, false branch, unconditional, etc. |
| 41 | :cvar source: The basic block that the edge originates from. |
| 42 | :cvar target: The basic block that the edge is going to. |
| 43 | :cvar backedge: Whether this edge targets to a node whose control flow can eventually flow back through the source node of this edge. |
| 44 | :Example: |
| 45 | |
| 46 | >>> current_basic_block.outgoing_edges |
| 47 | [<TrueBranch: x86_64@0x6>, <FalseBranch: x86_64@0x1f>] |
| 48 | """ |
| 49 | type: BranchType |
| 50 | source: 'BasicBlock' |
| 51 | target: 'BasicBlock' |
| 52 | back_edge: bool |
| 53 | fall_through: bool |
| 54 | |
| 55 | def __repr__(self): |
| 56 | if self.type == BranchType.UnresolvedBranch: |
| 57 | return f"<{self.type.name}>" |
| 58 | elif self.target.arch: |
| 59 | return f"<{self.type.name}: {self.target.arch.name}@{self.target.start:#x}>" |
| 60 | else: |
| 61 | return f"<{self.type.name}: {self.target.start:#x}>" |
| 62 | |
| 63 | |
| 64 | class BasicBlock: |