You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
disassemble the code into x86/aarch64 instruction format for debug usage, this can be gated behind a disassemble feature
example
demo code
// in JitMemory//capstone = { version = "0.13", optional = true }let cs = capstone::Capstone::new().x86()// shall handle x86 and aarch64 in the real world.mode(arch::x86::ArchMode::Mode64).syntax(arch::x86::ArchSyntax::Att).detail(detail).build().unwrap()let code = &self.contents[0..self.offset];let insns = cs.disasm_all(code,0).unwrap();for insn in insns {println!("{}", insn);}
output
for instructions
let prog = &[0x71,0x10,0x02,0x00,0x00,0x00,0x00,0x00,// ldxh r0, [r1+2]0x95,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// exit];
Thanks for the proposal, but I don't think we really need that in the crate. If users want to disassemble their program, they can probably do it outside of the library. I'm not sure we expose a way to retrieve the JITed program in rbpf, but we could add a function to do that; and then the user is free to disassemble or otherwise manipulate the JITed instructions in their app. What do you think?
motivation
disassemble the code into x86/aarch64 instruction format for debug usage, this can be gated behind a
disassemble
featureexample
demo code
output
for instructions
output is
The text was updated successfully, but these errors were encountered: