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

Unified Diff: runtime/vm/profiler.cc

Issue 2668443004: Make the segfault handler attempt to symbolize Dart frames. (Closed)
Patch Set: Created 3 years, 11 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/bin/platform_macos.cc ('k') | 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 9db93ae0cfe5eb6cdd69cc3b8f21faac1aec2e1a..2e99b34d7ee646d2eb9d364f4c66f09feb469a78 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -330,6 +330,20 @@ void ClearProfileVisitor::VisitSample(Sample* sample) {
static void DumpStackFrame(intptr_t frame_index, uword pc) {
+ Isolate* isolate = Isolate::Current();
+ if ((isolate != NULL) && isolate->is_runnable()) {
+ Code& code = Code::Handle(Code::LookupCodeInVmIsolate(pc));
+ if (!code.IsNull()) {
+ OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName());
+ return;
+ }
+ code = Code::LookupCode(pc);
+ if (!code.IsNull()) {
+ OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName());
+ return;
+ }
+ }
+
uintptr_t start = 0;
char* native_symbol_name = NativeSymbolResolver::LookupSymbolName(pc, &start);
if (native_symbol_name == NULL) {
@@ -341,16 +355,6 @@ static void DumpStackFrame(intptr_t frame_index, uword pc) {
}
-static void DumpStackFrame(intptr_t frame_index, uword pc, 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);
- }
-}
-
-
class ProfilerStackWalker : public ValueObject {
public:
ProfilerStackWalker(Isolate* isolate,
@@ -370,16 +374,6 @@ class ProfilerStackWalker : public ValueObject {
}
}
- bool Append(uword pc, const Code& code) {
- if (sample_ == NULL) {
- DumpStackFrame(frame_index_, pc, code);
- frame_index_++;
- total_frames_++;
- return true;
- }
- return Append(pc);
- }
-
bool Append(uword pc) {
if (sample_ == NULL) {
DumpStackFrame(frame_index_, pc);
« no previous file with comments | « runtime/bin/platform_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698