summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-21 00:06:34 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-21 00:06:34 +0000
commit6e395578250dfc5851c1d0e5b38570af82ef563d (patch)
treec24b827b097f8525a893e678dcf6a8f39be24cca
parentcef8055d74532525ab53b4a751de4cdc66e93a2a (diff)
downloadgcc-6e395578250dfc5851c1d0e5b38570af82ef563d.tar.gz
Avoid emitting bogus debug info that confuses gdb.
PR c++/20805 * dwarf2out.c (gen_variable_die): Don't emit a specification if this is another declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98473 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/dwarf2out.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index b750ff8b466..c32c545477f 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -11615,8 +11615,13 @@ gen_variable_die (tree decl, dw_die_ref context_die)
copy decls and set the DECL_ABSTRACT flag on them instead of
sharing them.
- ??? Duplicated blocks have been rewritten to use .debug_ranges. */
- else if (old_die && TREE_STATIC (decl)
+ ??? Duplicated blocks have been rewritten to use .debug_ranges.
+
+ ??? The declare_in_namespace support causes us to get two DIEs for one
+ variable, both of which are declarations. We want to avoid considering
+ one to be a specification, so we must test that this DIE is not a
+ declaration. */
+ else if (old_die && TREE_STATIC (decl) && ! declaration
&& get_AT_flag (old_die, DW_AT_declaration) == 1)
{
/* This is a definition of a C++ class level static. */