This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [XenPPC] [RFC] GDB "O" packets

To: Tony Breeds <tony@xxxxxxxxxxxxxxxxxx>
Subject: Re: [XenPPC] [RFC] GDB "O" packets
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Mon, 28 Aug 2006 09:38:08 -0500
Cc: XenPPC-devel <xen-ppc-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 28 Aug 2006 07:37:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060828071345.GO27551@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
References: <20060828071345.GO27551@xxxxxxxxxxxxxxxxxx>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
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);
                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

<Prev in Thread] Current Thread [Next in Thread>