* Re: extending Gdb to display app specific data
[not found] ` <3A0C8E19.A8A6D355@netscape.com>
@ 2000-11-10 16:14 ` Michael Meissner
[not found] ` <3A0C935B.AE3C0AF9@netscape.com>
0 siblings, 1 reply; 2+ messages in thread
From: Michael Meissner @ 2000-11-10 16:14 UTC (permalink / raw)
To: Brian Stell; +Cc: gdb
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: extending Gdb to display app specific data
[not found] ` <3A0C935B.AE3C0AF9@netscape.com>
@ 2000-11-10 17:03 ` Daniel Berlin
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Berlin @ 2000-11-10 17:03 UTC (permalink / raw)
To: Brian Stell; +Cc: gdb
bstell@netscape.com (Brian Stell) writes:
> 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?
Um, use a single routine name, overloaded for the data types you want
to print?
You did say you were using C++, right?
>
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-11-10 17:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[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 ` extending Gdb to display app specific data Michael Meissner
[not found] ` <3A0C935B.AE3C0AF9@netscape.com>
2000-11-10 17:03 ` Daniel Berlin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox