mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-23 05:31:32 +00:00
Get aggressive about running cargo check over all packages with all features.
Fixes the one issue uncovered. The capstone disassembling support in the LLVM backend was broken. Fixed by removing it. Instead, use the `--llvm-object-file` flag to get a finished object file to disassemble with any disassembler.
This commit is contained in:
@ -477,33 +477,3 @@ impl CacheGen for LLVMCache {
|
||||
Ok(([].as_ref().into(), memory))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "disasm")]
|
||||
unsafe fn disass_ptr(ptr: *const u8, size: usize, inst_count: usize) {
|
||||
use capstone::arch::BuildsCapstone;
|
||||
let mut cs = capstone::Capstone::new() // Call builder-pattern
|
||||
.x86() // X86 architecture
|
||||
.mode(capstone::arch::x86::ArchMode::Mode64) // 64-bit mode
|
||||
.detail(true) // Generate extra instruction details
|
||||
.build()
|
||||
.expect("Failed to create Capstone object");
|
||||
|
||||
// Get disassembled instructions
|
||||
let insns = cs
|
||||
.disasm_count(
|
||||
std::slice::from_raw_parts(ptr, size),
|
||||
ptr as u64,
|
||||
inst_count,
|
||||
)
|
||||
.expect("Failed to disassemble");
|
||||
|
||||
println!("count = {}", insns.len());
|
||||
for insn in insns.iter() {
|
||||
println!(
|
||||
"0x{:x}: {:6} {}",
|
||||
insn.address(),
|
||||
insn.mnemonic().unwrap_or(""),
|
||||
insn.op_str().unwrap_or("")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user