Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH v2 41/42] Make mapped_debug_names independent of objfile
Date: Tue, 12 May 2020 17:18:23 -0400	[thread overview]
Message-ID: <20200512211824.6834-42-simon.marchi@efficios.com> (raw)
In-Reply-To: <20200512210913.5593-1-simon.marchi@efficios.com>

mapped_debug_names currently has a dwarf2_per_objfile field.  Since we
want it to become objfile-independent, this field must be removed.

This patch removes it, and then arranges for all methods that needed it
to accept a dwarf2_per_objfile parameter.  This trickles down at various
places, like the dw2_debug_names_iterator type.

Ultimately, the objfile only seems to be needed because we might need to
read a string from the string section.  For that, we might need to read
in the section, and if it's a relocatable section, the objfile is needed
in order to do the relocation.  This pattern happens often (that we to
pass an objfile only because a section might be read).  I think it's a
bit ugly, but I don't have a good alternative right now.

gdb/ChangeLog:

	* dwarf2/read.c (struct mapped_index_base) <symbol_name_at,
	build_name_components, find_name_components_bounds>:
	Add per_objfile parameter.
	(struct mapped_index) <symbol_name_at>: Likewise.
	(struct mapped_debug_names): Remove constructor.
	<dwarf2_per_objfile>: Remove field.
	<namei_to_name, symbol_name_at>: Add per_objfile parameter.
	(mapped_index_base::find_name_components_bounds,
	mapped_index_base::build_name_components,
	dw2_expand_symtabs_matching_symbol): Likewise.
	(class mock_mapped_index) <symbol_name_at>: Likewise.
	(check_match): Likewise.
	(check_find_bounds_finds): Likewise.
	(test_mapped_index_find_name_component_bounds): Update.
	(CHECK_MATCH): Update.
	(dw2_expand_symtabs_matching): Update.
	(class dw2_debug_names_iterator) <dw2_debug_names_iterator>: Add
	per_objfile parameter.
	<find_vec_in_debug_names>: Likewise.
	<m_per_objfile>: New field.
	(mapped_debug_names::namei_to_name): Add dwarf2_per_objfile
	parameter.
	(dw2_debug_names_iterator::find_vec_in_debug_names): Likewise.
	(dw2_debug_names_iterator::next): Update.
	(dw2_debug_names_lookup_symbol): Update.
	(dw2_debug_names_expand_symtabs_for_function): Update.
	(dw2_debug_names_map_matching_symbols): Update.
	(dw2_debug_names_expand_symtabs_matching): Update.
	(dwarf2_read_debug_names): Update.
