Stream: general

Topic: ✔ Disassembling .cwasm files


view this post on Zulip Alan Wang (Jan 24 2024 at 15:15):

Hi!

I've been looking to dissassemble .cwasm files generated by wasmtime compile. I can't seem to figure it out. Does anyone have a quick way to do so? I've tried various tools like objdump and wasm-objdump

Thanks

view this post on Zulip Alex Crichton (Jan 24 2024 at 15:38):

the *.cwasm output is an ELF file so you can pass it to objdump. Note though that we'd prefer if you don't rely on the particulars of the format, but for debugging that's what I do, pass it to objdump

view this post on Zulip Alan Wang (Jan 24 2024 at 15:46):

I've tried objdump -d but I get the following error file format elf64-x86-64 objdump: error: can't find target: unable to get target for 'x86_64--', see --version and --triple.

I'm also compiling for my current platform wasmtime compile <file>

view this post on Zulip Alex Crichton (Jan 24 2024 at 15:52):

what platform are you on?

view this post on Zulip Alex Crichton (Jan 24 2024 at 15:52):

if you have llvm-objdump available that may work better

view this post on Zulip Alan Wang (Jan 24 2024 at 15:54):

Ha, actually I figured it out, my objdump was not the system /usr/bin objdump it was the wasi-sdk objdump which is missing all the formats. Using the /usr/bin/objdump works :)

view this post on Zulip Alan Wang (Jan 24 2024 at 15:54):

Thanks, though! Appreciate the help :)

view this post on Zulip Notification Bot (Jan 24 2024 at 15:54):

Alan Wang has marked this topic as resolved.


Last updated: Dec 23 2024 at 12:05 UTC