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]

[commit] serial_write: Handle serial_debug_p akin to serial_read.


Hi.

serial_read prints debugging output if serial_debug_p,
but serial_write doesn't.
I had a use for it during some recent debugging so I added it.

2010-04-26  Doug Evans  <dje@google.com>

	* serial.c (serial_write): Handle serial_debug_p akin to serial_read.

Index: serial.c
===================================================================
RCS file: /cvs/src/src/gdb/serial.c,v
retrieving revision 1.35
diff -u -p -r1.35 serial.c
--- serial.c	1 Jan 2010 07:31:41 -0000	1.35
+++ serial.c	26 Apr 2010 21:43:06 -0000
@@ -408,6 +408,18 @@ serial_write (struct serial *scb, const 
          in case we are getting ready to dump core or something. */
       gdb_flush (serial_logfp);
     }
+  if (serial_debug_p (scb))
+    {
+      int count;
+
+      for (count = 0; count < len; count++)
+	{
+	  fprintf_unfiltered (gdb_stdlog, "[");
+	  serial_logchar (gdb_stdlog, 'w', str[count] & 0xff, 0);
+	  fprintf_unfiltered (gdb_stdlog, "]");
+	}
+      gdb_flush (gdb_stdlog);
+    }
 
   return (scb->ops->write (scb, str, len));
 }


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