Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@cygnus.com>
To: Brian Stell <bstell@netscape.com>
Cc: gdb@sources.redhat.com
Subject: Re: extending Gdb to display app specific data
Date: Fri, 10 Nov 2000 16:14:00 -0000	[thread overview]
Message-ID: <20001110191444.26019@cse.cygnus.com> (raw)
In-Reply-To: <3A0C8E19.A8A6D355@netscape.com>

On Fri, Nov 10, 2000 at 04:08:57PM -0800, Brian Stell wrote:
> We all agree that gdb by itself cannot display every data
> type that will come along.
> 
> What I'm looking for is a way for an expert user to tell
> gdb how to display a given type. This way within a
> community of developers the expert users can setup
> display routines for the complex data types in that
> environment and everyone else can view the data
> in gdb.
> 
> For example, in the Mozilla development world there are a
> large number of developers and a variety of string formats
> (PRUnichar=UTF16, nsString=C++ object, etc.) and more
> are expected in the future (e.g.: a compressed format).
> 
> It is easy to say RTFM but it would be more effective
> to say "copy this file to your home dir".

Do like GCC does and include functions in your code that take your type as an
argument, and print the type in question to stdout (or stderr).  For example
within gcc, there is debug_rtx, which takes a rtx pointer, and prints out the
value in tree format, and similarly debug_tree which does it for tree nodes.
To further enhance the debugging experience, the .gdbinit command includes
several shortcuts (like pr/pt) that pass the last value to the above
functions.

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482
From bstell@netscape.com Fri Nov 10 16:30:00 2000
From: bstell@netscape.com (Brian Stell)
To: egcs@cygnus.com
Cc: gdb@sources.redhat.com
Subject: Re: extending Gdb to display app specific data
Date: Fri, 10 Nov 2000 16:30:00 -0000
Message-id: <3A0C935B.AE3C0AF9@netscape.com>
References: <3A0B4885.B2384AE7@netscape.com> <200011101039.FAA29785@indy.delorie.com> <3A0C2791.A33BE9AC@ix.netcom.com> <200011102009.PAA00126@indy.delorie.com> <3A0C8E19.A8A6D355@netscape.com> <20001110191444.26019@cse.cygnus.com>
X-SW-Source: 2000-11/msg00082.html
Content-length: 1741

So how do we do this without requiring the end
user to know the exact data type of a variable
in any routine they pass thru and without requiring
the end user memorize the routine names?

Michael Meissner wrote:

> On Fri, Nov 10, 2000 at 04:08:57PM -0800, Brian Stell wrote:
> > We all agree that gdb by itself cannot display every data
> > type that will come along.
> >
> > What I'm looking for is a way for an expert user to tell
> > gdb how to display a given type. This way within a
> > community of developers the expert users can setup
> > display routines for the complex data types in that
> > environment and everyone else can view the data
> > in gdb.
> >
> > For example, in the Mozilla development world there are a
> > large number of developers and a variety of string formats
> > (PRUnichar=UTF16, nsString=C++ object, etc.) and more
> > are expected in the future (e.g.: a compressed format).
> >
> > It is easy to say RTFM but it would be more effective
> > to say "copy this file to your home dir".
>
> Do like GCC does and include functions in your code that take your type as an
> argument, and print the type in question to stdout (or stderr).  For example
> within gcc, there is debug_rtx, which takes a rtx pointer, and prints out the
> value in tree format, and similarly debug_tree which does it for tree nodes.
> To further enhance the debugging experience, the .gdbinit command includes
> several shortcuts (like pr/pt) that pass the last value to the above
> functions.
>
> --
> Michael Meissner, Red Hat, Inc.
> PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
> Work:     meissner@redhat.com           phone: +1 978-486-9304
> Non-work: meissner@spectacle-pond.org   fax:   +1 978-692-4482


       reply	other threads:[~2000-11-10 16:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3A0B4885.B2384AE7@netscape.com>
     [not found] ` <200011101039.FAA29785@indy.delorie.com>
     [not found]   ` <3A0C2791.A33BE9AC@ix.netcom.com>
     [not found]     ` <200011102009.PAA00126@indy.delorie.com>
     [not found]       ` <3A0C8E19.A8A6D355@netscape.com>
2000-11-10 16:14         ` Michael Meissner [this message]
     [not found]           ` <3A0C935B.AE3C0AF9@netscape.com>
2000-11-10 17:03             ` Daniel Berlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20001110191444.26019@cse.cygnus.com \
    --to=meissner@cygnus.com \
    --cc=bstell@netscape.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox