Chromium Code Reviews| Index: runtime/vm/debugger.cc |
| =================================================================== |
| --- runtime/vm/debugger.cc (revision 23045) |
| +++ runtime/vm/debugger.cc (working copy) |
| @@ -588,7 +588,7 @@ |
| (kind == PcDescriptors::kFuncCall) || |
| (kind == PcDescriptors::kClosureCall) || |
| (kind == PcDescriptors::kReturn) || |
| - (kind == PcDescriptors::kEqualNull)); |
| + (kind == PcDescriptors::kRuntimeCall)); |
| } |
| @@ -672,24 +672,16 @@ |
| StubCode::BreakpointStaticEntryPoint()); |
| break; |
| } |
| + case PcDescriptors::kRuntimeCall: |
| case PcDescriptors::kClosureCall: { |
| const Code& code = |
| Code::Handle(Function::Handle(function_).unoptimized_code()); |
| saved_bytes_.target_address_ = |
| CodePatcher::GetStaticCallTargetAt(pc_, code); |
| CodePatcher::PatchStaticCallAt(pc_, code, |
| - StubCode::BreakpointClosureEntryPoint()); |
| + StubCode::BreakpointRuntimeEntryPoint()); |
| break; |
| } |
| - case PcDescriptors::kEqualNull: { |
| - const Code& code = |
| - Code::Handle(Function::Handle(function_).unoptimized_code()); |
| - saved_bytes_.target_address_ = |
| - CodePatcher::GetStaticCallTargetAt(pc_, code); |
| - CodePatcher::PatchStaticCallAt(pc_, code, |
| - StubCode::BreakpointEqNullEntryPoint()); |
| - break; |
| - } |
| case PcDescriptors::kReturn: |
| PatchFunctionReturn(); |
| break; |
| @@ -712,7 +704,7 @@ |
| } |
| case PcDescriptors::kFuncCall: |
| case PcDescriptors::kClosureCall: |
| - case PcDescriptors::kEqualNull: { |
| + case PcDescriptors::kRuntimeCall: { |
| const Code& code = |
| Code::Handle(Function::Handle(function_).unoptimized_code()); |
| CodePatcher::PatchStaticCallAt(pc_, code, |
| @@ -1618,7 +1610,7 @@ |
| // to invoke the "call" method on the object if one exists. |
| // TODO(hausner): find call method and intrument it for stepping. |
| } |
| - } else if (bpt->breakpoint_kind_ == PcDescriptors::kEqualNull) { |
| + } else if (bpt->breakpoint_kind_ == PcDescriptors::kRuntimeCall) { |
| // This is just a call to the runtime, not Dart code. Stepping |
| // into not possible, just treat like StepOver. |
| func_to_instrument = bpt->function(); |
| @@ -1700,8 +1692,11 @@ |
| OS::Print("Enable pending breakpoint for function '%s'\n", |
| String::Handle(lookup_function.name()).ToCString()); |
| } |
| + const Script& script= Script::Handle(func.script()); |
| + intptr_t first_pos, last_pos; |
| + script.TokenRangeAtLine(bpt->LineNumber(), &first_pos, &last_pos); |
| intptr_t bp_pos = |
| - ResolveBreakpointPos(func, bpt->token_pos(), func.end_token_pos()); |
| + ResolveBreakpointPos(func, bpt->token_pos(), last_pos); |
| bpt->set_token_pos(bp_pos); |
| MakeCodeBreakpointsAt(func, bp_pos, bpt); |
| SignalBpResolved(bpt); |
| @@ -1725,6 +1720,16 @@ |
| } |
| +uword Debugger::GetPatchedStubAddress(uword breakpoint_address) { |
| + CodeBreakpoint* bpt = GetCodeBreakpoint(breakpoint_address); |
| + if (bpt != NULL) { |
| + return bpt->saved_bytes_.target_address_; |
|
siva
2013/05/23 01:11:26
Is bpt->saved_bytes_.target_address_ a Smi always?
hausner
2013/05/23 18:32:12
Yes, we depend on the fact that target addresses o
|
| + } |
| + UNREACHABLE(); |
| + return NULL; |
| +} |
| + |
| + |
| // Remove and delete the source breakpoint bpt and its associated |
| // code breakpoints. |
| void Debugger::RemoveBreakpoint(intptr_t bp_id) { |