[2/4] gdb/dwarf2: move some things to read.h

Message ID 20230213145559.46676-3-simon.marchi@polymtl.ca
State New
Headers
Series Move index reading code out of dwarf2/read.c |

Commit Message

Simon Marchi Feb. 13, 2023, 2:55 p.m. UTC
  The following 2 patches move .gdb_index and .debug_names reading code to
their own file.  Prepare this by exposing some things used by that code
to read.h.

Change-Id: If8ef135758a2ff0ab3b765cc92596da8189f3bbd
---
 gdb/dwarf2/read.c | 211 +++-------------------------------------------
 gdb/dwarf2/read.h | 206 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 219 insertions(+), 198 deletions(-)
  

Comments

Tom Tromey Feb. 13, 2023, 11:33 p.m. UTC | #1
>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> The following 2 patches move .gdb_index and .debug_names reading code to
Simon> their own file.  Prepare this by exposing some things used by that code
Simon> to read.h.

Simon> +/* If FILE_MATCHER is NULL or if PER_CU has
Simon> +   dwarf2_per_cu_quick_data::MARK set (see
Simon> +   dw_expand_symtabs_matching_file_matcher), expand the CU and call
Simon> +   EXPANSION_NOTIFY on it.  */
Simon> +
Simon> +bool
Simon> +dw2_expand_symtabs_matching_one
Simon> +  (dwarf2_per_cu_data *per_cu,
Simon> +   dwarf2_per_objfile *per_objfile,
Simon> +   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
Simon> +   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify);

Don't we normally write "extern" in headers?

Also normally in declarations the type is on the same line as the
function name.

Simon> +/* This is a view into the index that converts from bytes to an
Simon> +   offset_type, and allows indexing.  Unaligned bytes are specifically
Simon> +   allowed here, and handled via unpacking.  */
Simon> +
Simon> +class offset_view
Simon> +{
Simon> +public:
Simon> +  offset_view () = default;

I think this type should be specific to .gdb_index.  It shouldn't be
needed anywhere else -- it's there to work around the lack of alignment.

If it is needed somewhere else, I suppose it's fine, it would just be
better to refactor so that this can be an implementation detail of
.gdb_index again.

Tom
  
Thiago Jung Bauermann Feb. 14, 2023, 2:24 a.m. UTC | #2
Tom Tromey <tom@tromey.com> writes:

>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Simon> The following 2 patches move .gdb_index and .debug_names reading code to
> Simon> their own file.  Prepare this by exposing some things used by that code
> Simon> to read.h.
>
> Simon> +/* If FILE_MATCHER is NULL or if PER_CU has
> Simon> +   dwarf2_per_cu_quick_data::MARK set (see
> Simon> +   dw_expand_symtabs_matching_file_matcher), expand the CU and call
> Simon> +   EXPANSION_NOTIFY on it.  */
> Simon> +
> Simon> +bool
> Simon> +dw2_expand_symtabs_matching_one
> Simon> +  (dwarf2_per_cu_data *per_cu,
> Simon> +   dwarf2_per_objfile *per_objfile,
> Simon> +   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
> Simon> +   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify);
>
> Don't we normally write "extern" in headers?

IIUC “extern” is only meaningful for variable and template declarations.
  
Simon Marchi Feb. 14, 2023, 7:35 p.m. UTC | #3
On 2/13/23 21:24, Thiago Jung Bauermann wrote:
> 
> Tom Tromey <tom@tromey.com> writes:
> 
>>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>>
>> Simon> The following 2 patches move .gdb_index and .debug_names reading code to
>> Simon> their own file.  Prepare this by exposing some things used by that code
>> Simon> to read.h.
>>
>> Simon> +/* If FILE_MATCHER is NULL or if PER_CU has
>> Simon> +   dwarf2_per_cu_quick_data::MARK set (see
>> Simon> +   dw_expand_symtabs_matching_file_matcher), expand the CU and call
>> Simon> +   EXPANSION_NOTIFY on it.  */
>> Simon> +
>> Simon> +bool
>> Simon> +dw2_expand_symtabs_matching_one
>> Simon> +  (dwarf2_per_cu_data *per_cu,
>> Simon> +   dwarf2_per_objfile *per_objfile,
>> Simon> +   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
>> Simon> +   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify);
>>
>> Don't we normally write "extern" in headers?
> 
> IIUC “extern” is only meaningful for variable and template declarations.

For some reason, our coding standards says we should use extern for
function declarations:

https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#Function_Prototypes

But I don't understand why, IMO it just consumes some columns for no
purpose.  Also, it's not always respected, there are many header files
that don't use it.

Simon
  
Simon Marchi Feb. 14, 2023, 7:37 p.m. UTC | #4
On 2/13/23 18:33, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> The following 2 patches move .gdb_index and .debug_names reading code to
> Simon> their own file.  Prepare this by exposing some things used by that code
> Simon> to read.h.
> 
> Simon> +/* If FILE_MATCHER is NULL or if PER_CU has
> Simon> +   dwarf2_per_cu_quick_data::MARK set (see
> Simon> +   dw_expand_symtabs_matching_file_matcher), expand the CU and call
> Simon> +   EXPANSION_NOTIFY on it.  */
> Simon> +
> Simon> +bool
> Simon> +dw2_expand_symtabs_matching_one
> Simon> +  (dwarf2_per_cu_data *per_cu,
> Simon> +   dwarf2_per_objfile *per_objfile,
> Simon> +   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
> Simon> +   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify);
> 
> Don't we normally write "extern" in headers?

I added those.

> Also normally in declarations the type is on the same line as the
> function name.

My bad, I just copy pasted the line from the definition and forgot to
adjust them.  Done now.

> Simon> +/* This is a view into the index that converts from bytes to an
> Simon> +   offset_type, and allows indexing.  Unaligned bytes are specifically
> Simon> +   allowed here, and handled via unpacking.  */
> Simon> +
> Simon> +class offset_view
> Simon> +{
> Simon> +public:
> Simon> +  offset_view () = default;
> 
> I think this type should be specific to .gdb_index.  It shouldn't be
> needed anywhere else -- it's there to work around the lack of alignment.

Nice find, I thought it was used in .debug_names too, but no.  I will
revert this part of this patch, and the class will go to
read-gdb-index.c in the following patch.

Simon
  

Patch

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index d504be58e676..74856ce4a456 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -158,46 +158,6 @@  static int dwarf2_loclist_block_index;
 /* Size of .debug_rnglists section header for 64-bit DWARF format.  */
 #define RNGLIST_HEADER_SIZE64 20
 
-/* This is a view into the index that converts from bytes to an
-   offset_type, and allows indexing.  Unaligned bytes are specifically
-   allowed here, and handled via unpacking.  */
-
-class offset_view
-{
-public:
-  offset_view () = default;
-
-  explicit offset_view (gdb::array_view<const gdb_byte> bytes)
-    : m_bytes (bytes)
-  {
-  }
-
-  /* Extract the INDEXth offset_type from the array.  */
-  offset_type operator[] (size_t index) const
-  {
-    const gdb_byte *bytes = &m_bytes[index * sizeof (offset_type)];
-    return (offset_type) extract_unsigned_integer (bytes,
-						   sizeof (offset_type),
-						   BFD_ENDIAN_LITTLE);
-  }
-
-  /* Return the number of offset_types in this array.  */
-  size_t size () const
-  {
-    return m_bytes.size () / sizeof (offset_type);
-  }
-
-  /* Return true if this view is empty.  */
-  bool empty () const
-  {
-    return m_bytes.empty ();
-  }
-
-private:
-  /* The underlying bytes.  */
-  gdb::array_view<const gdb_byte> m_bytes;
-};
-
 /* A description of .gdb_index index.  The file format is described in
    a comment by the code that writes the index.  */
 
@@ -920,9 +880,6 @@  static const char *read_indirect_string
   (dwarf2_per_objfile *per_objfile, bfd *, const gdb_byte *,
    const struct comp_unit_head *, unsigned int *);
 
-static const char *read_indirect_string_at_offset
-  (dwarf2_per_objfile *per_objfile, LONGEST str_offset);
-
 static CORE_ADDR read_addr_index_from_leb128 (struct dwarf2_cu *,
 					      const gdb_byte *,
 					      unsigned int *);
@@ -1279,8 +1236,6 @@  static const char *compute_include_file_name
       const file_and_directory &cu_info,
       std::string &name_holder);
 
-static htab_up allocate_signatured_type_table ();
-
 static htab_up allocate_dwo_unit_table ();
 
 static struct dwo_unit *lookup_dwo_unit_in_dwp
@@ -1372,75 +1327,6 @@  line_header_eq_voidp (const void *item_lhs, const void *item_rhs)
 	  && ofs_lhs->offset_in_dwz == ofs_rhs->offset_in_dwz);
 }
 
