Skip to content

[cli/move] Expose --Xdebug flag for sui move disassemble #8948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 7, 2023

Conversation

amnn
Copy link
Contributor

@amnn amnn commented Mar 7, 2023

Description

Replicates a change to the move CLI, where the --Xdebug flag dumps a compiled module in its most raw form -- the Debug format of the CompiledModule type in Rust.

This helps to see what's going on in the module's pools which are otherwise hidden in the disassembly output.

Test Plan

First call to disassemble will forward to the move CLI's debug command and print both a source-mapped disassembly, and the raw output, and the second call will print just the raw output:

sui$ cargo build
sui$ target/debug/sui move disassemble --Xdebug crates/sui-framework/build/Sui/bytecode_modules/pay.mv
sui$ cp crates/sui-framework/build/Sui/bytecode_modules/pay.mv /tmp/
sui$ target/debug/sui move disassemble --Xdebug /tmp/pay.mv

Replicates a change to the `move` CLI, where the `--Xdebug` flag dumps
a compiled module in its most raw form -- the `Debug` format of the
`CompiledModule` type in Rust.

This helps to see what's going on in the module's pools which are
otherwise hidden in the disassembly output.

Test Plan:

First call to disassemble will forward to the move CLI's `debug`
command and print both a source-mapped disassembly, and the raw
output, and the second call will print just the raw output:

```
sui$ cargo build
sui$ target/debug/sui move disassemble --Xdebug crates/sui-framework/build/Sui/bytecode_modules/pay.mv
sui$ cp crates/sui-framework/build/Sui/bytecode_modules/pay.mv /tmp/
sui$ target/debug/sui move disassemble --Xdebug /tmp/pay.mv
```
@amnn amnn added move observability Observability for Sui, Narwhal, etc. Logging/metrics/alerting/tracing/events labels Mar 7, 2023
@amnn amnn self-assigned this Mar 7, 2023
@vercel
Copy link

vercel bot commented Mar 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Ignored Deployments
Name Status Preview Comments Updated
explorer ⬜️ Ignored (Inspect) Mar 7, 2023 at 2:53PM (UTC)
explorer-storybook ⬜️ Ignored (Inspect) Mar 7, 2023 at 2:53PM (UTC)
wallet-adapter ⬜️ Ignored (Inspect) Mar 7, 2023 at 2:53PM (UTC)

@Shuknasty80
Copy link

Nice

Copy link
Contributor

@oxade oxade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just a nit.

Co-authored-by: oxade <93547199+oxade@users.noreply.github.com>
@amnn amnn enabled auto-merge (squash) March 7, 2023 14:52
Copy link
Contributor

@rvantonder rvantonder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@amnn amnn merged commit 1c41943 into main Mar 7, 2023
@amnn amnn deleted the amnn/disassemble-xdebug branch March 7, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
move observability Observability for Sui, Narwhal, etc. Logging/metrics/alerting/tracing/events
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants