OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --expose-debug-as debug | 5 // Flags: --expose-debug-as debug |
6 | 6 |
7 Debug = debug.Debug | 7 Debug = debug.Debug |
8 | 8 |
9 var exception = null; | 9 var exception = null; |
10 var log = []; | 10 var log = []; |
11 | 11 |
12 function listener(event, exec_state, event_data, data) { | 12 function listener(event, exec_state, event_data, data) { |
13 if (event != Debug.DebugEvent.Break) return; | 13 if (event != Debug.DebugEvent.Break) return; |
14 try { | 14 try { |
15 print(event_data.sourceLineText()); | 15 print(event_data.sourceLineText()); |
16 var entry = ""; | 16 var entry = ""; |
17 for (var i = 0; i < exec_state.frameCount(); i++) { | 17 for (var i = 0; i < exec_state.frameCount(); i++) { |
18 entry += exec_state.frame(i).sourceLineText().substr(-1); | 18 entry += exec_state.frame(i).sourceLineText().substr(-1); |
19 entry += exec_state.frame(i).sourceColumn(); | 19 entry += exec_state.frame(i).sourceColumn(); |
20 } | 20 } |
21 log.push(entry); | 21 log.push(entry); |
22 exec_state.prepareStep(Debug.StepAction.StepIn, 1); | 22 exec_state.prepareStep(Debug.StepAction.StepIn); |
23 } catch (e) { | 23 } catch (e) { |
24 exception = e; | 24 exception = e; |
25 } | 25 } |
26 }; | 26 }; |
27 | 27 |
28 function u(x) { | 28 function u(x) { |
29 return x.toUpperCase(); // d | 29 return x.toUpperCase(); // d |
30 } // e | 30 } // e |
31 | 31 |
32 var n = 3; | 32 var n = 3; |
(...skipping 18 matching lines...) Expand all Loading... |
51 "b0", | 51 "b0", |
52 "d2b13", | 52 "d2b13", |
53 "e0b13", | 53 "e0b13", |
54 "b25", | 54 "b25", |
55 "d2b25", | 55 "d2b25", |
56 "e0b25", | 56 "e0b25", |
57 "f4b44", | 57 "f4b44", |
58 "g2b44", | 58 "g2b44", |
59 "c0" | 59 "c0" |
60 ], log); | 60 ], log); |
OLD | NEW |