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

Side by Side Diff: test/mjsunit/debug-stepframe.js

Issue 690263004: Introduce new stepping mode to step into another frame. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | no next file » | 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 2014 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 // Flags: --expose-debug-as debug
6
7 function f0() {
8 var v00 = 0; // Break 1
9 var v01 = 1;
10 // Normal function call in a catch scope.
11 try {
12 throw 1;
13 } catch (e) {
14 f1(); // Break 3
aandrey 2014/11/04 17:28:18 remove comment? should be no break here.
Yang 2014/11/04 17:30:13 right. this is outdated.
15 var v02 = 2; // Break 13
16 }
17 var v03 = 3;
18 var v04 = 4;
19 }
20
21 function f1() {
22 var v10 = 0; // Break 2
23 var v11 = 1;
24 // Getter call.
25 var v12 = o.get;
26 var v13 = 3 // Break 4
27 // Setter call.
28 o.set = 2;
29 var v14 = 4; // Break 6
30 // Function.prototype.call.
31 f2.call();
32 var v15 = 5; // Break 12
33 var v16 = 6;
34 }
35
36 function get() {
37 var g0 = 0; // Break 3
38 var g1 = 1;
39 return 3;
40 }
41
42 function set() {
43 var s0 = 0; // Break 5
44 return 3;
45 }
46
47 function f2() {
48 var v20 = 0; // Break 7
49 // Construct call.
50 var v21 = new c0();
51 var v22 = 2; // Break 9
52 // Bound function.
53 b0();
54 return 2; // Break 11
55 }
56
57 function c0() {
58 this.v0 = 0; // Break 8
59 this.v1 = 1;
60 }
61
62 function f3() {
63 var v30 = 0; // Break 10
64 var v31 = 1;
65 return 3;
66 }
67
68 var b0 = f3.bind(o);
69
70 var o = {};
71 Object.defineProperty(o, "get", { get : get });
72 Object.defineProperty(o, "set", { set : set });
73
74 Debug = debug.Debug;
75 var break_count = 0
76 var exception = null;
77
78 function listener(event, exec_state, event_data, data) {
79 if (event != Debug.DebugEvent.Break) return;
80 try {
81 var line = exec_state.frame(0).sourceLineText();
82 print(line);
83 var match = line.match(/\/\/ Break (\d+)$/);
84 assertEquals(2, match.length);
85 assertEquals(break_count++, parseInt(match[1]));
86 exec_state.prepareStep(Debug.StepAction.StepFrame, 1);
87 } catch (e) {
88 exception = e;
89 }
90 }
91
92 Debug.setListener(listener);
93 debugger; // Break 0
94 f0();
95 Debug.setListener(null); // Break 14
96
97 assertEquals(15, break_count);
98 assertNull(exception);
OLDNEW
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698