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

Side by Side Diff: test/mjsunit/regress/regress-crbug-432493.js

Issue 728103008: Fix disabling all break points from within the debug event callback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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
« src/debug.h ('K') | « src/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 f() {
8 var a = 1;
9 var b = 2;
10 return a + b;
11 }
12
13 var exception = null;
14 var break_count = 0;
15 var throw_count = 0;
16
17 function listener(event, exec_state, event_data, data) {
18 try {
19 if (event == Debug.DebugEvent.Break) {
20 break_count++;
21 // Disable all breakpoints from within the debug event callback.
22 Debug.debuggerFlags().breakPointsActive.setValue(false);
23 } else if (event = Debug.DebugEvent.Exception) {
24 throw_count++;
25 // Enable all breakpoints from within the debug event callback.
26 Debug.debuggerFlags().breakPointsActive.setValue(true);
27 }
28 } catch (e) {
29 exception = e;
30 }
31 }
32
33 Debug = debug.Debug;
34
35 Debug.setListener(listener);
36 Debug.setBreakOnException();
37 Debug.setBreakPoint(f, 2);
38
39 f();
40 f();
41
aandrey 2014/11/18 14:07:27 mind adding assertEquals(1, break_count); here?
42 // Trigger exception event.
43 try { throw 1; } catch (e) {}
44
45 f();
46 f();
47
48 Debug.setListener(null);
49 Debug.clearBreakOnException();
50 Debug.debuggerFlags().breakPointsActive.setValue(true);
51
52 assertEquals(2, break_count);
53 assertEquals(1, throw_count);
54 assertNull(exception);
OLDNEW
« src/debug.h ('K') | « src/debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698