diff options
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r-- | gdb/procfs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c index 703415c..658ec10 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -3634,13 +3634,13 @@ static void procfs_detach (char *args, int from_tty) { int sig = 0; + int pid = PIDGET (inferior_ptid); if (args) sig = atoi (args); if (from_tty) { - int pid = PIDGET (inferior_ptid); char *exec_file; exec_file = get_exec_file (0); @@ -3655,6 +3655,7 @@ procfs_detach (char *args, int from_tty) do_detach (sig); inferior_ptid = null_ptid; + detach_inferior (pid); unpush_target (&procfs_ops); } @@ -3711,6 +3712,7 @@ do_attach (ptid_t ptid) if ((fail = procfs_debug_inferior (pi)) != 0) dead_procinfo (pi, "do_attach: failed in procfs_debug_inferior", NOKILL); + add_inferior (pi->pid); /* Let GDB know that the inferior was attached. */ attach_flag = 1; |