From 9214d3714ab60f9f5811fc250632ae98f6a94102 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Mon, 26 Apr 2010 21:45:50 +0000 Subject: * serial.c (serial_write): Handle serial_debug_p akin to serial_read. --- gdb/ChangeLog | 4 ++++ gdb/serial.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 405ab22..9f221fd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2010-04-26 Doug Evans + + * serial.c (serial_write): Handle serial_debug_p akin to serial_read. + 2010-04-26 Tom Tromey * cli/cli-decode.c (complete_on_cmdlist): Make two passes over the diff --git a/gdb/serial.c b/gdb/serial.c index 986326a..305ac33 100644 --- a/gdb/serial.c +++ b/gdb/serial.c @@ -408,6 +408,18 @@ serial_write (struct serial *scb, const char *str, int len) 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)); } -- cgit v1.1