X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gdb%2Fpsymtab.h;h=e8bafbe4338f8cd32e79fea653b17704708331b5;hb=90fd07fcd3e6af8679df55b67482d5c8ab8dd9b9;hp=a4ac35a7916b12393ea612043cd1a017554af9d7;hpb=26abc753cd1eb1349f6fa053caab016c93ca5302;p=binutils-gdb.git diff --git a/gdb/psymtab.h b/gdb/psymtab.h index a4ac35a7916..e8bafbe4338 100644 --- a/gdb/psymtab.h +++ b/gdb/psymtab.h @@ -1,6 +1,6 @@ /* Public partial symbol table definitions. - Copyright (C) 2009-2019 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -36,7 +36,9 @@ struct partial_symbol; other memory managed by this class), or on the per-BFD object. The only link from the psymtab storage object back to the objfile (or objfile_obstack) that is made by the core psymtab code is the - compunit_symtab member in the psymtab. + compunit_symtab member in the standard_psymtab -- and a given + symbol reader can avoid this by implementing its own subclasses of + partial_symtab. However, it is up to each symbol reader to maintain this invariant in other ways, if it wants to reuse psymtabs across multiple @@ -83,11 +85,10 @@ public: return OBSTACK_CALLOC (obstack (), number, struct partial_symtab *); } - /* Allocate a new psymtab on the psymtab obstack. The new psymtab - will be linked in to the "psymtabs" list, but otherwise all other - fields will be zero. */ + /* Install a psymtab on the psymtab list. This transfers ownership + of PST to this object. */ - struct partial_symtab *allocate_psymtab (); + void install_psymtab (partial_symtab *pst); typedef next_adapter partial_symtab_range; @@ -120,7 +121,7 @@ public: /* A byte cache where we can stash arbitrary "chunks" of bytes that will not change. */ - struct bcache psymbol_cache; + gdb::bcache psymbol_cache; /* Vectors of all partial symbols read in from file. The actual data is stored in the objfile_obstack. */ @@ -128,11 +129,13 @@ public: std::vector global_psymbols; std::vector static_psymbols; -private: + /* Stack of vectors of partial symbols, using during psymtab + initialization. */ - /* List of freed partial symtabs, available for re-use. */ + std::vector*> current_global_psymbols; + std::vector*> current_static_psymbols; - struct partial_symtab *free_psymtabs = nullptr; +private: /* The obstack where allocations are made. This is lazily allocated so that we don't waste memory when there are no psymtabs. */