Add a wasmtime objdump subcommand #10405
Conversation
|
I'll note that this is built on #10404 currently and an example output looks like this:
|
Subscribe to Label ActionDetailsThis 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:
To subscribe or unsubscribe from this label, edit the |
fitzgen
left a comment
There was a problem hiding this comment.
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
| /// Whether or not to interleave instructions with address maps. | ||
| #[arg(long)] | ||
| addrmap: bool, | ||
|
|
||
| /// Whether or not to interleave instructions with stack maps. | ||
| #[arg(long)] | ||
| stack_maps: bool, | ||
|
|
||
| /// Column width of how large an address is rendered as. | ||
| #[arg(long, default_value = "10")] | ||
| address_width: usize, | ||
|
|
||
| /// Whether or not to show information about what instructions can trap. | ||
| #[arg(long)] | ||
| traps: bool, |
There was a problem hiding this comment.
These seem like they should all be on by default?
There was a problem hiding this 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.
|
It'll take me some time to work through the stack map bits, so I'm splitting that out of this PR |
|
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 |
This commit consolidates all of the existing crates we have for testing into a smaller set of crates. Specifically: * `crates/misc/component-fuzz-util` => `wasmtime-test-util` + `component-fuzz` feature * `crates/misc/component-test-util` => `wasmtime-test-util` + `component` feature * `crates/wast-util` => `wasmtime-test-util` + `wast` feature * `crates/misc/component-macro-test` => `wasmtime-test-macros` The goal is to have one location we put various test helpers/macros rather than our current organically-grown many locations. This is inspired by the test failure on bytecodealliance#10405 where I'd like to refactor more infrastructure to a "test util" location but it wasn't clear where to put it so I wanted to do this refactoring first.
|
This PR now depends on #10423 and is temporarily rebased on it |
Subscribe to Label Actioncc @fitzgen DetailsThis issue or pull request has been labeled: "fuzzing"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
* Consolidate "util" crates for testing This commit consolidates all of the existing crates we have for testing into a smaller set of crates. Specifically: * `crates/misc/component-fuzz-util` => `wasmtime-test-util` + `component-fuzz` feature * `crates/misc/component-test-util` => `wasmtime-test-util` + `component` feature * `crates/wast-util` => `wasmtime-test-util` + `wast` feature * `crates/misc/component-macro-test` => `wasmtime-test-macros` The goal is to have one location we put various test helpers/macros rather than our current organically-grown many locations. This is inspired by the test failure on #10405 where I'd like to refactor more infrastructure to a "test util" location but it wasn't clear where to put it so I wanted to do this refactoring first. * Remove unused file
This commit adds an `objdump` subcommand to the `wasmtime` 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 native `objdump` 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 uses `wasmtime objdump` to generate test expectations. Additionally the subcommand replaces the Pulley `objdump` 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 bytecodealliance#10336
`IOView` is split off of `WasiView`. bytecodealliance/wasmtime#10016 `static_memory_maximum_size` is now `memory_reservation`. bytecodealliance/wasmtime#9545 `detect_precompiled` is now associated function. bytecodealliance/wasmtime#10405
`IOView` is split off of `WasiView`. bytecodealliance/wasmtime#10016 `static_memory_maximum_size` is now `memory_reservation`. bytecodealliance/wasmtime#9545 `detect_precompiled` is now associated function. bytecodealliance/wasmtime#10405 Moved WASIp2 related things to `wasmtime_wasi::p2` module. bytecodealliance/wasmtime#10073
`IOView` is split off of `WasiView`. bytecodealliance/wasmtime#10016 `static_memory_maximum_size` is now `memory_reservation`. bytecodealliance/wasmtime#9545 `detect_precompiled` is now associated function. bytecodealliance/wasmtime#10405 Moved WASIp2 related things to `wasmtime_wasi::p2` module. bytecodealliance/wasmtime#10073
`IOView` is split off of `WasiView`. bytecodealliance/wasmtime#10016 `static_memory_maximum_size` is now `memory_reservation`. bytecodealliance/wasmtime#9545 `detect_precompiled` is now associated function. bytecodealliance/wasmtime#10405 Moved WASIp2 related things to `wasmtime_wasi::p2` module. bytecodealliance/wasmtime#10073
`IOView` is split off of `WasiView`. bytecodealliance/wasmtime#10016 `static_memory_maximum_size` is now `memory_reservation`. bytecodealliance/wasmtime#9545 `detect_precompiled` is now associated function. bytecodealliance/wasmtime#10405 Moved WASIp2 related things to `wasmtime_wasi::p2` module. bytecodealliance/wasmtime#10073
`IOView` is split off of `WasiView`. bytecodealliance/wasmtime#10016 `static_memory_maximum_size` is now `memory_reservation`. bytecodealliance/wasmtime#9545 `detect_precompiled` is now associated function. bytecodealliance/wasmtime#10405 Moved WASIp2 related things to `wasmtime_wasi::p2` module. bytecodealliance/wasmtime#10073
`IOView` is split off of `WasiView`. bytecodealliance/wasmtime#10016 `static_memory_maximum_size` is now `memory_reservation`. bytecodealliance/wasmtime#9545 `detect_precompiled` is now associated function. bytecodealliance/wasmtime#10405 Moved WASIp2 related things to `wasmtime_wasi::p2` module. bytecodealliance/wasmtime#10073

This commit adds an
objdumpsubcommand to thewasmtimeCLI. Like allother 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 native
objdumpitself. Notablythis brings Wasmtime-specific knowledge for filtering functions, showing
Wasmtime metadata, etc.
This command is intended to look like
objdumproughly but also hasconfigurable 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
*.cwasmfile.This new subcommand replaces the infrastructure of the
disastestsuite, and now that test suite uses
wasmtime objdumpto generate testexpectations. Additionally the subcommand replaces the Pulley
objdumpexample 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 #10336