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

Side by Side Diff: test/debugger/debugger/debug-step.js

Issue 2466273005: [debugger] Further stepping support in test wrapper (Closed)
Patch Set: Move more tests Created 4 years, 1 month 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/debugger/debugger.status ('k') | test/debugger/debugger/debug-step-2.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 Debug = new DebugWrapper();
6 Debug.enable();
7
8 // Simple debug event handler which performs 100 steps and then retrieves
9 // the resulting value of "i" in f().
10
11 function listener(event, exec_state, event_data, data) {
12 if (event == Debug.DebugEvent.Break) {
13 if (step_count > 0) {
14 Debug.stepInto();
15 step_count--;
16 } else {
17 const frameid = exec_state.frames[0].callFrameId;
18 result = Debug.evaluate(frameid, "i").value;
19 }
20 }
21 };
22
23 // Add the debug event listener.
24 Debug.setListener(listener);
25
26 // Test debug event for break point.
27 function f() {
28 var i; // Line 1.
29 for (i = 0; i < 100; i++) { // Line 2.
30 x = 1; // Line 3.
31 }
32 };
33
34 // Set a breakpoint on the for statement (line 1).
35 Debug.setBreakPoint(f, 1);
36
37 // Check that performing 100 steps will make i 33.
38 let step_count = 100;
39 let result = -1;
40
41 f();
42
43 assertEquals(33, result);
OLDNEW
« no previous file with comments | « test/debugger/debugger.status ('k') | test/debugger/debugger/debug-step-2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698