On Mon, 2006-08-28 at 17:13 +1000, Tony Breeds wrote:
> Hello All,
> When GDB is atatched to the serial console you loose the output
> from printk()'s. Below is a quick patch that uses GDBs "O" packet to
> pass this data out to GDB.
> diff -r f8233165fb80 xen/drivers/char/console.c
> --- a/xen/drivers/char/console.c Sun Aug 27 16:12:00 2006 -0400
> +++ b/xen/drivers/char/console.c Mon Aug 28 17:07:02 2006 +1000
> @@ -258,6 +260,8 @@ static inline void __putstr(const char *
> int c;
>
> serial_puts(sercon_handle, str);
> + /* FIXME: Make sure this builds without debug=y */
> + gdb_puts(str);
>
> while ( (c = *str++) != '\0' )
> {
You probably want to avoid serial_puts() if GDB is attached, no?
Otherwise, you'll be sending "garbage" (i.e. non-packet data) down the
serial line to GDB.
Rather than including gdbstub.h here, you might do something like this:
if (in_debugger())
debug_puts(sercon_handle, str);
else
serial_puts(sercon_handle, str);
In fact, it might be worth adding another flag to the serial handles
(see e.g. SERHND_COOKED), and intercepting inside serial_puts(). The
only problem there is that serial_putc() would bypass this, but as you
can see practically speaking there aren't any callers.
--
Hollis Blanchard
IBM Linux Technology Center
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|