alexcrichton opened PR #10405 from alexcrichton:objdump
to bytecodealliance:main
:
This commit adds an
objdump
subcommand to thewasmtime
CLI. Like all
other subcommands this can be disabled for a more minimal build of the
CLI as well. The purpose of this subcommand is to provide a
Wasmtime-specific spin on the venerable nativeobjdump
itself. Notably
this brings Wasmtime-specific knowledge for filtering functions, showing
Wasmtime metadata, etc.This command is intended to look like
objdump
roughly but also has
configurable output with various flags and things that can be printed.
For now the main Wasmtime additions are showing the address map
section, stack map section, and trap section of a*.cwasm
file.This new subcommand replaces the infrastructure of the
disas
test
suite, and now that test suite useswasmtime objdump
to generate test
expectations. Additionally the subcommand replaces the Pulleyobjdump
example as a more full-featured objdump that also works natively with
Pulley.The hope is that if we add more binary metadata in the future (such as
unwinding tables) that can be relatively easily added here for
exploration as well. Otherwise this is mostly just a developer
convenience for Wasmtime developers as well and hopefully doesn't cost
too much in maintenance burden.Closes https://github.com/bytecodealliance/wasmtime/issues/10336
alexcrichton requested fitzgen for a review on PR #10405.
alexcrichton requested wasmtime-core-reviewers for a review on PR #10405.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #10405.
alexcrichton requested wasmtime-default-reviewers for a review on PR #10405.
alexcrichton commented on PR #10405:
I'll note that this is built on https://github.com/bytecodealliance/wasmtime/pull/10404 currently and an example output looks like this:
<img width="763" alt="Screenshot 2025-03-15 at 12 31 14 PM" src="https://github.com/user-attachments/assets/268af977-b8cd-48cf-ba6c-397dbb4a05bb" />
github-actions[bot] commented on PR #10405:
Subscribe to Label Action
cc @fitzgen, @saulecabrera
<details>
This issue or pull request has been labeled: "cranelift", "pulley", "wasmtime:api", "wasmtime:docs", "winch"Thus the following users have been cc'd because of the following labels:
- fitzgen: pulley
- saulecabrera: winch
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
alexcrichton updated PR #10405.
alexcrichton updated PR #10405.
fitzgen submitted PR review:
Looks fantastic! (modulo my comments on the stack-maps-in-an-elf-section bits in the other PR)
Thanks for putting this together, it is going to be super helpful going forward
fitzgen created PR review comment:
These seem like they should all be on by default?
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Personally I found the address map pretty noisy so I'm not sure we'd want to have that on-by-default. For the others I figured it wasn't too too hard to enable but it means we'd need flags to disable them. Flags-to-disable I find a bit cumbersome with with clap so I left it as off-by-default.
alexcrichton updated PR #10405.
alexcrichton commented on PR #10405:
It'll take me some time to work through the stack map bits, so I'm splitting that out of this PR
alexcrichton commented on PR #10405:
I'm going to go ahead and merge this but @fitzgen I'm happy to continue to iterate on the CLI and defaults if you'd like
alexcrichton updated PR #10405.
alexcrichton has enabled auto merge for PR #10405.
fitzgen submitted PR review.
fitzgen created PR review comment:
Yeah that makes sense :+1:
alexcrichton updated PR #10405.
alexcrichton requested wasmtime-fuzz-reviewers for a review on PR #10405.
alexcrichton commented on PR #10405:
This PR now depends on https://github.com/bytecodealliance/wasmtime/pull/10423 and is temporarily rebased on it
alexcrichton updated PR #10405.
github-actions[bot] commented on PR #10405:
Subscribe to Label Action
cc @fitzgen
<details>
This issue or pull request has been labeled: "fuzzing"Thus the following users have been cc'd because of the following labels:
- fitzgen: fuzzing
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
alexcrichton updated PR #10405.
alexcrichton has enabled auto merge for PR #10405.
alexcrichton merged PR #10405.
Last updated: Apr 17 2025 at 01:31 UTC