From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8757 invoked by alias); 10 Aug 2005 20:35:39 -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 8736 invoked by uid 22791); 10 Aug 2005 20:35:34 -0000 Received: from mail-out4.apple.com (HELO mail-out4.apple.com) (17.254.13.23) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 10 Aug 2005 20:35:34 +0000 Received: from mailgate2.apple.com (a17-128-100-204.apple.com [17.128.100.204]) by mail-out4.apple.com (8.12.11/8.12.11) with ESMTP id j7AKZWls019865 for ; Wed, 10 Aug 2005 13:35:32 -0700 (PDT) Received: from relay1.apple.com (relay1.apple.com) by mailgate2.apple.com (Content Technologies SMTPRS 4.3.17) with ESMTP id ; Wed, 10 Aug 2005 13:35:32 -0700 Received: from [17.201.22.21] (moleja.apple.com [17.201.22.21]) by relay1.apple.com (8.12.11/8.12.11) with ESMTP id j7AKZTHh023037; Wed, 10 Aug 2005 13:35:30 -0700 (PDT) In-Reply-To: <1123694226.6601.12.camel@okra.transitives.com> References: <1123694226.6601.12.camel@okra.transitives.com> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <186AD8EB-8137-4F61-8715-7A4CF6E00E7A@apple.com> Cc: gdb@sources.redhat.com Content-Transfer-Encoding: 7bit From: Jason Molenda Subject: Re: Getting to the source for a given C++ object Date: Wed, 10 Aug 2005 20:35:00 -0000 To: Alex Bennee X-SW-Source: 2005-08/txt/msg00047.txt.bz2 On Aug 10, 2005, at 10:17 AM, Alex Bennee wrote: > 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? I'm not sure exactly what you're looking for. ptype can tell you the class - is that what you want? e.g. (gdb) p beta $1 = { = {_vptr$A = 0x30b0, a1 = 200}, b1 = 201, b2 = 202} (gdb) ptype beta type = class B : public A { public: int b1; int b2; B(B const&); B(B const&); B(); B(); ~B(); virtual ~B(); virtual ~B(); } (gdb) J