MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / to_capstone

Method to_capstone

cranelift/codegen/src/isa/aarch64/mod.rs:188–202  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 3

OkFunction · 0.85
newFunction · 0.50
buildMethod · 0.45

Tested by

no test coverage detected