Attempt prep work for 64 bit just in case.

If SDL2 fails, someone (not me) will have to try to
keep these updated.
This commit is contained in:
Jason Felds
2014-02-12 19:40:27 -05:00
parent 0715c38475
commit 9bbefe2240
4 changed files with 22 additions and 22 deletions
@@ -8645,7 +8645,6 @@
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)";
FPM = "";
"FPM[arch=i386]" = FPM_INTEL;
"FPM[arch=ppc]" = FPM_PPC;
GCC_MODEL_TUNING = G5;
GCC_PREPROCESSOR_DEFINITIONS = (
"HAVE_ASSERT_H=1",
@@ -8678,7 +8677,6 @@
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)";
FPM = "";
"FPM[arch=i386]" = FPM_INTEL;
"FPM[arch=ppc]" = FPM_PPC;
GCC_MODEL_TUNING = G5;
GCC_PREPROCESSOR_DEFINITIONS = (
"HAVE_ASSERT_H=1",
@@ -8711,7 +8709,6 @@
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)";
FPM = "";
"FPM[arch=i386]" = FPM_INTEL;
"FPM[arch=ppc]" = FPM_PPC;
GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = G5;
GCC_PREPROCESSOR_DEFINITIONS = (
+3 -3
View File
@@ -129,10 +129,10 @@ void ArchHooks_MacOSX::Init()
RString ArchHooks_MacOSX::GetArchName() const
{
#if defined(__ppc__)
return "Mac OS X (ppc)";
#elif defined(__i386__)
#if defined(__i386__)
return "Mac OS X (i386)";
#elif defined(__x86_64__)
return "Mac OS X (x86_64)";
#else
#error What arch?
#endif
+14 -10
View File
@@ -27,16 +27,7 @@ bool GetThreadBacktraceContext( uint64_t iID, BacktraceContext *ctx )
thread_act_t thread = thread_act_t( iID );
#if defined(__ppc__)
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;
return true;
#elif defined(__i386__)
#if defined(__i386__)
i386_thread_state_t state;
mach_msg_type_number_t count = i386_THREAD_STATE_COUNT;
@@ -46,6 +37,19 @@ bool GetThreadBacktraceContext( uint64_t iID, BacktraceContext *ctx )
ctx->bp = (void *)state.__ebp;
ctx->sp = (void *)state.__esp;
return true;
#elif defined(__x86_64__)
x86_thread_state64_t state;
mach_msg_type_number_t count = x86_THREAD_STATE64_COUNT;
if (thread_get_state(thread, x86_THREAD_STATE64, thread_state_t(&state), &count))
{
return false;
}
ctx->ip = (void *)state.__rip;
ctx->bp = (void *)state.__rbp;
ctx->sp = (void *)state.__rsp;
return true;
#else
return false;
#endif
+5 -6
View File
@@ -460,10 +460,14 @@ void GetSignalBacktraceContext( BacktraceContext *ctx, const ucontext_t *uc )
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
#elif defined(__i386__)
ctx->ip = (void *) uc->uc_mcontext->__ss.__eip;
ctx->bp = (void *) uc->uc_mcontext->__ss.__ebp;
ctx->sp = (void *) uc->uc_mcontext->__ss.__esp;
#elif defined(__x86_64__)
ctx->ip = (void *) uc->uc_mcontext->__ss.__rip;
ctx->bp = (void *) uc->uc_mcontext->__ss.__rbp;
ctx->sp = (void *) uc->uc_mcontext->__ss.__rsp;
#endif
}
@@ -635,13 +639,8 @@ 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() { }