| 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 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 Code& code = Code::Handle( | 1396 Code& code = Code::Handle( |
| 1397 ResolveCompileInstanceCallTarget(isolate_, receiver)); | 1397 ResolveCompileInstanceCallTarget(isolate_, receiver)); |
| 1398 if (!code.IsNull()) { | 1398 if (!code.IsNull()) { |
| 1399 Function& callee = Function::Handle(code.function()); | 1399 Function& callee = Function::Handle(code.function()); |
| 1400 if (IsDebuggable(callee)) { | 1400 if (IsDebuggable(callee)) { |
| 1401 func_to_instrument = callee.raw(); | 1401 func_to_instrument = callee.raw(); |
| 1402 } | 1402 } |
| 1403 } | 1403 } |
| 1404 } else if (bpt->breakpoint_kind_ == PcDescriptors::kFuncCall) { | 1404 } else if (bpt->breakpoint_kind_ == PcDescriptors::kFuncCall) { |
| 1405 func_to_instrument = bpt->function(); | 1405 func_to_instrument = bpt->function(); |
| 1406 Function& callee = Function::Handle(); | 1406 const Code& code = Code::Handle(func_to_instrument.CurrentCode()); |
| 1407 uword target; | 1407 const Function& callee = |
| 1408 CodePatcher::GetStaticCallAt(bpt->pc_, &callee, &target); | 1408 Function::Handle(code.GetStaticCallTargetFunctionAt(bpt->pc_)); |
| 1409 ASSERT(!callee.IsNull()); |
| 1409 if (IsDebuggable(callee)) { | 1410 if (IsDebuggable(callee)) { |
| 1410 func_to_instrument = callee.raw(); | 1411 func_to_instrument = callee.raw(); |
| 1411 } | 1412 } |
| 1412 } else { | 1413 } else { |
| 1413 ASSERT(bpt->breakpoint_kind_ == PcDescriptors::kReturn); | 1414 ASSERT(bpt->breakpoint_kind_ == PcDescriptors::kReturn); |
| 1414 // Treat like stepping out to caller. | 1415 // Treat like stepping out to caller. |
| 1415 if (stack_trace->Length() > 1) { | 1416 if (stack_trace->Length() > 1) { |
| 1416 ActivationFrame* caller_frame = stack_trace->ActivationFrameAt(1); | 1417 ActivationFrame* caller_frame = stack_trace->ActivationFrameAt(1); |
| 1417 func_to_instrument = caller_frame->DartFunction().raw(); | 1418 func_to_instrument = caller_frame->DartFunction().raw(); |
| 1418 } | 1419 } |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 } | 1617 } |
| 1617 | 1618 |
| 1618 | 1619 |
| 1619 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 1620 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 1620 ASSERT(bpt->next() == NULL); | 1621 ASSERT(bpt->next() == NULL); |
| 1621 bpt->set_next(code_breakpoints_); | 1622 bpt->set_next(code_breakpoints_); |
| 1622 code_breakpoints_ = bpt; | 1623 code_breakpoints_ = bpt; |
| 1623 } | 1624 } |
| 1624 | 1625 |
| 1625 } // namespace dart | 1626 } // namespace dart |
| OLD | NEW |