[PATCH] Fix PR debug/11816
Ulrich Weigand
weigand@i1.informatik.uni-erlangen.de
Wed Jan 28 22:59:00 GMT 2004
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
More information about the Gcc-bugs
mailing list