Skip to content
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

[trace-view] Added support for displaying disassembly view #20942

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

awelc
Copy link
Contributor

@awelc awelc commented Jan 22, 2025

Description

This PR adds support for viewing disassembly of Move source code when available. It does not use DAP's 'disassemblyRequest` feature as it does not seem mature enough to be used in our production setting. The particular problems discovered when trying to use it were:

  • difficulty to properly refresh the disassembly view when moving between disassembly located in different files
  • difficulty in controlling disassembly<->source transitions
  • difficulty in controlling how disassembly input looks like (in particular if trying to add "invalid" instructions surrounding the disassembly to satisfy number of instructions to be returned as per VSCode-specified requirements passed in disassemblyRequest)

The gist of this solution is to maintain two views of the trace state, one reflecting "source" execution and one (optional), reflecting "bytecode" execution". The two main differences between these views are:

  • local variable display: "source" view uses source-level variable names and hides "artificial" variables (generated by the compiler to support enums/macros), whereas "bytecode" displays all variables and uses their bytecode-level names
  • a line of source/bytecode being executed at stop points

Breakpoints are also handles separately for different views (i.e., source/bytecode-level breakpoints only work in frames that show source/bytecode, respectively).

Test plan

A new test for disassembly-level stepping, breakpoints and variable display has been added. All remaining tests must pass

@awelc awelc self-assigned this Jan 22, 2025
Copy link

vercel bot commented Jan 22, 2025

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

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2025 1:43am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2025 1:43am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2025 1:43am

@awelc awelc requested a review from dariorussi January 22, 2025 02:03
@awelc awelc temporarily deployed to sui-typescript-aws-kms-test-env January 22, 2025 02:03 — with GitHub Actions Inactive
@awelc awelc requested a review from tzakian January 22, 2025 02:03
@awelc awelc changed the title [trace-view] Addes support for displaying disassembly view [trace-view] Added support for displaying disassembly view Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant