2002-01-17 Daniel Jacobowitz <drow@mvista.com>

* low-hppabsd.c (myattach): New function, returning -1.
        * low-lynx.c (myattach): Likewise.
        * low-nbsd.c (myattach): Likewise.
        * low-sim.c (myattach): Likewise.
        * low-sparc.c (myattach): Likewise.
        * low-sun3.c (myattach): Likewise.

        * low-linux.c (myattach): New function.

        * server.c (attach_inferior): New function.
        (main): Handle "--attach".
This commit is contained in:
Daniel Jacobowitz
2002-01-17 20:46:16 +00:00
parent 55baa95bb2
commit 45b7b34510
9 changed files with 140 additions and 9 deletions

View File

@ -78,6 +78,23 @@ create_inferior (char *program, char **allargs)
return pid;
}
/* Attach to an inferior process. */
int
myattach (int pid)
{
if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0)
{
fprintf (stderr, "Cannot attach to process %d: %s (%d)\n", pid,
errno < sys_nerr ? sys_errlist[errno] : "unknown error",
errno);
fflush (stderr);
_exit (0177);
}
return 0;
}
/* Kill the inferior process. Make us have no inferior. */
void