| 129 | |
| 130 | @dataclass(frozen=False) |
| 131 | class InstructionInfo: |
| 132 | length: int = 0 |
| 133 | arch_transition_by_target_addr: bool = False |
| 134 | branch_delay: int = 0 |
| 135 | branches: List[InstructionBranch] = field(default_factory=list) |
| 136 | |
| 137 | def add_branch(self, branch_type: BranchType, target: int = 0, arch: Optional['Architecture'] = None) -> None: |
| 138 | self.branches.append(InstructionBranch(branch_type, target, arch)) |
| 139 | |
| 140 | def __len__(self): |
| 141 | return self.length |
| 142 | |
| 143 | def __repr__(self): |
| 144 | branch_delay = "" |
| 145 | if self.branch_delay: |
| 146 | branch_delay = ", delay slot" |
| 147 | return f"<instr: {self.length} bytes{branch_delay}, {repr(self.branches)}>" |
| 148 | |
| 149 | |
| 150 | class _ArchitectureMetaClass(type): |
no outgoing calls
no test coverage detected