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

Unified Diff: runtime/vm/debugger.cc

Issue 106053011: Make return statements single steppable (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 12 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/debugger_api_impl_test.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 31428)
+++ runtime/vm/debugger.cc (working copy)
@@ -392,11 +392,6 @@
return context_level_;
}
ASSERT(!pc_desc_.IsNull());
- if (pc_desc_.DescriptorKind(pc_desc_idx) == PcDescriptors::kReturn) {
- // Special case: the context chain has already been deallocated.
- // The context level is 0.
- return context_level_;
- }
intptr_t innermost_begin_pos = 0;
intptr_t activation_token_pos = TokenPos();
ASSERT(activation_token_pos >= 0);
@@ -785,7 +780,8 @@
break;
}
case PcDescriptors::kRuntimeCall:
- case PcDescriptors::kClosureCall: {
+ case PcDescriptors::kClosureCall:
+ case PcDescriptors::kReturn: {
const Code& code =
Code::Handle(Function::Handle(function_).unoptimized_code());
saved_bytes_.target_address_ =
@@ -794,9 +790,6 @@
StubCode::BreakpointRuntimeEntryPoint());
break;
}
- case PcDescriptors::kReturn:
- PatchFunctionReturn();
- break;
default:
UNREACHABLE();
}
@@ -816,16 +809,14 @@
}
case PcDescriptors::kUnoptStaticCall:
case PcDescriptors::kClosureCall:
- case PcDescriptors::kRuntimeCall: {
+ case PcDescriptors::kRuntimeCall:
+ case PcDescriptors::kReturn: {
const Code& code =
Code::Handle(Function::Handle(function_).unoptimized_code());
CodePatcher::PatchStaticCallAt(pc_, code,
saved_bytes_.target_address_);
break;
}
- case PcDescriptors::kReturn:
- RestoreFunctionReturn();
- break;
default:
UNREACHABLE();
}
@@ -2013,14 +2004,13 @@
}
Function& func_to_instrument = Function::Handle();
+ if ((resume_action_ == kStepOver) &&
+ (bpt->breakpoint_kind_ == PcDescriptors::kReturn)) {
+ resume_action_ = kStepOut;
+ }
if (resume_action_ == kStepOver) {
- if (bpt->breakpoint_kind_ == PcDescriptors::kReturn) {
- // Step over return is converted into a single step so we break at
- // the caller.
- SetSingleStep();
- } else {
- func_to_instrument = bpt->function();
- }
+ ASSERT(bpt->breakpoint_kind_ != PcDescriptors::kReturn);
+ func_to_instrument = bpt->function();
} else if (resume_action_ == kStepOut) {
if (stack_trace->Length() > 1) {
ActivationFrame* caller_frame = stack_trace->FrameAt(1);
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/debugger_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698