]>
Commit | Line | Data |
---|---|---|
0baae8db | 1 | /* Build symbol tables in GDB's internal format - legacy APIs |
213516ef | 2 | Copyright (C) 1986-2023 Free Software Foundation, Inc. |
0baae8db TT |
3 | |
4 | This file is part of GDB. | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 3 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
18 | ||
1a5c2598 TT |
19 | #ifndef BUILDSYM_LEGACY_H |
20 | #define BUILDSYM_LEGACY_H | |
0baae8db TT |
21 | |
22 | #include "buildsym.h" | |
23 | ||
24 | /* This module provides definitions used for creating and adding to | |
25 | the symbol table. These routines are called from various symbol- | |
26 | file-reading routines. This file holds the legacy API, which | |
27 | relies on a global variable to work properly. New or maintained | |
28 | symbol readers should use the builder API in buildsym.h. | |
29 | ||
30 | The basic way this module is used is as follows: | |
31 | ||
32 | scoped_free_pendings free_pending; | |
59dfe8ad | 33 | cust = start_compunit_symtab (...); |
0baae8db | 34 | ... read debug info ... |
59dfe8ad | 35 | cust = end_compunit_symtab (...); |
0baae8db | 36 | |
59dfe8ad SM |
37 | The compunit symtab pointer ("cust") is returned from both |
38 | start_compunit_symtab and end_compunit_symtab to simplify the debug info readers. | |
0baae8db | 39 | |
0baae8db TT |
40 | dbxread.c and xcoffread.c use another variation: |
41 | ||
42 | scoped_free_pendings free_pending; | |
59dfe8ad | 43 | cust = start_compunit_symtab (...); |
0baae8db | 44 | ... read debug info ... |
59dfe8ad SM |
45 | cust = end_compunit_symtab (...); |
46 | ... start_compunit_symtab + read + end_compunit_symtab repeated ... | |
0baae8db TT |
47 | */ |
48 | ||
49 | class scoped_free_pendings | |
50 | { | |
51 | public: | |
52 | ||
53 | scoped_free_pendings () = default; | |
54 | ~scoped_free_pendings (); | |
55 | ||
56 | DISABLE_COPY_AND_ASSIGN (scoped_free_pendings); | |
57 | }; | |
58 | ||
59 | extern struct block *finish_block (struct symbol *symbol, | |
60 | struct pending_block *old_blocks, | |
61 | const struct dynamic_prop *static_link, | |
62 | CORE_ADDR start, | |
63 | CORE_ADDR end); | |
64 | ||
0baae8db TT |
65 | extern void start_subfile (const char *name); |
66 | ||
67 | extern void patch_subfile_names (struct subfile *subfile, const char *name); | |
68 | ||
69 | extern void push_subfile (); | |
70 | ||
71 | extern const char *pop_subfile (); | |
72 | ||
83bad316 | 73 | extern struct compunit_symtab *end_compunit_symtab (CORE_ADDR end_addr); |
0baae8db | 74 | |
0baae8db TT |
75 | extern struct context_stack *push_context (int desc, CORE_ADDR valu); |
76 | ||
77 | extern struct context_stack pop_context (); | |
78 | ||
bfe2e011 | 79 | extern void record_line (struct subfile *subfile, int line, CORE_ADDR pc); |
0baae8db | 80 | |
59dfe8ad SM |
81 | extern struct compunit_symtab *start_compunit_symtab (struct objfile *objfile, |
82 | const char *name, | |
83 | const char *comp_dir, | |
84 | CORE_ADDR start_addr, | |
85 | enum language language); | |
0baae8db | 86 | |
0baae8db TT |
87 | /* Record the name of the debug format in the current pending symbol |
88 | table. FORMAT must be a string with a lifetime at least as long as | |
89 | the symtab's objfile. */ | |
90 | ||
91 | extern void record_debugformat (const char *format); | |
92 | ||
93 | /* Record the name of the debuginfo producer (usually the compiler) in | |
94 | the current pending symbol table. PRODUCER must be a string with a | |
95 | lifetime at least as long as the symtab's objfile. */ | |
96 | ||
97 | extern void record_producer (const char *producer); | |
98 | ||
99 | /* Set the name of the last source file. NAME is copied by this | |
100 | function. */ | |
101 | ||
102 | extern void set_last_source_file (const char *name); | |
103 | ||
104 | /* Fetch the name of the last source file. */ | |
105 | ||
106 | extern const char *get_last_source_file (void); | |
107 | ||
0baae8db | 108 | /* Set the last source start address. Can only be used between |
59dfe8ad | 109 | start_compunit_symtab and end_compunit_symtab* calls. */ |
0baae8db TT |
110 | |
111 | extern void set_last_source_start_addr (CORE_ADDR addr); | |
112 | ||
113 | /* Get the last source start address. Can only be used between | |
59dfe8ad | 114 | start_compunit_symtab and end_compunit_symtab* calls. */ |
0baae8db TT |
115 | |
116 | extern CORE_ADDR get_last_source_start_addr (); | |
117 | ||
0baae8db TT |
118 | /* True if the context stack is empty. */ |
119 | ||
120 | extern bool outermost_context_p (); | |
121 | ||
0baae8db TT |
122 | /* Return the context stack depth. */ |
123 | ||
124 | extern int get_context_stack_depth (); | |
125 | ||
126 | /* Return the current subfile. */ | |
127 | ||
128 | extern struct subfile *get_current_subfile (); | |
129 | ||
130 | /* Return the local symbol list. */ | |
131 | ||
132 | extern struct pending **get_local_symbols (); | |
133 | ||
134 | /* Return the file symbol list. */ | |
135 | ||
136 | extern struct pending **get_file_symbols (); | |
137 | ||
138 | /* Return the global symbol list. */ | |
139 | ||
140 | extern struct pending **get_global_symbols (); | |
141 | ||
80e649fc TT |
142 | /* Return the current buildsym_compunit. */ |
143 | ||
144 | extern struct buildsym_compunit *get_buildsym_compunit (); | |
145 | ||
1a5c2598 | 146 | #endif /* BUILDSYM_LEGACY_H */ |