This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Inline ptrace_wait, mostly
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 29 Sep 2004 12:01:04 -0400
- Subject: [commit] Inline ptrace_wait, mostly
As follow on from Mark's inlining of ptrace_wait in inf-ptrace.c, and my
elimination of target_post_wait() method, this inlines most of the calls
to the now very empty infptrace.c:ptrace_wait().
It can't inline all the calls and eliminate the function as, dependant
on the HPUX system, hpuxh-nat.c ends up calling either
inf[pt]trace.c:ptrace_wait(). (I suspect that hppahpux.mh is dead but
that's a separate problem.)
anyway, this part is committed,
Andrew
2004-09-29 Andrew Cagney <cagney@gnu.org>
* infptrace.c (ptrace_wait): Mention problem with HPUX.
(kill_inferior): Inline ptrace_wait call.
* linux-nat.c (kill_inferior): Inline ptrace_wait call.
* inftarg.c (child_wait): Inline ptrace_wait call.
Index: infptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infptrace.c,v
retrieving revision 1.46
diff -p -u -r1.46 infptrace.c
--- infptrace.c 29 Sep 2004 15:33:02 -0000 1.46
+++ infptrace.c 29 Sep 2004 15:54:41 -0000
@@ -138,6 +138,10 @@ call_ptrace (int request, int pid, PTRAC
/* Wait for a process to finish, possibly running a target-specific
hook before returning. */
+/* NOTE: cagney: 2004-09-29: Dependant on the native configuration,
+ "hppah-nat.c" may either call this or infttrace.c's implementation
+ of ptrace_wait. See "hppahpux.mh". */
+
int
ptrace_wait (ptid_t ptid, int *status)
{
@@ -170,7 +174,7 @@ kill_inferior (void)
The kill call causes problems under hpux10, so it's been removed;
if this causes problems we'll deal with them as they arise. */
ptrace (PT_KILL, pid, (PTRACE_TYPE_ARG3) 0, 0);
- ptrace_wait (null_ptid, &status);
+ wait (status);
target_mourn_inferior ();
}
#endif /* DEPRECATED_KILL_INFERIOR */
Index: inftarg.c
===================================================================
RCS file: /cvs/src/src/gdb/inftarg.c,v
retrieving revision 1.30
diff -p -u -r1.30 inftarg.c
--- inftarg.c 29 Sep 2004 15:33:02 -0000 1.30
+++ inftarg.c 29 Sep 2004 15:54:41 -0000
@@ -113,7 +113,7 @@ child_wait (ptid_t ptid, struct target_w
attached process. */
set_sigio_trap ();
- pid = ptrace_wait (inferior_ptid, &status);
+ pid = wait (&status);
save_errno = errno;
Index: linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.11
diff -p -u -r1.11 linux-nat.c
--- linux-nat.c 29 Sep 2004 14:20:25 -0000 1.11
+++ linux-nat.c 29 Sep 2004 15:54:42 -0000
@@ -522,12 +522,12 @@ kill_inferior (void)
|| last.kind == TARGET_WAITKIND_VFORKED)
{
ptrace (PT_KILL, last.value.related_pid, 0, 0);
- ptrace_wait (null_ptid, &status);
+ wait (&status);
}
/* Kill the current process. */
ptrace (PT_KILL, pid, 0, 0);
- ret = ptrace_wait (null_ptid, &status);
+ ret = wait (&status);
/* We might get a SIGCHLD instead of an exit status. This is
aggravated by the first kill above - a child has just died. */
@@ -535,7 +535,7 @@ kill_inferior (void)
while (ret == pid && WIFSTOPPED (status))
{
ptrace (PT_KILL, pid, 0, 0);
- ret = ptrace_wait (null_ptid, &status);
+ ret = wait (&status);
}
target_mourn_inferior ();