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

Unified Diff: runtime/bin/platform_macos.cc

Issue 2514113002: Dump stack trace on segfault in the VM. (Closed)
Patch Set: comment Created 4 years, 1 month 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_linux.cc ('k') | runtime/include/dart_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform_macos.cc
diff --git a/runtime/bin/platform_macos.cc b/runtime/bin/platform_macos.cc
index 35e910706ac3da97eeee42b54ecdc7173cd0fd32..8e2fd187b911b5f03ddf882675e958544bd076bb 100644
--- a/runtime/bin/platform_macos.cc
+++ b/runtime/bin/platform_macos.cc
@@ -39,6 +39,20 @@ bool Platform::Initialize() {
perror("Setting signal handler failed");
return false;
}
+ act.sa_flags = SA_SIGINFO;
+ act.sa_sigaction = &segv_handler;
+ if (sigemptyset(&act.sa_mask) != 0) {
+ perror("sigemptyset() failed.");
+ return false;
+ }
+ if (sigaddset(&act.sa_mask, SIGPROF) != 0) {
+ perror("sigaddset() failed");
+ return false;
+ }
+ if (sigaction(SIGSEGV, &act, NULL) != 0) {
+ perror("sigaction() failed.");
+ return false;
+ }
return true;
}
« no previous file with comments | « runtime/bin/platform_linux.cc ('k') | runtime/include/dart_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698