From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4051 invoked by alias); 1 Oct 2002 12:06:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 4037 invoked by uid 71); 1 Oct 2002 12:06:03 -0000 Date: Tue, 01 Oct 2002 05:06:00 -0000 Message-ID: <20021001120603.4036.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Horsley Tom Subject: RE: debug/8095: missing dwarf info for parent class Reply-To: Horsley Tom X-SW-Source: 2002-10/txt/msg00001.txt.bz2 List-Id: The following reply was made to PR debug/8095; it has been noted by GNATS. From: Horsley Tom To: 'Daniel Jacobowitz' , Horsley Tom Cc: gcc-gnats@gcc.gnu.org Subject: RE: debug/8095: missing dwarf info for parent class Date: Tue, 1 Oct 2002 08:02:44 -0400 > -----Original Message----- > From: Daniel Jacobowitz [mailto:drow@mvista.com] > Sent: Monday, September 30, 2002 4:38 PM > To: tom.horsley@ccur.com > Cc: gcc-gnats@gcc.gnu.org > Subject: Re: debug/8095: missing dwarf info for parent class >... > Please provide a test case. Weird. Every program I have exhibits this behavior. Here's a random test program I picked this morning on my first try :-). class Vtab1 { public: Vtab1(); Vtab1(int init_x); virtual ~Vtab1(); virtual int GetX(); private: int x; }; class Vtab2 { public: Vtab2(); Vtab2(int init_y); virtual ~Vtab2(); virtual int GetY(); private: int y; }; class Multiple1 : public Vtab1, public Vtab2 { public: Multiple1(int init_x, int init_y, int init_z); virtual ~Multiple1(); virtual int GetZ(); private: int z; }; class Derived1 : public Multiple1 { public: Derived1(int init_x, int init_y, int init_z); virtual ~Derived1(); virtual int GetX(); private: int my_x; }; Derived1::Derived1(int init_x, int init_y, int init_z) : Multiple1(init_x, init_y, init_z) { my_x = GetY(); } Derived1::~Derived1() { return; } int Derived1::GetX() { return my_x; } Using g++ 3.2 (Red Hat Linux Rawhide 3.2-1), if I compile this as g++ -g -c d1.cpp and examine the dwarf in the d1.o file, no symbols named "x","y", or "z" appear anywhere, and the parent class info for Derived1 points to a DW_AT_declaration for Multiple1, but there is no corresponding class definition with a DW_AT_specification pointing to that Multiple1, so no definition is available anywhere for the actual contents of the parent classes, yet they are certainly used since the type of the "this" pointer in the member functions refers to them indirectly.