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

Unified Diff: runtime/vm/debugger.cc

Issue 11776007: Handle optimized code blocks in debugger stack trace (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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') | 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 16663)
+++ runtime/vm/debugger.cc (working copy)
@@ -139,6 +139,7 @@
: pc_(pc), fp_(fp), sp_(sp),
ctx_(Context::ZoneHandle(ctx.raw())),
function_(Function::ZoneHandle()),
+ code_(Code::ZoneHandle()),
token_pos_(-1),
pc_desc_index_(-1),
line_number_(-1),
@@ -150,13 +151,20 @@
}
-const Function& ActivationFrame::DartFunction() {
- if (function_.IsNull()) {
+const Code& ActivationFrame::DartCode() {
+ if (code_.IsNull()) {
Isolate* isolate = Isolate::Current();
ASSERT(isolate != NULL);
- const Code& code = Code::Handle(Code::LookupCode(pc_));
- function_ = code.function();
+ code_ = Code::LookupCode(pc_);
}
+ return code_;
+}
+
+
+const Function& ActivationFrame::DartFunction() {
+ if (function_.IsNull()) {
+ function_ = DartCode().function();
+ }
return function_;
}
@@ -235,9 +243,7 @@
void ActivationFrame::GetPcDescriptors() {
if (pc_desc_.IsNull()) {
- const Function& func = DartFunction();
- ASSERT(!func.HasOptimizedCode());
- Code& code = Code::Handle(func.unoptimized_code());
+ const Code& code = DartCode();
ASSERT(!code.IsNull());
pc_desc_ = code.pc_descriptors();
ASSERT(!pc_desc_.IsNull());
@@ -283,13 +289,11 @@
void ActivationFrame::GetVarDescriptors() {
- if (!var_descriptors_.IsNull()) {
- return;
+ if (var_descriptors_.IsNull()) {
+ const Code& code = DartCode();
+ var_descriptors_ = code.var_descriptors();
+ ASSERT(!var_descriptors_.IsNull());
}
- ASSERT(!DartFunction().HasOptimizedCode());
- const Code& code = Code::Handle(DartFunction().unoptimized_code());
- var_descriptors_ = code.var_descriptors();
- ASSERT(!var_descriptors_.IsNull());
}
@@ -349,7 +353,16 @@
return;
}
GetVarDescriptors();
- // TODO(hausner): Consider replacing this GrowableArray.
+
+ // We don't trust variable descriptors in optimized code.
+ // Rather than potentially displaying incorrect values, we
+ // pretend that there are no variables in the frame.
+ // We should be more clever about this in the future.
+ if (DartCode().is_optimized()) {
+ vars_initialized_ = true;
+ return;
+ }
+
GrowableArray<String*> var_names(8);
intptr_t activation_token_pos = TokenPos();
intptr_t var_desc_len = var_descriptors_.Length();
« no previous file with comments | « runtime/vm/debugger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698