]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* procfs.c (procfs_detach): Cleanup. Print process ID, not LWP
authorMark Kettenis <kettenis@gnu.org>
Wed, 11 Aug 2004 06:55:15 +0000 (06:55 +0000)
committerMark Kettenis <kettenis@gnu.org>
Wed, 11 Aug 2004 06:55:15 +0000 (06:55 +0000)
ID.  Use comma in output.  Use gdb_flush on gdb_stdout instead of
fflush on stdout.

gdb/ChangeLog
gdb/procfs.c

index d79ae860126d8a38c8e67e8f3766bdf2868cb103..794c78f15ce4c459192a3fa0f0d685070307a25a 100644 (file)
@@ -1,3 +1,9 @@
+2004-08-10  Mark Kettenis  <kettenis@gnu.org>
+
+       * 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.
+
 2004-08-10  Joel Brobecker  <brobecker@gnat.com>
 
        * xcoff_symfile_finish: Replace last call to xmfree by call
index b94e03710acbbce524f4635ef85f41e9741e819a..3ac970240287ee313508d8a7fe0d0f268e940d2c 100644 (file)
@@ -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