From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27196 invoked by alias); 9 Mar 2002 00:56:45 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 27145 invoked from network); 9 Mar 2002 00:56:43 -0000 Received: from unknown (HELO gnocchi.cs.washington.edu) (128.95.2.217) by sources.redhat.com with SMTP; 9 Mar 2002 00:56:43 -0000 Received: from localhost (brad@localhost) by gnocchi.cs.washington.edu (8.11.6/8.11.6/0.4) with ESMTP id g290uhj25365 for ; Fri, 8 Mar 2002 16:56:43 -0800 X-Authentication-Warning: gnocchi.cs.washington.edu: brad owned process doing -bs Date: Fri, 08 Mar 2002 16:56:00 -0000 From: Bradford Chamberlain To: gdb@sources.redhat.com Subject: QUERY: Pretty-printing C++ classes in gdb Message-ID: <20020308165335.L25327-100000@gnocchi.cs.washington.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-03/txt/msg00077.txt.bz2 (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