CrashSignalHandler works on DARWIN
This commit is contained in:
@@ -303,11 +303,9 @@ static void RunCrashHandler( const CrashData *crash )
|
|||||||
* crashed. */
|
* crashed. */
|
||||||
switch( crash->type )
|
switch( crash->type )
|
||||||
{
|
{
|
||||||
#if !defined(DARWIN)
|
|
||||||
case CrashData::SIGNAL:
|
case CrashData::SIGNAL:
|
||||||
safe_print( fileno(stderr), "Fatal signal (", SignalName(crash->signal), ")", NULL );
|
safe_print( fileno(stderr), "Fatal signal (", SignalName(crash->signal), ")", NULL );
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(DARWIN)
|
#if defined(DARWIN)
|
||||||
case CrashData::OSX_EXCEPTION:
|
case CrashData::OSX_EXCEPTION:
|
||||||
@@ -407,7 +405,6 @@ void ForceCrashHandlerDeadlock( const char *reason, const BacktraceContext *ctx
|
|||||||
|
|
||||||
/* XXX test for recursive crashes here (eg. GetBacktrace crashing) */
|
/* XXX test for recursive crashes here (eg. GetBacktrace crashing) */
|
||||||
|
|
||||||
#if !defined(DARWIN)
|
|
||||||
void CrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *uc )
|
void CrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *uc )
|
||||||
{
|
{
|
||||||
CrashData crash;
|
CrashData crash;
|
||||||
@@ -423,7 +420,6 @@ void CrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *uc )
|
|||||||
|
|
||||||
RunCrashHandler( &crash );
|
RunCrashHandler( &crash );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(DARWIN)
|
#if defined(DARWIN)
|
||||||
OSStatus CrashExceptionHandler( ExceptionInformation *e )
|
OSStatus CrashExceptionHandler( ExceptionInformation *e )
|
||||||
|
|||||||
@@ -7,11 +7,9 @@ void ForceCrashHandlerDeadlock( const char *reason, const BacktraceContext *ctx
|
|||||||
void CrashHandlerHandleArgs( int argc, char* argv[] );
|
void CrashHandlerHandleArgs( int argc, char* argv[] );
|
||||||
void InitializeCrashHandler();
|
void InitializeCrashHandler();
|
||||||
|
|
||||||
#if !defined(DARWIN)
|
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
#include <ucontext.h>
|
#include <ucontext.h>
|
||||||
void CrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *uc );
|
void CrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *uc );
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(DARWIN)
|
#if defined(DARWIN)
|
||||||
#include <MachineExceptions.h>
|
#include <MachineExceptions.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user