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

Unified Diff: runtime/vm/stack_frame.cc

Issue 240213004: Fixes a problem with the recovery of contexts in the debugger at closure calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « runtime/vm/stack_frame.h ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame.cc
diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc
index 582d4fae0f9f535ea4550b96965f4c8c36a16da8..391556377535976bcae00454e87c0267361f3172 100644
--- a/runtime/vm/stack_frame.cc
+++ b/runtime/vm/stack_frame.cc
@@ -26,8 +26,30 @@ bool StackFrame::IsStubFrame() const {
}
-void StackFrame::Print() const {
- OS::Print("[%-8s : sp(%#" Px ") ]\n", GetName(), sp());
+const char* StackFrame::ToCString() const {
+ Zone* zone = Isolate::Current()->current_zone();
+ if (IsDartFrame()) {
+ const Code& code = Code::Handle(LookupDartCode());
+ ASSERT(!code.IsNull());
+ const Object& owner = Object::Handle(code.owner());
+ ASSERT(!owner.IsNull());
+ if (owner.IsFunction()) {
+ const Function& function = Function::Cast(owner);
+ return zone->PrintToString(
+ "[%-8s : sp(%#" Px ") fp(%#" Px ") pc(%#" Px ") %s ]",
+ GetName(), sp(), fp(), pc(),
+ function.ToFullyQualifiedCString());
+ } else {
+ return zone->PrintToString(
+ "[%-8s : sp(%#" Px ") fp(%#" Px ") pc(%#" Px ") %s ]",
+ GetName(), sp(), fp(), pc(),
+ owner.ToCString());
+ }
+ } else {
+ return zone->PrintToString(
+ "[%-8s : sp(%#" Px ") fp(%#" Px ") pc(%#" Px ")]",
+ GetName(), sp(), fp(), pc());
+ }
}
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698