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

Unified Diff: runtime/vm/object.cc

Issue 12380031: Fixed debugger stacktrace generation that failed a VM assertion. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 19251)
+++ runtime/vm/object.cc (working copy)
@@ -7080,8 +7080,38 @@
const char* LocalVarDescriptors::ToCString() const {
- UNIMPLEMENTED();
- return "LocalVarDescriptors";
+ intptr_t len = 1; // Trailing '\0'.
+ const char* kFormat =
+ "%2"Pd" kind=%d scope=0x%04x begin=%"Pd" end=%"Pd" name=%s\n";
+ for (intptr_t i = 0; i < Length(); i++) {
+ String& var_name = String::Handle(GetName(i));
+ RawLocalVarDescriptors::VarInfo info;
+ GetInfo(i, &info);
+ len += OS::SNPrint(NULL, 0, kFormat,
+ i,
+ info.kind,
+ info.scope_id,
+ info.begin_pos,
+ info.end_pos,
+ var_name.ToCString());
+ }
+ char* buffer = Isolate::Current()->current_zone()->Alloc<char>(len);
+ intptr_t num_chars = 0;
+ for (intptr_t i = 0; i < Length(); i++) {
+ String& var_name = String::Handle(GetName(i));
+ RawLocalVarDescriptors::VarInfo info;
+ GetInfo(i, &info);
+ num_chars += OS::SNPrint((buffer + num_chars),
+ (len - num_chars),
+ kFormat,
+ i,
+ info.kind,
+ info.scope_id,
+ info.begin_pos,
+ info.end_pos,
+ var_name.ToCString());
+ }
+ return buffer;
}
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698