OLD | NEW |
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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 // Give the event to the Service first, as the debugger event handler | 298 // Give the event to the Service first, as the debugger event handler |
299 // may go into a message loop and the Service will not. | 299 // may go into a message loop and the Service will not. |
300 // | 300 // |
301 // kBreakpointResolved events are handled differently in the vm | 301 // kBreakpointResolved events are handled differently in the vm |
302 // service, so suppress them here. | 302 // service, so suppress them here. |
303 if (ServiceNeedsDebuggerEvent(event->type())) { | 303 if (ServiceNeedsDebuggerEvent(event->type())) { |
304 ServiceEvent service_event(event); | 304 ServiceEvent service_event(event); |
305 Service::HandleEvent(&service_event); | 305 Service::HandleEvent(&service_event); |
306 } | 306 } |
307 | 307 |
308 if ((FLAG_steal_breakpoints || (event_handler_ == NULL)) && | 308 { |
309 event->IsPauseEvent()) { | 309 TransitionVMToNative transition(Thread::Current()); |
310 // We allow the embedder's default breakpoint handler to be overridden. | 310 if ((FLAG_steal_breakpoints || (event_handler_ == NULL)) && |
311 isolate_->PauseEventHandler(); | 311 event->IsPauseEvent()) { |
312 } else if (event_handler_ != NULL) { | 312 // We allow the embedder's default breakpoint handler to be overridden. |
313 (*event_handler_)(event); | 313 isolate_->PauseEventHandler(); |
| 314 } else if (event_handler_ != NULL) { |
| 315 (*event_handler_)(event); |
| 316 } |
314 } | 317 } |
315 | 318 |
316 if (ServiceNeedsDebuggerEvent(event->type()) && event->IsPauseEvent()) { | 319 if (ServiceNeedsDebuggerEvent(event->type()) && event->IsPauseEvent()) { |
317 // If we were paused, notify the service that we have resumed. | 320 // If we were paused, notify the service that we have resumed. |
318 const Error& error = | 321 const Error& error = |
319 Error::Handle(isolate_->object_store()->sticky_error()); | 322 Error::Handle(isolate_->object_store()->sticky_error()); |
320 ASSERT(error.IsNull() || error.IsUnwindError()); | 323 ASSERT(error.IsNull() || error.IsUnwindError()); |
321 | 324 |
322 // Only send a resume event when the isolate is not unwinding. | 325 // Only send a resume event when the isolate is not unwinding. |
323 if (!error.IsUnwindError()) { | 326 if (!error.IsUnwindError()) { |
(...skipping 2929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3253 } | 3256 } |
3254 | 3257 |
3255 | 3258 |
3256 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3259 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
3257 ASSERT(bpt->next() == NULL); | 3260 ASSERT(bpt->next() == NULL); |
3258 bpt->set_next(code_breakpoints_); | 3261 bpt->set_next(code_breakpoints_); |
3259 code_breakpoints_ = bpt; | 3262 code_breakpoints_ = bpt; |
3260 } | 3263 } |
3261 | 3264 |
3262 } // namespace dart | 3265 } // namespace dart |
OLD | NEW |