From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10425 invoked by alias); 10 Aug 2005 17:17:47 -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 10405 invoked by uid 22791); 10 Aug 2005 17:17:41 -0000 Received: from smarthost3.mail.uk.easynet.net (HELO smarthost3.mail.uk.easynet.net) (212.135.6.13) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 10 Aug 2005 17:17:41 +0000 Received: from [217.207.128.220] (helo=mx.transitive.com) by smarthost3.mail.uk.easynet.net with esmtp (Exim 4.10) id 1E2uCw-000HWn-00 for gdb@sources.redhat.com; Wed, 10 Aug 2005 18:17:39 +0100 Subject: Getting to the source for a given C++ object From: Alex Bennee To: gdb@sources.redhat.com Content-Type: text/plain Date: Wed, 10 Aug 2005 17:17:00 -0000 Message-Id: <1123694226.6601.12.camel@okra.transitives.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TL-MailScanner: Found to be clean X-SW-Source: 2005-08/txt/msg00044.txt.bz2 Hi, I'm currently trying to debug a C++ program that makes heavy use of templates and derived classes. Is there an easy way to get to the actual code for a given class pointer? At the moment if I look at the class pointer it gives me the template instantiation which I can work it out from but as most of the parameters are #define's is a rather labour intensive operation. e.g. (gdb) p currNode $8 = (Operation<(ExpressionType)45, 0, 1, RegisterID, (ResultType)2> *) 0x3834a3d0 -- Alex, homepage: http://www.bennee.com/~alex/ Spirtle, n.: The fine stream from a grapefruit that always lands right in your eye. -- Sniglets, "Rich Hall & Friends"