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 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2268 stack_trace_ = stack_trace; | 2268 stack_trace_ = stack_trace; |
2269 SignalPausedEvent(top_frame, bpt->src_bpt_); | 2269 SignalPausedEvent(top_frame, bpt->src_bpt_); |
2270 HandleSteppingRequest(stack_trace_); | 2270 HandleSteppingRequest(stack_trace_); |
2271 stack_trace_ = NULL; | 2271 stack_trace_ = NULL; |
2272 if (bpt->IsInternal()) { | 2272 if (bpt->IsInternal()) { |
2273 RemoveInternalBreakpoints(); | 2273 RemoveInternalBreakpoints(); |
2274 } | 2274 } |
2275 } | 2275 } |
2276 | 2276 |
2277 | 2277 |
2278 void Debugger::BreakHere() { | 2278 void Debugger::BreakHere(const String& msg) { |
2279 // We ignore this breakpoint when the VM is executing code invoked | 2279 // We ignore this breakpoint when the VM is executing code invoked |
2280 // by the debugger to evaluate variables values, or when we see a nested | 2280 // by the debugger to evaluate variables values, or when we see a nested |
2281 // breakpoint or exception event. | 2281 // breakpoint or exception event. |
2282 if (ignore_breakpoints_ || IsPaused() || !HasEventHandler()) { | 2282 if (ignore_breakpoints_ || IsPaused() || !HasEventHandler()) { |
2283 return; | 2283 return; |
2284 } | 2284 } |
2285 | 2285 |
2286 DebuggerStackTrace* stack_trace = CollectStackTrace(); | 2286 DebuggerStackTrace* stack_trace = CollectStackTrace(); |
2287 ASSERT(stack_trace->Length() > 0); | 2287 ASSERT(stack_trace->Length() > 0); |
2288 ASSERT(stack_trace_ == NULL); | 2288 ASSERT(stack_trace_ == NULL); |
2289 stack_trace_ = stack_trace; | 2289 stack_trace_ = stack_trace; |
2290 | 2290 |
| 2291 // TODO(johnmccutchan): Send |msg| to Observatory. |
| 2292 |
2291 // We are in the native call to Debugger_breakHere or Debugger_breakHereIf, | 2293 // We are in the native call to Debugger_breakHere or Debugger_breakHereIf, |
2292 // the developer gets a better experience by not seeing this call. To | 2294 // the developer gets a better experience by not seeing this call. To |
2293 // accomplish this, we continue execution until the call exits (step out). | 2295 // accomplish this, we continue execution until the call exits (step out). |
2294 SetStepOut(); | 2296 SetStepOut(); |
2295 HandleSteppingRequest(stack_trace_); | 2297 HandleSteppingRequest(stack_trace_); |
2296 | 2298 |
2297 stack_trace_ = NULL; | 2299 stack_trace_ = NULL; |
2298 } | 2300 } |
2299 | 2301 |
2300 | 2302 |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2690 } | 2692 } |
2691 | 2693 |
2692 | 2694 |
2693 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2695 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
2694 ASSERT(bpt->next() == NULL); | 2696 ASSERT(bpt->next() == NULL); |
2695 bpt->set_next(code_breakpoints_); | 2697 bpt->set_next(code_breakpoints_); |
2696 code_breakpoints_ = bpt; | 2698 code_breakpoints_ = bpt; |
2697 } | 2699 } |
2698 | 2700 |
2699 } // namespace dart | 2701 } // namespace dart |
OLD | NEW |