From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6303 invoked by alias); 22 Jun 2017 20:03:27 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 6264 invoked by uid 9674); 22 Jun 2017 20:03:26 -0000 Date: Thu, 22 Jun 2017 20:03:00 -0000 Message-ID: <20170622200326.6230.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] users/jkratoch/index: DWARF-5: .debug_names index consumer X-Git-Refname: refs/heads/users/jkratoch/index X-Git-Reftype: branch X-Git-Oldrev: 2b5a46380bbd3241b12049f79e3eb20a880d0eaa X-Git-Newrev: 458882a19f9d084b9a10444dc0d867085171162a X-SW-Source: 2017-q2/txt/msg00043.txt.bz2 List-Id: The branch, users/jkratoch/index has been updated discards 2b5a46380bbd3241b12049f79e3eb20a880d0eaa (commit) discards 8f65b17a537789c51eaf56c933377159fb99f038 (commit) discards dd8677e1f7b751b0bf808840dbcc0fa00ddcef49 (commit) discards b647fdee7e9f43d10d25e6b341cd45f9da90ff90 (commit) via 458882a19f9d084b9a10444dc0d867085171162a (commit) via eeb6810fc7fd76359517d882d861447ad063b37c (commit) via 17ceeb59d9c75ab41e5a3e6a2d89c5eb03324538 (commit) via e2936bef9ce99169f039e0e1b994852fee28582c (commit) from 2b5a46380bbd3241b12049f79e3eb20a880d0eaa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 458882a19f9d084b9a10444dc0d867085171162a Author: Jan Kratochvil Date: Thu Jun 22 20:18:21 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. (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. * 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. commit eeb6810fc7fd76359517d882d861447ad063b37c Author: Jan Kratochvil Date: Thu Jun 22 20:18:21 2017 +0200 Refactor: Move some generic code out of .gdb_index code Hi, just for the next patch. Jan gdb/ChangeLog 2017-05-26 Jan Kratochvil * dwarf2read.c (create_cu_from_index_list): New from ... (create_cus_from_index_list): ... this function, use it. (dw_expand_symtabs_matching_file_matcher) (dw2_expand_symtabs_matching_one): New from ... (dw2_expand_symtabs_matching): ... this function, use them. commit 17ceeb59d9c75ab41e5a3e6a2d89c5eb03324538 Author: Jan Kratochvil Date: Thu Jun 22 20:18:20 2017 +0200 Code cleanup: dwarf2_initialize_objfile return value Hi, dwarf2_initialize_objfile was returning boolean whether it is psymtabs or .gdb_index while now it needs to return also whether it is .debug_names. Jan gdb/ChangeLog 2017-05-26 Jan Kratochvil * defs.h (elf_sym_fns_lazy_psyms, elf_sym_fns_gdb_index): Move here declarations from elfread.c. (dwarf2_initialize_objfile): Change return value. * elfread.c (elf_sym_fns_lazy_psyms, elf_sym_fns_gdb_index): Move these declarations to defs.h. (elf_symfile_read): Adjust dwarf2_initialize_objfile caller. * symfile.h (dwarf2_initialize_objfile): Change return type. commit e2936bef9ce99169f039e0e1b994852fee28582c Author: Jan Kratochvil Date: Thu Jun 22 20:18:20 2017 +0200 DWARF-5: .debug_names index producer Hi, there are two FIXME lines I do not have a real answer for. Also I am not sure if the -dwarf-4 option for former .gdb_index should be named that way. And contrib/gdb-add-index.sh (incl. cc-with-tweaks.sh) has no commandline option for that -dwarf-4 GDB option. Jan gdb/ChangeLog 2017-05-26 Jan Kratochvil * contrib/gdb-add-index.sh (index): Rename to ... (index4): ... here. (index5, debugstr, debugstrmerge, debugstrerr): New variables. Support also .debug_names and .debug_str. * dwarf2read.c: Include cmath, locale, set, list. (INDEX_SUFFIX): Rename to ... (INDEX4_SUFFIX): ... here. (INDEX5_SUFFIX, DEBUG_STR_SUFFIX): New. (file_write, file_write, file_write): New. (data_buf::append_unsigned_leb128, data_buf::empty): New. (data_buf::file_write): Use ::file_write. (data_buf::operator const char *, debug_names, check_dwarf64_offsets): New. (psyms_seen_size, write_gdbindex): New from write_psymtabs_to_index code. (write_debug_names): New. (write_psymtabs_to_index): New parameter is_dwarf5. Support filename_str and out_file_str. Move code to write_gdbindex, possibly call write_debug_names. (save_gdb_index_command): New parameter -dwarf-4. (_initialize_dwarf2_read): Document the new parameter -dwarf-4. gdb/doc/ChangeLog 2017-05-26 Jan Kratochvil * gdb.texinfo (Index Files): Document .debug_names and -dwarf-4. (Index Section Format): Mention .debug_names. ----------------------------------------------------------------------- Summary of changes: gdb/doc/gdb.texinfo | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) First 500 lines of diff: diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 7411ce8..d2057ca 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -19246,11 +19246,13 @@ To create an index file, use the @code{save gdb-index} command: @table @code @item save gdb-index [-dwarf-4] @var{directory} @kindex save gdb-index -Create an index file for each symbol file currently known by -@value{GDBN}. Each file is named after its corresponding symbol file, -with @file{.debug_names} and @file{.debug_str} (or @file{.gdb-index} -from @code{-dwarf-4} option for older index consumers) appended, and is written -into the given @var{directory}. +Create index files for all symbol files currently known by +@value{GDBN}. For each known @var{symbol-file}, this command +by default creates 2 files: @file{@var{symbol-file}.debug_names} +and @file{@var{symbol-file}.debug_str}. If you invoke this +command with the @option{-dwarf-4} option, it produces a single +file @file{@var{symbol-file}.gdb-index}. The files are created +in the given @var{directory}. @end table Once you have created an index file you can merge it into your symbol hooks/post-receive -- Repository for Project Archer.