This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR39285, missing debug info for enum values


We fail to emit debug info values for enums as they seem to be put it
CONST_DECLs in some cases now.  This has been fixed for SDB with

2008-10-08  Kai Tietz  <kai.tietz@onevision.com>

        * sdbout.c (sdbout_one_type): Treat the value type
        CONST_DECL for enumerals.

already.  The following fixes it for dwarf.

Bootstrap & regtest running on x86_64-unknown-linux-gnu, I'll apply
this once it succeeded.

Richard.


2009-02-24  Richard Guenther  <rguenther@suse.de>

	PR debug/39285
	* dwarf2out.c (gen_enumeration_type_die): Handle CONST_DECLs.

Index: gcc/dwarf2out.c
===================================================================
*** gcc/dwarf2out.c	(revision 144404)
--- gcc/dwarf2out.c	(working copy)
*************** gen_enumeration_type_die (tree type, dw_
*** 13234,13239 ****
--- 13234,13242 ----
  	  add_name_attribute (enum_die,
  			      IDENTIFIER_POINTER (TREE_PURPOSE (link)));
  
+ 	  if (TREE_CODE (value) == CONST_DECL)
+ 	    value = DECL_INITIAL (value);
+ 
  	  if (host_integerp (value, TYPE_UNSIGNED (TREE_TYPE (value))))
  	    /* DWARF2 does not provide a way of indicating whether or
  	       not enumeration constants are signed or unsigned.  GDB


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]