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: Mon, 30 Sep 2002 13:46:00 -0000	[thread overview]
Message-ID: <20020930204602.10433.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: tom.horsley@ccur.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: debug/8095: missing dwarf info for parent class
Date: Mon, 30 Sep 2002 16:38:12 -0400

 On Mon, Sep 30, 2002 at 12:45:44PM -0000, tom.horsley@ccur.com wrote:
 > 
 > >Number:         8095
 > >Category:       debug
 > >Synopsis:       missing dwarf info for parent class
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Mon Sep 30 05:46:05 PDT 2002
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     tom.horsley@ccur.com
 > >Release:        gcc 3.2
 > >Organization:
 > >Environment:
 > redhat linux null beta
 > >Description:
 > I get the impression that g++ probably attempts to optimize the dwarf it generates to avoid generating masses of debug info for types that are not referenced in a compilation unit.
 > 
 > That is all well and good, but it appears to go too far,
 > leaving out parent classes even when it does generate the info for a derived class.
 > 
 > If a type is "used", parent classes of that type should also be counted as "used".
 > >How-To-Repeat:
 > Any old C++ program with more than one level of class heirarchy will demonstrate this. Declare some instances of the most derived class, but never refer to the base class in the source code any place other than the derviced class declaration. The resulting dwarf will have no information about the members of the parent class.
 > 
 > There is some chance you can find the parent definition in another compilation unit if it happens to be used there, but there are no guarantees you'll be able to find it anywhere. This makes symbolic debugging a bit difficult if you actually want to look at the base class members.
 
 You need to be more precise.  Not "any old C++ program" demonstrates
 this.  Here's a counterexample:
 
 struct A {
  int x;
 };
 
 struct B : public A {
   int z;
 };
 
 B b;
 
  <1><25>: Abbrev Number: 2 (DW_TAG_structure_type)
      DW_AT_sibling     : <7f>   
      DW_AT_name        : A      
      DW_AT_byte_size   : 4      
      DW_AT_decl_file   : 1      
      DW_AT_decl_line   : 1      
 
  <1><9d>: Abbrev Number: 2 (DW_TAG_structure_type)
      DW_AT_sibling     : <f7>   
      DW_AT_name        : B      
      DW_AT_byte_size   : 4      
      DW_AT_decl_file   : 1      
      DW_AT_decl_line   : 5      
  <2><a7>: Abbrev Number: 13 (DW_TAG_inheritance)
      DW_AT_type        : <25>
      DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0; )
      DW_AT_accessibility: 1     (public)
 
 
 Please provide a test case.
 
 -- 
 Daniel Jacobowitz
 MontaVista Software                         Debian GNU/Linux Developer


             reply	other threads:[~2002-09-30 20:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-30 13:46 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 Wolfgang Bangerth
2003-03-14 21:56 Daniel Jacobowitz
2003-03-14 21:36 Daniel Jacobowitz
2003-03-14 21:19 bangerth
2002-10-01 12:16 Daniel Jacobowitz
2002-10-01  5:06 Horsley Tom
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=20020930204602.10433.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).