]>
Commit | Line | Data |
---|---|---|
ccefe4c4 TT |
1 | /* Public partial symbol table definitions. |
2 | ||
42a4f53d | 3 | Copyright (C) 2009-2019 Free Software Foundation, Inc. |
ccefe4c4 TT |
4 | |
5 | This file is part of GDB. | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 3 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
19 | ||
20 | #ifndef PSYMTAB_H | |
21 | #define PSYMTAB_H | |
22 | ||
44b13c5a | 23 | #include "symfile.h" |
b22a7c6a | 24 | #include "common/next-iterator.h" |
44b13c5a | 25 | |
d320c2b5 TT |
26 | struct partial_symbol; |
27 | ||
710e1a31 SW |
28 | /* A bcache for partial symbols. */ |
29 | ||
30 | struct psymbol_bcache; | |
31 | ||
d320c2b5 TT |
32 | /* An instance of this class manages the partial symbol tables and |
33 | partial symbols for a given objfile. */ | |
cbd70537 | 34 | |
d320c2b5 TT |
35 | class psymtab_storage |
36 | { | |
37 | public: | |
ccefe4c4 | 38 | |
d320c2b5 | 39 | explicit psymtab_storage (struct objfile *objfile); |
9291a0cd | 40 | |
d320c2b5 | 41 | ~psymtab_storage (); |
b22a7c6a | 42 | |
d320c2b5 TT |
43 | DISABLE_COPY_AND_ASSIGN (psymtab_storage); |
44 | ||
45 | /* Discard all partial symbol tables starting with "psymtabs" and | |
46 | proceeding until "to" has been discarded. */ | |
b22a7c6a | 47 | |
d320c2b5 | 48 | void discard_psymtabs_to (struct partial_symtab *to) |
b22a7c6a | 49 | { |
d320c2b5 TT |
50 | while (psymtabs != to) |
51 | discard_psymtab (psymtabs); | |
b22a7c6a | 52 | } |
d320c2b5 TT |
53 | |
54 | /* Discard the partial symbol table. */ | |
55 | ||
56 | void discard_psymtab (struct partial_symtab *pst); | |
57 | ||
5923a04c TT |
58 | /* Return the obstack that is used for storage by this object. */ |
59 | ||
60 | struct obstack *obstack () | |
61 | { | |
62 | return m_obstack; | |
63 | } | |
64 | ||
d320c2b5 TT |
65 | |
66 | /* Each objfile points to a linked list of partial symtabs derived from | |
67 | this file, one partial symtab structure for each compilation unit | |
68 | (source file). */ | |
69 | ||
70 | struct partial_symtab *psymtabs = nullptr; | |
71 | ||
72 | /* Map addresses to the entries of PSYMTABS. It would be more efficient to | |
73 | have a map per the whole process but ADDRMAP cannot selectively remove | |
74 | its items during FREE_OBJFILE. This mapping is already present even for | |
75 | PARTIAL_SYMTABs which still have no corresponding full SYMTABs read. */ | |
76 | ||
77 | struct addrmap *psymtabs_addrmap = nullptr; | |
78 | ||
79 | /* List of freed partial symtabs, available for re-use. */ | |
80 | ||
81 | struct partial_symtab *free_psymtabs = nullptr; | |
82 | ||
d320c2b5 TT |
83 | /* A byte cache where we can stash arbitrary "chunks" of bytes that |
84 | will not change. */ | |
85 | ||
86 | struct psymbol_bcache *psymbol_cache; | |
87 | ||
88 | /* Vectors of all partial symbols read in from file. The actual data | |
89 | is stored in the objfile_obstack. */ | |
90 | ||
91 | std::vector<partial_symbol *> global_psymbols; | |
92 | std::vector<partial_symbol *> static_psymbols; | |
5923a04c TT |
93 | |
94 | private: | |
95 | ||
96 | /* The obstack where allocations are made. */ | |
97 | ||
98 | struct obstack *m_obstack; | |
b22a7c6a TT |
99 | }; |
100 | ||
d320c2b5 TT |
101 | |
102 | extern struct psymbol_bcache *psymbol_bcache_init (void); | |
103 | extern void psymbol_bcache_free (struct psymbol_bcache *); | |
104 | extern struct bcache *psymbol_bcache_get_bcache (struct psymbol_bcache *); | |
105 | ||
106 | extern const struct quick_symbol_functions psym_functions; | |
107 | ||
108 | extern const struct quick_symbol_functions dwarf2_gdb_index_functions; | |
109 | extern const struct quick_symbol_functions dwarf2_debug_names_functions; | |
110 | ||
b11896a5 TT |
111 | /* Ensure that the partial symbols for OBJFILE have been loaded. If |
112 | VERBOSE is non-zero, then this will print a message when symbols | |
b22a7c6a TT |
113 | are loaded. This function returns a range adapter suitable for |
114 | iterating over the psymtabs of OBJFILE. */ | |
b11896a5 | 115 | |
d320c2b5 | 116 | class objfile_psymtabs; |
b22a7c6a TT |
117 | extern objfile_psymtabs require_partial_symbols (struct objfile *objfile, |
118 | int verbose); | |
b11896a5 | 119 | |
ccefe4c4 | 120 | #endif /* PSYMTAB_H */ |