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

Side by Side Diff: src/debug/debug.cc

Issue 1321543004: [futex] Allow debugger to break in the middle of a futexWait Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: feedback Created 5 years, 3 months 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #include "src/debug/debug.h" 5 #include "src/debug/debug.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 23 matching lines...) Expand all
34 message_handler_(NULL), 34 message_handler_(NULL),
35 command_received_(0), 35 command_received_(0),
36 command_queue_(isolate->logger(), kQueueInitialSize), 36 command_queue_(isolate->logger(), kQueueInitialSize),
37 is_active_(false), 37 is_active_(false),
38 is_suppressed_(false), 38 is_suppressed_(false),
39 live_edit_enabled_(true), // TODO(yangguo): set to false by default. 39 live_edit_enabled_(true), // TODO(yangguo): set to false by default.
40 break_disabled_(false), 40 break_disabled_(false),
41 in_debug_event_listener_(false), 41 in_debug_event_listener_(false),
42 break_on_exception_(false), 42 break_on_exception_(false),
43 break_on_uncaught_exception_(false), 43 break_on_uncaught_exception_(false),
44 break_in_nondebuggable_(false),
44 debug_info_list_(NULL), 45 debug_info_list_(NULL),
45 isolate_(isolate) { 46 isolate_(isolate) {
46 ThreadInit(); 47 ThreadInit();
47 } 48 }
48 49
49 50
50 static v8::Local<v8::Context> GetDebugEventContext(Isolate* isolate) { 51 static v8::Local<v8::Context> GetDebugEventContext(Isolate* isolate) {
51 Handle<Context> context = isolate->debug()->debugger_entry()->GetContext(); 52 Handle<Context> context = isolate->debug()->debugger_entry()->GetContext();
52 // Isolate::context() may have been NULL when "script collected" event 53 // Isolate::context() may have been NULL when "script collected" event
53 // occured. 54 // occured.
(...skipping 2183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2237 if (!is_active()) return; 2238 if (!is_active()) return;
2238 2239
2239 StackLimitCheck check(isolate_); 2240 StackLimitCheck check(isolate_);
2240 if (check.HasOverflowed()) return; 2241 if (check.HasOverflowed()) return;
2241 2242
2242 { JavaScriptFrameIterator it(isolate_); 2243 { JavaScriptFrameIterator it(isolate_);
2243 DCHECK(!it.done()); 2244 DCHECK(!it.done());
2244 Object* fun = it.frame()->function(); 2245 Object* fun = it.frame()->function();
2245 if (fun && fun->IsJSFunction()) { 2246 if (fun && fun->IsJSFunction()) {
2246 // Don't stop in builtin functions. 2247 // Don't stop in builtin functions.
2247 if (!JSFunction::cast(fun)->IsSubjectToDebugging()) return; 2248 if (!(JSFunction::cast(fun)->IsSubjectToDebugging() ||
2249 break_in_nondebuggable_)) {
2250 return;
2251 }
2248 GlobalObject* global = JSFunction::cast(fun)->context()->global_object(); 2252 GlobalObject* global = JSFunction::cast(fun)->context()->global_object();
2249 // Don't stop in debugger functions. 2253 // Don't stop in debugger functions.
2250 if (IsDebugGlobal(global)) return; 2254 if (IsDebugGlobal(global)) return;
2251 } 2255 }
2252 } 2256 }
2253 2257
2254 // Collect the break state before clearing the flags. 2258 // Collect the break state before clearing the flags.
2255 bool debug_command_only = isolate_->stack_guard()->CheckDebugCommand() && 2259 bool debug_command_only = isolate_->stack_guard()->CheckDebugCommand() &&
2256 !isolate_->stack_guard()->CheckDebugBreak(); 2260 !isolate_->stack_guard()->CheckDebugBreak();
2257 2261
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
2580 } 2584 }
2581 2585
2582 2586
2583 void LockingCommandMessageQueue::Clear() { 2587 void LockingCommandMessageQueue::Clear() {
2584 base::LockGuard<base::Mutex> lock_guard(&mutex_); 2588 base::LockGuard<base::Mutex> lock_guard(&mutex_);
2585 queue_.Clear(); 2589 queue_.Clear();
2586 } 2590 }
2587 2591
2588 } // namespace internal 2592 } // namespace internal
2589 } // namespace v8 2593 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug/debug.h ('k') | src/futex-emulation.cc » ('j') | test/cctest/test-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698