gdbsupport: re-indent ptrace.m4
[deliverable/binutils-gdb.git] / gdb / psympriv.h
index 6f0307e05b787d762267e7c7e74179e28b21eecf..97f9b3b596c5d77d2f0cf3a1187807684662aeb6 100644 (file)
@@ -92,6 +92,15 @@ enum psymtab_search_status
     PST_SEARCHED_AND_NOT_FOUND
   };
 
+/* Specify whether a partial psymbol should be allocated on the global
+   list or the static list.  */
+
+enum class psymbol_placement
+{
+  STATIC,
+  GLOBAL
+};
+
 /* Each source file that has not been fully read in is represented by
    a partial_symtab.  This contains the information on where in the
    executable the debugging symbols for a specific file are, and a
@@ -147,13 +156,16 @@ struct partial_symtab
   void expand_dependencies (struct objfile *);
 
   /* Return true if the symtab corresponding to this psymtab has been
-     readin.  */
-  virtual bool readin_p () const = 0;
+     read in in the context of this objfile.  */
+  virtual bool readin_p (struct objfile *) const = 0;
 
-  /* Return a pointer to the compunit allocated for this source file.
-     Return nullptr if !readin or if there was no symtab.  */
-  virtual struct compunit_symtab *get_compunit_symtab () const = 0;
+  /* Return a pointer to the compunit allocated for this source file
+     in the context of this objfile.
 
+     Return nullptr if the compunit was not read in or if there was no
+     symtab.  */
+  virtual struct compunit_symtab *get_compunit_symtab
+    (struct objfile *) const = 0;
 
   /* Return the raw low text address of this partial_symtab.  */
   CORE_ADDR raw_text_low () const
@@ -193,6 +205,48 @@ struct partial_symtab
     text_high_valid = 1;
   }
 
+  /* Return true if this symtab is empty -- meaning that it contains
+     no symbols.  It may still have dependencies.  */
+  bool empty () const
+  {
+    return global_psymbols.empty () && static_psymbols.empty ();
+  }
+
+  /* Add a symbol to this partial symbol table of OBJFILE.
+
+     If COPY_NAME is true, make a copy of NAME, otherwise use the passed
+     reference.
+
+     THECLASS is the type of symbol.
+
+     SECTION is the index of the section of OBJFILE in which the symbol is found.
+
+     WHERE determines whether the symbol goes in the list of static or global
+     partial symbols.
+
+     COREADDR is the address of the symbol.  For partial symbols that don't have
+     an address, zero is passed.
+
+     LANGUAGE is the language from which the symbol originates.  This will
+     influence, amongst other things, how the symbol name is demangled. */
+
+  void add_psymbol (gdb::string_view name,
+                   bool copy_name, domain_enum domain,
+                   enum address_class theclass,
+                   short section,
+                   psymbol_placement where,
+                   CORE_ADDR coreaddr,
+                   enum language language,
+                   struct objfile *objfile);
+
+  /* Add a symbol to this partial symbol table of OBJFILE.  The psymbol
+     must be fully constructed, and the names must be set and intern'd
+     as appropriate.  */
+
+  void add_psymbol (const partial_symbol &psym,
+                   psymbol_placement where,
+                   struct objfile *objfile);
+
 
   /* Chain of all existing partial symtabs.  */
 
@@ -266,22 +320,18 @@ struct partial_symtab
 
   /* Global symbol list.  This list will be sorted after readin to
      improve access.  Binary search will be the usual method of
-     finding a symbol within it.  globals_offset is an integer offset
-     within global_psymbols[].  */
+     finding a symbol within it.  */
 
-  int globals_offset = 0;
-  int n_global_syms = 0;
+  std::vector<partial_symbol *> global_psymbols;
 
   /* Static symbol list.  This list will *not* be sorted after readin;
      to find a symbol in it, exhaustive search must be used.  This is
      reasonable because searches through this list will eventually
      lead to either the read in of a files symbols for real (assumed
      to take a *lot* of time; check) or an error (and we don't care
-     how long errors take).  This is an offset and size within
-     static_psymbols[].  */
+     how long errors take).  */
 
-  int statics_offset = 0;
-  int n_static_syms = 0;
+  std::vector<partial_symbol *> static_psymbols;
 
   /* True iff objfile->psymtabs_addrmap is properly populated for this
      partial_symtab.  For discontiguous overlapping psymtabs is the only usable
@@ -319,14 +369,12 @@ struct standard_psymtab : public partial_symtab
   {
   }
 
-  bool readin_p () const override
+  bool readin_p (struct objfile *) const override
   {
     return readin;
   }
 
-  /* Return a pointer to the compunit allocated for this source file.
-     Return nullptr if !readin or if there was no symtab.  */
-  struct compunit_symtab *get_compunit_symtab () const override
+  struct compunit_symtab *get_compunit_symtab (struct objfile *) const override
   {
     return compunit_symtab;
   }
@@ -388,50 +436,6 @@ struct legacy_psymtab : public standard_psymtab
   void *read_symtab_private = nullptr;
 };
 
-/* Specify whether a partial psymbol should be allocated on the global
-   list or the static list.  */
-
-enum class psymbol_placement
-{
-  STATIC,
-  GLOBAL
-};
-
-/* Add a symbol to the partial symbol table of OBJFILE.
-
-   If COPY_NAME is true, make a copy of NAME, otherwise use the passed
-   reference.
-
-   THECLASS is the type of symbol.
-
-   SECTION is the index of the section of OBJFILE in which the symbol is found.
-
-   WHERE determines whether the symbol goes in the list of static or global
-   partial symbols of OBJFILE.
-
-   COREADDR is the address of the symbol.  For partial symbols that don't have
-   an address, zero is passed.
-
-   LANGUAGE is the language from which the symbol originates.  This will
-   influence, amongst other things, how the symbol name is demangled. */
-
-extern void add_psymbol_to_list (gdb::string_view name,
-                                bool copy_name, domain_enum domain,
-                                enum address_class theclass,
-                                short section,
-                                psymbol_placement where,
-                                CORE_ADDR coreaddr,
-                                enum language language,
-                                struct objfile *objfile);
-
-/* Add a symbol to the partial symbol table of OBJFILE.  The psymbol
-   must be fully constructed, and the names must be set and intern'd
-   as appropriate.  */
-
-extern void add_psymbol_to_list (const partial_symbol &psym,
-                                psymbol_placement where,
-                                struct objfile *objfile);
-
 /* Initialize storage for partial symbols.  If partial symbol storage
    has already been initialized, this does nothing.  TOTAL_SYMBOLS is
    an estimate of how many symbols there will be.  */
This page took 0.025283 seconds and 4 git commands to generate.