Skip to content

Debug Move

Move Source Mapping

when your move contracts abort with error codes, in this move example, will abort with assert!, you may get the following error messages

debug3.png

shell
VMError with status ABORTED with sub status 1 at location Module ModuleId { address: 0000000000000000000000000000000000000000000000000000000000000000, name: Identifier("wasm_test") } and message 0x0000000000000000000000000000000000000000000000000000000000000000::wasm_test::get_vec at offset 19 at code offset 19 in function definition 4

as we can see, it is not quite easy to locate the wrong code position

will deepmove move vm runtime, you will get the extra message with source mapping to the original wrong code position

 → VMError with status ABORTED with sub status 1 at location Module ModuleId { address: 0000000000000000000000000000000000000000000000000000000000000000, name: Identifier("wasm_test") } and message 0x0000000000000000000000000000000000000000000000000000000000000000::wasm_test::get_vec at offset 19 at code offset 19 in function definition 4

move code error at:
0x0::wasm_test:59
59|    assert

59 shows the source code line number to your move codes

Released under the MIT License.