1 Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
2 ===================================================================
3 --- gdb-7.1.90.20100711.orig/gdb/dwarf2read.c 2010-07-12 23:07:35.000000000 +0200
4 +++ gdb-7.1.90.20100711/gdb/dwarf2read.c 2010-07-13 00:13:02.000000000 +0200
5 @@ -2251,6 +2251,7 @@ scan_partial_symbols (struct partial_die
6 add_partial_subprogram (pdi, lowpc, highpc, need_pc, cu);
9 + case DW_TAG_constant:
11 case DW_TAG_union_type:
12 if (!pdi->is_declaration)
13 @@ -2452,6 +2453,7 @@ add_partial_symbol (struct partial_die_i
17 + case DW_TAG_constant:
21 @@ -3289,6 +3291,7 @@ die_needs_namespace (struct die_info *di
25 + case DW_TAG_constant:
26 /* We only need to prefix "globally" visible variables. These include
27 any variable marked with DW_AT_external or any variable that
28 lives in a namespace. [Variables in anonymous namespaces
29 @@ -4638,7 +4641,8 @@ dwarf2_add_field (struct field_info *fip
30 fip->non_public_fields = 1;
33 - else if (die->tag == DW_TAG_member || die->tag == DW_TAG_variable)
34 + else if (die->tag == DW_TAG_member || die->tag == DW_TAG_variable
35 + || die->tag == DW_TAG_constant)
37 /* C++ static member. */
39 @@ -5250,7 +5254,8 @@ read_structure_type (struct die_info *di
40 while (child_die && child_die->tag)
42 if (child_die->tag == DW_TAG_member
43 - || child_die->tag == DW_TAG_variable)
44 + || child_die->tag == DW_TAG_variable
45 + || child_die->tag == DW_TAG_constant)
47 /* NOTE: carlton/2002-11-05: A C++ static data member
48 should be a DW_TAG_member that is a declaration, but
49 @@ -5396,6 +5401,7 @@ process_structure_scope (struct die_info
51 if (child_die->tag == DW_TAG_member
52 || child_die->tag == DW_TAG_variable
53 + || child_die->tag == DW_TAG_constant
54 || child_die->tag == DW_TAG_inheritance)
57 @@ -7109,6 +7115,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
58 && abbrev->tag != DW_TAG_subprogram
59 && abbrev->tag != DW_TAG_lexical_block
60 && abbrev->tag != DW_TAG_variable
61 + && abbrev->tag != DW_TAG_constant
62 && abbrev->tag != DW_TAG_namespace
63 && abbrev->tag != DW_TAG_module
64 && abbrev->tag != DW_TAG_member)
65 @@ -7217,6 +7224,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
67 || abbrev->tag == DW_TAG_subprogram
68 || abbrev->tag == DW_TAG_variable
69 + || abbrev->tag == DW_TAG_constant
70 || abbrev->tag == DW_TAG_namespace
71 || part_die->is_declaration)
73 @@ -9059,6 +9067,11 @@ new_symbol (struct die_info *die, struct
74 /* Do not add the symbol to any lists. It will be found via
75 BLOCK_FUNCTION from the blockvector. */
77 + case DW_TAG_constant:
78 + SYMBOL_TYPE (sym) = make_cv_type (1,
79 + TYPE_VOLATILE (SYMBOL_TYPE (sym)),
80 + SYMBOL_TYPE (sym), NULL);
84 /* Compilation with minimal debug info may result in variables