This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Fix procfs.c detach output
- From: Mark Kettenis <kettenis at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 11 Aug 2004 08:54:34 +0200 (CEST)
- Subject: [PATCH] Fix procfs.c detach output
Several things were wrong here, most notably we were printing the LWP
instead of the PID. There also was a missing comma. Caught by
Andrew's recent testsuite fixes.
Committed
Mark
Index: ChangeLog
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.
Index: procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.56
diff -u -p -r1.56 procfs.c
--- procfs.c 10 Aug 2004 16:05:38 -0000 1.56
+++ procfs.c 10 Aug 2004 16:13:23 -0000
@@ -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