[gdb] Fix assert in remote_async_get_pending_events_handler
[deliverable/binutils-gdb.git] / gdb / psympriv.h
index 8717bd259e1f8b57fcd7b1f825cdc57ce939a55f..59dd66f57e5d58dc94f1bd5935a4fd74ac3a15d2 100644 (file)
@@ -111,7 +111,8 @@ enum class psymbol_placement
 
 struct partial_symtab
 {
-  /* Allocate a new partial symbol table associated with OBJFILE.
+  /* Allocate a new partial symbol table.
+
      FILENAME (which must be non-NULL) is the filename of this partial
      symbol table; it is copied into the appropriate storage.  The
      partial symtab will also be installed using
@@ -119,7 +120,7 @@ struct partial_symtab
 
   partial_symtab (const char *filename,
                  psymtab_storage *partial_symtabs,
-                 struct objfile *objfile)
+                 objfile_per_bfd_storage *objfile_per_bfd)
     ATTRIBUTE_NONNULL (2) ATTRIBUTE_NONNULL (3);
 
   /* Like the above, but also sets the initial text low and text high
@@ -128,7 +129,7 @@ struct partial_symtab
 
   partial_symtab (const char *filename,
                  psymtab_storage *partial_symtabs,
-                 struct objfile *objfile,
+                 objfile_per_bfd_storage *objfile_per_bfd,
                  CORE_ADDR addr)
     ATTRIBUTE_NONNULL (2) ATTRIBUTE_NONNULL (3);
 
@@ -369,16 +370,16 @@ struct standard_psymtab : public partial_symtab
 {
   standard_psymtab (const char *filename,
                    psymtab_storage *partial_symtabs,
-                   struct objfile *objfile)
-    : partial_symtab (filename, partial_symtabs, objfile)
+                   objfile_per_bfd_storage *objfile_per_bfd)
+    : partial_symtab (filename, partial_symtabs, objfile_per_bfd)
   {
   }
 
   standard_psymtab (const char *filename,
                    psymtab_storage *partial_symtabs,
-                   struct objfile *objfile,
+                   objfile_per_bfd_storage *objfile_per_bfd,
                    CORE_ADDR addr)
-    : partial_symtab (filename, partial_symtabs, objfile, addr)
+    : partial_symtab (filename, partial_symtabs, objfile_per_bfd, addr)
   {
   }
 
@@ -411,16 +412,16 @@ struct legacy_psymtab : public standard_psymtab
 {
   legacy_psymtab (const char *filename,
                  psymtab_storage *partial_symtabs,
-                 struct objfile *objfile)
-    : standard_psymtab (filename, partial_symtabs, objfile)
+                 objfile_per_bfd_storage *objfile_per_bfd)
+    : standard_psymtab (filename, partial_symtabs, objfile_per_bfd)
   {
   }
 
   legacy_psymtab (const char *filename,
                  psymtab_storage *partial_symtabs,
-                 struct objfile *objfile,
+                 objfile_per_bfd_storage *objfile_per_bfd,
                  CORE_ADDR addr)
-    : standard_psymtab (filename, partial_symtabs, objfile, addr)
+    : standard_psymtab (filename, partial_symtabs, objfile_per_bfd, addr)
   {
   }
 
@@ -495,21 +496,17 @@ struct psymbol_functions : public quick_symbol_functions
   {
   }
 
+  psymbol_functions ()
+    : m_partial_symtabs (new psymtab_storage)
+  {
+  }
+
   bool has_symbols (struct objfile *objfile) override;
 
   struct symtab *find_last_source_symtab (struct objfile *objfile) override;
 
   void forget_cached_source_info (struct objfile *objfile) override;
 
-  bool map_symtabs_matching_filename
-    (struct objfile *objfile, const char *name, const char *real_path,
-     gdb::function_view<bool (symtab *)> callback) override;
-
-  struct compunit_symtab *lookup_symbol (struct objfile *objfile,
-                                        block_enum block_index,
-                                        const char *name,
-                                        domain_enum domain) override;
-
   enum language lookup_global_symbol_language (struct objfile *objfile,
                                               const char *name,
                                               domain_enum domain,
@@ -519,28 +516,23 @@ struct psymbol_functions : public quick_symbol_functions
 
   void dump (struct objfile *objfile) override;
 
-  void expand_symtabs_for_function (struct objfile *objfile,
-                                   const char *func_name) override;
-
   void expand_all_symtabs (struct objfile *objfile) override;
 
-  void expand_symtabs_with_fullname (struct objfile *objfile,
-                                    const char *fullname) override;
-
-  void map_matching_symbols
+  void expand_matching_symbols
     (struct objfile *,
      const lookup_name_info &lookup_name,
      domain_enum domain,
      int global,
-     gdb::function_view<symbol_found_callback_ftype> callback,
      symbol_compare_ftype *ordered_compare) override;
 
-  void expand_symtabs_matching
+  bool expand_symtabs_matching
     (struct objfile *objfile,
      gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
      const lookup_name_info *lookup_name,
      gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
      gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
+     block_search_flags search_flags,
+     domain_enum domain,
      enum search_domain kind) override;
 
   struct compunit_symtab *find_pc_sect_compunit_symtab
@@ -551,14 +543,26 @@ struct psymbol_functions : public quick_symbol_functions
     (struct objfile *objfile, CORE_ADDR address) override;
 
   void map_symbol_filenames (struct objfile *objfile,
-                            symbol_filename_ftype *fun, void *data,
-                            int need_fullname) override;
+                            gdb::function_view<symbol_filename_ftype> fun,
+                            bool need_fullname) override;
 
   void relocated () override
   {
     m_psymbol_map.clear ();
   }
 
+  /* Ensure the partial symbols for OBJFILE have been loaded.  Return
+     a range adapter for the psymtabs.  */
+  psymtab_storage::partial_symtab_range require_partial_symbols
+       (struct objfile *objfile);
+
+  /* Return the partial symbol storage associated with this
+     object.  */
+  const std::shared_ptr<psymtab_storage> &get_partial_symtabs () const
+  {
+    return m_partial_symtabs;
+  }
+
   /* Replace the partial symbol table storage in this object with
      SYMS.  */
   void set_partial_symtabs (const std::shared_ptr<psymtab_storage> &syms)
@@ -566,8 +570,22 @@ struct psymbol_functions : public quick_symbol_functions
     m_partial_symtabs = syms;
   }
 
+  /* Find which partial symtab contains PC and SECTION.  Return NULL if
+     none.  We return the psymtab that contains a symbol whose address
+     exactly matches PC, or, if we cannot find an exact match, the
+     psymtab that contains a symbol whose address is closest to PC.  */
+
+  struct partial_symtab *find_pc_sect_psymtab
+       (struct objfile *objfile,
+       CORE_ADDR pc,
+       struct obj_section *section,
+       struct bound_minimal_symbol msymbol);
+
 private:
 
+  /* Count the number of partial symbols in *THIS.  */
+  int count_psyms ();
+
   void fill_psymbol_map (struct objfile *objfile,
                         struct partial_symtab *psymtab,
                         std::set<CORE_ADDR> *seen_addrs,
This page took 0.026529 seconds and 4 git commands to generate.