---
 gdb/dwarf2/read.c | 163 ++++++++++++++++++++++++++--------------------
 1 file changed, 91 insertions(+), 72 deletions(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 9bc19a089b0..3f93a51381f 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -164,7 +164,8 @@ struct mapped_index_base
   virtual size_t symbol_name_count () const = 0;
 
   /* Get the name of the symbol at IDX in the symbol table.  */
-  virtual const char *symbol_name_at (offset_type idx) const = 0;
+  virtual const char *symbol_name_at
+    (offset_type idx, dwarf2_per_objfile *per_objfile) const = 0;
 
   /* Return whether the name at IDX in the symbol table should be
      ignored.  */
@@ -175,7 +176,7 @@ struct mapped_index_base
 
   /* Build the symbol name component sorted vector, if we haven't
      yet.  */
-  void build_name_components ();
+  void build_name_components (dwarf2_per_objfile *per_objfile);
 
   /* Returns the lower (inclusive) and upper (exclusive) bounds of the
      possible matches for LN_NO_PARAMS in the name component
@@ -183,7 +184,8 @@ struct mapped_index_base
   std::pair<std::vector<name_component>::const_iterator,
 	    std::vector<name_component>::const_iterator>
     find_name_components_bounds (const lookup_name_info &ln_no_params,
-				 enum language lang) const;
+				 enum language lang,
+				 dwarf2_per_objfile *per_objfile) const;
 
   /* Prevent deleting/destroying via a base class pointer.  */
 protected:
@@ -221,7 +223,8 @@ struct mapped_index final : public mapped_index_base
 
   /* Convenience method to get at the name of the symbol at IDX in the
      symbol table.  */
-  const char *symbol_name_at (offset_type idx) const override
+  const char *symbol_name_at
+    (offset_type idx, dwarf2_per_objfile *per_objfile) const override
   { return this->constant_pool + MAYBE_SWAP (this->symbol_table[idx].name); }
 
   size_t symbol_name_count () const override
@@ -232,11 +235,6 @@ struct mapped_index final : public mapped_index_base
    Uninitialized map has CU_COUNT 0.  */
 struct mapped_debug_names final : public mapped_index_base
 {
-  mapped_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile_)
-  : dwarf2_per_objfile (dwarf2_per_objfile_)
-  {}
-
-  struct dwarf2_per_objfile *dwarf2_per_objfile;
   bfd_endian dwarf5_byte_order;
   bool dwarf5_is_dwarf64;
   bool augmentation_is_gdb;
@@ -268,13 +266,15 @@ struct mapped_debug_names final : public mapped_index_base
 
   std::unordered_map<ULONGEST, index_val> abbrev_map;
 
-  const char *namei_to_name (uint32_t namei) const;
+  const char *namei_to_name
+    (uint32_t namei, dwarf2_per_objfile *per_objfile) const;
 
   /* Implementation of the mapped_index_base virtual interface, for
      the name_components cache.  */
 
-  const char *symbol_name_at (offset_type idx) const override
-  { return namei_to_name (idx); }
+  const char *symbol_name_at
+    (offset_type idx, dwarf2_per_objfile *per_objfile) const override
+  { return namei_to_name (idx, per_objfile); }
 
   size_t symbol_name_count () const override
   { return this->name_count; }
@@ -3802,7 +3802,8 @@ make_sort_after_prefix_name (const char *search_name)
 std::pair<std::vector<name_component>::const_iterator,
 	  std::vector<name_component>::const_iterator>
 mapped_index_base::find_name_components_bounds
-  (const lookup_name_info &lookup_name_without_params, language lang) const
+  (const lookup_name_info &lookup_name_without_params, language lang,
+   dwarf2_per_objfile *per_objfile) const
 {
   auto *name_cmp
     = this->name_components_casing == case_sensitive_on ? strcmp : strcasecmp;
@@ -3815,7 +3816,7 @@ mapped_index_base::find_name_components_bounds
   auto lookup_compare_lower = [&] (const name_component &elem,
 				   const char *name)
     {
-      const char *elem_qualified = this->symbol_name_at (elem.idx);
+      const char *elem_qualified = this->symbol_name_at (elem.idx, per_objfile);
       const char *elem_name = elem_qualified + elem.name_offset;
       return name_cmp (elem_name, name) < 0;
     };
@@ -3825,7 +3826,7 @@ mapped_index_base::find_name_components_bounds
   auto lookup_compare_upper = [&] (const char *name,
 				   const name_component &elem)
     {
-      const char *elem_qualified = this->symbol_name_at (elem.idx);
+      const char *elem_qualified = this->symbol_name_at (elem.idx, per_objfile);
       const char *elem_name = elem_qualified + elem.name_offset;
       return name_cmp (name, elem_name) < 0;
     };
@@ -3874,7 +3875,7 @@ mapped_index_base::find_name_components_bounds
 /* See declaration.  */
 
 void
-mapped_index_base::build_name_components ()
+mapped_index_base::build_name_components (dwarf2_per_objfile *per_objfile)
 {
   if (!this->name_components.empty ())
     return;
@@ -3892,7 +3893,7 @@ mapped_index_base::build_name_components ()
       if (this->symbol_name_slot_invalid (idx))
 	continue;
 
-      const char *name = this->symbol_name_at (idx);
+      const char *name = this->symbol_name_at (idx, per_objfile);
 
       /* Add each name component to the name component table.  */
       unsigned int previous_len = 0;
@@ -3930,8 +3931,10 @@ mapped_index_base::build_name_components ()
   auto name_comp_compare = [&] (const name_component &left,
 				const name_component &right)
     {
-      const char *left_qualified = this->symbol_name_at (left.idx);
-      const char *right_qualified = this->symbol_name_at (right.idx);
+      const char *left_qualified
+	= this->symbol_name_at (left.idx, per_objfile);
+      const char *right_qualified
+	= this->symbol_name_at (right.idx, per_objfile);
 
       const char *left_name = left_qualified + left.name_offset;
       const char *right_name = right_qualified + right.name_offset;
@@ -3957,14 +3960,15 @@ dw2_expand_symtabs_matching_symbol
    const lookup_name_info &lookup_name_in,
    gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
    enum search_domain kind,
-   gdb::function_view<bool (offset_type)> match_callback)
+   gdb::function_view<bool (offset_type)> match_callback,
+   dwarf2_per_objfile *per_objfile)
 {
   lookup_name_info lookup_name_without_params
     = lookup_name_in.make_ignore_params ();
 
   /* Build the symbol name component sorted vector, if we haven't
      yet.  */
-  index.build_name_components ();
+  index.build_name_components (per_objfile);
 
   /* The same symbol may appear more than once in the range though.
      E.g., if we're looking for symbols that complete "w", and we have
@@ -4014,14 +4018,15 @@ dw2_expand_symtabs_matching_symbol
 
       auto bounds
 	= index.find_name_components_bounds (lookup_name_without_params,
-					     lang_e);
+					     lang_e, per_objfile);
 
       /* Now for each symbol name in range, check to see if we have a name
 	 match, and if so, call the MATCH_CALLBACK callback.  */
 
       for (; bounds.first != bounds.second; ++bounds.first)
 	{
-	  const char *qualified = index.symbol_name_at (bounds.first->idx);
+	  const char *qualified
+	    = index.symbol_name_at (bounds.first->idx, per_objfile);
 
 	  if (!name_matcher (qualified, lookup_name_without_params, NULL)
 	      || (symbol_matcher != NULL && !symbol_matcher (qualified)))
@@ -4074,7 +4079,8 @@ class mock_mapped_index : public mapped_index_base
   }
 
   /* Get the name of the symbol at IDX in the symbol table.  */
-  const char *symbol_name_at (offset_type idx) const override
+  const char *symbol_name_at
+    (offset_type idx, dwarf2_per_objfile *per_objfile) const override
   {
     return m_symbol_table[idx];
   }
@@ -4104,7 +4110,8 @@ check_match (const char *file, int line,
 	     mock_mapped_index &mock_index,
 	     const char *name, symbol_name_match_type match_type,
 	     bool completion_mode,
-	     std::initializer_list<const char *> expected_list)
+	     std::initializer_list<const char *> expected_list,
+	     dwarf2_per_objfile *per_objfile)
 {
   lookup_name_info lookup_name (name, match_type, completion_mode);
 
@@ -4129,14 +4136,14 @@ check_match (const char *file, int line,
 				      NULL, ALL_DOMAIN,
 				      [&] (offset_type idx)
   {
-    const char *matched_name = mock_index.symbol_name_at (idx);
+    const char *matched_name = mock_index.symbol_name_at (idx, per_objfile);
     const char *expected_str
       = expected_it == expected_end ? NULL : *expected_it++;
 
     if (expected_str == NULL || strcmp (expected_str, matched_name) != 0)
       mismatch (expected_str, matched_name);
     return true;
-  });
+  }, per_objfile);
 
   const char *expected_str
   = expected_it == expected_end ? NULL : *expected_it++;
@@ -4197,13 +4204,15 @@ static const char *test_symbols[] = {
 static bool
 check_find_bounds_finds (mapped_index_base &index,
 			 const char *search_name,
-			 gdb::array_view<const char *> expected_syms)
+			 gdb::array_view<const char *> expected_syms,
+			 dwarf2_per_objfile *per_objfile)
 {
   lookup_name_info lookup_name (search_name,
 				symbol_name_match_type::FULL, true);
 
   auto bounds = index.find_name_components_bounds (lookup_name,
-						   language_cplus);
+						   language_cplus,
+						   per_objfile);
 
   size_t distance = std::distance (bounds.first, bounds.second);
   if (distance != expected_syms.size ())
@@ -4212,7 +4221,7 @@ check_find_bounds_finds (mapped_index_base &index,
   for (size_t exp_elem = 0; exp_elem < distance; exp_elem++)
     {
       auto nc_elem = bounds.first + exp_elem;
-      const char *qualified = index.symbol_name_at (nc_elem->idx);
+      const char *qualified = index.symbol_name_at (nc_elem->idx, per_objfile);
       if (strcmp (qualified, expected_syms[exp_elem]) != 0)
 	return false;
     }
@@ -4228,7 +4237,7 @@ test_mapped_index_find_name_component_bounds ()
 {
   mock_mapped_index mock_index (test_symbols);
 
-  mock_index.build_name_components ();
+  mock_index.build_name_components (NULL /* per_objfile */);
 
   /* Test the lower-level mapped_index::find_name_component_bounds
      method in completion mode.  */
@@ -4238,8 +4247,9 @@ test_mapped_index_find_name_component_bounds ()
       "t1_func1",
     };
 
-    SELF_CHECK (check_find_bounds_finds (mock_index,
-					 "t1_func", expected_syms));
+    SELF_CHECK (check_find_bounds_finds
+		  (mock_index, "t1_func", expected_syms,
+		   NULL /* per_objfile */));
   }
 
   /* Check that the increment-last-char in the name matching algorithm
@@ -4249,14 +4259,15 @@ test_mapped_index_find_name_component_bounds ()
       "\377",
       "\377\377123",
     };
-    SELF_CHECK (check_find_bounds_finds (mock_index,
-					 "\377", expected_syms1));
+    SELF_CHECK (check_find_bounds_finds
+		  (mock_index, "\377", expected_syms1, NULL /* per_objfile */));
 
     static const char *expected_syms2[] = {
       "\377\377123",
     };
-    SELF_CHECK (check_find_bounds_finds (mock_index,
-					 "\377\377", expected_syms2));
+    SELF_CHECK (check_find_bounds_finds
+		  (mock_index, "\377\377", expected_syms2,
+		   NULL /* per_objfile */));
   }
 }
 
@@ -4282,7 +4293,7 @@ test_dw2_expand_symtabs_matching_symbol ()
   any_mismatch |= !check_match (__FILE__, __LINE__,			\
 				mock_index,				\
 				NAME, MATCH_TYPE, COMPLETION_MODE,	\
-				EXPECTED_LIST)
+				EXPECTED_LIST, NULL)
 
   /* Identity checks.  */
   for (const char *sym : test_symbols)
@@ -4705,7 +4716,7 @@ dw2_expand_symtabs_matching
       dw2_expand_marked_cus (dwarf2_per_objfile, idx, file_matcher,
 			     expansion_notify, kind);
       return true;
-    });
+    }, dwarf2_per_objfile);
 }
 
 /* A helper for dw2_find_pc_sect_compunit_symtab which finds the most specific
@@ -5132,9 +5143,8 @@ create_cus_from_debug_names (dwarf2_per_bfd *per_bfd,
 static bool
 dwarf2_read_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile)
 {
-  std::unique_ptr<mapped_debug_names> map
-    (new mapped_debug_names (dwarf2_per_objfile));
-  mapped_debug_names dwz_map (dwarf2_per_objfile);
+  std::unique_ptr<mapped_debug_names> map (new mapped_debug_names);
+  mapped_debug_names dwz_map;
   struct objfile *objfile = dwarf2_per_objfile->objfile;
 
   if (!read_debug_names_from_section (objfile, objfile_name (objfile),
@@ -5196,23 +5206,26 @@ class dw2_debug_names_iterator
   dw2_debug_names_iterator (const mapped_debug_names &map,
 			    gdb::optional<block_enum> block_index,
 			    domain_enum domain,
-			    const char *name)
+			    const char *name, dwarf2_per_objfile *per_objfile)
     : m_map (map), m_block_index (block_index), m_domain (domain),
-      m_addr (find_vec_in_debug_names (map, name))
+      m_addr (find_vec_in_debug_names (map, name, per_objfile)),
+      m_per_objfile (per_objfile)
   {}
 
   dw2_debug_names_iterator (const mapped_debug_names &map,
-			    search_domain search, uint32_t namei)
+			    search_domain search, uint32_t namei, dwarf2_per_objfile *per_objfile)
     : m_map (map),
       m_search (search),
-      m_addr (find_vec_in_debug_names (map, namei))
+      m_addr (find_vec_in_debug_names (map, namei, per_objfile)),
+      m_per_objfile (per_objfile)
   {}
 
   dw2_debug_names_iterator (const mapped_debug_names &map,
 			    block_enum block_index, domain_enum domain,
-			    uint32_t namei)
+			    uint32_t namei, dwarf2_per_objfile *per_objfile)
     : m_map (map), m_block_index (block_index), m_domain (domain),
-      m_addr (find_vec_in_debug_names (map, namei))
+      m_addr (find_vec_in_debug_names (map, namei, per_objfile)),
+      m_per_objfile (per_objfile)
   {}
 
   /* Return the next matching CU or NULL if there are no more.  */
