aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2017-12-08 22:44:12 +0000
committerPedro Alves <palves@redhat.com>2017-12-08 23:37:31 +0000
commit927aa2e778dce440f4de5de8fc37ead1683a804e (patch)
treea50e6171c67f68fac150cf5f30774b542d306a3d /gdb/testsuite/gdb.dwarf2/gdb-index.exp
parentAdd gdb::hash_enum (diff)
downloadbinutils-gdb-927aa2e778dce440f4de5de8fc37ead1683a804e.tar.gz
binutils-gdb-927aa2e778dce440f4de5de8fc37ead1683a804e.tar.bz2
binutils-gdb-927aa2e778dce440f4de5de8fc37ead1683a804e.zip
DWARF-5: .debug_names index consumer
Some testcases needed to be updated as they were missing .debug_aranges. While that does not matter for no-index (as GDB builds the mapping internally during dwarf2_build_psymtabs_hard) and neither for .gdb_index (as GDB uses that internally built mapping which it stores into .gdb_index) it does matter for .debug_names as that simply assumes existing .debug_aranges from GCC. gdb/ChangeLog: 2017-12-08 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * defs.h (elf_sym_fns_debug_names): New declaration. * dwarf2read.c: Include "hash_enum.h". (mapped_debug_names): New. (struct dwarf2_per_objfile): Add debug_names, debug_aranges and debug_names_table. (dwarf2_elf_names): Add ".debug_names" and ".debug_aranges". (struct dwz_file): Add debug_names. (dwarf2_per_objfile::locate_sections): Handle debug_names and debug_aranges. (locate_dwz_sections): Handle debug_names. (create_signatured_type_table_from_debug_names) (create_addrmap_from_aranges): New. (dwarf2_read_index): Update function comment. (dwarf5_augmentation): Moved up. (read_debug_names_from_section, create_cus_from_debug_names_list) (create_cus_from_debug_names, dwarf2_read_debug_names): New. (dwarf5_djb_hash): Moved up. (dw2_debug_names_iterator): New. (read_indirect_string_at_offset): New declaration. (mapped_debug_names::namei_to_name) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_lookup_symbol) (dw2_debug_names_dump, dw2_debug_names_expand_symtabs_for_function) (dw2_debug_names_expand_symtabs_matching, dwarf2_debug_names_functions): New. (dwarf2_initialize_objfile): Return also elf_sym_fns_debug_names. (debug_names::djb_hash): Rename it to dwarf5_djb_hash. (debug_names::build): Update djb_hash caller. (write_debug_names): Move out and rename augmentation to dwarf5_augmentation. * elfread.c (elf_sym_fns_debug_names): New. * psymtab.h (dwarf2_debug_names_functions): New declaration. * symfile.h (struct dwarf2_debug_sections): Add debug_names and debug_aranges. * xcoffread.c (dwarf2_xcoff_names): Add debug_names and debug_aranges. gdb/testsuite/ChangeLog: 2017-12-08 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * gdb.base/maint.exp (check for .gdb_index): Check also for .debug_names. * gdb.dlang/watch-loc.c (.debug_aranges): New. * gdb.dwarf2/dw2-case-insensitive-debug.S: Likewise. * gdb.dwarf2/gdb-index.exp (check if index present, .gdb_index used) (.gdb_index used after symbol reloading): Support also .debug_names. * gdb.mi/dw2-ref-missing-frame-func.c (.debug_aranges): New.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/gdb-index.exp')
-rw-r--r--gdb/testsuite/gdb.dwarf2/gdb-index.exp19
1 files changed, 11 insertions, 8 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-index.exp
index c925b1ee47e..c7ddbbfe2b7 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-index.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-index.exp
@@ -58,7 +58,7 @@ proc add_gdb_index { program } {
return ${program_with_index}
}
-# Build a copy of the program with .gdb_index.
+# Build a copy of the program with an index (.gdb_index/.debug_names).
# But only if the toolchain didn't already create one: gdb doesn't support
# building an index from a program already using one.
@@ -67,6 +67,9 @@ gdb_test_multiple "mt print objfiles ${testfile}" $test {
-re "gdb_index.*${gdb_prompt} $" {
set binfile_with_index $binfile
}
+ -re "debug_names.*${gdb_prompt} $" {
+ set binfile_with_index $binfile
+ }
-re "Psymtabs.*${gdb_prompt} $" {
set binfile_with_index [add_gdb_index $binfile]
if { ${binfile_with_index} == "" } {
@@ -75,16 +78,16 @@ gdb_test_multiple "mt print objfiles ${testfile}" $test {
}
}
-# Ok, we have a copy of $binfile with .gdb_index.
+# Ok, we have a copy of $binfile with an index.
# Restart gdb and verify the index was used.
clean_restart ${binfile_with_index}
gdb_test "mt print objfiles ${testfile}" \
- "gdb_index.*" \
- ".gdb_index used"
+ "(gdb_index|debug_names).*" \
+ "index used"
-# Make gdb re-read symbols and see if .gdb_index still gets used.
-# symtab/15885
+# Make gdb re-read symbols and see if .gdb_index/.debug_names still
+# gets used. symtab/15885
# There is gdb_touch_execfile, but it doesn't handle remote hosts.
# Is touch portable enough?
@@ -98,5 +101,5 @@ if ![runto_main] {
return -1
}
gdb_test "mt print objfiles ${testfile}" \
- "gdb_index.*" \
- ".gdb_index used after symbol reloading"
+ "(gdb_index|debug_names).*" \
+ "index used after symbol reloading"