| 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 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2081 InvokeEventHandler(event); | 2081 InvokeEventHandler(event); |
| 2082 | 2082 |
| 2083 pause_event_ = NULL; | 2083 pause_event_ = NULL; |
| 2084 obj_cache_ = NULL; // Zone allocated | 2084 obj_cache_ = NULL; // Zone allocated |
| 2085 } | 2085 } |
| 2086 | 2086 |
| 2087 | 2087 |
| 2088 void Debugger::HandleSteppingRequest(DebuggerStackTrace* stack_trace) { | 2088 void Debugger::HandleSteppingRequest(DebuggerStackTrace* stack_trace) { |
| 2089 stepping_fp_ = 0; | 2089 stepping_fp_ = 0; |
| 2090 if (resume_action_ == kSingleStep) { | 2090 if (resume_action_ == kSingleStep) { |
| 2091 // When single stepping, we need to deoptimize because we might be |
| 2092 // stepping into optimized code. This happens in particular if |
| 2093 // the isolate has been interrupted, but can happen in other cases |
| 2094 // as well. We need to deoptimize the world in case we are about |
| 2095 // to call an optimized function. |
| 2096 DeoptimizeWorld(); |
| 2091 isolate_->set_single_step(true); | 2097 isolate_->set_single_step(true); |
| 2092 } else if (resume_action_ == kStepOver) { | 2098 } else if (resume_action_ == kStepOver) { |
| 2099 DeoptimizeWorld(); |
| 2093 isolate_->set_single_step(true); | 2100 isolate_->set_single_step(true); |
| 2094 ASSERT(stack_trace->Length() > 0); | 2101 ASSERT(stack_trace->Length() > 0); |
| 2095 stepping_fp_ = stack_trace->FrameAt(0)->fp(); | 2102 stepping_fp_ = stack_trace->FrameAt(0)->fp(); |
| 2096 } else if (resume_action_ == kStepOut) { | 2103 } else if (resume_action_ == kStepOut) { |
| 2104 DeoptimizeWorld(); |
| 2097 isolate_->set_single_step(true); | 2105 isolate_->set_single_step(true); |
| 2098 // Find topmost caller that is debuggable. | 2106 // Find topmost caller that is debuggable. |
| 2099 for (intptr_t i = 1; i < stack_trace->Length(); i++) { | 2107 for (intptr_t i = 1; i < stack_trace->Length(); i++) { |
| 2100 ActivationFrame* frame = stack_trace->FrameAt(i); | 2108 ActivationFrame* frame = stack_trace->FrameAt(i); |
| 2101 if (frame->IsDebuggable()) { | 2109 if (frame->IsDebuggable()) { |
| 2102 stepping_fp_ = frame->fp(); | 2110 stepping_fp_ = frame->fp(); |
| 2103 break; | 2111 break; |
| 2104 } | 2112 } |
| 2105 } | 2113 } |
| 2106 } | 2114 } |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2489 } | 2497 } |
| 2490 | 2498 |
| 2491 | 2499 |
| 2492 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2500 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2493 ASSERT(bpt->next() == NULL); | 2501 ASSERT(bpt->next() == NULL); |
| 2494 bpt->set_next(code_breakpoints_); | 2502 bpt->set_next(code_breakpoints_); |
| 2495 code_breakpoints_ = bpt; | 2503 code_breakpoints_ = bpt; |
| 2496 } | 2504 } |
| 2497 | 2505 |
| 2498 } // namespace dart | 2506 } // namespace dart |
| OLD | NEW |