v8/test/inspector/debugger/set-script-source-top-frame-expected.txt
Simon Zünd 3094c4002b [debug] Fix stepping through single statement loops
The debugger utilizes the source position while single stepping
("Step-in") through the source to go from statement to statement and
skipping some expressions along the way. The debugger remembers the
"statement position" of the last stepping action.

This works well in general but falls flat for loops that only have
a single statement in them. Every step lands on the same statement,
just one loop iteration later.

We detect this case by checking if we are in the same frame and have
the exact same bytecode offset as the last step action.

Note that this also fixes "frame restarting" should we have restarted
a function while paused at the beginning of that function.

R=jarin@chromium.org

Bug: chromium:1401674
Change-Id: Id0a5753ed7cc9f23f22d869368d88e1c4b48566d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4135881
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85107}
2023-01-05 07:18:16 +00:00

18 lines
310 B
Plaintext

Checks that setScriptSource works for editing the top-most stack frame
Paused at (before live edit):
function testExpression(a, b) {
#debugger;
return a + b;
Paused at (after live edit):
function testExpression(a, b) {
#return a * b;
}
Result:
{
description : 15
type : number
value : 15
}