aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorPaul Koning <ni1d@arrl.net>2012-10-23 18:44:27 +0000
committerPaul Koning <ni1d@arrl.net>2012-10-23 18:44:27 +0000
commit105671ecf73cdfcacc5d6fa29f1235c11b8f9a47 (patch)
treec683ea50ebea1be10dfc5c7e2eee5a1f7bfb42fc /gcc/dwarf2out.c
parent9ce99b8c2650fef738948b397df1088b5b6a2035 (diff)
PR debug/54508
* dwarf2out.c (prune_unused_types_prune): If pruning a class and not all its children were marked, add DW_AT_declaration flag. * g++.dg/debug/dwarf2/pr54508.C: New. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@192739 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index bc5868b6a25..bed3d67353a 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -21220,6 +21220,7 @@ static void
prune_unused_types_prune (dw_die_ref die)
{
dw_die_ref c;
+ int pruned = 0;
gcc_assert (die->die_mark);
prune_unused_types_update_strings (die);
@@ -21242,13 +21243,24 @@ prune_unused_types_prune (dw_die_ref die)
prev->die_sib = c->die_sib;
die->die_child = prev;
}
- return;
+ pruned = 1;
+ goto finished;
}
if (c != prev->die_sib)
- prev->die_sib = c;
+ {
+ prev->die_sib = c;
+ pruned = 1;
+ }
prune_unused_types_prune (c);
} while (c != die->die_child);
+
+ finished:
+ /* If we pruned children, and this is a class, mark it as a
+ declaration to inform debuggers that this is not a complete
+ class definition. */
+ if (pruned && die->die_mark == 1 && class_scope_p (die))
+ add_AT_flag (die, DW_AT_declaration, 1);
}
/* Remove dies representing declarations that we never use. */