-
-
-/* An iterator for all_units that is based on index.  This
-   approach makes it possible to iterate over all_units safely,
-   when some caller in the loop may add new units.  */
-
-class all_units_iterator
-{
-public:
-
-  all_units_iterator (dwarf2_per_bfd *per_bfd, bool start)
-    : m_per_bfd (per_bfd),
-      m_index (start ? 0 : per_bfd->all_units.size ())
-  {
-  }
-
-  all_units_iterator &operator++ ()
-  {
-    ++m_index;
-    return *this;
-  }
-
-  dwarf2_per_cu_data *operator* () const
-  {
-    return m_per_bfd->get_cu (m_index);
-  }
-
-  bool operator== (const all_units_iterator &other) const
-  {
-    return m_index == other.m_index;
-  }
-
-
-  bool operator!= (const all_units_iterator &other) const
-  {
-    return m_index != other.m_index;
-  }
-
-private:
-
-  dwarf2_per_bfd *m_per_bfd;
-  size_t m_index;
-};
-
-/* A range adapter for the all_units_iterator.  */
-class all_units_range
-{
-public:
-
-  all_units_range (dwarf2_per_bfd *per_bfd)
-    : m_per_bfd (per_bfd)
-  {
-  }
-
-  all_units_iterator begin ()
-  {
-    return all_units_iterator (m_per_bfd, true);
-  }
-
-  all_units_iterator end ()
-  {
-    return all_units_iterator (m_per_bfd, false);
-  }
-
-private:
-
-  dwarf2_per_bfd *m_per_bfd;
-};
-
 /* See declaration.  */
 
 dwarf2_per_bfd::dwarf2_per_bfd (bfd *obfd, const dwarf2_debug_sections *names,
@@ -1803,50 +1689,6 @@  struct quick_file_names
   const char **real_names;
 };
 
-struct dwarf2_base_index_functions : public quick_symbol_functions
-{
-  bool has_symbols (struct objfile *objfile) override;
-
-  bool has_unexpanded_symtabs (struct objfile *objfile) override;
-
-  struct symtab *find_last_source_symtab (struct objfile *objfile) override;
-
-  void forget_cached_source_info (struct objfile *objfile) override;
-
-  enum language lookup_global_symbol_language (struct objfile *objfile,
-					       const char *name,
-					       domain_enum domain,
-					       bool *symbol_found_p) override
-  {
-    *symbol_found_p = false;
-    return language_unknown;
-  }
-
-  void print_stats (struct objfile *objfile, bool print_bcache) override;
-
-  void expand_all_symtabs (struct objfile *objfile) override;
-
-  /* A helper function that finds the per-cu object from an "adjusted"
-     PC -- a PC with the base text offset removed.  */
-  virtual dwarf2_per_cu_data *find_per_cu (dwarf2_per_bfd *per_bfd,
-					   CORE_ADDR adjusted_pc);
-
-  struct compunit_symtab *find_pc_sect_compunit_symtab
-    (struct objfile *objfile, struct bound_minimal_symbol msymbol,
-     CORE_ADDR pc, struct obj_section *section, int warn_if_readin)
-       override final;
-
-  struct compunit_symtab *find_compunit_symtab_by_address
-    (struct objfile *objfile, CORE_ADDR address) override
-  {
-    return nullptr;
-  }
-
-  void map_symbol_filenames (struct objfile *objfile,
-			     gdb::function_view<symbol_filename_ftype> fun,
-			     bool need_fullname) override;
-};
-
 /* With OBJF_READNOW, the DWARF reader expands all CUs immediately.
    It's handy in this case to have an empty implementation of the
    quick symbol functions, to avoid special cases in the rest of the
@@ -1987,9 +1829,9 @@  eq_file_name_entry (const void *a, const void *b)
   return eq_stmt_list_entry (&ea->hash, &eb->hash);
 }
 
-/* Create a quick_file_names hash table.  */
+/* See read.h.  */
 
-static htab_up
+htab_up
 create_quick_file_names_table (unsigned int nr_initial_entries)
 {
   return htab_up (htab_create_alloc (nr_initial_entries,
@@ -2621,8 +2463,6 @@  to use the section anyway."),
   return 1;
 }
 
-static void finalize_all_units (dwarf2_per_bfd *per_bfd);
-
 /* Callback types for dwarf2_read_gdb_index.  */
 
 typedef gdb::function_view
@@ -3117,21 +2957,6 @@  dwarf2_base_index_functions::expand_all_symtabs (struct objfile *objfile)
     }
 }
 
-static bool
-dw2_expand_symtabs_matching_symbol
-  (mapped_index_base &index,
-   const lookup_name_info &lookup_name_in,
-   gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-   gdb::function_view<bool (offset_type)> match_callback,
-   dwarf2_per_objfile *per_objfile);
-
-static bool
-dw2_expand_symtabs_matching_one
-  (dwarf2_per_cu_data *per_cu,
-   dwarf2_per_objfile *per_objfile,
-   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
-   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify);
-
 void
 dwarf2_gdb_index::expand_matching_symbols
   (struct objfile *objfile,
@@ -3394,14 +3219,9 @@  mapped_index_base::build_name_components (dwarf2_per_objfile *per_objfile)
 	     name_comp_compare);
 }
 
-/* Helper for dw2_expand_symtabs_matching that works with a
-   mapped_index_base instead of the containing objfile.  This is split
-   to a separate function in order to be able to unit test the
-   name_components matching using a mock mapped_index_base.  For each
-   symbol name that matches, calls MATCH_CALLBACK, passing it the
-   symbol's index in the mapped_index_base symbol table.  */
+/* See read.h.  */
 
-static bool
+bool
 dw2_expand_symtabs_matching_symbol
   (mapped_index_base &index,
    const lookup_name_info &lookup_name_in,
@@ -3954,12 +3774,9 @@  run_test ()
 
 #endif /* GDB_SELF_TEST */
 
-/* If FILE_MATCHER is NULL or if PER_CU has
-   dwarf2_per_cu_quick_data::MARK set (see
-   dw_expand_symtabs_matching_file_matcher), expand the CU and call
-   EXPANSION_NOTIFY on it.  */
+/* See read.h.  */
 
-static bool
+bool
 dw2_expand_symtabs_matching_one
   (dwarf2_per_cu_data *per_cu,
    dwarf2_per_objfile *per_objfile,
@@ -4081,11 +3898,9 @@  dw2_expand_marked_cus
   return true;
 }
 
-/* If FILE_MATCHER is non-NULL, set all the
-   dwarf2_per_cu_quick_data::MARK of the current DWARF2_PER_OBJFILE
-   that match FILE_MATCHER.  */
+/* See read.h.  */
 
-static void
+void
 dw_expand_symtabs_matching_file_matcher
   (dwarf2_per_objfile *per_objfile,
    gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher)
@@ -5522,9 +5337,9 @@  eq_signatured_type (const void *item_lhs, const void *item_rhs)
   return lhs->signature == rhs->signature;
 }
 
