| 186 | |
| 187 | #[cfg(feature = "disas")] |
| 188 | fn to_capstone(&self) -> Result<capstone::Capstone, capstone::Error> { |
| 189 | use capstone::prelude::*; |
| 190 | let mut cs = Capstone::new() |
| 191 | .arm64() |
| 192 | .mode(arch::arm64::ArchMode::Arm) |
| 193 | .detail(true) |
| 194 | .build()?; |
| 195 | // AArch64 uses inline constants rather than a separate constant pool right now. |
| 196 | // Without this option, Capstone will stop disassembling as soon as it sees |
| 197 | // an inline constant that is not also a valid instruction. With this option, |
| 198 | // Capstone will print a `.byte` directive with the bytes of the inline constant |
| 199 | // and continue to the next instruction. |
| 200 | cs.set_skipdata(true)?; |
| 201 | Ok(cs) |
| 202 | } |
| 203 | |
| 204 | fn pretty_print_reg(&self, reg: Reg, _size: u8) -> String { |
| 205 | inst::regs::pretty_print_reg(reg) |