On Mon, Aug 28, 2006 at 09:38:08AM -0500, Hollis Blanchard wrote:
> 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);

but in_debugger() and debug_puts() need to come from somewhere and
gdbstub.h makes sense or am I missing the point?

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

so something like:
void serial_puts(int handle, const char *s)
    struct serial_port *port = &com[handle & SERHND_IDX];
    unsigned long flags;
    char c;

    if ( (handle == -1) || !port->driver || !port->driver->putc )

    if ( (handle & SERHND_DEBUGGER) && in_debugger() ) {

Actually that seems pretty nice as it means that the debug messages get
push to gdb when console==gdb.

I'll have a play.  Thanks Hollis.

Yours Tony

   linux.conf.au       http://linux.conf.au/ || http://lca2007.linux.org.au/
   Jan 15-20 2007      The Australian Linux Technical Conference!

Xen-ppc-devel mailing list

Reply via email to