Remove Exceptions since OS X does not catch them. Instead, it waits for the signal.

This commit is contained in:
Steve Checkoway
2004-09-07 13:44:06 +00:00
parent 1e036b76fd
commit f08a2d00c9
5 changed files with 0 additions and 81 deletions
@@ -385,12 +385,6 @@ typedef struct Frame
void *linkReg;
} *FramePtr;
void GetExceptionBacktraceContext( BacktraceContext *ctx, const ExceptionInformation *exception )
{
ctx->PC = (void *) exception->machineState->PC.lo;
ctx->FramePtr = (void *) exception->registerImage->R1.lo;
}
void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc )
{
ctx->PC = (void *) uc->uc_mcontext->ss.srr0;
-8
View File
@@ -36,14 +36,6 @@ bool GetThreadBacktraceContext( uint64_t ThreadID, BacktraceContext *ctx );
#include <ucontext.h>
void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc );
#if defined(DARWIN)
#include <MachineExceptions.h>
/* Set up a BacktraceContext to get a backtrace after receiving an exception, given
* an ExceptionInformation*. */
void GetExceptionBacktraceContext( BacktraceContext *ctx, const ExceptionInformation *exception );
#endif
#define BACKTRACE_METHOD_NOT_AVAILABLE ((void*) -1)
#endif
@@ -218,38 +218,6 @@ static void parent_process( int to_child, const CrashData *crash )
* signal trampolines. The result is that it doesn't properly show the
* function that actually caused the signal--which is the most important
* one! So, we have to do it all ourself. */
#if defined(DARWIN)
const char *ExceptionName( int signo )
{
#define X(code) case k##code: return #code;
switch( signo )
{
X(UnknownException)
X(IllegalInstructionException)
X(TrapException)
X(AccessException)
X(UnmappedMemoryException)
X(ExcludedMemoryException)
X(ReadOnlyMemoryException)
X(UnresolvablePageFaultException)
X(PrivilegeViolationException)
X(TraceException)
X(InstructionBreakpointException)
X(DataBreakpointException)
X(FloatingPointException)
X(StackOverflowException)
default:
{
static char buf[128];
strcpy( buf, "Unknown exception " );
strcat( buf, itoa(signo) );
return buf;
}
}
#undef X
}
#endif
const char *SignalName( int signo )
{
#define X(a) case a: return #a;
@@ -316,11 +284,6 @@ static void RunCrashHandler( const CrashData *crash )
safe_print( fileno(stderr), "Deadlock (", crash->reason, ")", NULL );
break;
#if defined(DARWIN)
case CrashData::OSX_EXCEPTION:
safe_print( fileno(stderr), "Fatal exception (", ExceptionName( crash->kind ), ")", NULL );
break;
#endif
case CrashData::FORCE_CRASH_THIS_THREAD:
safe_print( fileno(stderr), "Crash handler failed an assertion: \"", crash->reason, "\"", NULL );
break;
@@ -465,24 +428,6 @@ void CrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *uc )
RunCrashHandler( &crash );
}
#if defined(DARWIN)
OSStatus CrashExceptionHandler( ExceptionInformation *e )
{
CrashData crash;
memset( &crash, 0, sizeof(crash) );
crash.type = CrashData::OSX_EXCEPTION;
crash.kind = e->theKind;
BacktraceContext ctx;
GetExceptionBacktraceContext( &ctx, e );
GetBacktrace( crash.BacktracePointers, BACKTRACE_MAX_SIZE, &ctx );
RunCrashHandler( &crash );
_exit(1);
}
#endif
void InitializeCrashHandler()
{
InitializeBacktrace();
@@ -12,11 +12,6 @@ void InitializeCrashHandler();
#include <ucontext.h>
void CrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *uc );
#if defined(DARWIN)
#include <MachineExceptions.h>
OSStatus CrashExceptionHandler( ExceptionInformation *e );
#endif
#endif
/*
@@ -307,13 +307,6 @@ static void child_process()
}
break;
}
#if defined(DARWIN)
case CrashData::OSX_EXCEPTION:
reason = ExceptionName( crash.kind );
break;
#endif
case CrashData::FORCE_CRASH_THIS_THREAD:
case CrashData::FORCE_CRASH_DEADLOCK:
crash.reason[ sizeof(crash.reason)-1] = 0;