Chromium Code Reviews| 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::ExplicitBreakpoint() { | |
|
hausner
2015/05/05 00:16:27
SignalDebugBreak() ?
Cutch
2015/05/05 02:38:53
I went with BreakHere and changed the behaviour. P
| |
| 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 | |
| 2281 // breakpoint or exception event. | |
| 2282 if (ignore_breakpoints_ || IsPaused() || !HasEventHandler()) { | |
| 2283 return; | |
| 2284 } | |
| 2285 | |
| 2286 DebuggerStackTrace* stack_trace = CollectStackTrace(); | |
| 2287 ASSERT(stack_trace->Length() > 0); | |
| 2288 ActivationFrame* top_frame = stack_trace->FrameAt(0); | |
| 2289 ASSERT(top_frame != NULL); | |
| 2290 | |
| 2291 ASSERT(stack_trace_ == NULL); | |
| 2292 stack_trace_ = stack_trace; | |
| 2293 SignalPausedEvent(top_frame, NULL); | |
| 2294 HandleSteppingRequest(stack_trace_); | |
| 2295 stack_trace_ = NULL; | |
| 2296 } | |
| 2297 | |
| 2298 | |
| 2278 void Debugger::Initialize(Isolate* isolate) { | 2299 void Debugger::Initialize(Isolate* isolate) { |
| 2279 if (initialized_) { | 2300 if (initialized_) { |
| 2280 return; | 2301 return; |
| 2281 } | 2302 } |
| 2282 isolate_ = isolate; | 2303 isolate_ = isolate; |
| 2283 | 2304 |
| 2284 // Use the isolate's control port as the isolate_id for debugging. | 2305 // Use the isolate's control port as the isolate_id for debugging. |
| 2285 // This port will be used as a unique ID to represent the isolate in the | 2306 // This port will be used as a unique ID to represent the isolate in the |
| 2286 // debugger wire protocol messages. | 2307 // debugger wire protocol messages. |
| 2287 isolate_id_ = isolate->main_port(); | 2308 isolate_id_ = isolate->main_port(); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2667 } | 2688 } |
| 2668 | 2689 |
| 2669 | 2690 |
| 2670 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2691 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2671 ASSERT(bpt->next() == NULL); | 2692 ASSERT(bpt->next() == NULL); |
| 2672 bpt->set_next(code_breakpoints_); | 2693 bpt->set_next(code_breakpoints_); |
| 2673 code_breakpoints_ = bpt; | 2694 code_breakpoints_ = bpt; |
| 2674 } | 2695 } |
| 2675 | 2696 |
| 2676 } // namespace dart | 2697 } // namespace dart |
| OLD | NEW |