mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-10 09:33:36 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user