From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97995 invoked by alias); 2 Jul 2017 14:30:45 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 97514 invoked by uid 9674); 2 Jul 2017 14:30:19 -0000 Date: Sun, 02 Jul 2017 14:30:00 -0000 Message-ID: <20170702143019.97474.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] users/jkratoch/index: addons X-Git-Refname: refs/heads/users/jkratoch/index X-Git-Reftype: branch X-Git-Oldrev: e1fd680ae2861d484d0747145d5bcc5cbb706e63 X-Git-Newrev: 9e9e2bebb4e198c1e8ab70fa1abd8d91679eb295 X-SW-Source: 2017-q3/txt/msg00001.txt.bz2 List-Id: The branch, users/jkratoch/index has been updated discards e1fd680ae2861d484d0747145d5bcc5cbb706e63 (commit) discards f721e806396f0ff007be23413a21ac4c8522590d (commit) discards 04f63cd7971a2bad4f510c3c2d3edd0a549c8348 (commit) via 9e9e2bebb4e198c1e8ab70fa1abd8d91679eb295 (commit) via d0bbbf782b7f6b59659ae4c3f604a54dc0ad4225 (commit) via 8cb3d56cdfb6a9a6d7488ce83b98781871e3bc23 (commit) from e1fd680ae2861d484d0747145d5bcc5cbb706e63 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 9e9e2bebb4e198c1e8ab70fa1abd8d91679eb295 Author: Jan Kratochvil Date: Sat Jul 1 17:24:41 2017 +0200 addons commit d0bbbf782b7f6b59659ae4c3f604a54dc0ad4225 Author: Jan Kratochvil Date: Sat Jul 1 17:24:41 2017 +0200 bfd5 commit 8cb3d56cdfb6a9a6d7488ce83b98781871e3bc23 Author: Jan Kratochvil Date: Sat Jul 1 17:24:41 2017 +0200 DWARF-5: .debug_names index consumer Hi, it is not regression-free against no-index but it is regression-free against .gdb_index. That is because .gdb_index is not regression-free against no-index. 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. I tried some performance checking but the index handling speed is negligible compared to the CU expansion associated with it. .debug_names looked even as a bit faster to me than .gdb_index which rather surprised me but I did not investigate it more. Jan gdb/ChangeLog 2017-05-26 Jan Kratochvil * defs.h (elf_sym_fns_debug_names): New declaration. * dwarf2read.c (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_locate_sections): Add debug_names and debug_aranges. (locate_dwz_sections): Add debug_names. (create_signatured_type_table_from_debug_names) (create_addrmap_from_aranges): New. (dwarf2_read_index): Update function comment. (dwarf5_augmentation): New from write_debug_names. (read_debug_names_from_section, create_cus_from_debug_names_list) (create_cus_from_debug_names, dwarf2_read_debug_names): New. (dwarf5_djb_hash): Function renamed from DebugNamesNameTable::djb_hash. (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::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. (dwarf2_free_objfile): Delete also debug_names_table; (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-05-26 Jan Kratochvil * 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. ----------------------------------------------------------------------- Summary of changes: gdb/dwarf2read.c | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) First 500 lines of diff: diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index dad1f3e..3dcb07a 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -218,6 +218,7 @@ class mapped_debug_names public: bfd_endian dwarf5_byte_order; bool dwarf5_is_dwarf64; + bool augmentation_is_gdb; uint8_t offset_size; uint32_t cu_count = 0; uint32_t tu_count, bucket_count, name_count; @@ -3700,6 +3701,9 @@ dwarf2_read_index (struct objfile *objfile) return 1; } +/* DWARF-5 augmentation string for GDB's DW_IDX_GNU_* extension. */ +static const gdb_byte dwarf5_augmentation[] = { 'G', 'D', 'B', 0 }; + /* A helper function that reads the .debug_names from SECTION and fills in MAP. FILENAME is the name of the file containing the section; it is used for error reporting. @@ -3815,6 +3819,10 @@ read_debug_names_from_section (struct objfile *objfile, string. This value is rounded up to a multiple of 4. */ augmentation_string_size = read_4_bytes (abfd, addr); addr += 4; + map.augmentation_is_gdb = ((augmentation_string_size + == sizeof (dwarf5_augmentation)) + && memcmp (addr, dwarf5_augmentation, + sizeof (dwarf5_augmentation)) == 0); augmentation_string_size += (-augmentation_string_size) & 3; addr += augmentation_string_size; @@ -5246,10 +5254,14 @@ dw2_debug_names_iterator::next () per_cu = dw2_get_cutu (ull); break; case DW_IDX_GNU_static: + if (!map.augmentation_is_gdb) + break; have_is_static = true; is_static = true; break; case DW_IDX_GNU_external: + if (!map.augmentation_is_gdb) + break; have_is_static = true; is_static = false; break; @@ -25692,9 +25704,9 @@ write_debug_names (struct objfile *objfile, FILE *out_file, FILE *out_file_str) to_underlying (per_cu.sect_off)); } - const gdb_byte augmentation[] = { 'G', 'D', 'B', 0 }; const offset_type bytes_of_header ((dwarf5_is_dwarf64 ? 12 : 4) - + 2 + 2 + 7 * 4 + sizeof (augmentation)); + + 2 + 2 + 7 * 4 + + sizeof (dwarf5_augmentation)); size_t expected_bytes (0); expected_bytes += bytes_of_header; expected_bytes += cu_list.size (); @@ -25744,9 +25756,9 @@ write_debug_names (struct objfile *objfile, FILE *out_file, FILE *out_file_str) /* augmentation_string_size - The size in bytes of the augmentation string. This value is rounded up to a multiple of 4. */ - static_assert (sizeof (augmentation) % 4 == 0); - header.append_uint (4, dwarf5_byte_order, sizeof (augmentation)); - header.append_data (augmentation); + static_assert (sizeof (dwarf5_augmentation) % 4 == 0); + header.append_uint (4, dwarf5_byte_order, sizeof (dwarf5_augmentation)); + header.append_data (dwarf5_augmentation); gdb_assert (header.size () == bytes_of_header); hooks/post-receive -- Repository for Project Archer.