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}
118 lines
8.7 KiB
Plaintext
118 lines
8.7 KiB
Plaintext
Tests stepping through wasm scripts by byte offsets
|
|
Setting up global instance variable
|
|
Got wasm script: wasm://wasm/befe41aa
|
|
{
|
|
columnNumber : 46
|
|
lineNumber : 0
|
|
scriptId : <scriptId>
|
|
}
|
|
Test with valid skip lists
|
|
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
|
|
Test: Stepping over without skip list
|
|
Testing stepOver with skipList: []
|
|
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
|
|
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20 (kExprLocalGet)
|
|
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41 (kExprI32Const)
|
|
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b (kExprI32Sub)
|
|
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21 (kExprLocalSet)
|
|
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41 (kExprI32Const)
|
|
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10 (kExprCallFunction)
|
|
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
|
|
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
|
|
Test: Stepping over with skip list
|
|
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":48},"end":{"lineNumber":0,"columnNumber":50}},{"scriptId":"4","start":{"lineNumber":0,"columnNumber":60},"end":{"lineNumber":0,"columnNumber":62}}]
|
|
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20 (kExprLocalGet)
|
|
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41 (kExprI32Const)
|
|
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b (kExprI32Sub)
|
|
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21 (kExprLocalSet)
|
|
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41 (kExprI32Const)
|
|
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
|
|
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
|
|
Test: Stepping over start location is inclusive
|
|
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":48},"end":{"lineNumber":0,"columnNumber":61}}]
|
|
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
|
|
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
|
|
Test: Stepping over end location is exclusive
|
|
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":49},"end":{"lineNumber":0,"columnNumber":62}}]
|
|
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
|
|
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
|
|
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
|
|
Test: Stepping into without skip list
|
|
Testing stepInto with skipList: []
|
|
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
|
|
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20 (kExprLocalGet)
|
|
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41 (kExprI32Const)
|
|
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b (kExprI32Sub)
|
|
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21 (kExprLocalSet)
|
|
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41 (kExprI32Const)
|
|
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10 (kExprCallFunction)
|
|
Script wasm://wasm/befe41aa byte offset 39: Wasm opcode 0x01 (kExprNop)
|
|
Script wasm://wasm/befe41aa byte offset 40: Wasm opcode 0x01 (kExprNop)
|
|
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b (kExprEnd)
|
|
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
|
|
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
|
|
Test: Stepping into with skip list, while call itself is skipped
|
|
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":39},"end":{"lineNumber":0,"columnNumber":41}},{"scriptId":"4","start":{"lineNumber":0,"columnNumber":50},"end":{"lineNumber":0,"columnNumber":62}}]
|
|
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
|
|
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b (kExprEnd)
|
|
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
|
|
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
|
|
Test: Stepping into start location is inclusive
|
|
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":39},"end":{"lineNumber":0,"columnNumber":40}}]
|
|
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
|
|
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20 (kExprLocalGet)
|
|
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41 (kExprI32Const)
|
|
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b (kExprI32Sub)
|
|
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21 (kExprLocalSet)
|
|
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41 (kExprI32Const)
|
|
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10 (kExprCallFunction)
|
|
Script wasm://wasm/befe41aa byte offset 40: Wasm opcode 0x01 (kExprNop)
|
|
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b (kExprEnd)
|
|
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
|
|
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
|
|
Test: Stepping into end location is exclusive
|
|
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":38},"end":{"lineNumber":0,"columnNumber":41}}]
|
|
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
|
|
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20 (kExprLocalGet)
|
|
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41 (kExprI32Const)
|
|
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b (kExprI32Sub)
|
|
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21 (kExprLocalSet)
|
|
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41 (kExprI32Const)
|
|
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10 (kExprCallFunction)
|
|
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b (kExprEnd)
|
|
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
|
|
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
|
|
Test with invalid skip lists
|
|
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
|
|
Test: start position has invalid column number
|
|
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":-1},"end":{"lineNumber":0,"columnNumber":62}}]
|
|
Position missing 'column' or 'column' < 0.
|
|
Test: start position has invalid line number
|
|
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":-1,"columnNumber":0},"end":{"lineNumber":0,"columnNumber":62}}]
|
|
Position missing 'line' or 'line' < 0.
|
|
Test: end position smaller than start position
|
|
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":62},"end":{"lineNumber":0,"columnNumber":48}}]
|
|
Input positions array is not sorted or contains duplicate values.
|
|
Test: skip list is not maximally merged
|
|
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":48},"end":{"lineNumber":0,"columnNumber":50}},{"scriptId":"4","start":{"lineNumber":0,"columnNumber":50},"end":{"lineNumber":0,"columnNumber":62}}]
|
|
Input positions array is not sorted or contains duplicate values.
|
|
Test: skip list is not sorted
|
|
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":50},"end":{"lineNumber":0,"columnNumber":62}},{"scriptId":"4","start":{"lineNumber":0,"columnNumber":48},"end":{"lineNumber":0,"columnNumber":62}}]
|
|
Input positions array is not sorted or contains duplicate values.
|
|
Test: start position has invalid column number
|
|
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":-1},"end":{"lineNumber":0,"columnNumber":62}}]
|
|
Position missing 'column' or 'column' < 0.
|
|
Test: start position has invalid line number
|
|
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":-1,"columnNumber":0},"end":{"lineNumber":0,"columnNumber":62}}]
|
|
Position missing 'line' or 'line' < 0.
|
|
Test: end position smaller than start position
|
|
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":62},"end":{"lineNumber":0,"columnNumber":48}}]
|
|
Input positions array is not sorted or contains duplicate values.
|
|
Test: skip list is not maximally merged
|
|
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":48},"end":{"lineNumber":0,"columnNumber":50}},{"scriptId":"4","start":{"lineNumber":0,"columnNumber":50},"end":{"lineNumber":0,"columnNumber":62}}]
|
|
Input positions array is not sorted or contains duplicate values.
|
|
Test: skip list is not sorted
|
|
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":50},"end":{"lineNumber":0,"columnNumber":62}},{"scriptId":"4","start":{"lineNumber":0,"columnNumber":48},"end":{"lineNumber":0,"columnNumber":62}}]
|
|
Input positions array is not sorted or contains duplicate values.
|
|
Finished!
|