-
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 handling of aborts
- Loading branch information
Showing
41 changed files
with
1,105 additions
and
29 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
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/abort_assert/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 = "abort_assert" | ||
edition = "2024.beta" | ||
|
||
[dependencies] | ||
MoveStdlib = { local = "../../../../move-stdlib" } | ||
|
||
[addresses] | ||
abort_assert = "0x0" | ||
std = "0x1" |
Binary file added
BIN
+268 Bytes
...s/move-analyzer/trace-adapter/tests/abort_assert/build/abort_assert/bytecode_modules/m.mv
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...ates/move-analyzer/trace-adapter/tests/abort_assert/build/abort_assert/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":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":90,"end":91},"module_name":["0000000000000000000000000000000000000000000000000000000000000000","m"],"struct_map":{},"enum_map":{},"function_map":{"0":{"definition_location":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":98,"end":101},"type_parameters":[],"parameters":[["p#0#0",{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":102,"end":103}]],"returns":[{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":111,"end":114}],"locals":[["val#1#0",{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":125,"end":128}]],"nops":{},"code_map":{"0":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":131,"end":132},"1":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":135,"end":136},"2":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":133,"end":134},"3":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":125,"end":128},"4":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":150,"end":153},"5":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":157,"end":159},"6":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":154,"end":156},"7":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":142,"end":160},"11":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":166,"end":169}},"is_native":false},"1":{"definition_location":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":185,"end":189},"type_parameters":[],"parameters":[],"returns":[],"locals":[],"nops":{},"code_map":{"0":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":202,"end":204},"1":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":198,"end":205},"3":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":205,"end":206}},"is_native":false},"2":{"definition_location":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":69,"end":208},"type_parameters":[],"parameters":[],"returns":[],"locals":[],"nops":{},"code_map":{"0":{"file_hash":[168,122,162,74,20,113,41,145,92,12,34,91,147,70,136,52,6,15,129,19,242,234,217,255,35,9,215,162,135,4,101,199],"start":69,"end":208}},"is_native":false}},"constant_map":{}} |
13 changes: 13 additions & 0 deletions
13
...e/crates/move-analyzer/trace-adapter/tests/abort_assert/build/abort_assert/sources/m.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,13 @@ | ||
// Test abort on an assertion when stepping (but not stepping over). | ||
module abort_assert::m; | ||
|
||
fun foo(p: u64): u64 { | ||
let val = p + p; | ||
assert!(val != 84); | ||
val | ||
} | ||
|
||
#[test] | ||
fun test() { | ||
foo(42); | ||
} |
13 changes: 13 additions & 0 deletions
13
external-crates/move/crates/move-analyzer/trace-adapter/tests/abort_assert/sources/m.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,13 @@ | ||
// Test abort on an assertion when stepping (but not stepping over). | ||
module abort_assert::m; | ||
|
||
fun foo(p: u64): u64 { | ||
let val = p + p; | ||
assert!(val != 84); | ||
val | ||
} | ||
|
||
#[test] | ||
fun test() { | ||
foo(42); | ||
} |
1 change: 1 addition & 0 deletions
1
external-crates/move/crates/move-analyzer/trace-adapter/tests/abort_assert/test.exp
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 @@ | ||
Exception |
11 changes: 11 additions & 0 deletions
11
external-crates/move/crates/move-analyzer/trace-adapter/tests/abort_assert/trace.spec.js
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 @@ | ||
const { ExecutionResult } = require('../../out/runtime'); | ||
|
||
let action = (runtime) => { | ||
let res = ''; | ||
// keep stepping to get abort state | ||
runtime.step(false); | ||
runtime.step(false); | ||
res += ExecutionResult[runtime.step(false)]; | ||
return res; | ||
}; | ||
run_spec(__dirname, action); |
1 change: 1 addition & 0 deletions
1
...e/crates/move-analyzer/trace-adapter/tests/abort_assert/traces/abort_assert__m__test.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 @@ | ||
{"version":1,"events":[{"OpenFrame":{"frame":{"frame_id":0,"function_name":"test","module":{"address":"0000000000000000000000000000000000000000000000000000000000000000","name":"m"},"binary_member_index":1,"type_instantiation":[],"parameters":[],"return_types":[],"locals_types":[],"is_native":false},"gas_left":1000000000}},{"Instruction":{"type_parameters":[],"pc":0,"gas_left":999999997,"instruction":"LD_U64"}},{"Effect":{"Push":{"RuntimeValue":{"value":42}}}},{"Instruction":{"type_parameters":[],"pc":1,"gas_left":999999997,"instruction":"CALL"}},{"OpenFrame":{"frame":{"frame_id":4,"function_name":"foo","module":{"address":"0000000000000000000000000000000000000000000000000000000000000000","name":"m"},"binary_member_index":0,"type_instantiation":[],"parameters":[{"RuntimeValue":{"value":42}}],"return_types":[{"type_":"u64","ref_type":null}],"locals_types":[{"type_":"u64","ref_type":null},{"type_":"u64","ref_type":null}],"is_native":false},"gas_left":999999997}},{"Instruction":{"type_parameters":[],"pc":0,"gas_left":999999978,"instruction":"COPY_LOC"}},{"Effect":{"Read":{"location":{"Local":[4,0]},"root_value_read":{"RuntimeValue":{"value":42}},"moved":false}}},{"Effect":{"Push":{"RuntimeValue":{"value":42}}}},{"Instruction":{"type_parameters":[],"pc":1,"gas_left":999999960,"instruction":"MOVE_LOC"}},{"Effect":{"Read":{"location":{"Local":[4,0]},"root_value_read":{"RuntimeValue":{"value":42}},"moved":true}}},{"Effect":{"Push":{"RuntimeValue":{"value":42}}}},{"Instruction":{"type_parameters":[],"pc":2,"gas_left":999999957,"instruction":"ADD"}},{"Effect":{"Pop":{"RuntimeValue":{"value":42}}}},{"Effect":{"Pop":{"RuntimeValue":{"value":42}}}},{"Effect":{"Push":{"RuntimeValue":{"value":84}}}},{"Instruction":{"type_parameters":[],"pc":3,"gas_left":999999956,"instruction":"ST_LOC"}},{"Effect":{"Pop":{"RuntimeValue":{"value":84}}}},{"Effect":{"Write":{"location":{"Local":[4,1]},"root_value_after_write":{"RuntimeValue":{"value":84}}}}},{"Instruction":{"type_parameters":[],"pc":4,"gas_left":999999938,"instruction":"COPY_LOC"}},{"Effect":{"Read":{"location":{"Local":[4,1]},"root_value_read":{"RuntimeValue":{"value":84}},"moved":false}}},{"Effect":{"Push":{"RuntimeValue":{"value":84}}}},{"Instruction":{"type_parameters":[],"pc":5,"gas_left":999999935,"instruction":"LD_U64"}},{"Effect":{"Push":{"RuntimeValue":{"value":84}}}},{"Instruction":{"type_parameters":[],"pc":6,"gas_left":999999932,"instruction":"NEQ"}},{"Effect":{"Pop":{"RuntimeValue":{"value":84}}}},{"Effect":{"Pop":{"RuntimeValue":{"value":84}}}},{"Effect":{"Push":{"RuntimeValue":{"value":false}}}},{"Instruction":{"type_parameters":[],"pc":7,"gas_left":999999931,"instruction":"BR_FALSE"}},{"Effect":{"Pop":{"RuntimeValue":{"value":false}}}},{"Instruction":{"type_parameters":[],"pc":9,"gas_left":999999928,"instruction":"LD_U64"}},{"Effect":{"Push":{"RuntimeValue":{"value":9223372066919546879}}}},{"Instruction":{"type_parameters":[],"pc":10,"gas_left":999999927,"instruction":"ABORT"}},{"Effect":{"Pop":{"RuntimeValue":{"value":9223372066919546879}}}},{"Effect":{"ExecutionError":"ABORTED"}}]} |
10 changes: 10 additions & 0 deletions
10
external-crates/move/crates/move-analyzer/trace-adapter/tests/abort_math/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 = "abort_math" | ||
edition = "2024.beta" | ||
|
||
[dependencies] | ||
MoveStdlib = { local = "../../../../move-stdlib" } | ||
|
||
[addresses] | ||
abort_math = "0x0" | ||
std = "0x1" |
Binary file added
BIN
+245 Bytes
...rates/move-analyzer/trace-adapter/tests/abort_math/build/abort_math/bytecode_modules/m.mv
Binary file not shown.
Oops, something went wrong.