public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mark at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/33429] debug info for class2 in g++.dg/other/unused1.C  requires -femit-class-debug-always
Date: Wed, 15 Oct 2008 22:52:00 -0000	[thread overview]
Message-ID: <20081015225103.27650.qmail@sourceware.org> (raw)
In-Reply-To: <bug-33429-507@http.gcc.gnu.org/bugzilla/>



------- Comment #9 from mark at codesourcery dot com  2008-10-15 22:51 -------
Subject: Re:  debug info for class2 in g++.dg/other/unused1.C
  requires -femit-class-debug-always

jason at redhat dot com wrote:

>> But, I think it's odd if I'm in the debugger, looking at code that says:
>>
>>   return (X*)y;
>>
>> if I can't say "print (X*)y".
>>
>> If the type is coming from a library, we may not ever create objects of this
>> type.
> 
> If the Xes are created in the library, the library should have the debug 
> info we need.

That assumes a friendly library distributor. :-)

The library is provided to us in binary form and stripped, and if it
does have debug info it might not have come from GCC.  But, if it's
declared in a header, we can still provide debug info.

>> Finally, we use vast amounts of space in object files for debug info, since we
>> emit the same debug info in multiple object files.  Trying to optimize by not
>> emitting debug info in this case doesn't seem likely to be a big win given our
>> overall strategy.  I don't have any data to support that claim, though.
> 
> I'm not sure what overall strategy you mean.  We try to avoid emitting 
> the same info in multiple places when possible: we try to treat the 
> debug info for classes as another vague linkage entity and put it with 
> the vtable.

OK, my statement was overly strong.  I was thinking particularly of C++
templates, where the vague linkage strategy makes for lots of copies,
both in the object files, and, because we don't use COMDAT, in the final
binaries.  In that kind of C++ code, this optimization doesn't save a
significant percentage of space.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33429


  parent reply	other threads:[~2008-10-15 22:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-14  6:25 [Bug debug/33429] New: " hp at gcc dot gnu dot org
2007-09-14  6:33 ` [Bug debug/33429] " hp at gcc dot gnu dot org
2007-09-14  6:48 ` hp at gcc dot gnu dot org
2007-09-14 16:33 ` pinskia at gcc dot gnu dot org
2007-09-15 18:39 ` danglin at gcc dot gnu dot org
2007-10-01 15:09 ` rguenth at gcc dot gnu dot org
2008-10-15 18:30 ` jason at gcc dot gnu dot org
2008-10-15 19:38 ` dodji at gcc dot gnu dot org
2008-10-15 20:22 ` mmitchel at gcc dot gnu dot org
2008-10-15 22:24 ` jason at redhat dot com
2008-10-15 22:52 ` mark at codesourcery dot com [this message]
2008-10-16 18:41 ` jason at redhat dot com
2008-10-16 20:38 ` mark at codesourcery dot com
2008-10-20 10:21 ` dodji at gcc dot gnu dot org
2008-10-20 19:03 ` jason at redhat dot com
2008-10-20 19:04 ` jason at redhat dot com
2008-10-21 10:16 ` dodji at seketeli dot org
2008-10-24 10:58 ` dodji at seketeli dot org

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=20081015225103.27650.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).