This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR debug/11816
- From: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 28 Jan 2004 23:59:46 +0100 (CET)
- Subject: [PATCH] Fix PR debug/11816
Hello,
after running into the issue described in PR 11816 (dwarf-2 info
for anonymous struct members is not generated), I've had a look;
it would appear this is easy to fix by the following patch.
Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux;
no regressions in the gdb testsuite.
OK for mainline/3.4?
Bye,
Ulrich
ChangeLog:
* dwarf2out.c (gen_decl_die): Handle anonymous struct members.
Index: gcc/dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.480
diff -c -p -r1.480 dwarf2out.c
*** gcc/dwarf2out.c 20 Jan 2004 22:29:20 -0000 1.480
--- gcc/dwarf2out.c 27 Jan 2004 20:14:27 -0000
*************** gen_decl_die (tree decl, dw_die_ref cont
*** 12079,12087 ****
case FIELD_DECL:
/* Ignore the nameless fields that are used to skip bits but handle C++
! anonymous unions. */
if (DECL_NAME (decl) != NULL_TREE
! || TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE)
{
gen_type_die (member_declared_type (decl), context_die);
gen_field_die (decl, context_die);
--- 12079,12088 ----
case FIELD_DECL:
/* Ignore the nameless fields that are used to skip bits but handle C++
! anonymous unions and structs. */
if (DECL_NAME (decl) != NULL_TREE
! || TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE
! || TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE)
{
gen_type_die (member_declared_type (decl), context_die);
gen_field_die (decl, context_die);
--
Dr. Ulrich Weigand
weigand@informatik.uni-erlangen.de