Bug 1043112 - Allow b2g to core dump when signal permits. r=jld

This commit is contained in:
Andrew Osmond 2015-07-08 16:24:58 -03:00
parent 6dcf37294c
commit 85ae2e3a88

View File

@ -34,6 +34,10 @@
#include <rmsdef.h>
#endif
#if defined(MOZ_B2G) && !defined(MOZ_CRASHREPORTER)
#include <sys/syscall.h>
#endif
// **********************************************************************
// class nsProfileLock
//
@ -192,6 +196,27 @@ void nsProfileLock::FatalSignalHandler(int signo
}
}
#ifdef MOZ_B2G
switch (signo) {
case SIGQUIT:
case SIGILL:
case SIGABRT:
case SIGSEGV:
#ifndef MOZ_CRASHREPORTER
// Retrigger the signal for those that can generate a core dump
signal(signo, SIG_DFL);
if (info->si_code <= 0) {
if (syscall(__NR_tgkill, getpid(), syscall(__NR_gettid), signo) < 0) {
break;
}
}
#endif
return;
default:
break;
}
#endif
// Backstop exit call, just in case.
_exit(signo);
}