From 8ca27aeeb99a0da43e92e39918aa07c0b1443c07 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Thu, 19 Dec 2024 19:47:19 +0100 Subject: rt: remove dump() and add disasm(), to directly disasm code using ndisasm if available --- examples/add.rs | 5 ++--- examples/fib.rs | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/add.rs b/examples/add.rs index 3ad8893..fee5392 100644 --- a/examples/add.rs +++ b/examples/add.rs @@ -30,9 +30,8 @@ fn main() { let mut rt = Runtime::new(); let add42 = unsafe { rt.add_code:: u32>(asm.into_code()) }; - // Write out JIT code for visualization. - // Disassemble for example with `ndisasm -b 64 jit.asm`. - rt.dump(); + // Disassemble JIT code and write to stdout. + rt.disasm(); let res = add42(5); assert_eq!(res, 47); diff --git a/examples/fib.rs b/examples/fib.rs index c38589f..573b27c 100644 --- a/examples/fib.rs +++ b/examples/fib.rs @@ -66,9 +66,8 @@ fn main() { let mut rt = Runtime::new(); let fib = unsafe { rt.add_code:: u64>(asm.into_code()) }; - // Write out JIT code for visualization. - // Disassemble for example with `ndisasm -b 64 jit.asm`. - rt.dump(); + // Disassemble JIT code and write to stdout. + rt.disasm(); for n in 0..15 { let fib_jit = fib(n); -- cgit v1.2.3