diff options
author | Mark Kettenis <kettenis@gnu.org> | 2004-08-11 06:55:15 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2004-08-11 06:55:15 +0000 |
commit | cc377e6b36d4c3239980bed893dec833a3a2793c (patch) | |
tree | eef6f0f82ab0b059e9b6dff70c7ed36ea623c8c9 /gdb/procfs.c | |
parent | b2221023d38c7988aa0c6db830062b96f84354b2 (diff) | |
download | gdb-cc377e6b36d4c3239980bed893dec833a3a2793c.zip gdb-cc377e6b36d4c3239980bed893dec833a3a2793c.tar.gz gdb-cc377e6b36d4c3239980bed893dec833a3a2793c.tar.bz2 |
* procfs.c (procfs_detach): Cleanup. Print process ID, not LWP
ID. Use comma in output. Use gdb_flush on gdb_stdout instead of
fflush on stdout.
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r-- | gdb/procfs.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c index b94e037..3ac9702 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -3545,24 +3545,29 @@ procfs_attach (char *args, int from_tty) static void procfs_detach (char *args, int from_tty) { - char *exec_file; - int signo = 0; + int sig = 0; + + if (args) + sig = atoi (args); if (from_tty) { + int pid = PIDGET (inferior_ptid); + char *exec_file; + exec_file = get_exec_file (0); - if (exec_file == 0) + if (exec_file == NULL) exec_file = ""; - printf_filtered ("Detaching from program: %s %s\n", - exec_file, target_pid_to_str (inferior_ptid)); - fflush (stdout); + + printf_filtered ("Detaching from program: %s, %s\n", exec_file, + target_pid_to_str (pid_to_ptid (pid))); + gdb_flush (gdb_stdout); } - if (args) - signo = atoi (args); - do_detach (signo); + do_detach (sig); + inferior_ptid = null_ptid; - unpush_target (&procfs_ops); /* Pop out of handling an inferior */ + unpush_target (&procfs_ops); } static ptid_t |