aboutsummaryrefslogtreecommitdiff
path: root/gdb/infptrace.c
diff options
context:
space:
mode:
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 ();
}