aboutsummaryrefslogtreecommitdiff
path: root/gdb/symm-nat.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-03-26 00:19:35 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-03-26 00:19:35 +0000
commit59144a812481808f86d7525f5ad23934c5ab4a96 (patch)
treec2fb85e07efe414d0e2e4083c9d05fc56dc59095 /gdb/symm-nat.c
parent32001cc5da5c4244ae1314b1baafeae041642229 (diff)
downloadgdb-59144a812481808f86d7525f5ad23934c5ab4a96.zip
gdb-59144a812481808f86d7525f5ad23934c5ab4a96.tar.gz
gdb-59144a812481808f86d7525f5ad23934c5ab4a96.tar.bz2
* config/i386/ptx.mh (XDEPFILES): Add coredep.o. Delete infptrace.o.
* symm-nat.c (child_wait, _initialize_symm_nat, kill_inferior): Supply alternate version if ATTACH_DETACH is not defined. * ptx4-nat.c, config/i386/{nm-ptx4.h, ptx4.mh, ptx.mt, ptx4.mt, tm-ptx.h, tm-ptx4.h, xm-ptx.h, xm-ptx4.h}: New files. * configure.in: Recognize i[34]86-sequent-sysv4* host.
Diffstat (limited to 'gdb/symm-nat.c')
-rw-r--r--gdb/symm-nat.c50
1 files changed, 45 insertions, 5 deletions
diff --git a/gdb/symm-nat.c b/gdb/symm-nat.c
index f910d7d..e63ef97 100644
--- a/gdb/symm-nat.c
+++ b/gdb/symm-nat.c
@@ -362,7 +362,7 @@ sigchld_handler(signo)
sigmask(SIGCONT) | sigmask(SIGWINCH) | sigmask(SIGPWR) | \
sigmask(SIGURG) | sigmask(SIGPOLL)
-
+#ifdef ATTACH_DETACH
/*
* Thanks to XPT_MPDEBUGGER, we have to mange child_wait().
*/
@@ -514,6 +514,38 @@ child_wait(pid, status)
return pid;
}
+#else /* !ATTACH_DETACH */
+/*
+ * Simple child_wait() based on inftarg.c child_wait() for use until
+ * the MPDEBUGGER child_wait() works properly. This will go away when
+ * that is fixed.
+ */
+child_wait (pid, ourstatus)
+ int pid;
+ struct target_waitstatus *ourstatus;
+{
+ int save_errno;
+ int status;
+
+ do {
+ pid = wait (&status);
+ save_errno = errno;
+
+ if (pid == -1)
+ {
+ if (save_errno == EINTR)
+ continue;
+ fprintf (stderr, "Child process unexpectedly missing: %s.\n",
+ safe_strerror (save_errno));
+ ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
+ ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
+ return -1;
+ }
+ } while (pid != inferior_pid); /* Some other child died or stopped */
+ store_waitstatus (ourstatus, status);
+ return pid;
+}
+#endif /* ATTACH_DETACH */
@@ -550,12 +582,18 @@ kill_inferior ()
{
if (inferior_pid == 0)
return;
- /*
- * Don't use PT_KILL, since the child will stop again with a PTS_EXIT.
- * Just hit him with SIGKILL (so he stops) and detach.
- */
+
+ /* For MPDEBUGGER, don't use PT_KILL, since the child will stop
+ again with a PTS_EXIT. Just hit him with SIGKILL (so he stops)
+ and detach. */
+
kill (inferior_pid, SIGKILL);
+#ifdef ATTACH_DETACH
detach(SIGKILL);
+#else /* ATTACH_DETACH */
+ ptrace(PT_KILL, inferior_pid, 0, 0);
+ wait((int *)NULL);
+#endif /* ATTACH_DETACH */
target_mourn_inferior ();
}
@@ -737,6 +775,7 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
void
_initialize_symm_nat ()
{
+#ifdef ATTACH_DETACH
/*
* the MPDEBUGGER is necessary for process tree debugging and attach
* to work, but it alters the behavior of debugged processes, so other
@@ -786,4 +825,5 @@ _initialize_symm_nat ()
fatal("_initialize_symm_nat(): sigaction(SIGCHLD): %s",
safe_strerror(errno));
}
+#endif
}