e5611bf
Index: gdb-6.8.50.20090803/gdb/dwarf2read.c
407ebe9
===================================================================
e5611bf
--- gdb-6.8.50.20090803.orig/gdb/dwarf2read.c	2009-08-04 06:32:58.000000000 +0200
e5611bf
+++ gdb-6.8.50.20090803/gdb/dwarf2read.c	2009-08-04 06:33:18.000000000 +0200
e5611bf
@@ -2459,6 +2459,7 @@ scan_partial_symbols (struct partial_die
a1707b2
 	      add_partial_subprogram (pdi, lowpc, highpc, need_pc, cu);
e3c8b47
 	      break;
e3c8b47
 	    case DW_TAG_variable:
e3c8b47
+	    case DW_TAG_constant:
e3c8b47
 	    case DW_TAG_typedef:
e3c8b47
 	    case DW_TAG_union_type:
e3c8b47
 	      if (!pdi->is_declaration)
e5611bf
@@ -2654,6 +2655,7 @@ add_partial_symbol (struct partial_die_i
e3c8b47
 	}
e3c8b47
       break;
e3c8b47
     case DW_TAG_variable:
e3c8b47
+    case DW_TAG_constant:
e3c8b47
       if (pdi->is_external)
e3c8b47
 	{
e3c8b47
 	  /* Global Variable.
e5611bf
@@ -4790,7 +4792,8 @@ dwarf2_add_field (struct field_info *fip
e3c8b47
 	  fip->non_public_fields = 1;
e3c8b47
 	}
e3c8b47
     }
e3c8b47
-  else if (die->tag == DW_TAG_member || die->tag == DW_TAG_variable)
e3c8b47
+  else if (die->tag == DW_TAG_member || die->tag == DW_TAG_variable
e3c8b47
+	   || die->tag == DW_TAG_constant)
e3c8b47
     {
e3c8b47
       /* C++ static member.  */
e3c8b47
 
e5611bf
@@ -5297,7 +5300,8 @@ read_structure_type (struct die_info *di
e3c8b47
       while (child_die && child_die->tag)
e3c8b47
 	{
e3c8b47
 	  if (child_die->tag == DW_TAG_member
e3c8b47
-	      || child_die->tag == DW_TAG_variable)
e3c8b47
+	      || child_die->tag == DW_TAG_variable
e3c8b47
+	      || child_die->tag == DW_TAG_constant)
e3c8b47
 	    {
e3c8b47
 	      /* NOTE: carlton/2002-11-05: A C++ static data member
e3c8b47
 		 should be a DW_TAG_member that is a declaration, but
e5611bf
@@ -5416,6 +5420,7 @@ process_structure_scope (struct die_info
e3c8b47
     {
e3c8b47
       if (child_die->tag == DW_TAG_member
e3c8b47
 	  || child_die->tag == DW_TAG_variable
e3c8b47
+	  || child_die->tag == DW_TAG_constant
e3c8b47
 	  || child_die->tag == DW_TAG_inheritance)
e3c8b47
 	{
e3c8b47
 	  /* Do nothing.  */
e5611bf
@@ -6926,6 +6931,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
e3c8b47
 	  && abbrev->tag != DW_TAG_subprogram
407ebe9
 	  && abbrev->tag != DW_TAG_lexical_block
e3c8b47
 	  && abbrev->tag != DW_TAG_variable
e3c8b47
+	  && abbrev->tag != DW_TAG_constant
e3c8b47
 	  && abbrev->tag != DW_TAG_namespace
e3c8b47
 	  && abbrev->tag != DW_TAG_member)
e5611bf
 	{
e5611bf
@@ -7033,6 +7039,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
e3c8b47
       if (load_all
e3c8b47
 	  || abbrev->tag == DW_TAG_subprogram
e3c8b47
 	  || abbrev->tag == DW_TAG_variable
e3c8b47
+	  || abbrev->tag == DW_TAG_constant
e3c8b47
 	  || abbrev->tag == DW_TAG_namespace
e3c8b47
 	  || part_die->is_declaration)
e3c8b47
 	{
e5611bf
@@ -8840,6 +8847,11 @@ new_symbol (struct die_info *die, struct
e3c8b47
 	  /* Do not add the symbol to any lists.  It will be found via
e3c8b47
 	     BLOCK_FUNCTION from the blockvector.  */
e3c8b47
 	  break;
e3c8b47
+	case DW_TAG_constant:
e3c8b47
+	  SYMBOL_TYPE (sym) = make_cv_type (1,
e3c8b47
+					    TYPE_VOLATILE (SYMBOL_TYPE (sym)),
e3c8b47
+					    SYMBOL_TYPE (sym), NULL);
e3c8b47
+	  /* PASSTHRU */
e3c8b47
 	case DW_TAG_variable:
e3c8b47
 	  /* Compilation with minimal debug info may result in variables
e3c8b47
 	     with missing type entries. Change the misleading `void' type