-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[trace-view] Added support for native functions and global locations (#…
…20080) ## Description Adds support for native functions where the `CloseFrame` event happens right after `OpenFrame` event and both need to be skipped to skip over the native function. Also added support for handling global locations - they should be parsed properly but largely ignored in the trace as they cannot directly affect values of local variables ## Test plan All old and new tests must pass
- Loading branch information
Showing
30 changed files
with
1,269 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
external-crates/move/crates/move-analyzer/trace-adapter/tests/global_loc/Move.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "global_loc" | ||
edition = "2024.beta" | ||
|
||
[dependencies] | ||
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/mainnet" } | ||
|
||
[addresses] | ||
global_loc = "0x0" | ||
Sui = "0x2" |
Binary file added
BIN
+520 Bytes
...rates/move-analyzer/trace-adapter/tests/global_loc/build/global_loc/bytecode_modules/m.mv
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...ce-adapter/tests/global_loc/build/global_loc/source_maps/dependencies/MoveStdlib/bcs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"definition_location":{"file_hash":[34,201,103,208,120,108,208,171,127,162,154,113,96,186,51,169,173,216,199,217,88,54,128,150,101,140,27,7,37,201,47,24],"start":395,"end":398},"module_name":["0000000000000000000000000000000000000000000000000000000000000001","bcs"],"struct_map":{},"enum_map":{},"function_map":{"0":{"definition_location":{"file_hash":[34,201,103,208,120,108,208,171,127,162,154,113,96,186,51,169,173,216,199,217,88,54,128,150,101,140,27,7,37,201,47,24],"start":510,"end":518},"type_parameters":[["MoveValue",{"file_hash":[34,201,103,208,120,108,208,171,127,162,154,113,96,186,51,169,173,216,199,217,88,54,128,150,101,140,27,7,37,201,47,24],"start":519,"end":528}]],"parameters":[["v#0#0",{"file_hash":[34,201,103,208,120,108,208,171,127,162,154,113,96,186,51,169,173,216,199,217,88,54,128,150,101,140,27,7,37,201,47,24],"start":530,"end":531}]],"returns":[{"file_hash":[34,201,103,208,120,108,208,171,127,162,154,113,96,186,51,169,173,216,199,217,88,54,128,150,101,140,27,7,37,201,47,24],"start":546,"end":556}],"locals":[],"nops":{},"code_map":{},"is_native":true},"1":{"definition_location":{"file_hash":[34,201,103,208,120,108,208,171,127,162,154,113,96,186,51,169,173,216,199,217,88,54,128,150,101,140,27,7,37,201,47,24],"start":383,"end":557},"type_parameters":[],"parameters":[],"returns":[],"locals":[],"nops":{},"code_map":{"0":{"file_hash":[34,201,103,208,120,108,208,171,127,162,154,113,96,186,51,169,173,216,199,217,88,54,128,150,101,140,27,7,37,201,47,24],"start":383,"end":557}},"is_native":false}},"constant_map":{}} |
1 change: 1 addition & 0 deletions
1
.../trace-adapter/tests/global_loc/build/global_loc/source_maps/dependencies/Sui/object.json
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...ce-adapter/tests/global_loc/build/global_loc/source_maps/dependencies/Sui/tx_context.json
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...e/crates/move-analyzer/trace-adapter/tests/global_loc/build/global_loc/source_maps/m.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"definition_location":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":70,"end":71},"module_name":["0000000000000000000000000000000000000000000000000000000000000000","m"],"struct_map":{"0":{"definition_location":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":88,"end":98},"type_parameters":[],"fields":[{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":113,"end":115},{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":126,"end":129}]}},"enum_map":{},"function_map":{"0":{"definition_location":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":142,"end":145},"type_parameters":[],"parameters":[["o#0#0",{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":146,"end":147}],["p#0#0",{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":161,"end":162}]],"returns":[{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":169,"end":172}],"locals":[["%#1",{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":187,"end":201}],["%#2",{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":187,"end":212}],["n#1#0",{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":183,"end":184}],["num#1#0",{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":242,"end":245}]],"nops":{},"code_map":{"0":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":198,"end":200},"1":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":187,"end":201},"4":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":187,"end":212},"6":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":187,"end":215},"7":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":213,"end":214},"8":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":187,"end":215},"10":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":183,"end":184},"11":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":250,"end":251},"12":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":225,"end":247},"13":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":242,"end":245},"14":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":257,"end":275},"15":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":282,"end":283},"16":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":282,"end":290},"17":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":295,"end":298},"18":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":295,"end":305},"19":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":292,"end":293},"20":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":310,"end":311},"21":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":310,"end":318},"22":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":307,"end":308},"23":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":281,"end":319}},"is_native":false},"1":{"definition_location":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":335,"end":339},"type_parameters":[],"parameters":[],"returns":[],"locals":[["ctx#1#0",{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":356,"end":359}]],"nops":{},"code_map":{"0":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":362,"end":381},"1":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":352,"end":359},"2":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":435,"end":443},"3":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":423,"end":444},"4":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":451,"end":453},"5":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":406,"end":455},"6":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":457,"end":459},"7":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":402,"end":460},"8":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":590,"end":598},"9":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":578,"end":599},"10":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":606,"end":608},"11":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":561,"end":610},"12":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":612,"end":614},"13":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":557,"end":615},"14":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":555,"end":556},"15":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":543,"end":547},"16":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":615,"end":616}},"is_native":false},"2":{"definition_location":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":51,"end":618},"type_parameters":[],"parameters":[],"returns":[],"locals":[],"nops":{},"code_map":{"0":{"file_hash":[9,0,245,148,110,8,77,217,5,163,139,61,20,43,54,140,85,157,1,225,181,146,97,220,49,193,128,189,216,45,155,5],"start":51,"end":618}},"is_native":false}},"constant_map":{}} |
11 changes: 11 additions & 0 deletions
11
.../trace-adapter/tests/global_loc/build/global_loc/sources/dependencies/MoveStdlib/bcs.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
/// Utility for converting a Move value to its binary representation in BCS (Binary Canonical | ||
/// Serialization). BCS is the binary encoding for Move resources and other non-module values | ||
/// published on-chain. See https://github.com/diem/bcs#binary-canonical-serialization-bcs for more | ||
/// details on BCS. | ||
module std::bcs; | ||
|
||
/// Return the binary representation of `v` in BCS (Binary Canonical Serialization) format | ||
public native fun to_bytes<MoveValue>(v: &MoveValue): vector<u8>; |
Oops, something went wrong.