Move psymtab statistics printing to psymtab.c

This moves all the psymtab statistics printing code form symmisc.c to
psymtab.c.  This changes the formatting of the output a little, but
considering that it is a maint command (and, I assume, a rarely used
one), this seems fine to me.

This change helps further dissociate the psymtab from the objfile.  In
the end there will be no direct connect -- only via the
quick_symbol_functions interface.

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

	* dwarf2/read.c (dwarf2_base_index_functions::print_stats): Add
	print_bcache parameter.
	* symfile-debug.c (objfile::print_stats): Add print_bcache
	parameter.
	* quick-symbol.h (struct quick_symbol_functions)
	<print_stats>: Add print_bcache parameter.
	* symmisc.c (print_symbol_bcache_statistics, count_psyms): Move
	code to psymtab.c.
	(print_objfile_statistics): Move psymtab code to psymtab.c.
	* psymtab.c (count_psyms): Move from symmisc.c.
	(psymbol_functions::print_stats): Print partial symbol and bcache
	statistics.  Add print_bcache parameter.
	* objfiles.h (print_symbol_bcache_statistics): Don't declare.
	(struct objfile) <print_stats>: Add print_bcache parameter.
	* maint.c (maintenance_print_statistics): Update.

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

	* gdb.base/maint.exp: Update "maint print statistics" output.
This commit is contained in:
Tom Tromey
2021-03-20 17:23:40 -06:00
parent efd7398ee2
commit 4829711b6b
11 changed files with 84 additions and 60 deletions

View File

@ -174,14 +174,14 @@ objfile::lookup_symbol (block_enum kind, const char *name, domain_enum domain)
}
void
objfile::print_stats ()
objfile::print_stats (bool print_bcache)
{
if (debug_symfile)
fprintf_filtered (gdb_stdlog, "qf->print_stats (%s)\n",
objfile_debug_name (this));
fprintf_filtered (gdb_stdlog, "qf->print_stats (%s, %d)\n",
objfile_debug_name (this), print_bcache);
if (qf != nullptr)
qf->print_stats (this);
qf->print_stats (this, print_bcache);
}
void