This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: debug/8095: missing dwarf info for parent class


The following reply was made to PR debug/8095; it has been noted by GNATS.

From: Horsley Tom <Tom.Horsley@ccur.com>
To: 'Daniel Jacobowitz' <drow@mvista.com>, Horsley Tom
	 <Tom.Horsley@ccur.com>
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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]