* am29k-tdep.c (initialize_29k): Fix call_scratch_address doc.
[deliverable/binutils-gdb.git] / gdb / buildsym.h
CommitLineData
c0302457
JG
1/* Build symbol tables in GDB's internal format.
2 Copyright (C) 1986-1991 Free Software Foundation, Inc.
3
4This file is part of GDB.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
1ab3bf1b
JG
20#if !defined (BUILDSYM_H)
21#define BUILDSYM_H 1
22
c0302457
JG
23/* This module provides definitions used for creating and adding to
24 the symbol table. These routines are called from various symbol-
25 file-reading routines.
26
27 They originated in dbxread.c of gdb-4.2, and were split out to
28 make xcoffread.c more maintainable by sharing code.
29
30 Variables declared in this file can be defined by #define-ing
31 the name EXTERN to null. It is used to declare variables that
32 are normally extern, but which get defined in a single module
33 using this technique. */
34
35#ifndef EXTERN
d07734e3 36#define EXTERN extern
c0302457
JG
37#endif
38
d07734e3 39#define HASHSIZE 127 /* Size of things hashed via hashname() */
c0302457 40
c0302457 41/* Name of source file whose symbol data we are now processing.
d07734e3 42 This comes from a symbol of type N_SO. */
c0302457
JG
43
44EXTERN char *last_source_file;
45
46/* Core address of start of text of current source file.
d07734e3 47 This too comes from the N_SO symbol. */
c0302457
JG
48
49EXTERN CORE_ADDR last_source_start_addr;
50
51/* The list of sub-source-files within the current individual compilation.
52 Each file gets its own symtab with its own linetable and associated info,
53 but they all share one blockvector. */
54
55struct subfile
56{
57 struct subfile *next;
58 char *name;
59 char *dirname;
60 struct linetable *line_vector;
61 int line_vector_length;
2e4964ad 62 enum language language;
c0302457
JG
63};
64
65EXTERN struct subfile *subfiles;
66
67EXTERN struct subfile *current_subfile;
68
69/* Global variable which, when set, indicates that we are processing a
70 .o file compiled with gcc */
71
72EXTERN unsigned char processing_gcc_compilation;
73
93297ea0 74/* When set, we are processing a .o file compiled by sun acc */
d07734e3 75
93297ea0
JG
76EXTERN unsigned char processing_acc_compilation;
77
c0302457
JG
78/* Count symbols as they are processed, for error messages. */
79
80EXTERN unsigned int symnum;
81
c0302457
JG
82/* Record the symbols defined for each context in a list.
83 We don't create a struct block for the context until we
84 know how long to make it. */
85
86#define PENDINGSIZE 100
87
88struct pending
89{
90 struct pending *next;
91 int nsyms;
92 struct symbol *symbol[PENDINGSIZE];
93};
94
95/* List of free `struct pending' structures for reuse. */
d07734e3 96
c0302457
JG
97EXTERN struct pending *free_pendings;
98
99/* Here are the three lists that symbols are put on. */
100
101EXTERN struct pending *file_symbols; /* static at top level, and types */
102
103EXTERN struct pending *global_symbols; /* global functions and variables */
104
4137c5fc
JG
105EXTERN struct pending *local_symbols; /* everything local to lexic context */
106
c0302457
JG
107/* Stack representing unclosed lexical contexts
108 (that will become blocks, eventually). */
109
110struct context_stack
111{
d07734e3
FF
112 /* Outer locals at the time we entered */
113
114 struct pending *locals;
115
116 /* Pointer into blocklist as of entry */
117
118 struct pending_block *old_blocks;
119
120 /* Name of function, if any, defining context*/
121
122 struct symbol *name;
123
124 /* PC where this context starts */
125
126 CORE_ADDR start_addr;
127
128 /* Temp slot for exception handling. */
129
130 CORE_ADDR end_addr;
131
132 /* For error-checking matching push/pop */
133
134 int depth;
135
c0302457
JG
136};
137
138EXTERN struct context_stack *context_stack;
139
140/* Index of first unused entry in context stack. */
d07734e3 141
c0302457
JG
142EXTERN int context_stack_depth;
143
144/* Currently allocated size of context stack. */
145
146EXTERN int context_stack_size;
147
a048c8f5
JG
148/* Macro "function" for popping contexts from the stack. Pushing is done
149 by a real function, push_context. This returns a pointer to a struct
150 context_stack. */
151
d07734e3 152#define pop_context() (&context_stack[--context_stack_depth]);
a048c8f5 153
c0302457
JG
154/* Nonzero if within a function (so symbols should be local,
155 if nothing says specifically). */
156
157EXTERN int within_function;
158
159/* List of blocks already made (lexical contexts already closed).
160 This is used at the end to make the blockvector. */
161
162struct pending_block
163{
164 struct pending_block *next;
165 struct block *block;
166};
167
168EXTERN struct pending_block *pending_blocks;
169
c0302457 170\f
a048c8f5
JG
171struct subfile_stack
172{
173 struct subfile_stack *next;
174 char *name;
a048c8f5
JG
175};
176
177EXTERN struct subfile_stack *subfile_stack;
aab77d5f 178
aab77d5f
PB
179#define next_symbol_text() (*next_symbol_text_func)()
180
181/* Function to invoke get the next symbol. Return the symbol name. */
182
1ab3bf1b
JG
183EXTERN char *(*next_symbol_text_func) PARAMS ((void));
184
d07734e3
FF
185/* Vector of types defined so far, indexed by their type numbers.
186 Used for both stabs and coff.
187 (In newer sun systems, dbx uses a pair of numbers in parens,
188 as in "(SUBFILENUM,NUMWITHINSUBFILE)". Then these numbers must be
189 translated through the type_translations hash table to get
190 the index into the type vector.) */
1ab3bf1b 191
d07734e3 192EXTERN struct type **type_vector;
1ab3bf1b 193
d07734e3 194/* Number of elements allocated for type_vector currently. */
1ab3bf1b 195
d07734e3 196EXTERN int type_vector_length;
1ab3bf1b 197
d07734e3
FF
198/* Initial size of type vector. Is realloc'd larger if needed,
199 and realloc'd down to the size actually used, when completed. */
1ab3bf1b 200
d07734e3
FF
201#define INITIAL_TYPE_VECTOR_LENGTH 160
202
203extern void
204add_symbol_to_list PARAMS ((struct symbol *, struct pending **));
205
206extern struct symbol *
207find_symbol_in_list PARAMS ((struct pending *, char *, int));
1ab3bf1b
JG
208
209extern void
210finish_block PARAMS ((struct symbol *, struct pending **,
211 struct pending_block *, CORE_ADDR, CORE_ADDR,
212 struct objfile *));
213
1ab3bf1b
JG
214extern void
215really_free_pendings PARAMS ((int foo));
216
217extern void
218start_subfile PARAMS ((char *, char *));
219
3416d90b
FF
220extern void
221patch_subfile_names PARAMS ((struct subfile *subfile, char *name));
222
1ab3bf1b
JG
223extern void
224push_subfile PARAMS ((void));
225
226extern char *
227pop_subfile PARAMS ((void));
228
229extern struct symtab *
d07734e3 230end_symtab PARAMS ((CORE_ADDR, int, int, struct objfile *));
1ab3bf1b
JG
231
232extern void
233scan_file_globals PARAMS ((struct objfile *));
234
235extern void
236buildsym_new_init PARAMS ((void));
237
238extern void
239buildsym_init PARAMS ((void));
240
241extern struct context_stack *
242push_context PARAMS ((int, CORE_ADDR));
243
244extern void
245record_line PARAMS ((struct subfile *, int, CORE_ADDR));
246
247extern void
248start_symtab PARAMS ((char *, char *, CORE_ADDR));
249
1ab3bf1b 250extern struct partial_symtab *
2670f34d 251start_psymtab PARAMS ((struct objfile *, struct section_offsets *, char *,
d07734e3
FF
252 CORE_ADDR, int, struct partial_symbol *,
253 struct partial_symbol *));
1ab3bf1b
JG
254
255extern void
256end_psymtab PARAMS ((struct partial_symtab *, char **, int, int, CORE_ADDR,
257 struct partial_symtab **, int));
258
259extern void
2670f34d
JG
260process_one_symbol PARAMS ((int, int, CORE_ADDR, char *,
261 struct section_offsets *, struct objfile *));
1ab3bf1b
JG
262extern int
263hashname PARAMS ((char *));
264
d07734e3
FF
265#undef EXTERN
266
1ab3bf1b 267#endif /* defined (BUILDSYM_H) */
This page took 0.078158 seconds and 4 git commands to generate.