* [MI] Prevent program output from mixing with "^running".
@ 2009-11-06 14:28 Vladimir Prus
2009-11-06 14:51 ` Joel Brobecker
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Prus @ 2009-11-06 14:28 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: Text/Plain, Size: 343 bytes --]
We have run into a case where the output of the programm being
debugger got inserted between the MI token and "^running", confusing
the frontend quite considerably. This was on Windows, so pseudoterminals
are not a solution. I've checked in this patch to address this.
There's no testcase, since reproducing this is tricky.
Thanks,
Volodya
[-- Attachment #2: token-final.diff --]
[-- Type: text/x-patch, Size: 1389 bytes --]
Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.11035
diff -u -p -r1.11035 ChangeLog
--- gdb/ChangeLog 5 Nov 2009 23:18:00 -0000 1.11035
+++ gdb/ChangeLog 6 Nov 2009 14:24:59 -0000
@@ -1,3 +1,12 @@
+2009-11-06 Vladimir Prus <vladimir@codesourcery.com>
+
+ Prevent program output from mix with "^running".
+
+ gdb/
+ * mi/mi-interp.c (mi_on_resume): Output token
+ and "^running" together, so that nothing else gets
+ in between.
+
2009-11-05 Daniel Jacobowitz <dan@codesourcery.com>
* dwarf2read.c (struct dwarf2_cu): Remove ranges_offset and
Index: gdb/mi/mi-interp.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-interp.c,v
retrieving revision 1.51
diff -u -p -r1.51 mi-interp.c
--- gdb/mi/mi-interp.c 19 Oct 2009 09:51:42 -0000 1.51
+++ gdb/mi/mi-interp.c 6 Nov 2009 14:24:59 -0000
@@ -438,9 +438,8 @@ mi_on_resume (ptid_t ptid)
In future (MI3), we'll be outputting "^done" here. */
if (!running_result_record_printed && mi_proceeded)
{
- if (current_token)
- fputs_unfiltered (current_token, raw_stdout);
- fputs_unfiltered ("^running\n", raw_stdout);
+ fprintf_unfiltered (raw_stdout, "%s^running\n",
+ current_token ? current_token : "");
}
if (PIDGET (ptid) == -1)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [MI] Prevent program output from mixing with "^running".
2009-11-06 14:28 [MI] Prevent program output from mixing with "^running" Vladimir Prus
@ 2009-11-06 14:51 ` Joel Brobecker
0 siblings, 0 replies; 2+ messages in thread
From: Joel Brobecker @ 2009-11-06 14:51 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
> + fprintf_unfiltered (raw_stdout, "%s^running\n",
> + current_token ? current_token : "");
If I were you, I'd add a comment explaining that both elements are
printed at the same time on purpose. I occasionally "improve" code
clarity by getting rid of ill-used ?: sequences...
--
Joel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-06 14:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-06 14:28 [MI] Prevent program output from mixing with "^running" Vladimir Prus
2009-11-06 14:51 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox