MystenLabs / sui

Sui, a next-generation smart contract platform with high throughput, low latency, and an asset-oriented programming model powered by the Move programming language
https://sui.io
Apache License 2.0
6.28k stars 11.22k forks source link

[trace-view] Finessed support for tracing macros #20298

Closed awelc closed 1 week ago

awelc commented 1 week ago

Description

This PR finesses support for tracing macros, but due to how macros are (or rather are not) represented in the bytecode and source maps, this support has some limitations. In particular:

  1. Currently we don't keep track of variable values inside macros
  2. Macros and lambdas are not real function calls so when tracing execution of the macro, control flow may move somewhat unpredictably between the caller and callee
  3. We track macro invocations using virtual frames but these are not necessarily pushed/popped symmetrically due to lack of precise information on when macro code starts and ends. As a result we keep limited number of virtual frames on the stack (max 2) - more detailed explanation can be found in code comments

Test plan

All new and old tests must pass

vercel[bot] commented 1 week ago

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 Nov 18, 2024 0:13am
3 Skipped Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **multisig-toolkit** | ⬜️ Ignored ([Inspect](https://vercel.com/mysten-labs/multisig-toolkit/CCSRXUVf4CVQWfNB9jXAD84YdSuQ)) | [Visit Preview](https://multisig-toolkit-git-aw-trace-view-macros-mysten-labs.vercel.app) | | Nov 18, 2024 0:13am | | **sui-kiosk** | ⬜️ Ignored ([Inspect](https://vercel.com/mysten-labs/sui-kiosk/9si12RzmYBXg4HXkxHjGP1Np8mV2)) | [Visit Preview](https://sui-kiosk-git-aw-trace-view-macros-mysten-labs.vercel.app) | | Nov 18, 2024 0:13am | | **sui-typescript-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/mysten-labs/sui-typescript-docs/4gUjskdsVvoWiNJP7er54KpvoyEy)) | [Visit Preview](https://sui-typescript-docs-git-aw-trace-view-macros-mysten-labs.vercel.app) | | Nov 18, 2024 0:13am |