Commit bf28ec63 authored by Simon Zünd's avatar Simon Zünd Committed by V8 LUCI CQ

[debug] Add new debug-evaluate block list test

This CL adds a test that checks the block list for outer functions is
also correctly calculated when pausing in inner functions.

R=kimanh@chromium.org

Bug: chromium:1363561
Change-Id: I2d7c1671475759b977e4e41c7e09856b3b2e7daf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3904308Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83319}
parent 0d25fc2c
......@@ -178,6 +178,37 @@ listener_delegate = function(exec_state) {
(f5())()();
EndTest();
BeginTest("Check that outer functions also get the correct block list calculated");
// This test is important once we re-use block list info. The block list for `g`
// needs to be correctly calculated already when we stop on break_position 1.
let break_position;
function f6() {
let a = 1; // stack-allocated
return function g() { // g itself doesn't require a context.
if (break_position === 2) debugger;
let a = 2; (() => a); // context-allocated
return function h() {
if (break_position === 1) debugger;
}
}
}
listener_delegate = function (exec_state) {
assertEquals(2, exec_state.frame(0).evaluate("a").value());
}
break_position = 1;
(f6())()();
EndTest();
BeginTest("Check that outer functions also get the correct block list calculated (continued)");
listener_delegate = function (exec_state) {
assertThrows(() => exec_state.frame(0).evaluate("a").value());
}
break_position = 2;
(f6())()();
EndTest();
assertEquals(begin_test_count, break_count,
'one or more tests did not enter the debugger');
assertEquals(begin_test_count, end_test_count,
......
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