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

This commit is contained in:
Doug Evans 2010-04-26 21:45:50 +00:00
parent bdf92a1c03
commit 9214d3714a
2 changed files with 16 additions and 0 deletions

View File

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

View File

@ -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));
}