From: Bradford Chamberlain <brad@cs.washington.edu>
To: gdb@sources.redhat.com
Subject: QUERY: Pretty-printing C++ classes in gdb
Date: Fri, 08 Mar 2002 16:56:00 -0000 [thread overview]
Message-ID: <20020308165335.L25327-100000@gnocchi.cs.washington.edu> (raw)
(I hope the following is not a FAQ. I didn't find one on the gdb page.)
I am curious whether gdb has hooks that would allow me to provide a means
of pretty-printing C++ classes without modifying the gdb source code.
For example, imagine that I am supplying you with a C++ class library, and
want to save you the hassle of inspecting the guts of my classes and
understanding their inner workings when debugging your code that uses
them. Rather, I'd like to cause "p instanceOfClassFoo" to give you a
clean view of the class that doesn't require understanding its
implementation.
One way to do this would be to hack the source, perhaps treating my
library as a new language. However, I'd like to avoid changing the gdb
source both for simplicity and so that I don't have to ship users a new
copy of gdb. So is there a less intrusive way that I can hook my pretty
printing in? For example, I could imagine that a well-defined method name
or operator<< overload might be utilized by gdb if it exists. Or that
perhaps I can give you a dot-file that will be used at load time to
configure the behavior.
Any information on whether such a feature exists, or other possible
workarounds would be appreciated.
Thanks very much,
-Brad Chamberlain
next reply other threads:[~2002-03-09 0:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-08 16:56 Bradford Chamberlain [this message]
2002-03-08 18:58 ` Daniel Jacobowitz
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=20020308165335.L25327-100000@gnocchi.cs.washington.edu \
--to=brad@cs.washington.edu \
--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