Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(761)

Unified Diff: runtime/vm/debugger.cc

Issue 15743019: Consolidate debug stubs (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 23086)
+++ 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_;
+ }
+ UNREACHABLE();
+ return NULL;
+}
+
+
// Remove and delete the source breakpoint bpt and its associated
// code breakpoints.
void Debugger::RemoveBreakpoint(intptr_t bp_id) {
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698