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: addons
Date: Sun, 02 Jul 2017 14:30:00 -0000	[thread overview]
Message-ID: <20170702143019.97474.qmail@sourceware.org> (raw)

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 <jan.kratochvil@redhat.com>
Date:   Sat Jul 1 17:24:41 2017 +0200

    addons

commit d0bbbf782b7f6b59659ae4c3f604a54dc0ad4225
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sat Jul 1 17:24:41 2017 +0200

    bfd5

commit 8cb3d56cdfb6a9a6d7488ce83b98781871e3bc23
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
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  <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.
    	(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  <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.

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

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.


             reply	other threads:[~2017-07-02 14:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-02 14:30 jkratoch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-07-02 20:23 jkratoch
2017-07-01 15:25 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=20170702143019.97474.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).