Commit 699d3cf8 authored by Alexandre Julliard's avatar Alexandre Julliard

Added use_ptrace flag to disable ptrace usage. Should eventually be

made into an option.
parent c38cb012
...@@ -82,6 +82,7 @@ static const struct object_ops thread_ops = ...@@ -82,6 +82,7 @@ static const struct object_ops thread_ops =
destroy_thread destroy_thread
}; };
static const int use_ptrace = 1; /* set to 0 to disable ptrace */
static struct thread *first_thread; static struct thread *first_thread;
/* allocate the buffer for the communication with the client */ /* allocate the buffer for the communication with the client */
...@@ -292,7 +293,7 @@ void wait4_thread( struct thread *thread, int signal ) ...@@ -292,7 +293,7 @@ void wait4_thread( struct thread *thread, int signal )
static int attach_thread( struct thread *thread ) static int attach_thread( struct thread *thread )
{ {
/* this may fail if the client is already being debugged */ /* this may fail if the client is already being debugged */
if (ptrace( PTRACE_ATTACH, thread->unix_pid, 0, 0 ) == -1) return 0; if (!use_ptrace || (ptrace( PTRACE_ATTACH, thread->unix_pid, 0, 0 ) == -1)) return 0;
if (debug_level) fprintf( stderr, "ptrace: attached to pid %d\n", thread->unix_pid ); if (debug_level) fprintf( stderr, "ptrace: attached to pid %d\n", thread->unix_pid );
thread->attached = 1; thread->attached = 1;
wait4_thread( thread, SIGSTOP ); wait4_thread( thread, SIGSTOP );
......
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