aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-20 17:23:40 -0600
committerTom Tromey <tom@tromey.com>2021-03-20 17:23:45 -0600
commitcaf8c1e5071295d25f3843d5d39541df24b45787 (patch)
tree2be1468f6e2e29fb26cc8e60e2abd3c6114927e2
parent3aa31ce7884f979c68d440a4352c8d69a3283f6c (diff)
downloadgdb-caf8c1e5071295d25f3843d5d39541df24b45787.zip
gdb-caf8c1e5071295d25f3843d5d39541df24b45787.tar.gz
gdb-caf8c1e5071295d25f3843d5d39541df24b45787.tar.bz2
Change count_psyms to be a method on psymbol_functions
This removes a use of objfile->psymtabs by changing count_psyms to be a method on psymbol_functions. gdb/ChangeLog 2021-03-20 Tom Tromey <tom@tromey.com> * psymtab.c (psymbol_functions::count_psyms): Rename. (psymbol_functions::print_stats): Update. * psympriv.h (struct psymbol_functions) <count_psyms>: Declare method.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/psympriv.h3
-rw-r--r--gdb/psymtab.c8
3 files changed, 14 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3abf801..cd9c17c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2021-03-20 Tom Tromey <tom@tromey.com>
+ * psymtab.c (psymbol_functions::count_psyms): Rename.
+ (psymbol_functions::print_stats): Update.
+ * psympriv.h (struct psymbol_functions) <count_psyms>: Declare
+ method.
+
+2021-03-20 Tom Tromey <tom@tromey.com>
+
* psymtab.c (psymbol_functions::require_partial_symbols): Rename.
(psymbol_functions::find_pc_sect_psymtab): Rename.
(psymbol_functions::find_pc_sect_compunit_symtab)
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index 85651f5..b613911 100644
--- a/gdb/psympriv.h
+++ b/gdb/psympriv.h
@@ -591,6 +591,9 @@ struct psymbol_functions : public quick_symbol_functions
private:
+ /* Count the number of partial symbols in *THIS. */
+ int count_psyms ();
+
void fill_psymbol_map (struct objfile *objfile,
struct partial_symtab *psymtab,
std::set<CORE_ADDR> *seen_addrs,
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index b2f9299..3f3b559 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -962,11 +962,11 @@ dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab,
/* Count the number of partial symbols in OBJFILE. */
-static int
-count_psyms (struct objfile *objfile)
+int
+psymbol_functions::count_psyms ()
{
int count = 0;
- for (partial_symtab *pst : objfile->psymtabs ())
+ for (partial_symtab *pst : m_partial_symtabs->range ())
{
count += pst->global_psymbols.size ();
count += pst->static_psymbols.size ();
@@ -984,7 +984,7 @@ psymbol_functions::print_stats (struct objfile *objfile, bool print_bcache)
if (!print_bcache)
{
- int n_psyms = count_psyms (objfile);
+ int n_psyms = count_psyms ();
if (n_psyms > 0)
printf_filtered (_(" Number of \"partial\" symbols read: %d\n"),
n_psyms);