public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: debug/8095: missing dwarf info for parent class
Date: Tue, 01 Oct 2002 12:16:00 -0000	[thread overview]
Message-ID: <20021001191602.20042.qmail@sources.redhat.com> (raw)

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

From: Daniel Jacobowitz <drow@mvista.com>
To: 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 15:06:44 -0400

 On Tue, Oct 01, 2002 at 08:02:44AM -0400, Horsley Tom wrote:
 > > -----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.
 
 OK.  The reason that debug info for (for example) Vtab1 is not emitted
 is because it contains unimplemented virtual functions which are not
 declared as abstract.  Thus the vtable for Vtab1 is not emitted, and
 the debug information appears to be tied to that.
 
 I could make a good argument that this isn't right.  Can a C++
 maintainer comment?
 
 -- 
 Daniel Jacobowitz
 MontaVista Software                         Debian GNU/Linux Developer


             reply	other threads:[~2002-10-01 19:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-01 12:16 Daniel Jacobowitz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-04-15 15:05 bangerth
2003-04-15 13:36 Daniel Jacobowitz
2003-03-17 14:26 Daniel Jacobowitz
2003-03-17 13:06 Horsley Tom
2003-03-14 22:06 Wolfgang Bangerth
2003-03-14 21:56 Daniel Jacobowitz
2003-03-14 21:56 Wolfgang Bangerth
2003-03-14 21:36 Daniel Jacobowitz
2003-03-14 21:19 bangerth
2002-10-01  5:06 Horsley Tom
2002-09-30 13:46 Daniel Jacobowitz
2002-09-30  5:46 tom.horsley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021001191602.20042.qmail@sources.redhat.com \
    --to=drow@mvista.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).