| 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 stack_trace_ = NULL; | 309 stack_trace_ = NULL; |
| 310 } else { | 310 } else { |
| 311 InvokeEventHandler(&event); | 311 InvokeEventHandler(&event); |
| 312 } | 312 } |
| 313 } | 313 } |
| 314 } | 314 } |
| 315 | 315 |
| 316 | 316 |
| 317 void Debugger::SignalIsolateInterrupted() { | 317 void Debugger::SignalIsolateInterrupted() { |
| 318 if (HasEventHandler()) { | 318 if (HasEventHandler()) { |
| 319 ASSERT(Isolate::Current()->debugger() != NULL); |
| 319 Debugger* debugger = Isolate::Current()->debugger(); | 320 Debugger* debugger = Isolate::Current()->debugger(); |
| 320 ASSERT(debugger != NULL); | 321 ASSERT(debugger != NULL); |
| 321 debugger->SignalIsolateEvent(DebuggerEvent::kIsolateInterrupted); | 322 debugger->SignalIsolateEvent(DebuggerEvent::kIsolateInterrupted); |
| 322 } | 323 } |
| 323 } | 324 } |
| 324 | 325 |
| 325 | 326 |
| 326 // The vm service handles breakpoint notifications in a different way | 327 // The vm service handles breakpoint notifications in a different way |
| 327 // than the regular debugger breakpoint notifications. | 328 // than the regular debugger breakpoint notifications. |
| 328 static void SendServiceBreakpointEvent(ServiceEvent::EventType type, | 329 static void SendServiceBreakpointEvent(ServiceEvent::EventType type, |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 "Current frame:\n%s\n", | 838 "Current frame:\n%s\n", |
| 838 this->ToCString()); | 839 this->ToCString()); |
| 839 | 840 |
| 840 OS::PrintErr("-------------------------\n" | 841 OS::PrintErr("-------------------------\n" |
| 841 "Context contents:\n"); | 842 "Context contents:\n"); |
| 842 const Context& ctx = GetSavedCurrentContext(); | 843 const Context& ctx = GetSavedCurrentContext(); |
| 843 ctx.Dump(8); | 844 ctx.Dump(8); |
| 844 | 845 |
| 845 OS::PrintErr("-------------------------\n" | 846 OS::PrintErr("-------------------------\n" |
| 846 "Debugger stack trace...\n\n"); | 847 "Debugger stack trace...\n\n"); |
| 848 ASSERT(Isolate::Current()->debugger() != NULL); |
| 847 DebuggerStackTrace* stack = | 849 DebuggerStackTrace* stack = |
| 848 Isolate::Current()->debugger()->StackTrace(); | 850 Isolate::Current()->debugger()->StackTrace(); |
| 849 intptr_t num_frames = stack->Length(); | 851 intptr_t num_frames = stack->Length(); |
| 850 for (intptr_t i = 0; i < num_frames; i++) { | 852 for (intptr_t i = 0; i < num_frames; i++) { |
| 851 ActivationFrame* frame = stack->FrameAt(i); | 853 ActivationFrame* frame = stack->FrameAt(i); |
| 852 OS::PrintErr("#%04" Pd " %s", i, frame->ToCString()); | 854 OS::PrintErr("#%04" Pd " %s", i, frame->ToCString()); |
| 853 } | 855 } |
| 854 | 856 |
| 855 OS::PrintErr("-------------------------\n" | 857 OS::PrintErr("-------------------------\n" |
| 856 "All frames...\n\n"); | 858 "All frames...\n\n"); |
| (...skipping 2095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2952 } | 2954 } |
| 2953 | 2955 |
| 2954 | 2956 |
| 2955 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2957 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2956 ASSERT(bpt->next() == NULL); | 2958 ASSERT(bpt->next() == NULL); |
| 2957 bpt->set_next(code_breakpoints_); | 2959 bpt->set_next(code_breakpoints_); |
| 2958 code_breakpoints_ = bpt; | 2960 code_breakpoints_ = bpt; |
| 2959 } | 2961 } |
| 2960 | 2962 |
| 2961 } // namespace dart | 2963 } // namespace dart |
| OLD | NEW |