public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/45048] duplicate DW_TAG_variable
Date: Tue, 27 Jul 2010 10:40:00 -0000	[thread overview]
Message-ID: <20100727103938.25991.qmail@sourceware.org> (raw)
In-Reply-To: <bug-45048-360@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from jakub at gcc dot gnu dot org  2010-07-27 10:39 -------
One of these DW_TAG_variable DIEs at the DW_TAG_namespace scope is created
from declare_in_namespace when processing decls_for_scope of a lexical block.
The other one comes from declare_in_namespace from dwarf2out_global_decl
from wrapup_globals_for_namespace.
The problem is that the C++ FE doesn't unify externs, so the debugger sees
different decls with the same name, but different DECL_UID.
So for say
namespace N
{
  int i;
  void foo (void)
  {
    { extern int i; i++; }
    { extern int i; i++; }
    { extern int i; i++; }
    { extern int i; i++; }
  }
}
there will be 5 DW_TAG_variable DIEs in DW_TAG_namespace.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dodji at gcc dot gnu dot
                   |                            |org, jason at gcc dot gnu
                   |                            |dot org


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


  parent reply	other threads:[~2010-07-27 10:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-23 17:54 [Bug debug/45048] New: " tromey at gcc dot gnu dot org
2010-07-23 21:06 ` [Bug debug/45048] " tromey at gcc dot gnu dot org
2010-07-27 10:40 ` jakub at gcc dot gnu dot org [this message]
2010-07-27 11:14 ` jakub at gcc dot gnu 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=20100727103938.25991.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).