Commit 3ea7ecaf authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm][debug] Improve printing of break locations

Using the "logSourceLocation" function from protocol-test.js prints
slightly better location information for wasm, and especially much
better information for JS breakpoints. This helps understanding and
debugging these tests.

R=thibaudm@chromium.org

Bug: v8:10351
Change-Id: I51c7d168d2cb19fb8469b4a2eb372c2b95650fcb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2120539Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66863}
parent 252acd7f
......@@ -7,7 +7,7 @@ Setting breakpoint on offset 59 (should be propagated to 60, the offset of the c
lineNumber : 0
scriptId : <scriptId>
}
Paused at wasm://wasm/befe41aa:0:60
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10
at wasm_B (0:60):
- scope (global):
-- skipped
......@@ -18,7 +18,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:39
Script wasm://wasm/befe41aa byte offset 39: Wasm opcode 0x1
at wasm_A (0:39):
- scope (global):
-- skipped
......@@ -35,7 +35,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOver called
Paused at wasm://wasm/befe41aa:0:40
Script wasm://wasm/befe41aa byte offset 40: Wasm opcode 0x1
at wasm_A (0:40):
- scope (global):
-- skipped
......@@ -52,7 +52,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOut called
Paused at wasm://wasm/befe41aa:0:62
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0xc
at wasm_B (0:62):
- scope (global):
-- skipped
......@@ -63,7 +63,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOut called
Paused at wasm://wasm/befe41aa:0:60
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10
at wasm_B (0:60):
- scope (global):
-- skipped
......@@ -74,7 +74,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOver called
Paused at wasm://wasm/befe41aa:0:62
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0xc
at wasm_B (0:62):
- scope (global):
-- skipped
......@@ -85,7 +85,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:44
Script wasm://wasm/befe41aa byte offset 44: Wasm opcode 0x3
at wasm_B (0:44):
- scope (global):
-- skipped
......@@ -96,7 +96,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.resume called
Paused at wasm://wasm/befe41aa:0:60
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10
at wasm_B (0:60):
- scope (global):
-- skipped
......@@ -107,7 +107,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:39
Script wasm://wasm/befe41aa byte offset 39: Wasm opcode 0x1
at wasm_A (0:39):
- scope (global):
-- skipped
......@@ -124,7 +124,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOut called
Paused at wasm://wasm/befe41aa:0:62
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0xc
at wasm_B (0:62):
- scope (global):
-- skipped
......@@ -135,7 +135,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:44
Script wasm://wasm/befe41aa byte offset 44: Wasm opcode 0x3
at wasm_B (0:44):
- scope (global):
-- skipped
......@@ -146,7 +146,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:46
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20
at wasm_B (0:46):
- scope (global):
-- skipped
......@@ -157,7 +157,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:48
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x4
at wasm_B (0:48):
- scope (global):
-- skipped
......@@ -168,7 +168,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:50
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20
at wasm_B (0:50):
- scope (global):
-- skipped
......@@ -179,7 +179,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:52
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41
at wasm_B (0:52):
- scope (global):
-- skipped
......@@ -190,7 +190,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:54
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b
at wasm_B (0:54):
- scope (global):
-- skipped
......@@ -201,7 +201,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:55
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21
at wasm_B (0:55):
- scope (global):
-- skipped
......@@ -212,7 +212,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:57
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41
at wasm_B (0:57):
- scope (global):
-- skipped
......@@ -223,7 +223,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:60
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10
at wasm_B (0:60):
- scope (global):
-- skipped
......@@ -234,7 +234,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:39
Script wasm://wasm/befe41aa byte offset 39: Wasm opcode 0x1
at wasm_A (0:39):
- scope (global):
-- skipped
......@@ -251,7 +251,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:40
Script wasm://wasm/befe41aa byte offset 40: Wasm opcode 0x1
at wasm_A (0:40):
- scope (global):
-- skipped
......@@ -268,7 +268,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:41
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0xb
at wasm_A (0:41):
- scope (global):
-- skipped
......@@ -285,7 +285,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/befe41aa:0:62
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0xc
at wasm_B (0:62):
- scope (global):
-- skipped
......
......@@ -4,6 +4,7 @@
let {session, contextGroup, Protocol} =
InspectorTest.start('Tests stepping through wasm scripts by byte offsets');
session.setupScriptMap();
utils.load('test/mjsunit/wasm/wasm-module-builder.js');
......@@ -95,9 +96,7 @@ function instantiate(bytes) {
async function waitForPauseAndStep(stepAction) {
const {params: {callFrames}} = await Protocol.Debugger.oncePaused();
const topFrame = callFrames[0];
InspectorTest.log(
`Paused at ${topFrame.url}:${topFrame.location.lineNumber}:${topFrame.location.columnNumber}`);
await session.logSourceLocation(callFrames[0].location);
for (var frame of callFrames) {
const functionName = frame.functionName || '(anonymous)';
const lineNumber = frame.location.lineNumber;
......
......@@ -7,53 +7,54 @@ Setting breakpoint on offset 72 (should be propagated to 73, the offset of the c
lineNumber : 0
scriptId : <scriptId>
}
Paused at wasm://wasm/42af3c82:0:73
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:52
Script wasm://wasm/42af3c82 byte offset 52: Wasm opcode 0x1
Debugger.stepOver called
Paused at wasm://wasm/42af3c82:0:53
Script wasm://wasm/42af3c82 byte offset 53: Wasm opcode 0x1
Debugger.stepOut called
Paused at wasm://wasm/42af3c82:0:75
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0xc
Debugger.stepOut called
Paused at wasm://wasm/42af3c82:0:73
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10
Debugger.stepOver called
Paused at wasm://wasm/42af3c82:0:75
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0xc
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:59
Script wasm://wasm/42af3c82 byte offset 59: Wasm opcode 0x20
Debugger.resume called
Paused at wasm://wasm/42af3c82:0:73
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:52
Script wasm://wasm/42af3c82 byte offset 52: Wasm opcode 0x1
Debugger.stepOut called
Paused at wasm://wasm/42af3c82:0:75
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0xc
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:59
Script wasm://wasm/42af3c82 byte offset 59: Wasm opcode 0x20
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:61
Script wasm://wasm/42af3c82 byte offset 61: Wasm opcode 0x4
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:63
Script wasm://wasm/42af3c82 byte offset 63: Wasm opcode 0x20
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:65
Script wasm://wasm/42af3c82 byte offset 65: Wasm opcode 0x41
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:67
Script wasm://wasm/42af3c82 byte offset 67: Wasm opcode 0x6b
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:68
Script wasm://wasm/42af3c82 byte offset 68: Wasm opcode 0x21
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:70
Script wasm://wasm/42af3c82 byte offset 70: Wasm opcode 0x41
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:73
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:52
Script wasm://wasm/42af3c82 byte offset 52: Wasm opcode 0x1
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:53
Script wasm://wasm/42af3c82 byte offset 53: Wasm opcode 0x1
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:54
Script wasm://wasm/42af3c82 byte offset 54: Wasm opcode 0xb
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:75
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0xc
Debugger.stepInto called
Paused at wasm://wasm/42af3c82:0:59
Script wasm://wasm/42af3c82 byte offset 59: Wasm opcode 0x20
Debugger.resume called
Paused at :0:24
instance.exports.main(4)#
Debugger.resume called
exports.main returned!
Test stepping over a recursive call
......@@ -63,9 +64,9 @@ Setting breakpoint on the recursive call instruction @+93, url wasm://wasm/42af3
lineNumber : 0
scriptId : <scriptId>
}
Paused at wasm://wasm/42af3c82:0:93
Script wasm://wasm/42af3c82 byte offset 93: Wasm opcode 0x10
Removing breakpoint
Debugger.stepOver called
Paused at wasm://wasm/42af3c82:0:95
Script wasm://wasm/42af3c82 byte offset 95: Wasm opcode 0x20
Debugger.resume called
Finished!
......@@ -6,6 +6,7 @@
let {session, contextGroup, Protocol} =
InspectorTest.start('Tests stepping through wasm scripts by byte offsets');
session.setupScriptMap();
utils.load('test/mjsunit/wasm/wasm-module-builder.js');
......@@ -143,7 +144,5 @@ async function waitForPauseAndStep(stepAction) {
async function waitForPause() {
const {params: {callFrames}} = await Protocol.Debugger.oncePaused();
const topFrame = callFrames[0];
InspectorTest.log(
`Paused at ${topFrame.url}:${topFrame.location.lineNumber}:${topFrame.location.columnNumber}`);
await session.logSourceLocation(callFrames[0].location);
}
......@@ -10,7 +10,7 @@ Setting breakpoint on offset 54 (on the setlocal before the call), url wasm://wa
lineNumber : 0
scriptId : <scriptId>
}
Paused at wasm://wasm/9b4bf87e:0:54
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21
at wasm_B (0:54):
- scope (global):
-- skipped
......@@ -21,7 +21,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:56
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10
at wasm_B (0:56):
- scope (global):
-- skipped
......@@ -32,7 +32,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:38
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x1
at wasm_A (0:38):
- scope (global):
-- skipped
......@@ -48,7 +48,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOver called
Paused at wasm://wasm/9b4bf87e:0:39
Script wasm://wasm/9b4bf87e byte offset 39: Wasm opcode 0x1
at wasm_A (0:39):
- scope (global):
-- skipped
......@@ -64,7 +64,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOut called
Paused at wasm://wasm/9b4bf87e:0:58
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0xc
at wasm_B (0:58):
- scope (global):
-- skipped
......@@ -75,7 +75,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOut called
Paused at wasm://wasm/9b4bf87e:0:54
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21
at wasm_B (0:54):
- scope (global):
-- skipped
......@@ -86,7 +86,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOver called
Paused at wasm://wasm/9b4bf87e:0:56
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10
at wasm_B (0:56):
- scope (global):
-- skipped
......@@ -97,7 +97,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOver called
Paused at wasm://wasm/9b4bf87e:0:58
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0xc
at wasm_B (0:58):
- scope (global):
-- skipped
......@@ -108,7 +108,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.resume called
Paused at wasm://wasm/9b4bf87e:0:54
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21
at wasm_B (0:54):
- scope (global):
-- skipped
......@@ -119,7 +119,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:56
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10
at wasm_B (0:56):
- scope (global):
-- skipped
......@@ -130,7 +130,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:38
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x1
at wasm_A (0:38):
- scope (global):
-- skipped
......@@ -146,7 +146,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOut called
Paused at wasm://wasm/9b4bf87e:0:58
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0xc
at wasm_B (0:58):
- scope (global):
-- skipped
......@@ -157,7 +157,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:43
Script wasm://wasm/9b4bf87e byte offset 43: Wasm opcode 0x3
at wasm_B (0:43):
- scope (global):
-- skipped
......@@ -168,7 +168,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:45
Script wasm://wasm/9b4bf87e byte offset 45: Wasm opcode 0x20
at wasm_B (0:45):
- scope (global):
-- skipped
......@@ -179,7 +179,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:47
Script wasm://wasm/9b4bf87e byte offset 47: Wasm opcode 0x4
at wasm_B (0:47):
- scope (global):
-- skipped
......@@ -190,7 +190,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:49
Script wasm://wasm/9b4bf87e byte offset 49: Wasm opcode 0x20
at wasm_B (0:49):
- scope (global):
-- skipped
......@@ -201,7 +201,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:51
Script wasm://wasm/9b4bf87e byte offset 51: Wasm opcode 0x41
at wasm_B (0:51):
- scope (global):
-- skipped
......@@ -212,7 +212,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:53
Script wasm://wasm/9b4bf87e byte offset 53: Wasm opcode 0x6b
at wasm_B (0:53):
- scope (global):
-- skipped
......@@ -223,7 +223,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:54
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21
at wasm_B (0:54):
- scope (global):
-- skipped
......@@ -234,7 +234,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:56
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10
at wasm_B (0:56):
- scope (global):
-- skipped
......@@ -245,7 +245,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:38
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x1
at wasm_A (0:38):
- scope (global):
-- skipped
......@@ -261,7 +261,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:39
Script wasm://wasm/9b4bf87e byte offset 39: Wasm opcode 0x1
at wasm_A (0:39):
- scope (global):
-- skipped
......@@ -277,7 +277,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:40
Script wasm://wasm/9b4bf87e byte offset 40: Wasm opcode 0xb
at wasm_A (0:40):
- scope (global):
-- skipped
......@@ -293,7 +293,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Paused at wasm://wasm/9b4bf87e:0:58
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0xc
at wasm_B (0:58):
- scope (global):
-- skipped
......
......@@ -4,6 +4,7 @@
let {session, contextGroup, Protocol} =
InspectorTest.start('Tests stepping through wasm scripts with source maps');
session.setupScriptMap();
utils.load('test/mjsunit/wasm/wasm-module-builder.js');
......@@ -93,9 +94,7 @@ function instantiate(bytes) {
async function waitForPauseAndStep(stepAction) {
const {params: {callFrames}} = await Protocol.Debugger.oncePaused();
const topFrame = callFrames[0];
InspectorTest.log(
`Paused at ${topFrame.url}:${topFrame.location.lineNumber}:${topFrame.location.columnNumber}`);
await session.logSourceLocation(callFrames[0].location);
for (var frame of callFrames) {
const functionName = frame.functionName || '(anonymous)';
const lineNumber = frame.location.lineNumber;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment