gdb: add new function quick_symbol_functions::has_unexpanded_symbols

Adds a new function to the quick_symbol_functions API to let us know
if there are any unexpanded symbols.  This functionality is required
by a later commit.  After this commit the functionality is unused, and
untested.

The new function objfile::has_unexpanded_symtabs is added to the
symfile-debug.c file which is a little strange, but this
is (currently) where many of the other objfile::* functions (that call
onto the quick_symbol_functions) are defined, so I'm reluctant to
break this pattern.

There should be no user visible changes after this commit.

gdb/ChangeLog:

	* dwarf2/read.c (struct dwarf2_base_index_functions)
	<has_unexpanded_symtabs>: Declare.
	(dwarf2_base_index_functions::has_unexpanded_symtabs): Define new
	function.
	* objfiles.h (struct objfile) <has_unexpanded_symtabs>: Declare.
	* psympriv.h (struct psymbol_functions) <has_unexpanded_symtabs>:
	Declare.
	* psymtab.c (psymbol_functions::has_unexpanded_symtabs): Define
	new function.
	* quick-symbol.h (struct quick_symbol_functions)
	<has_unexpanded_symtabs>: Declare.
	* symfile-debug.c (objfile::has_unexpanded_symtabs): Define new
	function.
This commit is contained in:
Andrew Burgess
2021-04-15 11:29:55 +01:00
parent d038ce48f1
commit fc4d5ebf8f
7 changed files with 95 additions and 0 deletions

View File

@ -1184,6 +1184,24 @@ psymbol_functions::has_symbols (struct objfile *objfile)
return m_partial_symtabs->psymtabs != NULL;
}
/* See quick_symbol_functions::has_unexpanded_symtabs in quick-symbol.h. */
bool
psymbol_functions::has_unexpanded_symtabs (struct objfile *objfile)
{
for (partial_symtab *psymtab : require_partial_symbols (objfile))
{
/* Is this already expanded? */
if (psymtab->readin_p (objfile))
continue;
/* It has not yet been expanded. */
return true;
}
return false;
}
/* Helper function for psym_find_compunit_symtab_by_address that fills
in m_psymbol_map for a given range of psymbols. */