aboutsummaryrefslogtreecommitdiff
path: root/gdb/infptrace.c
diff options
context:
space:
mode:
authorK. Richard Pixley <rich@cygnus>1992-09-30 02:03:24 +0000
committerK. Richard Pixley <rich@cygnus>1992-09-30 02:03:24 +0000
commitc9c2341230952e66b843f7031acd40070eebc2f9 (patch)
tree843d88e437fa43a77130ade757fbf5213eda2124 /gdb/infptrace.c
parent6e37b2150bdfc0f2aafdb4da52aa1698b99401d5 (diff)
downloadgdb-c9c2341230952e66b843f7031acd40070eebc2f9.zip
gdb-c9c2341230952e66b843f7031acd40070eebc2f9.tar.gz
gdb-c9c2341230952e66b843f7031acd40070eebc2f9.tar.bz2
Host/target/native split for sun4.
* Makefile.in (TSOBS): removed corelow.o. * infptrace.c: included nat.h. * nat-trash.h: temporary header file. This should be removed once all hosts have the native/host/target split. * configure.in: add a symlink from nat-trash.h to nat.h if no other nat file exists for this configuration. * sparc-tdep.c: no longer include sys/ptrace.h. * sparc-xdep.c: removed. contents have been moved to nat-sparc.c. * xm-sparc.h (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): moved to nat-sun4os4.h. * nat-sparc.c, nat-sun4os4.h: new files for sun4 native support. * config/sun4os4.mh (XDEPFILES): moved infptrace.o and inftarg.o to NATDEPFILES. removed sparc-xdep.o. (NATDEPFILES, NAT_FILE): new macros for native support.
Diffstat (limited to 'gdb/infptrace.c')
-rw-r--r--gdb/infptrace.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gdb/infptrace.c b/gdb/infptrace.c
index 23cb8f4..7117bf9 100644
--- a/gdb/infptrace.c
+++ b/gdb/infptrace.c
@@ -22,6 +22,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "inferior.h"
#include "target.h"
+#include "nat.h"
+
#ifdef USG
#include <sys/types.h>
#endif
@@ -89,21 +91,16 @@ call_ptrace (request, pid, addr, data)
#define ptrace call_ptrace
#endif
-/* This is used when GDB is exiting. It gives less chance of error.*/
-
void
-kill_inferior_fast ()
+kill_inferior ()
{
if (inferior_pid == 0)
return;
+ /* ptrace PT_KILL only works if process is stopped!!! So stop it with
+ a real signal first, if we can. */
+ kill (inferior_pid, SIGKILL);
ptrace (PT_KILL, inferior_pid, (PTRACE_ARG3_TYPE) 0, 0);
wait ((int *)0);
-}
-
-void
-kill_inferior ()
-{
- kill_inferior_fast ();
target_mourn_inferior ();
}