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

Unified Diff: runtime/vm/profiler.cc

Issue 2199983002: Also attempt to symbolize dart frames in Profiler::DumpStackTrace. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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/profiler.cc
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index 21b8bf80871d4a778e0b9d3ea6951737ae2bb552..c1a74e45d2606587429a6015f88490ff39b91d42 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -334,14 +334,29 @@ static void DumpStackFrame(intptr_t frame_index, uword pc) {
uintptr_t start = 0;
char* native_symbol_name =
NativeSymbolResolver::LookupSymbolName(pc, &start);
- if (native_symbol_name == NULL) {
- OS::PrintErr("Frame[%" Pd "] = `unknown symbol` [0x%" Px "]\n",
- frame_index, pc);
- } else {
- OS::PrintErr("Frame[%" Pd "] = `%s` [0x%" Px "]\n",
- frame_index, native_symbol_name, pc);
+ if (native_symbol_name != NULL) {
+ OS::PrintErr(" %" Pp " [native] %s\n", pc, native_symbol_name);
NativeSymbolResolver::FreeSymbolName(native_symbol_name);
+ return;
+ }
+
+ Code& code = Code::Handle(Code::LookupCodeInVmIsolate(pc));
+ if (code.IsNull()) {
+ code = Code::LookupCode(pc); // In current isolate.
+ }
+ if (code.IsNull()) {
+ OS::PrintErr(" %" Pp " [unknown]\n", pc);
+ return;
+ }
+
+ const Object& owner = Object::Handle(code.owner());
+ if (owner.IsFunction()) {
+ OS::PrintErr(" %" Pp " [dart] %s\n", pc,
+ Function::Cast(owner).ToFullyQualifiedCString());
+ return;
}
+
+ OS::PrintErr(" %" Pp " [stub] %s\n", pc, code.ToCString());
}
@@ -350,10 +365,17 @@ static void DumpStackFrame(intptr_t frame_index,
const Code& code) {
if (code.IsNull()) {
DumpStackFrame(frame_index, pc);
- } else {
- OS::PrintErr("Frame[%" Pd "] = Dart:`%s` [0x%" Px "]\n",
- frame_index, code.ToCString(), pc);
+ return;
}
+
+ const Object& owner = Object::Handle(code.owner());
+ if (owner.IsFunction()) {
+ OS::PrintErr(" %" Pp " [dart] %s\n", pc,
+ Function::Cast(owner).ToFullyQualifiedCString());
+ return;
+ }
+
+ OS::PrintErr(" %" Pp " [stub] %s\n", pc, code.ToCString());
}
« 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