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

Unified Diff: runtime/vm/profiler.cc

Issue 2985963002: [standalone] Register a segfault handler on Android as already done on Linux. (Closed)
Patch Set: . Created 3 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 | « 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 3059a2040df7d085f10221e907d6e8e0cc92fcc5..a99b48ee84b38090e31fdc1e74dc7b6e2eef88a3 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -1035,7 +1035,7 @@ static bool CheckIsolate(Isolate* isolate) {
}
void Profiler::DumpStackTrace(void* context) {
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS)
+#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || defined(HOST_OS_ANDROID)
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
mcontext_t mcontext = ucontext->uc_mcontext;
uword pc = SignalHandler::GetProgramCounter(mcontext);
@@ -1085,12 +1085,14 @@ void Profiler::DumpStackTrace(uword sp, uword fp, uword pc, bool for_crash) {
Thread* thread = Thread::Current();
if (thread == NULL) {
+ OS::PrintErr("Stack dump aborted because no current Dart thread.\n");
return;
}
OSThread* os_thread = thread->os_thread();
ASSERT(os_thread != NULL);
Isolate* isolate = thread->isolate();
if (!CheckIsolate(isolate)) {
+ OS::PrintErr("Stack dump aborted because CheckIsolate failed.\n");
return;
}
@@ -1101,7 +1103,7 @@ void Profiler::DumpStackTrace(uword sp, uword fp, uword pc, bool for_crash) {
uword stack_upper = 0;
if (!InitialRegisterCheck(pc, fp, sp)) {
- OS::PrintErr("Stack dump aborted because InitialRegisterCheck.\n");
+ OS::PrintErr("Stack dump aborted because InitialRegisterCheck failed.\n");
return;
}
@@ -1109,7 +1111,7 @@ void Profiler::DumpStackTrace(uword sp, uword fp, uword pc, bool for_crash) {
&stack_upper,
/*get_os_thread_bounds=*/true)) {
OS::PrintErr(
- "Stack dump aborted because GetAndValidateThreadStackBounds.\n");
+ "Stack dump aborted because GetAndValidateThreadStackBounds failed.\n");
return;
}
« 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