public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  users/jkratoch/index: DWARF-5: .debug_names index consumer
Date: Fri, 09 Jun 2017 05:59:00 -0000	[thread overview]
Message-ID: <20170609055956.24844.qmail@sourceware.org> (raw)

The branch, users/jkratoch/index has been updated
  discards  c7f6411c229d620b21c1ba1a2b2c3e31e0510f87 (commit)
  discards  1543c177a2e69043840e853c1b88e5f5e5daf9cf (commit)
  discards  a78a92cb4fa771815767500628596cfaabfceabc (commit)
  discards  4117ad457ff2f226f1d10f00e7d7cce41ac1c771 (commit)
       via  0b088180e930a5337b7d01a67e08fe62c5fea441 (commit)
       via  b94ba00665671b17f8c105efc314ca8b11b31ded (commit)
       via  67ac1f63c84b6f0b39ba16f92222cba2a40ecb7c (commit)
       via  4926bfc3e33a2149a5d1fe9760f2e017757a3264 (commit)
      from  c7f6411c229d620b21c1ba1a2b2c3e31e0510f87 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 0b088180e930a5337b7d01a67e08fe62c5fea441
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu May 25 15:48:12 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  <jan.kratochvil@redhat.com>
    
    	* 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;
    	(DebugNamesNameTable::djb_hash): Rename it to dwarf5_djb_hash.
    	(DebugNamesNameTable::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  <jan.kratochvil@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.

commit b94ba00665671b17f8c105efc314ca8b11b31ded
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri May 26 19:35:41 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  <jan.kratochvil@redhat.com>
    
    	* 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 67ac1f63c84b6f0b39ba16f92222cba2a40ecb7c
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu May 25 23:33:21 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  <jan.kratochvil@redhat.com>
    
    	* 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 4926bfc3e33a2149a5d1fe9760f2e017757a3264
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu May 25 15:47:08 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  <jan.kratochvil@redhat.com>
    
    	* 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.
    	(DataBuf::append_unsigned_leb128, DataBuf::empty)
    	(DataBuf::operator const char *, DebugNamesNameTable, check_dwarf64_offsets): New.
    	(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  <jan.kratochvil@redhat.com>
    
    	* gdb.texinfo (Index Files): Document .debug_names and -dwarf-4.
    	(Index Section Format): Mention .debug_names.

-----------------------------------------------------------------------

Summary of changes:
 gdb/dwarf2read.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

First 500 lines of diff:
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index f3c8ddb..ab224d6 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -81,7 +81,7 @@
 #include <cmath>
 #include <locale>
 #include <set>
-#include <list>
+#include <forward_list>
 
 typedef struct symbol *symbolp;
 DEF_VEC_P (symbolp);
@@ -25262,7 +25262,7 @@ public:
       uint32_t hash;
       decltype (name_to_value_set)::const_iterator it;
     };
-    std::vector<std::list<HashItPair>> bucket_hash;
+    std::vector<std::forward_list<HashItPair>> bucket_hash;
     bucket_hash.resize (bucket_table.size ());
     for (decltype (name_to_value_set)::const_iterator it =
 						    name_to_value_set.cbegin ();
@@ -25275,11 +25275,13 @@ public:
 	HashItPair hashitpair;
 	hashitpair.hash = hash;
 	hashitpair.it = it;
-	bucket_hash[hash % bucket_hash.size()].push_back (std::move (hashitpair));
+	bucket_hash[hash % bucket_hash.size()].push_front
+						       (std::move (hashitpair));
       }
     for (size_t bucket_ix = 0; bucket_ix < bucket_hash.size (); ++bucket_ix)
       {
-	const std::list<HashItPair> &hashitlist (bucket_hash[bucket_ix]);
+	const std::forward_list<HashItPair> &hashitlist
+						       (bucket_hash[bucket_ix]);
 	if (hashitlist.empty ())
 	  continue;
 	uint32_t &bucket_slot (bucket_table[bucket_ix]);


hooks/post-receive
--
Repository for Project Archer.


             reply	other threads:[~2017-06-09  5:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09  5:59 jkratoch [this message]
2017-06-18 19:30 jkratoch
2017-06-22 18:34 jkratoch
2017-06-22 20:03 jkratoch
2017-06-28 21:21 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20170609055956.24844.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).