Commit 5cc97c4e authored by Alexandre Julliard's avatar Alexandre Julliard

server: Always detach from the thread when we are done with ptrace.

parent 64f17bb3
...@@ -274,8 +274,12 @@ void resume_after_ptrace( struct thread *thread ) ...@@ -274,8 +274,12 @@ void resume_after_ptrace( struct thread *thread )
{ {
if (thread->unix_pid == -1) return; if (thread->unix_pid == -1) return;
assert( thread->attached ); assert( thread->attached );
ptrace( get_thread_single_step(thread) ? PTRACE_SINGLESTEP : PTRACE_CONT, if (ptrace( PTRACE_DETACH, get_ptrace_pid(thread), (caddr_t)1, 0 ) == -1)
get_ptrace_pid(thread), (caddr_t)1, 0 /* cancel the SIGSTOP */ ); {
if (errno == ESRCH) thread->unix_pid = thread->unix_tid = -1; /* thread got killed */
}
if (debug_level) fprintf( stderr, "%04x: *detached*\n", thread->id );
thread->attached = 0;
} }
/* read an int from a thread address space */ /* read an int from a thread address space */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment