🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #2591

(no subject given!)

#2591
From: News Subsystem
Date: Thu, 07 Mar 2002 05:43
38 lines
2493 bytes
Newsgroups: gnu.gdb.bug
Path: news
From: Bradford Chamberlain <brad@cs.washington.edu>
Subject: QUERY: pretty-printing C++ classes
Content-Type: text/plain; charset=us-ascii
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
Sender: news@beaver.cs.washington.edu (News Subsystem)
Organization: Computer Science & Engineering, U of Washington, Seattle
Lines: 24
Message-ID: <rr98z95ortv.fsf@gnocchi.cs.washington.edu>
Mime-Version: 1.0
X-Nntp-Posting-Host: gnocchi.cs.washington.edu
Date: 06 Mar 2002 21:43:56 -0800


I am curious whether gdb has hooks that would allow me to provide ways
of pretty-printing C++ classes without modifying its sources.  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 C++ code that
uses them.  Rather, I'd like to cause "p instanceOfMyClass" to supply
you with 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 you a
new copy of gdb.  So is there another 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 .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
Technical Details
Message-ID: <200203070543.g275hwvU057107@beaver.cs.washington.edu>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,c30f5eaeb63a78b2,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 2002-03-06 21:44:08 PST
x-uunet-gateway: chi6sosrv11.alter.net from bug-gdb to gnu.gdb.bug; Thu, 7 Mar 2002 05:44:06 GMT
Date: Wed, 6 Mar 2002 21:43:58 -0800
From: news@cs.washington.edu (News Subsystem)
Message-ID: <200203070543.g275hwvU057107@beaver.cs.washington.edu>
Approved: bug-gdb-request@mail.gnu.org
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb
Sender: bug-gdb-request@mail.gnu.org
Subject: (no subject given!)
Lines: 38