Code cleanup: Refactor abbrev_table_read_table cycle
[deliverable/binutils-gdb.git] / gdb / symfile.h
CommitLineData
c906108c 1/* Definitions for reading symbol files into GDB.
3a6c3343 2
61baf725 3 Copyright (C) 1990-2017 Free Software Foundation, Inc.
c906108c 4
c5aa993b 5 This file is part of GDB.
c906108c 6
c5aa993b
JM
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
a9762ec7 9 the Free Software Foundation; either version 3 of the License, or
c5aa993b 10 (at your option) any later version.
c906108c 11
c5aa993b
JM
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.
c906108c 16
c5aa993b 17 You should have received a copy of the GNU General Public License
a9762ec7 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
c906108c
SS
19
20#if !defined (SYMFILE_H)
21#define SYMFILE_H
22
23/* This file requires that you first include "bfd.h". */
16708cba 24#include "symtab.h"
48faced0 25#include "probe.h"
b15cc25c
PA
26#include "symfile-add-flags.h"
27#include "objfile-flags.h"
192b62ce 28#include "gdb_bfd.h"
c906108c 29
63ca651f 30/* Opaque declarations. */
0542c86d 31struct target_section;
da3331ec 32struct objfile;
1c772458 33struct obj_section;
63ca651f 34struct obstack;
fe898f56 35struct block;
55aa24fb
SDJ
36struct probe;
37struct value;
38struct frame_info;
39struct agent_expr;
40struct axs_value;
63ca651f 41
2edb89d3
JK
42/* Comparison function for symbol look ups. */
43
44typedef int (symbol_compare_ftype) (const char *string1,
45 const char *string2);
46
3a6c3343
AC
47/* Partial symbols are stored in the psymbol_cache and pointers to
48 them are kept in a dynamically grown array that is obtained from
49 malloc and grown as necessary via realloc. Each objfile typically
50 has two of these, one for global symbols and one for static
51 symbols. Although this adds a level of indirection for storing or
52 accessing the partial symbols, it allows us to throw away duplicate
53 psymbols and set all pointers to the single saved instance. */
c906108c 54
c5aa993b 55struct psymbol_allocation_list
3a6c3343 56{
c906108c 57
3a6c3343
AC
58 /* Pointer to beginning of dynamically allocated array of pointers
59 to partial symbols. The array is dynamically expanded as
60 necessary to accommodate more pointers. */
c906108c 61
3a6c3343 62 struct partial_symbol **list;
c906108c 63
3a6c3343
AC
64 /* Pointer to next available slot in which to store a pointer to a
65 partial symbol. */
c906108c 66
3a6c3343 67 struct partial_symbol **next;
c906108c 68
3a6c3343
AC
69 /* Number of allocated pointer slots in current dynamic array (not
70 the number of bytes of storage). The "next" pointer will always
71 point somewhere between list[0] and list[size], and when at
72 list[size] the array will be expanded on the next attempt to
73 store a pointer. */
c906108c 74
3a6c3343
AC
75 int size;
76};
c906108c 77
52059ffd
TT
78struct other_sections
79{
80 CORE_ADDR addr;
81 char *name;
82
83 /* SECTINDEX must be valid for associated BFD or set to -1. */
84 int sectindex;
85};
86
62557bbc
KB
87/* Define an array of addresses to accommodate non-contiguous dynamic
88 loading of modules. This is for use when entering commands, so we
3a6c3343
AC
89 can keep track of the section names until we read the file and can
90 map them to bfd sections. This structure is also used by solib.c
91 to communicate the section addresses in shared objects to
92 symbol_file_add (). */
93
94struct section_addr_info
62557bbc 95{
a39a16c4
MM
96 /* The number of sections for which address information is
97 available. */
98 size_t num_sections;
c378eb4e 99 /* Sections whose names are file format dependent. */
52059ffd 100 struct other_sections other[1];
62557bbc
KB
101};
102
28c32713
JB
103
104/* A table listing the load segments in a symfile, and which segment
105 each BFD section belongs to. */
31d99776
DJ
106struct symfile_segment_data
107{
108 /* How many segments are present in this file. If there are
109 two, the text segment is the first one and the data segment
110 is the second one. */
111 int num_segments;
112
113 /* If NUM_SEGMENTS is greater than zero, the original base address
114 of each segment. */
115 CORE_ADDR *segment_bases;
116
117 /* If NUM_SEGMENTS is greater than zero, the memory size of each
118 segment. */
119 CORE_ADDR *segment_sizes;
120
121 /* If NUM_SEGMENTS is greater than zero, this is an array of entries
28c32713
JB
122 recording which segment contains each BFD section.
123 SEGMENT_INFO[I] is S+1 if the I'th BFD section belongs to segment
124 S, or zero if it is not in any segment. */
31d99776
DJ
125 int *segment_info;
126};
127
44b13c5a
JK
128/* Callback for quick_symbol_functions->map_symbol_filenames. */
129
130typedef void (symbol_filename_ftype) (const char *filename,
131 const char *fullname, void *data);
132
206f2a57
DE
133/* Callback for quick_symbol_functions->expand_symtabs_matching
134 to match a file name. */
135
136typedef int (expand_symtabs_file_matcher_ftype) (const char *filename,
137 void *data, int basenames);
138
139/* Callback for quick_symbol_functions->expand_symtabs_matching
140 to match a symbol name. */
141
142typedef int (expand_symtabs_symbol_matcher_ftype) (const char *name,
143 void *data);
144
276d885b
GB
145/* Callback for quick_symbol_functions->expand_symtabs_matching
146 to be called after a symtab has been expanded. */
147
148typedef void (expand_symtabs_exp_notify_ftype) \
149 (struct compunit_symtab *symtab, void *data);
150
ccefe4c4
TT
151/* The "quick" symbol functions exist so that symbol readers can
152 avoiding an initial read of all the symbols. For example, symbol
153 readers might choose to use the "partial symbol table" utilities,
154 which is one implementation of the quick symbol functions.
155
156 The quick symbol functions are generally opaque: the underlying
157 representation is hidden from the caller.
158
159 In general, these functions should only look at whatever special
160 index the symbol reader creates -- looking through the symbol
161 tables themselves is handled by generic code. If a function is
162 defined as returning a "symbol table", this means that the function
163 should only return a newly-created symbol table; it should not
164 examine pre-existing ones.
165
166 The exact list of functions here was determined in an ad hoc way
167 based on gdb's history. */
168
169struct quick_symbol_functions
170{
171 /* Return true if this objfile has any "partial" symbols
172 available. */
173 int (*has_symbols) (struct objfile *objfile);
174
175 /* Return the symbol table for the "last" file appearing in
176 OBJFILE. */
177 struct symtab *(*find_last_source_symtab) (struct objfile *objfile);
178
179 /* Forget all cached full file names for OBJFILE. */
180 void (*forget_cached_source_info) (struct objfile *objfile);
181
f8eba3c6
TT
182 /* Expand and iterate over each "partial" symbol table in OBJFILE
183 where the source file is named NAME.
184
af529f8f
JK
185 If NAME is not absolute, a match after a '/' in the symbol table's
186 file name will also work, REAL_PATH is NULL then. If NAME is
187 absolute then REAL_PATH is non-NULL absolute file name as resolved
188 via gdb_realpath from NAME.
f8eba3c6
TT
189
190 If a match is found, the "partial" symbol table is expanded.
191 Then, this calls iterate_over_some_symtabs (or equivalent) over
192 all newly-created symbol tables, passing CALLBACK and DATA to it.
193 The result of this call is returned. */
194 int (*map_symtabs_matching_filename) (struct objfile *objfile,
195 const char *name,
f8eba3c6
TT
196 const char *real_path,
197 int (*callback) (struct symtab *,
198 void *),
199 void *data);
ccefe4c4
TT
200
201 /* Check to see if the symbol is defined in a "partial" symbol table
f88cb4b6 202 of OBJFILE. BLOCK_INDEX should be either GLOBAL_BLOCK or STATIC_BLOCK,
ccefe4c4
TT
203 depending on whether we want to search global symbols or static
204 symbols. NAME is the name of the symbol to look for. DOMAIN
205 indicates what sort of symbol to search for.
206
43f3e411 207 Returns the newly-expanded compunit in which the symbol is
bfb05775 208 defined, or NULL if no such symbol table exists. If OBJFILE
43f3e411
DE
209 contains !TYPE_OPAQUE symbol prefer its compunit. If it contains
210 only TYPE_OPAQUE symbol(s), return at least that compunit. */
211 struct compunit_symtab *(*lookup_symbol) (struct objfile *objfile,
212 int block_index, const char *name,
213 domain_enum domain);
ccefe4c4
TT
214
215 /* Print statistics about any indices loaded for OBJFILE. The
216 statistics should be printed to gdb_stdout. This is used for
217 "maint print statistics". */
218 void (*print_stats) (struct objfile *objfile);
219
220 /* Dump any indices loaded for OBJFILE. The dump should go to
221 gdb_stdout. This is used for "maint print objfiles". */
222 void (*dump) (struct objfile *objfile);
223
224 /* This is called by objfile_relocate to relocate any indices loaded
225 for OBJFILE. */
226 void (*relocate) (struct objfile *objfile,
3189cb12
DE
227 const struct section_offsets *new_offsets,
228 const struct section_offsets *delta);
ccefe4c4
TT
229
230 /* Find all the symbols in OBJFILE named FUNC_NAME, and ensure that
231 the corresponding symbol tables are loaded. */
232 void (*expand_symtabs_for_function) (struct objfile *objfile,
233 const char *func_name);
234
235 /* Read all symbol tables associated with OBJFILE. */
236 void (*expand_all_symtabs) (struct objfile *objfile);
237
652a8996
JK
238 /* Read all symbol tables associated with OBJFILE which have
239 symtab_to_fullname equal to FULLNAME.
d4637a04
DE
240 This is for the purposes of examining code only, e.g., expand_line_sal.
241 The routine may ignore debug info that is known to not be useful with
242 code, e.g., DW_TAG_type_unit for dwarf debug info. */
652a8996
JK
243 void (*expand_symtabs_with_fullname) (struct objfile *objfile,
244 const char *fullname);
ccefe4c4 245
fe978cb0 246 /* Find global or static symbols in all tables that are in DOMAIN
40658b94 247 and for which MATCH (symbol name, NAME) == 0, passing each to
265e52c3 248 CALLBACK, reading in partial symbol tables as needed. Look
c378eb4e 249 through global symbols if GLOBAL and otherwise static symbols.
40658b94
PH
250 Passes NAME, NAMESPACE, and DATA to CALLBACK with each symbol
251 found. After each block is processed, passes NULL to CALLBACK.
1e3a8f45
JB
252 MATCH must be weaker than strcmp_iw_ordered in the sense that
253 strcmp_iw_ordered(x,y) == 0 --> MATCH(x,y) == 0. ORDERED_COMPARE,
254 if non-null, must be an ordering relation compatible with
255 strcmp_iw_ordered in the sense that
256 strcmp_iw_ordered(x,y) == 0 --> ORDERED_COMPARE(x,y) == 0
40658b94 257 and
1e3a8f45
JB
258 strcmp_iw_ordered(x,y) <= 0 --> ORDERED_COMPARE(x,y) <= 0
259 (allowing strcmp_iw_ordered(x,y) < 0 while ORDERED_COMPARE(x, y) == 0).
40658b94
PH
260 CALLBACK returns 0 to indicate that the scan should continue, or
261 non-zero to indicate that the scan should be terminated. */
262
ade7ed9e 263 void (*map_matching_symbols) (struct objfile *,
fe978cb0 264 const char *name, domain_enum domain,
ade7ed9e 265 int global,
40658b94
PH
266 int (*callback) (struct block *,
267 struct symbol *, void *),
268 void *data,
2edb89d3
JK
269 symbol_compare_ftype *match,
270 symbol_compare_ftype *ordered_compare);
ccefe4c4
TT
271
272 /* Expand all symbol tables in OBJFILE matching some criteria.
273
274 FILE_MATCHER is called for each file in OBJFILE. The file name
275 and the DATA argument are passed to it. If it returns zero, this
7b08b9eb 276 file is skipped. If FILE_MATCHER is NULL such file is not skipped.
fbd9ab74
JK
277 If BASENAMES is non-zero the function should consider only base name of
278 DATA (passed file name is already only the lbasename part).
ccefe4c4 279
7b08b9eb 280 Otherwise, if KIND does not match this symbol is skipped.
74ccd7f5 281
206f2a57 282 If even KIND matches, then SYMBOL_MATCHER is called for each symbol
e078317b 283 defined in the file. The symbol "search" name and DATA are passed
206f2a57 284 to SYMBOL_MATCHER.
ccefe4c4 285
206f2a57 286 If SYMBOL_MATCHER returns zero, then this symbol is skipped.
ccefe4c4 287
7b08b9eb
JK
288 Otherwise, this symbol's symbol table is expanded.
289
ccefe4c4
TT
290 DATA is user data that is passed unmodified to the callback
291 functions. */
f8eba3c6
TT
292 void (*expand_symtabs_matching)
293 (struct objfile *objfile,
206f2a57
DE
294 expand_symtabs_file_matcher_ftype *file_matcher,
295 expand_symtabs_symbol_matcher_ftype *symbol_matcher,
276d885b 296 expand_symtabs_exp_notify_ftype *expansion_notify,
f8eba3c6
TT
297 enum search_domain kind,
298 void *data);
ccefe4c4 299
43f3e411
DE
300 /* Return the comp unit from OBJFILE that contains PC and
301 SECTION. Return NULL if there is no such compunit. This
302 should return the compunit that contains a symbol whose
ccefe4c4 303 address exactly matches PC, or, if there is no exact match, the
43f3e411 304 compunit that contains a symbol whose address is closest to
ccefe4c4 305 PC. */
43f3e411
DE
306 struct compunit_symtab *(*find_pc_sect_compunit_symtab)
307 (struct objfile *objfile, struct bound_minimal_symbol msymbol,
308 CORE_ADDR pc, struct obj_section *section, int warn_if_readin);
ccefe4c4 309
ad727bb2 310 /* Call a callback for every file defined in OBJFILE whose symtab is
44b13c5a 311 not already read in. FUN is the callback. It is passed the file's
74e2f255
DE
312 FILENAME, the file's FULLNAME (if need_fullname is non-zero), and
313 the DATA passed to this function. */
ccefe4c4 314 void (*map_symbol_filenames) (struct objfile *objfile,
74e2f255
DE
315 symbol_filename_ftype *fun, void *data,
316 int need_fullname);
ccefe4c4
TT
317};
318
55aa24fb
SDJ
319/* Structure of functions used for probe support. If one of these functions
320 is provided, all must be. */
321
322struct sym_probe_fns
323{
324 /* If non-NULL, return an array of probe objects.
325
326 The returned value does not have to be freed and it has lifetime of the
327 OBJFILE. */
328 VEC (probe_p) *(*sym_get_probes) (struct objfile *);
55aa24fb
SDJ
329};
330
c906108c
SS
331/* Structure to keep track of symbol reading functions for various
332 object file types. */
333
c5aa993b 334struct sym_fns
3a6c3343 335{
3a6c3343
AC
336 /* Initializes anything that is global to the entire symbol table.
337 It is called during symbol_file_add, when we begin debugging an
338 entirely new program. */
c906108c 339
3a6c3343 340 void (*sym_new_init) (struct objfile *);
c906108c 341
3a6c3343
AC
342 /* Reads any initial information from a symbol file, and initializes
343 the struct sym_fns SF in preparation for sym_read(). It is
344 called every time we read a symbol file for any reason. */
c906108c 345
3a6c3343 346 void (*sym_init) (struct objfile *);
c906108c 347
f4352531 348 /* sym_read (objfile, symfile_flags) Reads a symbol file into a psymtab
3a6c3343 349 (or possibly a symtab). OBJFILE is the objfile struct for the
f4352531
TG
350 file we are reading. SYMFILE_FLAGS are the flags passed to
351 symbol_file_add & co. */
c906108c 352
b15cc25c 353 void (*sym_read) (struct objfile *, symfile_add_flags);
c906108c 354
3e03848b
JK
355 /* Read the partial symbols for an objfile. This may be NULL, in which case
356 gdb has to check other ways if this objfile has any symbols. This may
357 only be non-NULL if the objfile actually does have debuginfo available.
358 */
b11896a5
TT
359
360 void (*sym_read_psymbols) (struct objfile *);
361
3a6c3343
AC
362 /* Called when we are finished with an objfile. Should do all
363 cleanup that is specific to the object file format for the
364 particular objfile. */
c906108c 365
3a6c3343 366 void (*sym_finish) (struct objfile *);
c906108c 367
db7a9bcd 368
3a6c3343 369 /* This function produces a file-dependent section_offsets
db7a9bcd
SM
370 structure, allocated in the objfile's storage.
371
372 The section_addr_info structure contains the offset of loadable and
373 allocated sections, relative to the absolute offsets found in the BFD. */
c906108c 374
3189cb12 375 void (*sym_offsets) (struct objfile *, const struct section_addr_info *);
c906108c 376
31d99776
DJ
377 /* This function produces a format-independent description of
378 the segments of ABFD. Each segment is a unit of the file
379 which may be relocated independently. */
380
381 struct symfile_segment_data *(*sym_segments) (bfd *abfd);
382
c295b2e5
JB
383 /* This function should read the linetable from the objfile when
384 the line table cannot be read while processing the debugging
385 information. */
ac8035ab 386
f56ce883 387 void (*sym_read_linetable) (struct objfile *);
c295b2e5 388
ac8035ab
TG
389 /* Relocate the contents of a debug section SECTP. The
390 contents are stored in BUF if it is non-NULL, or returned in a
391 malloc'd buffer otherwise. */
392
393 bfd_byte *(*sym_relocate) (struct objfile *, asection *sectp, bfd_byte *buf);
394
55aa24fb
SDJ
395 /* If non-NULL, this objfile has probe support, and all the probe
396 functions referred to here will be non-NULL. */
397 const struct sym_probe_fns *sym_probe_fns;
398
ccefe4c4
TT
399 /* The "quick" (aka partial) symbol functions for this symbol
400 reader. */
401 const struct quick_symbol_functions *qf;
3a6c3343 402};
c906108c 403
567995e1 404extern struct section_addr_info *
3e43a32a 405 build_section_addr_info_from_objfile (const struct objfile *objfile);
567995e1 406
75242ef4
JK
407extern void relative_addr_info_to_section_offsets
408 (struct section_offsets *section_offsets, int num_sections,
3189cb12 409 const struct section_addr_info *addrs);
75242ef4
JK
410
411extern void addr_info_make_relative (struct section_addr_info *addrs,
412 bfd *abfd);
413
c906108c
SS
414/* The default version of sym_fns.sym_offsets for readers that don't
415 do anything special. */
416
570b8f7c 417extern void default_symfile_offsets (struct objfile *objfile,
3189cb12 418 const struct section_addr_info *);
c906108c 419
31d99776
DJ
420/* The default version of sym_fns.sym_segments for readers that don't
421 do anything special. */
422
423extern struct symfile_segment_data *default_symfile_segments (bfd *abfd);
c906108c 424
ac8035ab
TG
425/* The default version of sym_fns.sym_relocate for readers that don't
426 do anything special. */
427
428extern bfd_byte *default_symfile_relocate (struct objfile *objfile,
429 asection *sectp, bfd_byte *buf);
430
43f3e411 431extern struct symtab *allocate_symtab (struct compunit_symtab *, const char *)
4e04028d 432 ATTRIBUTE_NONNULL (1);
c906108c 433
43f3e411
DE
434extern struct compunit_symtab *allocate_compunit_symtab (struct objfile *,
435 const char *)
436 ATTRIBUTE_NONNULL (1);
437
438extern void add_compunit_symtab_to_objfile (struct compunit_symtab *cu);
439
c256e171 440extern void add_symtab_fns (enum bfd_flavour flavour, const struct sym_fns *);
c906108c 441
b15cc25c 442extern void clear_symtab_users (symfile_add_flags add_flags);
f176c4b5
DE
443
444extern enum language deduce_language_from_filename (const char *);
445
56618e20
TT
446/* Map the filename extension EXT to the language LANG. Any previous
447 association of EXT will be removed. EXT will be copied by this
448 function. */
449extern void add_filename_language (const char *ext, enum language lang);
450
b15cc25c
PA
451extern struct objfile *symbol_file_add (const char *, symfile_add_flags,
452 struct section_addr_info *, objfile_flags);
7eedccfa 453
b15cc25c 454extern struct objfile *symbol_file_add_from_bfd (bfd *, const char *, symfile_add_flags,
eb4556d7 455 struct section_addr_info *,
b15cc25c 456 objfile_flags, struct objfile *parent);
eb4556d7 457
b15cc25c 458extern void symbol_file_add_separate (bfd *, const char *, symfile_add_flags,
24ba069a 459 struct objfile *);
9cce227f 460
15d123c9 461extern char *find_separate_debug_file_by_debuglink (struct objfile *);
9cce227f 462
a39a16c4
MM
463/* Create a new section_addr_info, with room for NUM_SECTIONS. */
464
3a6c3343
AC
465extern struct section_addr_info *alloc_section_addr_info (size_t
466 num_sections);
a39a16c4 467
3a6c3343
AC
468/* Build (allocate and populate) a section_addr_info struct from an
469 existing section table. */
62557bbc 470
3a6c3343 471extern struct section_addr_info
0542c86d 472 *build_section_addr_info_from_section_table (const struct target_section
3a6c3343 473 *start,
0542c86d 474 const struct target_section
3a6c3343 475 *end);
62557bbc 476
3a6c3343
AC
477/* Free all memory allocated by
478 build_section_addr_info_from_section_table. */
62557bbc 479
570b8f7c 480extern void free_section_addr_info (struct section_addr_info *);
62557bbc
KB
481
482
c906108c
SS
483 /* Variables */
484
b7209cb4
FF
485/* If non-zero, shared library symbols will be added automatically
486 when the inferior is created, new libraries are loaded, or when
487 attaching to the inferior. This is almost always what users will
488 want to have happen; but for very large programs, the startup time
489 will be excessive, and so if this is a problem, the user can clear
490 this flag and then add the shared library symbols as needed. Note
491 that there is a potential for confusion, since if the shared
492 library symbols are not loaded, commands like "info fun" will *not*
3a6c3343 493 report all the functions that are actually present. */
c906108c 494
b7209cb4 495extern int auto_solib_add;
c906108c 496
c906108c
SS
497/* From symfile.c */
498
8b60591b
JB
499extern void set_initial_language (void);
500
4efb68b1 501extern void find_lowest_section (bfd *, asection *, void *);
c906108c 502
192b62ce 503extern gdb_bfd_ref_ptr symfile_bfd_open (const char *);
c906108c 504
e2f6d8e5
JB
505extern int get_section_index (struct objfile *, char *);
506
770e7fc7
DE
507extern int print_symbol_loading_p (int from_tty, int mainline, int full);
508
c906108c 509/* Utility functions for overlay sections: */
3a6c3343
AC
510extern enum overlay_debugging_state
511{
512 ovly_off,
513 ovly_on,
d874f1e2
MS
514 ovly_auto
515} overlay_debugging;
c906108c
SS
516extern int overlay_cache_invalid;
517
3a6c3343 518/* Return the "mapped" overlay section containing the PC. */
714835d5 519extern struct obj_section *find_pc_mapped_section (CORE_ADDR);
c906108c 520
3a6c3343
AC
521/* Return any overlay section containing the PC (even in its LMA
522 region). */
714835d5 523extern struct obj_section *find_pc_overlay (CORE_ADDR);
c906108c 524
3a6c3343 525/* Return true if the section is an overlay. */
714835d5 526extern int section_is_overlay (struct obj_section *);
c906108c 527
3a6c3343 528/* Return true if the overlay section is currently "mapped". */
714835d5 529extern int section_is_mapped (struct obj_section *);
c906108c 530
3a6c3343 531/* Return true if pc belongs to section's VMA. */
714835d5 532extern CORE_ADDR pc_in_mapped_range (CORE_ADDR, struct obj_section *);
c906108c 533
3a6c3343 534/* Return true if pc belongs to section's LMA. */
714835d5 535extern CORE_ADDR pc_in_unmapped_range (CORE_ADDR, struct obj_section *);
c906108c 536
3a6c3343 537/* Map an address from a section's LMA to its VMA. */
714835d5 538extern CORE_ADDR overlay_mapped_address (CORE_ADDR, struct obj_section *);
c906108c 539
3a6c3343 540/* Map an address from a section's VMA to its LMA. */
714835d5 541extern CORE_ADDR overlay_unmapped_address (CORE_ADDR, struct obj_section *);
c906108c 542
3a6c3343 543/* Convert an address in an overlay section (force into VMA range). */
714835d5 544extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
c906108c 545
3a6c3343 546/* Load symbols from a file. */
ecf45d2c
SL
547extern void symbol_file_add_main (const char *args,
548 symfile_add_flags add_flags);
1adeb98a 549
3a6c3343 550/* Clear GDB symbol tables. */
1adeb98a
FN
551extern void symbol_file_clear (int from_tty);
552
1c772458
UW
553/* Default overlay update function. */
554extern void simple_overlay_update (struct obj_section *);
555
ac8035ab
TG
556extern bfd_byte *symfile_relocate_debug_section (struct objfile *, asection *,
557 bfd_byte *);
086df311 558
31d99776 559extern int symfile_map_offsets_to_segments (bfd *,
3189cb12 560 const struct symfile_segment_data *,
31d99776
DJ
561 struct section_offsets *,
562 int, const CORE_ADDR *);
563struct symfile_segment_data *get_symfile_segment_data (bfd *abfd);
564void free_symfile_segment_data (struct symfile_segment_data *data);
565
ccefe4c4
TT
566extern struct cleanup *increment_reading_symtab (void);
567
bb4142cf
DE
568void expand_symtabs_matching (expand_symtabs_file_matcher_ftype *,
569 expand_symtabs_symbol_matcher_ftype *,
276d885b 570 expand_symtabs_exp_notify_ftype *,
bb4142cf 571 enum search_domain kind, void *data);
540c2971 572
bb4142cf
DE
573void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
574 int need_fullname);
540c2971 575
c906108c
SS
576/* From dwarf2read.c */
577
251d32d9
TG
578/* Names for a dwarf2 debugging section. The field NORMAL is the normal
579 section name (usually from the DWARF standard), while the field COMPRESSED
580 is the name of compressed sections. If your object file format doesn't
581 support compressed sections, the field COMPRESSED can be NULL. Likewise,
582 the debugging section is not supported, the field NORMAL can be NULL too.
583 It doesn't make sense to have a NULL NORMAL field but a non-NULL COMPRESSED
584 field. */
585
586struct dwarf2_section_names {
587 const char *normal;
588 const char *compressed;
589};
590
591/* List of names for dward2 debugging sections. Also most object file formats
592 use the standardized (ie ELF) names, some (eg XCOFF) have customized names
593 due to restrictions.
594 The table for the standard names is defined in dwarf2read.c. Please
595 update all instances of dwarf2_debug_sections if you add a field to this
596 structure. It is always safe to use { NULL, NULL } in this case. */
597
598struct dwarf2_debug_sections {
599 struct dwarf2_section_names info;
600 struct dwarf2_section_names abbrev;
601 struct dwarf2_section_names line;
602 struct dwarf2_section_names loc;
603 struct dwarf2_section_names macinfo;
cf2c3c16 604 struct dwarf2_section_names macro;
251d32d9
TG
605 struct dwarf2_section_names str;
606 struct dwarf2_section_names ranges;
607 struct dwarf2_section_names types;
3019eac3 608 struct dwarf2_section_names addr;
251d32d9
TG
609 struct dwarf2_section_names frame;
610 struct dwarf2_section_names eh_frame;
611 struct dwarf2_section_names gdb_index;
24d3216f
TT
612 /* This field has no meaning, but exists solely to catch changes to
613 this structure which are not reflected in some instance. */
614 int sentinel;
251d32d9
TG
615};
616
617extern int dwarf2_has_info (struct objfile *,
618 const struct dwarf2_debug_sections *);
c906108c 619
3017a003
TG
620/* Dwarf2 sections that can be accessed by dwarf2_get_section_info. */
621enum dwarf2_section_enum {
622 DWARF2_DEBUG_FRAME,
623 DWARF2_EH_FRAME
624};
625
626extern void dwarf2_get_section_info (struct objfile *,
627 enum dwarf2_section_enum,
d521ce57 628 asection **, const gdb_byte **,
3017a003
TG
629 bfd_size_type *);
630
9291a0cd 631extern int dwarf2_initialize_objfile (struct objfile *);
f29dff0a 632extern void dwarf2_build_psymtabs (struct objfile *);
b6af0555 633extern void dwarf2_build_frame_info (struct objfile *);
d4f3574e 634
fe3e1990
DJ
635void dwarf2_free_objfile (struct objfile *);
636
c906108c
SS
637/* From mdebugread.c */
638
8dddcb8f
TT
639extern void mdebug_build_psymtabs (minimal_symbol_reader &,
640 struct objfile *,
3a6c3343
AC
641 const struct ecoff_debug_swap *,
642 struct ecoff_debug_info *);
643
644extern void elfmdebug_build_psymtabs (struct objfile *,
645 const struct ecoff_debug_swap *,
646 asection *);
c906108c 647
608e2dbb
TT
648/* From minidebug.c. */
649
192b62ce 650extern gdb_bfd_ref_ptr find_separate_debug_file_in_section (struct objfile *);
608e2dbb 651
c5aa993b 652#endif /* !defined(SYMFILE_H) */
This page took 1.806826 seconds and 4 git commands to generate.