(
&self,
address: u64,
code: &[u8],
_section_index: usize,
_relocations: &[Relocation],
diff_config: &DiffObjConfig,
)
| 206 | |
| 207 | impl Arch for ArchMips { |
| 208 | fn scan_instructions_internal( |
| 209 | &self, |
| 210 | address: u64, |
| 211 | code: &[u8], |
| 212 | _section_index: usize, |
| 213 | _relocations: &[Relocation], |
| 214 | diff_config: &DiffObjConfig, |
| 215 | ) -> Result<Vec<InstructionRef>> { |
| 216 | let instruction_flags = self.instruction_flags(diff_config); |
| 217 | let mut ops = Vec::<InstructionRef>::with_capacity(code.len() / 4); |
| 218 | let mut cur_addr = address as u32; |
| 219 | for chunk in code.chunks_exact(4) { |
| 220 | let code = self.endianness.read_u32_bytes(chunk.try_into()?); |
| 221 | let instruction = |
| 222 | rabbitizer::Instruction::new(code, Vram::new(cur_addr), instruction_flags); |
| 223 | let opcode = instruction.opcode() as u16; |
| 224 | let branch_dest = instruction.get_branch_vram_generic().map(|v| v.inner() as u64); |
| 225 | ops.push(InstructionRef { address: cur_addr as u64, size: 4, opcode, branch_dest }); |
| 226 | cur_addr += 4; |
| 227 | } |
| 228 | Ok(ops) |
| 229 | } |
| 230 | |
| 231 | fn display_instruction( |
| 232 | &self, |
nothing calls this directly
no test coverage detected