Revert "Debug: Allow stepping into on a given call frame."

This reverts commit r17095.
There were test failures (flaky).

BUG=chromium:296963
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/26703009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17125 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 51047312
...@@ -12620,11 +12620,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PrepareStep) { ...@@ -12620,11 +12620,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PrepareStep) {
return isolate->Throw(isolate->heap()->illegal_argument_string()); return isolate->Throw(isolate->heap()->illegal_argument_string());
} }
if (frame_id != StackFrame::NO_ID && if (frame_id != StackFrame::NO_ID && step_action != StepNext &&
step_action != StepIn && step_action != StepMin && step_action != StepOut) {
step_action != StepNext &&
step_action != StepOut &&
step_action != StepMin) {
return isolate->ThrowIllegalOperation(); return isolate->ThrowIllegalOperation();
} }
......
...@@ -29,17 +29,12 @@ ...@@ -29,17 +29,12 @@
// Get the Debug object exposed from the debug context global object. // Get the Debug object exposed from the debug context global object.
Debug = debug.Debug Debug = debug.Debug
// Tests how debugger can step into/over not necessarily in the top frame. // Tests how debugger can step over not necessarily in the top frame.
// Simple 3 functions, that protocol their execution state in global // Simple 3 functions, that protocol their execution state in global
// variable state. // variable state.
var state; var state;
function e() {
for (state[3] = 0; state[3] < 5; state[3]++) {
void ("" + e + state[3]);
}
}
function f() { function f() {
var a = 1978; var a = 1978;
for (state[2] = 0; state[2] < 5; state[2]++) { for (state[2] = 0; state[2] < 5; state[2]++) {
...@@ -48,20 +43,18 @@ function f() { ...@@ -48,20 +43,18 @@ function f() {
} }
function g() { function g() {
for (state[1] = 0; state[1] < 5; state[1]++) { for (state[1] = 0; state[1] < 5; state[1]++) {
f() + e(); f();
} }
} }
function h() { function h() {
state = [-1, -1, -1, -1]; state = [-1, -1, -1];
for (state[0] = 0; state[0] < 5; state[0]++) { for (state[0] = 0; state[0] < 5; state[0]++) {
g(); g();
} }
} }
function TestCase(frame_index, step_count, expected_final_state, action) { function TestCase(frame_index, step_count, expected_final_state) {
action = action || Debug.StepAction.StepNext; print("Test case, parameters " + frame_index + "/" + step_count);
print("Test case, parameters " + frame_index + "/" + step_count +
", action " + action);
var listener_exception = null; var listener_exception = null;
var state_snapshot; var state_snapshot;
...@@ -79,7 +72,8 @@ function TestCase(frame_index, step_count, expected_final_state, action) { ...@@ -79,7 +72,8 @@ function TestCase(frame_index, step_count, expected_final_state, action) {
if (frame_index !== undefined) { if (frame_index !== undefined) {
context_frame = exec_state.frame(frame_index); context_frame = exec_state.frame(frame_index);
} }
exec_state.prepareStep(action, step_count, context_frame); exec_state.prepareStep(Debug.StepAction.StepNext,
step_count, context_frame);
listener_state = 1; listener_state = 1;
} else if (listener_state == 1) { } else if (listener_state == 1) {
state_snapshot = String(state); state_snapshot = String(state);
...@@ -109,61 +103,30 @@ function TestCase(frame_index, step_count, expected_final_state, action) { ...@@ -109,61 +103,30 @@ function TestCase(frame_index, step_count, expected_final_state, action) {
assertEquals(expected_final_state, state_snapshot); assertEquals(expected_final_state, state_snapshot);
} }
function TestCase2(frame_index, step_count, expected_final_state) {
return TestCase(frame_index, step_count, expected_final_state,
Debug.StepAction.StepIn);
}
// Warm-up -- make sure all is compiled and ready for breakpoint. // Warm-up -- make sure all is compiled and ready for breakpoint.
h(); h();
// Stepping over on the default (top) frame. // Stepping in the default (top) frame.
TestCase(undefined, 0, "0,0,-1,-1"); TestCase(undefined, 0, "0,0,-1");
TestCase(undefined, 1, "0,0,-1,-1"); TestCase(undefined, 1, "0,0,-1");
TestCase(undefined, 2, "0,0,0,-1"); TestCase(undefined, 2, "0,0,0");
TestCase(undefined, 5, "0,0,1,-1"); TestCase(undefined, 5, "0,0,1");
TestCase(undefined, 8, "0,0,3,-1"); TestCase(undefined, 8, "0,0,3");
// Stepping over on the frame #0 (should be exactly the same as above). // Stepping in the frame #0 (should be exactly the same as above).
TestCase(0, 0, "0,0,-1,-1"); TestCase(0, 0, "0,0,-1");
TestCase(0, 1, "0,0,-1,-1"); TestCase(0, 1, "0,0,-1");
TestCase(0, 2, "0,0,0,-1"); TestCase(0, 2, "0,0,0");
TestCase(0, 5, "0,0,1,-1"); TestCase(0, 5, "0,0,1");
TestCase(0, 8, "0,0,3,-1"); TestCase(0, 8, "0,0,3");
// Stepping over on the frame #1. // Stepping in the frame #1.
TestCase(1, 0, "0,0,5,5"); TestCase(1, 0, "0,0,5");
TestCase(1, 3, "0,1,5,5"); TestCase(1, 3, "0,1,5");
TestCase(1, 8, "0,4,5,5"); TestCase(1, 8, "0,4,5");
// Stepping over on the frame #2. // Stepping in the frame #2.
TestCase(2, 3, "1,5,5,5"); TestCase(2, 3, "1,5,5");
TestCase(2, 8, "4,5,5,5"); TestCase(2, 8, "4,5,5");
// Stepping into on the default (top) frame.
TestCase2(undefined, 0, "0,0,-1,-1");
TestCase2(undefined, 1, "0,0,-1,-1");
TestCase2(undefined, 2, "0,0,0,-1");
TestCase2(undefined, 5, "0,0,1,-1");
TestCase2(undefined, 8, "0,0,3,-1");
// Stepping into on the frame #0 (should be exactly the same as above).
TestCase2(0, 0, "0,0,-1,-1");
TestCase2(0, 1, "0,0,-1,-1");
TestCase2(0, 2, "0,0,0,-1");
TestCase2(0, 5, "0,0,1,-1");
TestCase2(0, 8, "0,0,3,-1");
// Stepping into on the frame #1.
TestCase2(1, 0, "0,0,5,-1");
TestCase2(1, 3, "0,0,5,0");
TestCase2(1, 8, "0,0,5,2");
TestCase2(1, 9, "0,0,5,3");
// Stepping into on the frame #2.
TestCase2(2, 0, "0,5,5,5");
TestCase2(2, 3, "1,5,5,5");
TestCase2(2, 4, "1,0,5,5");
TestCase2(2, 8, "1,0,0,5");
TestCase2(2, 9, "1,0,1,5");
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