binutils-gdb/gdb/dwarf2/public.h
Tom Tromey eb36a3eb2f Allow multiple partial symbol readers per objfile
This patch finally changes gdb so that an objfile can have multiple
sources of partial symbols (or mixed partial symbols and other kinds
of indices).

This is done by having each symbol reader create its own
psymbol_functions object and add it to the 'qf' list in the objfile.

gdb/ChangeLog
2021-03-20  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (xcoff_initial_scan): Create partial symtabs.
	* symfile.c (syms_from_objfile_1, reread_symbols): Update.
	* psymtab.h (make_psymbol_functions): Don't declare.
	* psymtab.c (make_psymbol_functions): Remove.
	(maintenance_print_psymbols): Update.
	* psympriv.h (struct psymbol_functions): Add no-argument
	constructor.
	* objfiles.h (struct objfile) <reset_psymtabs>: Remove.
	<partial_symtabs>: Remove.
	* mdebugread.c (mdebug_build_psymtabs): Create partial symtabs.
	* elfread.c (read_partial_symbols): Update.
	(elf_symfile_read): Remove check for existing partial symbols.
	Don't clear "qf".
	* dwarf2/read.c (dwarf2_has_info): Remove check for existing
	partial symbols.
	(dwarf2_build_psymtabs): Add psymbol_functions parameter.  Create
	partial symtabs.
	* dwarf2/public.h (dwarf2_build_psymtabs): Add psymbol_functions
	parameter.
	* dbxread.c (dbx_symfile_read): Create partial symtabs.
	* ctfread.c (elfctf_build_psymtabs): Create partial symtabs.
2021-03-20 17:23:46 -06:00

52 lines
1.7 KiB
C

/* Public API for gdb DWARF reader
Copyright (C) 2021 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef DWARF2_PUBLIC_H
#define DWARF2_PUBLIC_H
extern int dwarf2_has_info (struct objfile *,
const struct dwarf2_debug_sections *,
bool = false);
/* A DWARF names index variant. */
enum class dw_index_kind
{
/* GDB's own .gdb_index format. */
GDB_INDEX,
/* DWARF5 .debug_names. */
DEBUG_NAMES,
};
/* Initialize for reading DWARF for OBJFILE. Return false if this
file will use psymtabs, or true if using an index, in which case
*INDEX_KIND is set to the index variant in use. */
extern bool dwarf2_initialize_objfile (struct objfile *objfile,
dw_index_kind *index_kind);
struct psymbol_functions;
extern void dwarf2_build_psymtabs (struct objfile *,
psymbol_functions *psf = nullptr);
extern void dwarf2_build_frame_info (struct objfile *);
extern quick_symbol_functions_up make_dwarf_gdb_index ();
extern quick_symbol_functions_up make_dwarf_debug_names ();
#endif /* DWARF2_PUBLIC_H */