diff options
author | Doug Evans <dje@google.com> | 2010-04-26 21:45:50 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2010-04-26 21:45:50 +0000 |
commit | 9214d3714ab60f9f5811fc250632ae98f6a94102 (patch) | |
tree | e4f6040a90f7b442bdee78bae9b0717fe354ab54 /gdb | |
parent | bdf92a1c039d3dfb07246213967bf109545e07a5 (diff) | |
download | binutils-gdb-9214d3714ab60f9f5811fc250632ae98f6a94102.tar.gz |
* serial.c (serial_write): Handle serial_debug_p akin to serial_read.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/serial.c | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 405ab221699..9f221fd6167 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2010-04-26 Doug Evans <dje@google.com> + + * serial.c (serial_write): Handle serial_debug_p akin to serial_read. + 2010-04-26 Tom Tromey <tromey@redhat.com> * cli/cli-decode.c (complete_on_cmdlist): Make two passes over the diff --git a/gdb/serial.c b/gdb/serial.c index 986326aa4d1..305ac33edf9 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)); } |