Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: test/mjsunit/debug-step-4.js

Issue 1525993002: [debugger] remove frame argument for prepare step. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/mjsunit/debug-step-4-in-frame.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 f(); 46 f();
47 } 47 }
48 } 48 }
49 function h() { 49 function h() {
50 state = [-1, -1, -1]; 50 state = [-1, -1, -1];
51 for (state[0] = 0; state[0] < 3; state[0]++) { 51 for (state[0] = 0; state[0] < 3; state[0]++) {
52 g(); 52 g();
53 } 53 }
54 } 54 }
55 55
56 function TestCase(frame_index, step_count, expected_final_state) { 56 function TestCase(step_count, expected_final_state) {
57 print("Test case, parameters " + frame_index + "/" + step_count); 57 print("Test case, step count: " + step_count);
58 58
59 var listener_exception = null; 59 var listener_exception = null;
60 var state_snapshot; 60 var state_snapshot;
61 var listener_state; 61 var listener_state;
62 var bp; 62 var bp;
63 63
64 function listener(event, exec_state, event_data, data) { 64 function listener(event, exec_state, event_data, data) {
65 print("Here ("+event+"/"+listener_state+"): " + 65 print("Here ("+event+"/"+listener_state+"): " +
66 exec_state.frame(0).sourceLineText()); 66 exec_state.frame(0).sourceLineText());
67 try { 67 try {
68 if (event == Debug.DebugEvent.Break) { 68 if (event == Debug.DebugEvent.Break) {
69 if (listener_state == 0) { 69 if (listener_state == 0) {
70 Debug.clearBreakPoint(bp); 70 Debug.clearBreakPoint(bp);
71 var context_frame; 71 exec_state.prepareStep(Debug.StepAction.StepNext, step_count);
72 if (frame_index !== undefined) {
73 context_frame = exec_state.frame(frame_index);
74 }
75 exec_state.prepareStep(Debug.StepAction.StepNext,
76 step_count, context_frame);
77 listener_state = 1; 72 listener_state = 1;
78 } else if (listener_state == 1) { 73 } else if (listener_state == 1) {
79 state_snapshot = String(state); 74 state_snapshot = String(state);
80 print("State: " + state_snapshot); 75 print("State: " + state_snapshot);
81 Debug.setListener(null); 76 Debug.setListener(null);
82 listener_state = 2; 77 listener_state = 2;
83 } 78 }
84 } 79 }
85 } catch (e) { 80 } catch (e) {
86 listener_exception = e; 81 listener_exception = e;
(...skipping 13 matching lines...) Expand all
100 assertUnreachable(); 95 assertUnreachable();
101 } 96 }
102 97
103 assertEquals(expected_final_state, state_snapshot); 98 assertEquals(expected_final_state, state_snapshot);
104 } 99 }
105 100
106 101
107 // Warm-up -- make sure all is compiled and ready for breakpoint. 102 // Warm-up -- make sure all is compiled and ready for breakpoint.
108 h(); 103 h();
109 104
110 105 TestCase(0, "0,0,-1");
111 // Stepping in the default (top) frame. 106 TestCase(1, "0,0,-1");
112 TestCase(undefined, 0, "0,0,-1"); 107 TestCase(2, "0,0,0");
113 TestCase(undefined, 1, "0,0,-1"); 108 TestCase(5, "0,0,1");
114 TestCase(undefined, 2, "0,0,0"); 109 TestCase(8, "0,0,2");
115 TestCase(undefined, 5, "0,0,1");
116 TestCase(undefined, 8, "0,0,3");
117
118 // Stepping in the frame #0 (should be exactly the same as above).
119 TestCase(0, 0, "0,0,-1");
120 TestCase(0, 1, "0,0,-1");
121 TestCase(0, 2, "0,0,0");
122 TestCase(0, 5, "0,0,1");
123 TestCase(0, 8, "0,0,3");
124
125 // Stepping in the frame #1.
126 TestCase(1, 0, "0,0,3");
127 TestCase(1, 3, "0,1,3");
128 TestCase(1, 7, "0,3,3");
129
130 // Stepping in the frame #2.
131 TestCase(2, 3, "1,3,3");
132 TestCase(2, 7, "3,3,3");
OLDNEW
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/mjsunit/debug-step-4-in-frame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698