This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[MI] Prevent program output from mixing with "^running".


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
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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]