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

Side by Side Diff: runtime/vm/debugger.cc

Issue 1649843002: Add --warn-on-pause-with-no-debugger flag. Add this to --observe behavior. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code review, etc. Created 4 years, 10 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
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/debugger.h" 5 #include "vm/debugger.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 26 matching lines...) Expand all
37 DEFINE_FLAG(bool, trace_debugger_stacktrace, false, 37 DEFINE_FLAG(bool, trace_debugger_stacktrace, false,
38 "Trace debugger stacktrace collection"); 38 "Trace debugger stacktrace collection");
39 DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages"); 39 DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages");
40 DEFINE_FLAG(bool, steal_breakpoints, false, 40 DEFINE_FLAG(bool, steal_breakpoints, false,
41 "Intercept breakpoints and other pause events before they " 41 "Intercept breakpoints and other pause events before they "
42 "are sent to the embedder and use a generic VM breakpoint " 42 "are sent to the embedder and use a generic VM breakpoint "
43 "handler instead. This handler dispatches breakpoints to " 43 "handler instead. This handler dispatches breakpoints to "
44 "the VM service."); 44 "the VM service.");
45 45
46 DECLARE_FLAG(bool, trace_isolates); 46 DECLARE_FLAG(bool, trace_isolates);
47 DECLARE_FLAG(bool, warn_on_pause_with_no_debugger);
47 48
48 49
49 Debugger::EventHandler* Debugger::event_handler_ = NULL; 50 Debugger::EventHandler* Debugger::event_handler_ = NULL;
50 51
51 52
52 class RemoteObjectCache : public ZoneAllocated { 53 class RemoteObjectCache : public ZoneAllocated {
53 public: 54 public:
54 explicit RemoteObjectCache(intptr_t initial_size); 55 explicit RemoteObjectCache(intptr_t initial_size);
55 intptr_t AddObject(const Object& obj); 56 intptr_t AddObject(const Object& obj);
56 RawObject* GetObj(intptr_t obj_id) const; 57 RawObject* GetObj(intptr_t obj_id) const;
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 static bool ServiceNeedsDebuggerEvent(DebuggerEvent::EventType type) { 275 static bool ServiceNeedsDebuggerEvent(DebuggerEvent::EventType type) {
275 switch (type) { 276 switch (type) {
276 case DebuggerEvent::kBreakpointResolved: 277 case DebuggerEvent::kBreakpointResolved:
277 // kBreakpointResolved events are handled differently in the vm 278 // kBreakpointResolved events are handled differently in the vm
278 // service, so suppress them here. 279 // service, so suppress them here.
279 return false; 280 return false;
280 281
281 case DebuggerEvent::kBreakpointReached: 282 case DebuggerEvent::kBreakpointReached:
282 case DebuggerEvent::kExceptionThrown: 283 case DebuggerEvent::kExceptionThrown:
283 case DebuggerEvent::kIsolateInterrupted: 284 case DebuggerEvent::kIsolateInterrupted:
284 return Service::debug_stream.enabled(); 285 return (Service::debug_stream.enabled() ||
286 FLAG_warn_on_pause_with_no_debugger);
285 287
286 case DebuggerEvent::kIsolateCreated: 288 case DebuggerEvent::kIsolateCreated:
287 case DebuggerEvent::kIsolateShutdown: 289 case DebuggerEvent::kIsolateShutdown:
288 return Service::isolate_stream.enabled(); 290 return Service::isolate_stream.enabled();
289 291
290 default: 292 default:
291 UNREACHABLE(); 293 UNREACHABLE();
292 return false; 294 return false;
293 } 295 }
294 } 296 }
(...skipping 2967 matching lines...) Expand 10 before | Expand all | Expand 10 after
3262 } 3264 }
3263 3265
3264 3266
3265 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 3267 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
3266 ASSERT(bpt->next() == NULL); 3268 ASSERT(bpt->next() == NULL);
3267 bpt->set_next(code_breakpoints_); 3269 bpt->set_next(code_breakpoints_);
3268 code_breakpoints_ = bpt; 3270 code_breakpoints_ = bpt;
3269 } 3271 }
3270 3272
3271 } // namespace dart 3273 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698