From 4829711b6ba57568d5fec3c2e8c747a2edb2aa8f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 20 Mar 2021 17:23:40 -0600 Subject: 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 * 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) : 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) : Add print_bcache parameter. * maint.c (maintenance_print_statistics): Update. gdb/testsuite/ChangeLog 2021-03-20 Tom Tromey * gdb.base/maint.exp: Update "maint print statistics" output. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/maint.exp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'gdb/testsuite') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d5ff002..e764c8f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2021-03-20 Tom Tromey + + * gdb.base/maint.exp: Update "maint print statistics" output. + 2021-03-19 Kevin Buettner * lib/gdbserver-support.exp (gdbserver_exit): Use the diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index b418c02..e723922 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -193,7 +193,7 @@ if [istarget "*-*-cygwin*"] { send_gdb "maint print statistics\n" gdb_expect { - -re "Statistics for\[^\n\r\]*maint\[^\n\r\]*:\r\n Number of \"minimal\" symbols read: $decimal\r\n( Number of \"partial\" symbols read: $decimal\r\n)? Number of \"full\" symbols read: $decimal\r\n Number of \"types\" defined: $decimal\r\n( Number of psym tables \\(not yet expanded\\): $decimal\r\n)?( Number of read CUs: $decimal\r\n Number of unread CUs: $decimal\r\n)? Number of symbol tables: $decimal\r\n Number of symbol tables with line tables: $decimal\r\n Number of symbol tables with blockvectors: $decimal\r\n Total memory used for objfile obstack: $decimal\r\n Total memory used for BFD obstack: $decimal\r\n Total memory used for psymbol cache: $decimal\r\n Total memory used for string cache: $decimal\r\n" { + -re "Statistics for\[^\n\r\]*maint\[^\n\r\]*:\r\n Number of \"minimal\" symbols read: $decimal\r\n Number of \"full\" symbols read: $decimal\r\n Number of \"types\" defined: $decimal\r\n( Number of read CUs: $decimal\r\n Number of unread CUs: $decimal\r\n)? Number of symbol tables: $decimal\r\n Number of symbol tables with line tables: $decimal\r\n Number of symbol tables with blockvectors: $decimal\r\n( Number of \"partial\" symbols read: $decimal\r\n)?( Number of psym tables \\(not yet expanded\\): $decimal\r\n)? Total memory used for psymbol cache: $decimal\r\n Total memory used for objfile obstack: $decimal\r\n Total memory used for BFD obstack: $decimal\r\n Total memory used for string cache: $decimal\r\n" { gdb_expect { -re "$gdb_prompt $" { pass "maint print statistics" -- cgit v1.1