| 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 2497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2508 | 2508 |
| 2509 | 2509 |
| 2510 void Debugger::Pause(DebuggerEvent* event) { | 2510 void Debugger::Pause(DebuggerEvent* event) { |
| 2511 ASSERT(!IsPaused()); // No recursive pausing. | 2511 ASSERT(!IsPaused()); // No recursive pausing. |
| 2512 ASSERT(obj_cache_ == NULL); | 2512 ASSERT(obj_cache_ == NULL); |
| 2513 | 2513 |
| 2514 pause_event_ = event; | 2514 pause_event_ = event; |
| 2515 pause_event_->UpdateTimestamp(); | 2515 pause_event_->UpdateTimestamp(); |
| 2516 obj_cache_ = new RemoteObjectCache(64); | 2516 obj_cache_ = new RemoteObjectCache(64); |
| 2517 | 2517 |
| 2518 // We are about to invoke the debuggers event handler. Disable interrupts | 2518 InvokeEventHandler(event); |
| 2519 // for this thread while waiting for debug commands over the service protocol. | |
| 2520 { | |
| 2521 DisableThreadInterruptsScope dtis(Thread::Current()); | |
| 2522 InvokeEventHandler(event); | |
| 2523 } | |
| 2524 | 2519 |
| 2525 pause_event_ = NULL; | 2520 pause_event_ = NULL; |
| 2526 obj_cache_ = NULL; // Zone allocated | 2521 obj_cache_ = NULL; // Zone allocated |
| 2527 } | 2522 } |
| 2528 | 2523 |
| 2529 | 2524 |
| 2530 void Debugger::EnterSingleStepMode() { | 2525 void Debugger::EnterSingleStepMode() { |
| 2531 stepping_fp_ = 0; | 2526 stepping_fp_ = 0; |
| 2532 DeoptimizeWorld(); | 2527 DeoptimizeWorld(); |
| 2533 isolate_->set_single_step(true); | 2528 isolate_->set_single_step(true); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2554 isolate_->set_single_step(true); | 2549 isolate_->set_single_step(true); |
| 2555 // Find topmost caller that is debuggable. | 2550 // Find topmost caller that is debuggable. |
| 2556 for (intptr_t i = 1; i < stack_trace->Length(); i++) { | 2551 for (intptr_t i = 1; i < stack_trace->Length(); i++) { |
| 2557 ActivationFrame* frame = stack_trace->FrameAt(i); | 2552 ActivationFrame* frame = stack_trace->FrameAt(i); |
| 2558 if (frame->IsDebuggable()) { | 2553 if (frame->IsDebuggable()) { |
| 2559 stepping_fp_ = frame->fp(); | 2554 stepping_fp_ = frame->fp(); |
| 2560 break; | 2555 break; |
| 2561 } | 2556 } |
| 2562 } | 2557 } |
| 2563 } | 2558 } |
| 2559 if (!isolate_->single_step()) { |
| 2560 // We are no longer single stepping, make sure that the ThreadInterrupter |
| 2561 // is awake. |
| 2562 ThreadInterrupter::WakeUp(); |
| 2563 } |
| 2564 } | 2564 } |
| 2565 | 2565 |
| 2566 | 2566 |
| 2567 // static | 2567 // static |
| 2568 bool Debugger::IsDebuggable(const Function& func) { | 2568 bool Debugger::IsDebuggable(const Function& func) { |
| 2569 if (!func.is_debuggable()) { | 2569 if (!func.is_debuggable()) { |
| 2570 return false; | 2570 return false; |
| 2571 } | 2571 } |
| 2572 if (ServiceIsolate::IsRunning()) { | 2572 if (ServiceIsolate::IsRunning()) { |
| 2573 return true; | 2573 return true; |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3250 } | 3250 } |
| 3251 | 3251 |
| 3252 | 3252 |
| 3253 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3253 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 3254 ASSERT(bpt->next() == NULL); | 3254 ASSERT(bpt->next() == NULL); |
| 3255 bpt->set_next(code_breakpoints_); | 3255 bpt->set_next(code_breakpoints_); |
| 3256 code_breakpoints_ = bpt; | 3256 code_breakpoints_ = bpt; |
| 3257 } | 3257 } |
| 3258 | 3258 |
| 3259 } // namespace dart | 3259 } // namespace dart |
| OLD | NEW |