-void
-kill_inferior ()
-{
- if (inferior_pid == 0)
- return;
- ptrace (PT_KILL, inferior_pid, (PTRACE_ARG3_TYPE) 0, 0);
- wait ((int *)0);
- target_mourn_inferior ();
-}
-
-#ifdef ATTACH_DETACH
-
-/* Start debugging the process whose number is PID. */
-int
-attach (pid)
- int pid;
-{
- errno = 0;
- ptrace (PT_ATTACH, pid, (PTRACE_ARG3_TYPE) 0, 0);
- if (errno)
- perror_with_name ("ptrace");
- attach_flag = 1;
- return pid;
-}
-
-/* Stop debugging the process whose number is PID
- and continue it with signal number SIGNAL.
- SIGNAL = 0 means just continue it. */
-
-void
-detach (signal)
- int signal;
-{
- errno = 0;
- ptrace (PT_DETACH, inferior_pid, (PTRACE_ARG3_TYPE) 1, signal);
- if (errno)
- perror_with_name ("ptrace");
- attach_flag = 0;
-}
-#endif /* ATTACH_DETACH */
-\f
-
-
-/* KERNEL_U_ADDR is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-#if defined (KERNEL_U_ADDR_BSD)
-/* Get kernel_u_addr using BSD-style nlist(). */
-CORE_ADDR kernel_u_addr;
-
-#include <a.out.gnu.h> /* For struct nlist */
-
-void
-_initialize_kernel_u_addr ()
-{
- struct nlist names[2];
-
- names[0].n_un.n_name = "_u";
- names[1].n_un.n_name = NULL;
- if (nlist ("/vmunix", names) == 0)
- kernel_u_addr = names[0].n_value;
- else
- fatal ("Unable to get kernel u area address.");
-}
-#endif /* KERNEL_U_ADDR_BSD. */
-
-#if defined (KERNEL_U_ADDR_HPUX)
-/* Get kernel_u_addr using HPUX-style nlist(). */
-CORE_ADDR kernel_u_addr;
-
-struct hpnlist {
- char * n_name;
- long n_value;
- unsigned char n_type;
- unsigned char n_length;
- short n_almod;
- short n_unused;
-};
-static struct hpnlist nl[] = {{ "_u", -1, }, { (char *) 0, }};
-
-/* read the value of the u area from the hp-ux kernel */
-void _initialize_kernel_u_addr ()
-{
- struct user u;
- nlist ("/hp-ux", &nl);
- kernel_u_addr = nl[0].n_value;
-}
-#endif /* KERNEL_U_ADDR_HPUX. */
-