-/* Allocate a hash table for signatured types.  */
+/* See read.h.  */
 
-static htab_up
+htab_up
 allocate_signatured_type_table ()
 {
   return htab_up (htab_create_alloc (41,
@@ -7245,7 +7060,7 @@  read_comp_units_from_section (dwarf2_per_objfile *per_objfile,
 
 /* Initialize the views on all_units.  */
 
-static void
+void
 finalize_all_units (dwarf2_per_bfd *per_bfd)
 {
   size_t nr_tus = per_bfd->tu_stats.nr_tus;
@@ -19342,9 +19157,9 @@  read_attribute (const struct die_reader_specs *reader,
 			       abbrev->implicit_const, info_ptr);
 }
 
-/* Return pointer to string at .debug_str offset STR_OFFSET.  */
+/* See read.h.  */
 
-static const char *
+const char *
 read_indirect_string_at_offset (dwarf2_per_objfile *per_objfile,
 				LONGEST str_offset)
 {
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index 8045a57563f9..476905c23737 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -558,6 +558,73 @@  struct dwarf2_per_bfd
   struct addrmap *index_addrmap = nullptr;
 };
 
+/* An iterator for all_units that is based on index.  This
+   approach makes it possible to iterate over all_units safely,
+   when some caller in the loop may add new units.  */
+
+class all_units_iterator
+{
+public:
+
+  all_units_iterator (dwarf2_per_bfd *per_bfd, bool start)
+    : m_per_bfd (per_bfd),
+      m_index (start ? 0 : per_bfd->all_units.size ())
+  {
+  }
+
+  all_units_iterator &operator++ ()
+  {
+    ++m_index;
+    return *this;
+  }
+
+  dwarf2_per_cu_data *operator* () const
+  {
+    return m_per_bfd->get_cu (m_index);
+  }
+
+  bool operator== (const all_units_iterator &other) const
+  {
+    return m_index == other.m_index;
+  }
+
+
+  bool operator!= (const all_units_iterator &other) const
+  {
+    return m_index != other.m_index;
+  }
+
+private:
+
+  dwarf2_per_bfd *m_per_bfd;
+  size_t m_index;
+};
+
+/* A range adapter for the all_units_iterator.  */
+class all_units_range
+{
+public:
+
+  all_units_range (dwarf2_per_bfd *per_bfd)
+    : m_per_bfd (per_bfd)
+  {
+  }
+
+  all_units_iterator begin ()
+  {
+    return all_units_iterator (m_per_bfd, true);
+  }
+
+  all_units_iterator end ()
+  {
+    return all_units_iterator (m_per_bfd, false);
+  }
+
+private:
+
+  dwarf2_per_bfd *m_per_bfd;
+};
+
 /* This is the per-objfile data associated with a type_unit_group.  */
 
 struct type_unit_group_unshareable
@@ -764,4 +831,143 @@  extern void dwarf2_get_section_info (struct objfile *,
 /* Return true if the producer of the inferior is clang.  */
 extern bool producer_is_clang (struct dwarf2_cu *cu);
 
+/* Interface for DWARF indexing methods.  */
+
+struct dwarf2_base_index_functions : public quick_symbol_functions
+{
+  bool has_symbols (struct objfile *objfile) override;
+
+  bool has_unexpanded_symtabs (struct objfile *objfile) override;
+
+  struct symtab *find_last_source_symtab (struct objfile *objfile) override;
+
+  void forget_cached_source_info (struct objfile *objfile) override;
+
+  enum language lookup_global_symbol_language (struct objfile *objfile,
+					       const char *name,
+					       domain_enum domain,
+					       bool *symbol_found_p) override
+  {
+    *symbol_found_p = false;
+    return language_unknown;
+  }
+
+  void print_stats (struct objfile *objfile, bool print_bcache) override;
+
+  void expand_all_symtabs (struct objfile *objfile) override;
+
+  /* A helper function that finds the per-cu object from an "adjusted"
+     PC -- a PC with the base text offset removed.  */
+  virtual dwarf2_per_cu_data *find_per_cu (dwarf2_per_bfd *per_bfd,
+					   CORE_ADDR adjusted_pc);
+
+  struct compunit_symtab *find_pc_sect_compunit_symtab
+    (struct objfile *objfile, struct bound_minimal_symbol msymbol,
+     CORE_ADDR pc, struct obj_section *section, int warn_if_readin)
+       override final;
+
+  struct compunit_symtab *find_compunit_symtab_by_address
+    (struct objfile *objfile, CORE_ADDR address) override
+  {
+    return nullptr;
+  }
+
+  void map_symbol_filenames (struct objfile *objfile,
+			     gdb::function_view<symbol_filename_ftype> fun,
+			     bool need_fullname) override;
+};
+
+/* If FILE_MATCHER is NULL or if PER_CU has
+   dwarf2_per_cu_quick_data::MARK set (see
+   dw_expand_symtabs_matching_file_matcher), expand the CU and call
+   EXPANSION_NOTIFY on it.  */
+
+bool
+dw2_expand_symtabs_matching_one
+  (dwarf2_per_cu_data *per_cu,
+   dwarf2_per_objfile *per_objfile,
+   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
+   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify);
+
+/* Helper for dw2_expand_symtabs_matching that works with a
+   mapped_index_base instead of the containing objfile.  This is split
+   to a separate function in order to be able to unit test the
+   name_components matching using a mock mapped_index_base.  For each
+   symbol name that matches, calls MATCH_CALLBACK, passing it the
+   symbol's index in the mapped_index_base symbol table.  */
+
+bool
+dw2_expand_symtabs_matching_symbol
+  (mapped_index_base &index,
+   const lookup_name_info &lookup_name_in,
+   gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
+   gdb::function_view<bool (offset_type)> match_callback,
+   dwarf2_per_objfile *per_objfile);
+
+/* If FILE_MATCHER is non-NULL, set all the
+   dwarf2_per_cu_quick_data::MARK of the current DWARF2_PER_OBJFILE
+   that match FILE_MATCHER.  */
+
+void
+dw_expand_symtabs_matching_file_matcher
+  (dwarf2_per_objfile *per_objfile,
+   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher);
+
+/* This is a view into the index that converts from bytes to an
+   offset_type, and allows indexing.  Unaligned bytes are specifically
+   allowed here, and handled via unpacking.  */
+
+class offset_view
+{
+public:
+  offset_view () = default;
+
+  explicit offset_view (gdb::array_view<const gdb_byte> bytes)
+    : m_bytes (bytes)
+  {
+  }
+
+  /* Extract the INDEXth offset_type from the array.  */
+  offset_type operator[] (size_t index) const
+  {
+    const gdb_byte *bytes = &m_bytes[index * sizeof (offset_type)];
+    return (offset_type) extract_unsigned_integer (bytes,
+						   sizeof (offset_type),
+						   BFD_ENDIAN_LITTLE);
+  }
+
+  /* Return the number of offset_types in this array.  */
+  size_t size () const
+  {
+    return m_bytes.size () / sizeof (offset_type);
+  }
+
+  /* Return true if this view is empty.  */
+  bool empty () const
+  {
+    return m_bytes.empty ();
+  }
+
+private:
+  /* The underlying bytes.  */
+  gdb::array_view<const gdb_byte> m_bytes;
+};
+
+/* Return pointer to string at .debug_str offset STR_OFFSET.  */
+
+const char *read_indirect_string_at_offset
+  (dwarf2_per_objfile *per_objfile, LONGEST str_offset);
+
+/* Allocate a hash table for signatured types.  */
+
+htab_up allocate_signatured_type_table ();
+
+/* Initialize the views on all_units.  */
+
+void finalize_all_units (dwarf2_per_bfd *per_bfd);
+
+/* Create a quick_file_names hash table.  */
+
+htab_up create_quick_file_names_table (unsigned int nr_initial_entries);
+
 #endif /* DWARF2READ_H */