public inbox for
help / color / mirror / Atom feed
Subject: [SCM]  users/jkratoch/index: DWARF-5: .debug_names index consumer
Date: Thu, 22 Jun 2017 20:03:00 -0000	[thread overview]
Message-ID: <> (raw)

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
    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
    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.
    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
    	(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_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.
    	(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):
    	(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
    	* xcoffread.c (dwarf2_xcoff_names): Add debug_names and debug_aranges.
    2017-05-26  Jan Kratochvil  <>
    	* gdb.base/maint.exp (check for .gdb_index): Check also for
    	* 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
    just for the next patch.
    2017-05-26  Jan Kratochvil  <>
    	* dwarf2read.c (create_cu_from_index_list): New from ...
    	(create_cus_from_index_list): ... this function, use it.
    	(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
    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.
    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
    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/ (incl. has no
    commandline option for that -dwarf-4 GDB option.
    2017-05-26  Jan Kratochvil  <>
    	* contrib/ (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.
    	(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):
    	(psyms_seen_size, write_gdbindex): New from write_psymtabs_to_index
    	(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.
    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

Repository for Project Archer.

             reply	other threads:[~2017-06-22 20:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22 20:03 jkratoch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-06-28 21:21 jkratoch
2017-06-22 18:34 jkratoch
2017-06-18 19:30 jkratoch
2017-06-09  5:59 jkratoch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).