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

Unified Diff: runtime/vm/debugger.cc

Issue 14783002: Loosen aggressive assert in debugger stack trace code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | 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 22267)
+++ runtime/vm/debugger.cc (working copy)
@@ -900,38 +900,34 @@
Code& code = Code::Handle(isolate);
StackFrameIterator iterator(false);
StackFrame* frame = iterator.NextFrame();
+ ActivationFrame* callee_activation = NULL;
bool optimized_frame_found = false;
while (frame != NULL) {
ASSERT(frame->IsValid());
if (frame->IsDartFrame()) {
code = frame->LookupDartCode();
- ActivationFrame* activation = new ActivationFrame(frame->pc(),
- frame->fp(),
- frame->sp(),
- code);
+ ActivationFrame* activation =
+ new ActivationFrame(frame->pc(), frame->fp(), frame->sp(), code);
// If this activation frame called a closure, the function has
// saved its context before the call.
- if (stack_trace->Length() > 0) {
- ActivationFrame* callee_frame =
- stack_trace->ActivationFrameAt(stack_trace->Length() - 1);
- if (callee_frame->function().IsClosureFunction()) {
- ctx = activation->GetSavedCurrentContext();
- if (FLAG_verbose_debug && ctx.IsNull()) {
- const Function& caller = activation->function();
- const Function& callee = callee_frame->function();
- const Script& script =
- Script::Handle(Class::Handle(caller.Owner()).script());
- intptr_t line, col;
- script.GetTokenLocation(activation->TokenPos(), &line, &col);
- printf("CollectStackTrace error: no saved context in function "
- "'%s' which calls closure '%s' "
- " in line %"Pd" column %"Pd"\n",
- caller.ToFullyQualifiedCString(),
- callee.ToFullyQualifiedCString(),
- line, col);
- }
- ASSERT(!ctx.IsNull());
+ if ((callee_activation != NULL) &&
+ (callee_activation->function().IsClosureFunction())) {
+ ctx = activation->GetSavedCurrentContext();
+ if (FLAG_verbose_debug && ctx.IsNull()) {
+ const Function& caller = activation->function();
+ const Function& callee = callee_activation->function();
+ const Script& script =
+ Script::Handle(Class::Handle(caller.Owner()).script());
+ intptr_t line, col;
+ script.GetTokenLocation(activation->TokenPos(), &line, &col);
+ OS::Print("CollectStackTrace error: no saved context in function "
+ "'%s' which calls closure '%s' "
+ " in line %"Pd" column %"Pd"\n",
+ caller.ToFullyQualifiedCString(),
+ callee.ToFullyQualifiedCString(),
+ line, col);
}
+ ASSERT(!ctx.IsNull());
}
if (optimized_frame_found || code.is_optimized()) {
// Set context to null, to avoid returning bad context variable values.
@@ -941,10 +937,12 @@
activation->SetContext(ctx);
}
stack_trace->AddActivation(activation);
+ callee_activation = activation;
// Get caller's context if this function saved it on entry.
ctx = activation->GetSavedEntryContext(ctx);
} else if (frame->IsEntryFrame()) {
ctx = reinterpret_cast<EntryFrame*>(frame)->SavedContext();
+ callee_activation = NULL;
}
frame = iterator.NextFrame();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698