aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/low-linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver/low-linux.c')
-rw-r--r--gdb/gdbserver/low-linux.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/gdbserver/low-linux.c b/gdb/gdbserver/low-linux.c
index 0fd14af..f2565d5 100644
--- a/gdb/gdbserver/low-linux.c
+++ b/gdb/gdbserver/low-linux.c
@@ -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