@@ -5220,9 +5233,9 @@ class dw2_debug_names_iterator
 
 private:
   static const gdb_byte *find_vec_in_debug_names (const mapped_debug_names &map,
-						  const char *name);
+						  const char *name, dwarf2_per_objfile *per_objfile);
   static const gdb_byte *find_vec_in_debug_names (const mapped_debug_names &map,
-						  uint32_t namei);
+						  uint32_t namei, dwarf2_per_objfile *per_objfile);
 
   /* The internalized form of .debug_names.  */
   const mapped_debug_names &m_map;
@@ -5238,10 +5251,13 @@ class dw2_debug_names_iterator
   /* The list of CUs from the index entry of the symbol, or NULL if
      not found.  */
   const gdb_byte *m_addr;
+
+  dwarf2_per_objfile *m_per_objfile;
 };
 
 const char *
-mapped_debug_names::namei_to_name (uint32_t namei) const
+mapped_debug_names::namei_to_name
+  (uint32_t namei, dwarf2_per_objfile *dwarf2_per_objfile) const
 {
   const ULONGEST namei_string_offs
     = extract_unsigned_integer ((name_table_string_offs_reordered
@@ -5258,7 +5274,7 @@ mapped_debug_names::namei_to_name (uint32_t namei) const
 
 const gdb_byte *
 dw2_debug_names_iterator::find_vec_in_debug_names
-  (const mapped_debug_names &map, const char *name)
+  (const mapped_debug_names &map, const char *name, dwarf2_per_objfile *per_objfile)
 {
   int (*cmp) (const char *, const char *);
 
@@ -5294,7 +5310,7 @@ dw2_debug_names_iterator::find_vec_in_debug_names
       complaint (_("Wrong .debug_names with name index %u but name_count=%u "
 		   "[in module %s]"),
 		 namei, map.name_count,
-		 objfile_name (map.dwarf2_per_objfile->objfile));
+		 objfile_name (per_objfile->objfile));
       return NULL;
     }
 
@@ -5309,7 +5325,7 @@ dw2_debug_names_iterator::find_vec_in_debug_names
 
       if (full_hash == namei_full_hash)
 	{
-	  const char *const namei_string = map.namei_to_name (namei);
+	  const char *const namei_string = map.namei_to_name (namei, per_objfile);
 
 #if 0 /* An expensive sanity check.  */
 	  if (namei_full_hash != dwarf5_djb_hash (namei_string))
@@ -5339,14 +5355,14 @@ dw2_debug_names_iterator::find_vec_in_debug_names
 
 const gdb_byte *
 dw2_debug_names_iterator::find_vec_in_debug_names
-  (const mapped_debug_names &map, uint32_t namei)
+  (const mapped_debug_names &map, uint32_t namei, dwarf2_per_objfile *per_objfile)
 {
   if (namei >= map.name_count)
     {
       complaint (_("Wrong .debug_names with name index %u but name_count=%u "
 		   "[in module %s]"),
 		 namei, map.name_count,
-		 objfile_name (map.dwarf2_per_objfile->objfile));
+		 objfile_name (per_objfile->objfile));
       return NULL;
     }
 
@@ -5365,8 +5381,8 @@ dw2_debug_names_iterator::next ()
   if (m_addr == NULL)
     return NULL;
 
-  struct dwarf2_per_objfile *dwarf2_per_objfile = m_map.dwarf2_per_objfile;
-  struct objfile *objfile = dwarf2_per_objfile->objfile;
+  dwarf2_per_bfd *per_bfd = m_per_objfile->per_bfd;
+  struct objfile *objfile = m_per_objfile->objfile;
   bfd *const abfd = objfile->obfd;
 
  again:
@@ -5429,33 +5445,33 @@ dw2_debug_names_iterator::next ()
 	{
 	case DW_IDX_compile_unit:
 	  /* Don't crash on bad data.  */
-	  if (ull >= dwarf2_per_objfile->per_bfd->all_comp_units.size ())
+	  if (ull >= m_per_objfile->per_bfd->all_comp_units.size ())
 	    {
 	      complaint (_(".debug_names entry has bad CU index %s"
 			   " [in module %s]"),
 			 pulongest (ull),
-			 objfile_name (dwarf2_per_objfile->objfile));
+			 objfile_name (objfile));
 	      continue;
 	    }
-	  per_cu = dwarf2_per_objfile->per_bfd->get_cutu (ull);
+	  per_cu = per_bfd->get_cutu (ull);
 	  break;
 	case DW_IDX_type_unit:
 	  /* Don't crash on bad data.  */
-	  if (ull >= dwarf2_per_objfile->per_bfd->all_type_units.size ())
+	  if (ull >= per_bfd->all_type_units.size ())
 	    {
 	      complaint (_(".debug_names entry has bad TU index %s"
 			   " [in module %s]"),
 			 pulongest (ull),
-			 objfile_name (dwarf2_per_objfile->objfile));
+			 objfile_name (objfile));
 	      continue;
 	    }
-	  per_cu = &dwarf2_per_objfile->per_bfd->get_tu (ull)->per_cu;
+	  per_cu = &per_bfd->get_tu (ull)->per_cu;
 	  break;
 	case DW_IDX_die_offset:
 	  /* In a per-CU index (as opposed to a per-module index), index
 	     entries without CU attribute implicitly refer to the single CU.  */
 	  if (per_cu == NULL)
-	    per_cu = dwarf2_per_objfile->per_bfd->get_cu (0);
+	    per_cu = per_bfd->get_cu (0);
 	  break;
 	case DW_IDX_GNU_internal:
 	  if (!m_map.augmentation_is_gdb)
@@ -5471,7 +5487,7 @@ dw2_debug_names_iterator::next ()
     }
 
   /* Skip if already read in.  */
-  if (dwarf2_per_objfile->symtab_set_p (per_cu))
+  if (m_per_objfile->symtab_set_p (per_cu))
     goto again;
 
   /* Check static vs global.  */
@@ -5596,7 +5612,8 @@ dw2_debug_names_lookup_symbol (struct objfile *objfile, block_enum block_index,
     }
   const auto &map = *mapp;
 
-  dw2_debug_names_iterator iter (map, block_index, domain, name);
+  dw2_debug_names_iterator iter (map, block_index, domain, name,
+				 dwarf2_per_objfile);
 
   struct compunit_symtab *stab_best = NULL;
   struct dwarf2_per_cu_data *per_cu;
@@ -5660,7 +5677,8 @@ dw2_debug_names_expand_symtabs_for_function (struct objfile *objfile,
     {
       const mapped_debug_names &map = *dwarf2_per_objfile->per_bfd->debug_names_table;
 
-      dw2_debug_names_iterator iter (map, {}, VAR_DOMAIN, func_name);
+      dw2_debug_names_iterator iter (map, {}, VAR_DOMAIN, func_name,
+				     dwarf2_per_objfile);
 
       struct dwarf2_per_cu_data *per_cu;
       while ((per_cu = iter.next ()) != NULL)
@@ -5699,14 +5717,15 @@ dw2_debug_names_map_matching_symbols
     {
       /* The name was matched, now expand corresponding CUs that were
 	 marked.  */
-      dw2_debug_names_iterator iter (map, block_kind, domain, namei);
+      dw2_debug_names_iterator iter (map, block_kind, domain, namei,
+				     dwarf2_per_objfile);
 
       struct dwarf2_per_cu_data *per_cu;
       while ((per_cu = iter.next ()) != NULL)
 	dw2_expand_symtabs_matching_one (per_cu, dwarf2_per_objfile, nullptr,
 					 nullptr);
       return true;
-    });
+    }, dwarf2_per_objfile);
 
   /* It's a shame we couldn't do this inside the
      dw2_expand_symtabs_matching_symbol callback, but that skips CUs
@@ -5764,14 +5783,14 @@ dw2_debug_names_expand_symtabs_matching
     {
       /* The name was matched, now expand corresponding CUs that were
 	 marked.  */
