b38c136948
It makes inspector tests a lot more readable if the opcode of the pause location is being printed. Since we already have a list of all opcodes available in wasm-module-builder.js, we can just reuse that to build a reverse lookup map. This CL implements this for single-byte opcodes only, which is enough for all tests that we currently have. It will have to be extended for prefixed opcodes once that is being used. R=thibaudm@chromium.org, kimanh@chromium.org Change-Id: I085fea99d2f5f2dc6cc084448e5f7444cce5c78b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2474789 Commit-Queue: Clemens Backes <clemensb@chromium.org> Reviewed-by: Kim-Anh Tran <kimanh@chromium.org> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org> Cr-Commit-Position: refs/heads/master@{#70578}
65 lines
1.0 KiB
Plaintext
65 lines
1.0 KiB
Plaintext
Test scope inspection and stepping after a trap.
|
|
Instantiating.
|
|
Calling div function.
|
|
Paused at:
|
|
--- 0 ---
|
|
Script wasm://wasm/a9a86c5e byte offset 46: Wasm opcode 0x6d (kExprI32DivS)
|
|
scope at div (0:46):
|
|
a: 1
|
|
b: 0
|
|
unused: 4711
|
|
local_zero: 0
|
|
local_const_11: 11
|
|
--- 1 ---
|
|
try {
|
|
instance.exports.#div(1, 0, 4711); // traps (div by zero)
|
|
} catch (e) {
|
|
|
|
--- 2 ---
|
|
#call_div()
|
|
|
|
-------------
|
|
-> stepInto
|
|
Paused at:
|
|
--- 0 ---
|
|
} catch (e) {
|
|
#e.stack; // step target of first pause
|
|
}
|
|
|
|
--- 1 ---
|
|
#call_div()
|
|
|
|
-------------
|
|
-> resume
|
|
Paused at:
|
|
--- 0 ---
|
|
Script wasm://wasm/a9a86c5e byte offset 46: Wasm opcode 0x6d (kExprI32DivS)
|
|
scope at div (0:46):
|
|
a: -2147483648
|
|
b: -1
|
|
unused: 4711
|
|
local_zero: 0
|
|
local_const_11: 11
|
|
--- 1 ---
|
|
try {
|
|
instance.exports.#div(0x80000000, -1, 4711); // traps (unrepresentable)
|
|
} catch (e) {
|
|
|
|
--- 2 ---
|
|
#call_div()
|
|
|
|
-------------
|
|
-> stepInto
|
|
Paused at:
|
|
--- 0 ---
|
|
} catch (e) {
|
|
#e.stack; // step target of second pause
|
|
}
|
|
|
|
--- 1 ---
|
|
#call_div()
|
|
|
|
-------------
|
|
-> resume
|
|
Finished.
|