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 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 | 1263 |
1264 void Debugger::SetStepOver() { | 1264 void Debugger::SetStepOver() { |
1265 resume_action_ = kStepOver; | 1265 resume_action_ = kStepOver; |
1266 } | 1266 } |
1267 | 1267 |
1268 | 1268 |
1269 void Debugger::SetStepOut() { | 1269 void Debugger::SetStepOut() { |
1270 resume_action_ = kStepOut; | 1270 resume_action_ = kStepOut; |
1271 } | 1271 } |
1272 | 1272 |
| 1273 |
1273 RawFunction* Debugger::ResolveFunction(const Library& library, | 1274 RawFunction* Debugger::ResolveFunction(const Library& library, |
1274 const String& class_name, | 1275 const String& class_name, |
1275 const String& function_name) { | 1276 const String& function_name) { |
1276 ASSERT(!library.IsNull()); | 1277 ASSERT(!library.IsNull()); |
1277 ASSERT(!class_name.IsNull()); | 1278 ASSERT(!class_name.IsNull()); |
1278 ASSERT(!function_name.IsNull()); | 1279 ASSERT(!function_name.IsNull()); |
1279 if (class_name.Length() == 0) { | 1280 if (class_name.Length() == 0) { |
1280 return ResolveLibraryFunction(library, function_name); | 1281 return ResolveLibraryFunction(library, function_name); |
1281 } | 1282 } |
1282 const Class& cls = Class::Handle(library.LookupClass(class_name)); | 1283 const Class& cls = Class::Handle(library.LookupClass(class_name)); |
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2315 pause_event_ = event; | 2316 pause_event_ = event; |
2316 obj_cache_ = new RemoteObjectCache(64); | 2317 obj_cache_ = new RemoteObjectCache(64); |
2317 | 2318 |
2318 InvokeEventHandler(event); | 2319 InvokeEventHandler(event); |
2319 | 2320 |
2320 pause_event_ = NULL; | 2321 pause_event_ = NULL; |
2321 obj_cache_ = NULL; // Zone allocated | 2322 obj_cache_ = NULL; // Zone allocated |
2322 } | 2323 } |
2323 | 2324 |
2324 | 2325 |
| 2326 void Debugger::EnterSingleStepMode() { |
| 2327 stepping_fp_ = 0; |
| 2328 DeoptimizeWorld(); |
| 2329 isolate_->set_single_step(true); |
| 2330 } |
| 2331 |
| 2332 |
2325 void Debugger::HandleSteppingRequest(DebuggerStackTrace* stack_trace) { | 2333 void Debugger::HandleSteppingRequest(DebuggerStackTrace* stack_trace) { |
2326 stepping_fp_ = 0; | 2334 stepping_fp_ = 0; |
2327 if (resume_action_ == kSingleStep) { | 2335 if (resume_action_ == kSingleStep) { |
2328 // When single stepping, we need to deoptimize because we might be | 2336 // When single stepping, we need to deoptimize because we might be |
2329 // stepping into optimized code. This happens in particular if | 2337 // stepping into optimized code. This happens in particular if |
2330 // the isolate has been interrupted, but can happen in other cases | 2338 // the isolate has been interrupted, but can happen in other cases |
2331 // as well. We need to deoptimize the world in case we are about | 2339 // as well. We need to deoptimize the world in case we are about |
2332 // to call an optimized function. | 2340 // to call an optimized function. |
2333 DeoptimizeWorld(); | 2341 DeoptimizeWorld(); |
2334 isolate_->set_single_step(true); | 2342 isolate_->set_single_step(true); |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3000 } | 3008 } |
3001 | 3009 |
3002 | 3010 |
3003 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3011 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
3004 ASSERT(bpt->next() == NULL); | 3012 ASSERT(bpt->next() == NULL); |
3005 bpt->set_next(code_breakpoints_); | 3013 bpt->set_next(code_breakpoints_); |
3006 code_breakpoints_ = bpt; | 3014 code_breakpoints_ = bpt; |
3007 } | 3015 } |
3008 | 3016 |
3009 } // namespace dart | 3017 } // namespace dart |
OLD | NEW |