diff --git a/stepmania/src/archutils/Darwin/DarwinThreadHelpers.cpp b/stepmania/src/archutils/Darwin/DarwinThreadHelpers.cpp index 84a29493fe..4e9a5b5b85 100644 --- a/stepmania/src/archutils/Darwin/DarwinThreadHelpers.cpp +++ b/stepmania/src/archutils/Darwin/DarwinThreadHelpers.cpp @@ -18,7 +18,7 @@ uint64_t GetCurrentThreadId() return mach_thread_self(); } -bool GetThreadBacktraceContext(int iCrashHandle, BacktraceContext *ctx) +bool GetThreadBacktraceContext(uint64_t iCrashHandle, BacktraceContext *ctx) { thread_act_t thread = thread_act_t(iCrashHandle); ppc_thread_state state; diff --git a/stepmania/src/archutils/Unix/Backtrace.h b/stepmania/src/archutils/Unix/Backtrace.h index 6326d5b6a2..51b9c82ca4 100644 --- a/stepmania/src/archutils/Unix/Backtrace.h +++ b/stepmania/src/archutils/Unix/Backtrace.h @@ -29,7 +29,7 @@ void GetBacktrace( const void **buf, size_t size, const BacktraceContext *ctx = /* Set up a BacktraceContext to get a backtrace for a thread. ThreadID may * not be the current thread. True is returned on success, false on failure. */ -bool GetThreadBacktraceContext( int ThreadID, BacktraceContext *ctx ); +bool GetThreadBacktraceContext( uint64_t ThreadID, BacktraceContext *ctx ); /* Set up a BacktraceContext to get a backtrace after receiving a signal, given * a ucontext_t (see sigaction(2)). (This interface is UNIX-specific.) */ diff --git a/stepmania/src/archutils/Unix/LinuxThreadHelpers.cpp b/stepmania/src/archutils/Unix/LinuxThreadHelpers.cpp index 66748a770b..b6275eb9f4 100644 --- a/stepmania/src/archutils/Unix/LinuxThreadHelpers.cpp +++ b/stepmania/src/archutils/Unix/LinuxThreadHelpers.cpp @@ -140,20 +140,20 @@ int GetCurrentThreadId() return getpid(); } -int SuspendThread( int ThreadID ) +int SuspendThread( uint64_t ThreadID ) { /* * Linux: We can't simply kill(SIGSTOP) (or tkill), since that will stop all processes * (grr). We can ptrace(PTRACE_ATTACH) the process to stop it, and PTRACE_DETACH * to restart it. */ - return PtraceAttach( ThreadID ); + return PtraceAttach( int(ThreadID) ); // kill( ThreadID, SIGSTOP ); } -int ResumeThread( int ThreadID ) +int ResumeThread( uint64_t ThreadID ) { - return PtraceDetach( ThreadID ); + return PtraceDetach( int(ThreadID) ); // kill( ThreadID, SIGSTOP ); } @@ -167,7 +167,7 @@ int ResumeThread( int ThreadID ) * This call leaves the given thread suspended, so the returned context doesn't become invalid. * ResumeThread() can be used to resume a thread after this call. */ #if defined(CRASH_HANDLER) -bool GetThreadBacktraceContext( int ThreadID, BacktraceContext *ctx ) +bool GetThreadBacktraceContext( uint64_t ThreadID, BacktraceContext *ctx ) { /* Can't GetThreadBacktraceContext the current thread. */ ASSERT( ThreadID != GetCurrentThreadId() ); @@ -178,20 +178,21 @@ bool GetThreadBacktraceContext( int ThreadID, BacktraceContext *ctx ) * * If it's in a debugger, we won't be able to ptrace(PTRACE_GETREGS). If * it's us that attached, we will. */ - if( PtraceAttach( ThreadID ) == -1 ) + if( PtraceAttach( int(ThreadID) ) == -1 ) { if( errno != EPERM ) { - CHECKPOINT_M( ssprintf( "%s (pid %i tid %i locking tid %i)", strerror(errno), getpid(), GetCurrentThreadId(), ThreadID ) ); + CHECKPOINT_M( ssprintf( "%s (pid %i tid %i locking tid %i)", + strerror(errno), getpid(), GetCurrentThreadId(), int(ThreadID) ) ); return false; } } user_regs_struct regs; - if( ptrace( PTRACE_GETREGS, ThreadID, NULL, ®s ) == -1 ) + if( ptrace( PTRACE_GETREGS, pid_t(ThreadID), NULL, ®s ) == -1 ) return false; - ctx->pid = ThreadID; + ctx->pid = pid_t(ThreadID); #if defined(CPU_X86_64) ctx->eip = (void *) regs.rip; ctx->ebp = (void *) regs.rbp; diff --git a/stepmania/src/archutils/Unix/LinuxThreadHelpers.h b/stepmania/src/archutils/Unix/LinuxThreadHelpers.h index 07b2795010..2a6e43086a 100644 --- a/stepmania/src/archutils/Unix/LinuxThreadHelpers.h +++ b/stepmania/src/archutils/Unix/LinuxThreadHelpers.h @@ -9,11 +9,11 @@ int GetCurrentThreadId(); /* Return true if NPTL libraries are in use, false if linuxthreads. */ bool UsingNPTL(); -int SuspendThread( int ThreadID ); -int ResumeThread( int ThreadID ); +int SuspendThread( uint64_t ThreadID ); +int ResumeThread( uint64_t ThreadID ); struct BacktraceContext; -int GetThreadContext( int ThreadID, BacktraceContext *ctx ); +int GetThreadContext( uint64_t ThreadID, BacktraceContext *ctx ); #endif