diff options
Diffstat (limited to 'gdb/nto-procfs.c')
-rw-r--r-- | gdb/nto-procfs.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index 130eb95..6714239 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -494,8 +494,10 @@ procfs_meminfo (char *args, int from_tty) static void procfs_files_info (struct target_ops *ignore) { + struct inferior *inf = current_inferior (); + printf_unfiltered ("\tUsing the running image of %s %s via %s.\n", - attach_flag ? "attached" : "child", + pi->attach_flag ? "attached" : "child", target_pid_to_str (inferior_ptid), nto_procfs_path); } @@ -512,6 +514,7 @@ procfs_attach (char *args, int from_tty) { char *exec_file; int pid; + struct inferior *inf; if (!args) error_no_arg (_("process-id to attach")); @@ -535,7 +538,8 @@ procfs_attach (char *args, int from_tty) gdb_flush (gdb_stdout); } inferior_ptid = do_attach (pid_to_ptid (pid)); - add_inferior (pid); + inf = add_inferior (pid); + inf->attach_flag = 1; push_target (&procfs_ops); @@ -575,7 +579,6 @@ do_attach (ptid_t ptid) if (devctl (ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status), 0) == EOK && status.flags & _DEBUG_FLAG_STOPPED) SignalKill (nto_node (), PIDGET (ptid), 0, SIGCONT, 0, 0); - attach_flag = 1; nto_init_solib_absolute_prefix (); return ptid; } @@ -795,7 +798,6 @@ procfs_detach (char *args, int from_tty) pid = ptid_get_pid (inferior_ptid); inferior_ptid = null_ptid; - attach_flag = 0; detach_inferior (pid); init_thread_list (); unpush_target (&procfs_ops); /* Pop out of handling an inferior. */ @@ -915,7 +917,6 @@ procfs_mourn_inferior (void) init_thread_list (); unpush_target (&procfs_ops); generic_mourn_inferior (); - attach_flag = 0; } /* This function breaks up an argument string into an argument |