aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2009-03-26 14:47:19 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2009-03-26 14:47:19 +0000
commit442ddf5987d97d3d8fc9c3e64449417d4cec3190 (patch)
treed697b674588393743f88af467ee7f9501efb0f45 /gdb/dwarf2read.c
parent4a1f88fe96b6ac3069d7c76e2c07a8b8a5620356 (diff)
downloadgdb-442ddf5987d97d3d8fc9c3e64449417d4cec3190.zip
gdb-442ddf5987d97d3d8fc9c3e64449417d4cec3190.tar.gz
gdb-442ddf5987d97d3d8fc9c3e64449417d4cec3190.tar.bz2
gdb/
Recognize missing DW_AT_location as <value optimized out>. * dwarf2read.c (new_symbol <DW_TAG_variable> <!DW_AT_location> <!DW_AT_external>): Call add_symbol_to_list. gdb/testsuite/ * gdb.dwarf2/dw2-noloc-main.c: New file. * gdb.dwarf2/dw2-noloc.S: New symbols matrix. (.text): Remove. (.data): New. (DW_AT_stmt_list, .debug_line, DW_AT_frame_base): Remove. (DW_AT_low_pc, DW_AT_high_pc): Reference `dw2-noloc-main.c'. (DW_TAG_subprogram func_cu1, noloc): Remove. (main): New. * gdb.dwarf2/dw2-noloc.exp: Use prepare_for_testing, compile also `dw2-noloc-main.c'. Test the new DIEs from `dw2-noloc.S'. (file_symbols): New procedure.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index cf8f458..9ec4efa 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -7659,6 +7659,12 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
SYMBOL_CLASS (sym) = LOC_UNRESOLVED;
add_symbol_to_list (sym, &global_symbols);
}
+ else if (!die_is_declaration (die, cu))
+ {
+ /* Use the default LOC_OPTIMIZED_OUT class. */
+ gdb_assert (SYMBOL_CLASS (sym) == LOC_OPTIMIZED_OUT);
+ add_symbol_to_list (sym, cu->list_in_scope);
+ }
}
break;
case DW_TAG_formal_parameter: