Merge with default
This commit is contained in:
@@ -28,23 +28,23 @@ bool GetThreadBacktraceContext( uint64_t iID, BacktraceContext *ctx )
|
||||
thread_act_t thread = thread_act_t( iID );
|
||||
|
||||
#if defined(__ppc__)
|
||||
ppc_thread_state state;
|
||||
ppc_thread_state_t state;
|
||||
mach_msg_type_number_t count = PPC_THREAD_STATE_COUNT;
|
||||
|
||||
if( thread_get_state(thread, PPC_THREAD_STATE, thread_state_t(&state), &count) )
|
||||
return false;
|
||||
ctx->FramePtr = (const Frame *)state.r1;
|
||||
ctx->PC = (void *)state.srr0;
|
||||
ctx->FramePtr = (const Frame *)state.__r1;
|
||||
ctx->PC = (void *)state.__srr0;
|
||||
return true;
|
||||
#elif defined(__i386__)
|
||||
i386_thread_state state;
|
||||
i386_thread_state_t state;
|
||||
mach_msg_type_number_t count = i386_THREAD_STATE_COUNT;
|
||||
|
||||
if( thread_get_state(thread, i386_THREAD_STATE, thread_state_t(&state), &count) )
|
||||
return false;
|
||||
ctx->ip = (void *)state.eip;
|
||||
ctx->bp = (void *)state.ebp;
|
||||
ctx->sp = (void *)state.esp;
|
||||
ctx->ip = (void *)state.__eip;
|
||||
ctx->bp = (void *)state.__ebp;
|
||||
ctx->sp = (void *)state.__esp;
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
|
||||
// Only do this for c++ files.
|
||||
#ifdef __cplusplus
|
||||
# include "global.h"
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
# import <Cocoa/Cocoa.h>
|
||||
#include "global.h"
|
||||
#include <map>
|
||||
#endif
|
||||
|
||||
@@ -456,9 +456,15 @@ void InitializeBacktrace()
|
||||
|
||||
void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc )
|
||||
{
|
||||
#if !defined(MACOSX)
|
||||
ctx->ip = (void *) uc->uc_mcontext->ss.eip;
|
||||
ctx->bp = (void *) uc->uc_mcontext->ss.ebp;
|
||||
ctx->sp = (void *) uc->uc_mcontext->ss.esp;
|
||||
#else
|
||||
ctx->ip = (void *) uc->uc_mcontext->__ss.__eip;
|
||||
ctx->bp = (void *) uc->uc_mcontext->__ss.__ebp;
|
||||
ctx->sp = (void *) uc->uc_mcontext->__ss.__esp;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* The following from VirtualDub: */
|
||||
@@ -629,8 +635,13 @@ struct Frame
|
||||
|
||||
void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc )
|
||||
{
|
||||
#if defined(__ppc__)
|
||||
ctx->PC = (const void *) uc->uc_mcontext->__ss.__srr0;
|
||||
ctx->FramePtr = (const Frame *) uc->uc_mcontext->__ss.__r1;
|
||||
#else
|
||||
ctx->PC = (const void *) uc->uc_mcontext->ss.srr0;
|
||||
ctx->FramePtr = (const Frame *) uc->uc_mcontext->ss.r1;
|
||||
#endif
|
||||
}
|
||||
|
||||
void InitializeBacktrace() { }
|
||||
|
||||
Reference in New Issue
Block a user