This commit is contained in:
Steve Checkoway
2006-03-28 14:37:40 +00:00
parent 79fdd16a55
commit 1a240d3b6c
@@ -208,15 +208,12 @@ bool GetThreadBacktraceContext( uint64_t ThreadID, BacktraceContext *ctx )
* *
* If it's in a debugger, we won't be able to ptrace(PTRACE_GETREGS). If * If it's in a debugger, we won't be able to ptrace(PTRACE_GETREGS). If
* it's us that attached, we will. */ * it's us that attached, we will. */
if( PtraceAttach( int(ThreadID) ) == -1 ) if( PtraceAttach( int(ThreadID) ) == -1 && errno != EPERM )
{
if( errno != EPERM )
{ {
CHECKPOINT_M( ssprintf( "%s (pid %i tid %i locking tid %i)", CHECKPOINT_M( ssprintf( "%s (pid %i tid %i locking tid %i)",
strerror(errno), getpid(), (int)GetCurrentThreadId(), int(ThreadID) ) ); strerror(errno), getpid(), (int)GetCurrentThreadId(), int(ThreadID) ) );
return false; return false;
} }
}
user_regs_struct regs; user_regs_struct regs;
if( ptrace( PTRACE_GETREGS, pid_t(ThreadID), NULL, &regs ) == -1 ) if( ptrace( PTRACE_GETREGS, pid_t(ThreadID), NULL, &regs ) == -1 )