-      dw2_debug_names_iterator iter (map, kind, namei);
+      dw2_debug_names_iterator iter (map, kind, namei, dwarf2_per_objfile);
 
       struct dwarf2_per_cu_data *per_cu;
       while ((per_cu = iter.next ()) != NULL)
 	dw2_expand_symtabs_matching_one (per_cu, dwarf2_per_objfile,
 					 file_matcher, expansion_notify);
       return true;
-    });
+    }, dwarf2_per_objfile);
 }
 
 const struct quick_symbol_functions dwarf2_debug_names_functions =
-- 
2.26.2



  parent reply	other threads:[~2020-05-12 21:19 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 21:08 [PATCH v2 00/42] Share DWARF partial symtabs between objfiles Simon Marchi
2020-05-12 21:08 ` [PATCH v2 01/42] Introduce dwarf2_per_objfile::obstack Simon Marchi
2020-05-12 21:08 ` [PATCH v2 02/42] Add "objfile" parameter to two partial_symtab methods Simon Marchi
2020-05-12 21:08 ` [PATCH v2 03/42] Add dwarf2_per_cu_data::index Simon Marchi
2020-05-12 21:08 ` [PATCH v2 04/42] Add dwarf2_per_objfile member to DWARF batons Simon Marchi
2020-05-12 21:08 ` [PATCH v2 05/42] Split dwarf2_per_objfile into dwarf2_per_objfile and dwarf2_per_bfd Simon Marchi
2020-05-12 21:08 ` [PATCH v2 06/42] Remove symtab links from dwarf2_psymtab and dwarf2_per_cu_quick_data Simon Marchi
2020-05-12 21:08 ` [PATCH v2 07/42] Move die_type_hash to dwarf2_per_objfile Simon Marchi
2020-05-12 21:08 ` [PATCH v2 08/42] Add dwarf2_per_objfile field to dwarf2_cu Simon Marchi
2020-05-12 21:08 ` [PATCH v2 09/42] Remove reference to dwarf2_per_cu_data::dwarf2_per_objfile in dw2_do_instantiate_symtab Simon Marchi
2020-05-12 21:11 ` [PATCH v2 10/42] Remove dwarf2_cu->per_cu->dwarf2_per_objfile references Simon Marchi
2020-05-12 21:11 ` [PATCH v2 11/42] Add dwarf2_per_bfd field to dwarf2_per_cu_data Simon Marchi
2020-05-12 21:11 ` [PATCH v2 12/42] Make dwarf2_get_dwz_file take a dwarf2_per_bfd Simon Marchi
2020-05-12 21:11 ` [PATCH v2 13/42] Use bfd_get_filename instead of objfile_name in lookup_dwo_unit Simon Marchi
2020-05-12 21:11 ` [PATCH v2 14/42] Add dwarf2_per_objfile parameter to cutu_reader's constructors Simon Marchi
2020-05-12 21:11 ` [PATCH v2 15/42] Make queue_and_load_dwo_tu receive a dwarf2_cu Simon Marchi
2020-05-22 20:45   ` Tom Tromey
2020-05-25 19:10     ` Simon Marchi
2020-05-12 21:11 ` [PATCH v2 16/42] Remove dwarf2_per_cu_data::dwarf2_per_objfile reference in cutu_reader::keep Simon Marchi
2020-05-12 21:11 ` [PATCH v2 17/42] Add dwarf2_per_objfile parameter to create_partial_symtab Simon Marchi
2020-05-12 21:11 ` [PATCH v2 18/42] Add dwarf2_per_objfile parameter to recursively_compute_inclusions Simon Marchi
2020-05-12 21:11 ` [PATCH v2 19/42] Add dwarf2_per_objfile parameter to process_full_{comp, type}_unit Simon Marchi
2020-05-12 21:12 ` [PATCH v2 20/42] Pass dwarf2_cu objects to dwo-related functions, instead of dwarf2_per_cu_data Simon Marchi
2020-05-12 21:12 ` [PATCH v2 21/42] Remove reference to dwarf2_per_cu_data::dwarf2_per_objfile in queue_and_load_all_dwo_tus Simon Marchi
2020-05-12 21:12 ` [PATCH v2 22/42] Move int type methods out of dwarf2_per_cu_data Simon Marchi
2020-05-12 21:12 ` [PATCH v2 23/42] Add dwarf2_per_objfile to dwarf_expr_context and dwarf2_frame_cache Simon Marchi
2020-05-22 21:04   ` Tom Tromey
2020-05-25 19:50     ` Simon Marchi
2020-05-28  1:44       ` Simon Marchi
2020-05-12 21:12 ` [PATCH v2 24/42] Remove dwarf2_per_cu_data::text_offset Simon Marchi
2020-05-12 21:12 ` [PATCH v2 25/42] Add dwarf2_per_objfile parameter to dwarf2_read_addr_index Simon Marchi
2020-05-12 21:12 ` [PATCH v2 26/42] Add dwarf2_per_objfile parameter to allocate_piece_closure Simon Marchi
2020-05-12 21:12 ` [PATCH v2 27/42] Add dwarf2_per_objfile parameters to dwarf2_fetch_* functions Simon Marchi
2020-05-12 21:12 ` [PATCH v2 28/42] Remove dwarf2_per_cu_data::objfile () Simon Marchi
2020-05-27 16:27   ` Tom de Vries
2020-05-27 16:52     ` Tom de Vries
2020-05-27 20:03     ` Simon Marchi
2020-05-27 21:08       ` Tom de Vries
2020-05-27 21:55         ` Simon Marchi
2020-05-27 22:16           ` Simon Marchi
2020-05-28  2:00             ` Simon Marchi
2020-05-28 13:05               ` Tom de Vries
2020-05-28 15:33                 ` Simon Marchi
2020-05-28 16:24                   ` Christian Biesinger
2020-05-28 16:52                     ` Simon Marchi
2020-05-28 19:49                       ` Simon Marchi
2020-05-12 21:12 ` [PATCH v2 29/42] Add dwarf2_per_objfile parameter to free_one_cached_comp_unit Simon Marchi
2020-05-12 21:17 ` [PATCH v2 30/42] Add dwarf2_per_objfile parameter to get_die_type_at_offset Simon Marchi
2020-05-12 21:17 ` [PATCH v2 31/42] Remove leftover references to dwarf2_per_cu_data::dwarf2_per_objfile Simon Marchi
2020-05-12 21:17 ` [PATCH v2 32/42] Remove dwarf2_per_cu_data::dwarf2_per_objfile Simon Marchi
2020-05-12 21:17 ` [PATCH v2 33/42] Split type_unit_group Simon Marchi
2020-05-13  9:54   ` Tom de Vries
2020-05-13 15:06     ` Simon Marchi
2020-05-12 21:17 ` [PATCH v2 34/42] Move signatured_type::type to unshareable object Simon Marchi
2020-05-12 21:17 ` [PATCH v2 35/42] Pass dwarf2_per_bfd instead of dwarf2_per_objfile to some index-related functions Simon Marchi
2020-05-12 21:17 ` [PATCH v2 36/42] Pass dwarf2_cu to process_full_{comp,type}_unit Simon Marchi
2020-05-12 21:17 ` [PATCH v2 37/42] Make load_cu return the loaded dwarf2_cu Simon Marchi
2020-05-12 21:17 ` [PATCH v2 38/42] Add comp_unit_head to dwarf2_per_cu_data Simon Marchi
2020-05-12 21:17 ` [PATCH v2 39/42] Pass existing_cu object to cutu_reader Simon Marchi
2020-05-22 20:57   ` Tom Tromey
2020-05-25 19:10     ` Simon Marchi
2020-05-12 21:18 ` [PATCH v2 40/42] Replace dwarf2_per_cu_data::cu backlink with per-objfile map Simon Marchi
2020-05-12 21:18 ` Simon Marchi [this message]
2020-05-22 21:01   ` [PATCH v2 41/42] Make mapped_debug_names independent of objfile Tom Tromey
2020-05-25 19:53     ` Simon Marchi
2020-05-12 21:18 ` [PATCH v2 42/42] Share DWARF partial symtabs Simon Marchi
2020-05-13 10:17 ` [PATCH v2 00/42] Share DWARF partial symtabs between objfiles Tom de Vries
2020-05-13 15:46   ` Simon Marchi
2020-05-22 21:02     ` Tom Tromey
2020-05-25 19:53       ` Simon Marchi
2020-05-13 14:52 ` Simon Marchi
2020-05-22 21:07 ` Tom Tromey
2020-05-23 12:24   ` Pedro Alves
2020-05-25 19:56     ` Simon Marchi
2020-05-26 11:17       ` Pedro Alves
2020-05-26 15:35         ` Simon Marchi
2020-05-26 21:34           ` Simon Marchi
2020-05-27  5:08             ` Simon Marchi
2020-05-27 14:53               ` Simon Marchi
2020-05-27 15:51                 ` Simon Marchi
2020-05-29 10:23                   ` Tom de Vries
2020-05-29 12:55                     ` Tom de Vries
2020-05-31  4:16                     ` Simon Marchi
2020-05-31 14:22                       ` Tom de Vries
2020-06-02 21:27                         ` Simon Marchi
2020-06-04 17:55                           ` Tom de Vries
2020-06-04 18:04                             ` Simon Marchi
2020-06-10  3:43                               ` Simon Marchi
2020-06-12  3:25                                 ` Tom Tromey
2020-05-27 14:50 ` [PATCH v2 41.5/42] Move line_header_hash to dwarf2_per_objfile Simon Marchi
2020-05-27 15:07   ` Tom Tromey
2020-05-27 15:10     ` Simon Marchi

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=20200512211824.6834-42-simon.marchi@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@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