This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] s/PTRACE_ARG3_TYPE/PTRACE_TYPE_ARG3/g step 5


The usage of PTRACE_ARG3_TYPE was inconsistent.  Worse, there was a
ptrace call that didn't use four arguments.  You can get away with
that on modern GNU/Linux systems since those have a varargs ptrace
prototype, but older Linux systems have a traditional four-arg ptrace
prototype.

I simply removed the PTRACE_ARG3_TYPE casts.  They shouldn't be
necessary on Linux.

Committed,

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>
 
	* linux-nat.c (kill_inferior): Add missing third and fourth
	arguments to ptrace call.  Don't use PTRACE_ARG3_TYPE.

 
Index: linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.6
diff -u -p -r1.6 linux-nat.c
--- linux-nat.c 29 Mar 2004 18:07:14 -0000 1.6
+++ linux-nat.c 15 Aug 2004 15:45:58 -0000
@@ -500,12 +500,12 @@ kill_inferior (void)
   if (last.kind == TARGET_WAITKIND_FORKED
       || last.kind == TARGET_WAITKIND_VFORKED)
     {
-      ptrace (PT_KILL, last.value.related_pid);
+      ptrace (PT_KILL, last.value.related_pid, 0, 0);
       ptrace_wait (null_ptid, &status);
     }
 
   /* Kill the current process.  */
-  ptrace (PT_KILL, pid, (PTRACE_ARG3_TYPE) 0, 0);
+  ptrace (PT_KILL, pid, 0, 0);
   ret = ptrace_wait (null_ptid, &status);
 
   /* We might get a SIGCHLD instead of an exit status.  This is
@@ -513,7 +513,7 @@ kill_inferior (void)
 
   while (ret == pid && WIFSTOPPED (status))
     {
-      ptrace (PT_KILL, pid, (PTRACE_ARG3_TYPE) 0, 0);
+      ptrace (PT_KILL, pid, 0, 0);
       ret = ptrace_wait (null_ptid, &status);
     }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]