summaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2010-09-22 16:15:34 +0000
committerJoel Brobecker <brobecker@gnat.com>2010-09-22 16:15:34 +0000
commit72929c628e0547bcffcbb3e7b7afabb912ce246b (patch)
treef9da49dbda440c43d69894b0dfc714719674d976 /gdb/dwarf2read.c
parent496c0e1ba7bd2b8596d90cc6b2bc87cf5c1cff67 (diff)
downloadbinutils-gdb-72929c628e0547bcffcbb3e7b7afabb912ce246b.tar.gz
DWARF: Add support for DW_TAG_constant DIEs
gdb/ChangeLog: * dwarf2read.c (scan_partial_symbols): Add handling of DW_TAG_constant DIEs. (add_partial_symbol, load_partial_dies, new_symbol): Likewise. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-const.S, gdb.dwarf2/dw2-const.exp: New files.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index c4016b2dac4..082400e19db 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3466,6 +3466,7 @@ scan_partial_symbols (struct partial_die_info *first_die, CORE_ADDR *lowpc,
case DW_TAG_subprogram:
add_partial_subprogram (pdi, lowpc, highpc, need_pc, cu);
break;
+ case DW_TAG_constant:
case DW_TAG_variable:
case DW_TAG_typedef:
case DW_TAG_union_type:
@@ -3690,6 +3691,20 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
cu->language, objfile);
}
break;
+ case DW_TAG_constant:
+ {
+ struct psymbol_allocation_list *list;
+
+ if (pdi->is_external)
+ list = &objfile->global_psymbols;
+ else
+ list = &objfile->static_psymbols;
+ psym = add_psymbol_to_list (actual_name, strlen (actual_name),
+ built_actual_name, VAR_DOMAIN, LOC_STATIC,
+ list, 0, 0, cu->language, objfile);
+
+ }
+ break;
case DW_TAG_variable:
if (pdi->locdesc)
addr = decode_locdesc (pdi->locdesc, cu);
@@ -8567,6 +8582,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr,
static members). */
if (!load_all
&& !is_type_tag_for_partial (abbrev->tag)
+ && abbrev->tag != DW_TAG_constant
&& abbrev->tag != DW_TAG_enumerator
&& abbrev->tag != DW_TAG_subprogram
&& abbrev->tag != DW_TAG_lexical_block
@@ -8677,6 +8693,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr,
unit with load_all_dies set. */
if (load_all
+ || abbrev->tag == DW_TAG_constant
|| abbrev->tag == DW_TAG_subprogram
|| abbrev->tag == DW_TAG_variable
|| abbrev->tag == DW_TAG_namespace
@@ -10583,6 +10600,7 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
case DW_TAG_template_value_param:
suppress_add = 1;
/* Fall through. */
+ case DW_TAG_constant:
case DW_TAG_variable:
case DW_TAG_member:
/* Compilation with minimal debug info may result in variables