| 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" |
| 11 #include "vm/compiler.h" | 11 #include "vm/compiler.h" |
| 12 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
| 13 #include "vm/deopt_instructions.h" | 13 #include "vm/deopt_instructions.h" |
| 14 #include "vm/flags.h" | 14 #include "vm/flags.h" |
| 15 #include "vm/globals.h" | 15 #include "vm/globals.h" |
| 16 #include "vm/longjump.h" | 16 #include "vm/longjump.h" |
| 17 #include "vm/json_stream.h" | 17 #include "vm/json_stream.h" |
| 18 #include "vm/object.h" | 18 #include "vm/object.h" |
| 19 #include "vm/object_store.h" | 19 #include "vm/object_store.h" |
| 20 #include "vm/os.h" | 20 #include "vm/os.h" |
| 21 #include "vm/port.h" | 21 #include "vm/port.h" |
| 22 #include "vm/service_event.h" | 22 #include "vm/service_event.h" |
| 23 #include "vm/service_isolate.h" | 23 #include "vm/service_isolate.h" |
| 24 #include "vm/service.h" | 24 #include "vm/service.h" |
| 25 #include "vm/stack_frame.h" | 25 #include "vm/stack_frame.h" |
| 26 #include "vm/stub_code.h" | 26 #include "vm/stub_code.h" |
| 27 #include "vm/symbols.h" | 27 #include "vm/symbols.h" |
| 28 #include "vm/thread_interrupter.h" |
| 28 #include "vm/visitor.h" | 29 #include "vm/visitor.h" |
| 29 | 30 |
| 30 | 31 |
| 31 namespace dart { | 32 namespace dart { |
| 32 | 33 |
| 33 DEFINE_FLAG(bool, show_invisible_frames, false, | 34 DEFINE_FLAG(bool, show_invisible_frames, false, |
| 34 "Show invisible frames in debugger stack traces"); | 35 "Show invisible frames in debugger stack traces"); |
| 35 DEFINE_FLAG(bool, trace_debugger_stacktrace, false, | 36 DEFINE_FLAG(bool, trace_debugger_stacktrace, false, |
| 36 "Trace debugger stacktrace collection"); | 37 "Trace debugger stacktrace collection"); |
| 37 DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages"); | 38 DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages"); |
| (...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2141 isolate_->set_single_step(true); | 2142 isolate_->set_single_step(true); |
| 2142 // Find topmost caller that is debuggable. | 2143 // Find topmost caller that is debuggable. |
| 2143 for (intptr_t i = 1; i < stack_trace->Length(); i++) { | 2144 for (intptr_t i = 1; i < stack_trace->Length(); i++) { |
| 2144 ActivationFrame* frame = stack_trace->FrameAt(i); | 2145 ActivationFrame* frame = stack_trace->FrameAt(i); |
| 2145 if (frame->IsDebuggable()) { | 2146 if (frame->IsDebuggable()) { |
| 2146 stepping_fp_ = frame->fp(); | 2147 stepping_fp_ = frame->fp(); |
| 2147 break; | 2148 break; |
| 2148 } | 2149 } |
| 2149 } | 2150 } |
| 2150 } | 2151 } |
| 2152 if (!isolate_->single_step()) { |
| 2153 // We are no longer single stepping, make sure that the ThreadInterrupter |
| 2154 // is awake. |
| 2155 ThreadInterrupter::WakeUp(); |
| 2156 } |
| 2151 } | 2157 } |
| 2152 | 2158 |
| 2153 | 2159 |
| 2154 // static | 2160 // static |
| 2155 bool Debugger::IsDebuggable(const Function& func) { | 2161 bool Debugger::IsDebuggable(const Function& func) { |
| 2156 if (!func.is_debuggable()) { | 2162 if (!func.is_debuggable()) { |
| 2157 return false; | 2163 return false; |
| 2158 } | 2164 } |
| 2159 if (ServiceIsolate::IsRunning()) { | 2165 if (ServiceIsolate::IsRunning()) { |
| 2160 return true; | 2166 return true; |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2694 } | 2700 } |
| 2695 | 2701 |
| 2696 | 2702 |
| 2697 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2703 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2698 ASSERT(bpt->next() == NULL); | 2704 ASSERT(bpt->next() == NULL); |
| 2699 bpt->set_next(code_breakpoints_); | 2705 bpt->set_next(code_breakpoints_); |
| 2700 code_breakpoints_ = bpt; | 2706 code_breakpoints_ = bpt; |
| 2701 } | 2707 } |
| 2702 | 2708 |
| 2703 } // namespace dart | 2709 } // namespace dart |
| OLD | NEW |