aboutsummaryrefslogtreecommitdiff
path: root/gdb/psymtab.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-11-24 14:22:25 -0700
committerTom Tromey <tom@tromey.com>2019-01-09 18:28:15 -0700
commitb22a7c6ab6173fe4fa1352e14d00a234bbf50346 (patch)
treedb8a06cfd47bf49629796ab9f06fc4a1947ef2e3 /gdb/psymtab.h
parent3b9d3ac236dcc418619785e0660fc0063e6489b8 (diff)
downloadgdb-b22a7c6ab6173fe4fa1352e14d00a234bbf50346.zip
gdb-b22a7c6ab6173fe4fa1352e14d00a234bbf50346.tar.gz
gdb-b22a7c6ab6173fe4fa1352e14d00a234bbf50346.tar.bz2
Remove ALL_OBJFILE_PSYMTABS
This removes the ALL_OBJFILE_PSYMTABS macro, replacing its uses with ranged for loops. gdb/ChangeLog 2019-01-09 Tom Tromey <tom@tromey.com> * dbxread.c (dbx_end_psymtab): Use objfile_psymtabs. * mdebugread.c (parse_partial_symbols): Use objfile_psymtabs. * psymtab.c (ALL_OBJFILE_PSYMTABS_REQUIRED): Remove. (psym_map_symtabs_matching_filename, find_pc_sect_psymtab) (psym_lookup_symbol, psym_find_last_source_symtab) (psym_forget_cached_source_info, psym_print_stats) (psym_expand_symtabs_for_function, psym_expand_all_symtabs) (psym_expand_symtabs_with_fullname, psym_map_symbol_filenames) (psym_map_matching_symbols, psym_expand_symtabs_matching) (psym_find_compunit_symtab_by_address) (maintenance_print_psymbols, maintenance_info_psymtabs) (maintenance_check_psymtabs): Use ranged for. * psymtab.h (class objfile_psymtabs): New. (require_partial_symbols): Return objfile_psymtabs. * psympriv.h (ALL_OBJFILE_PSYMTABS): Remove.
Diffstat (limited to 'gdb/psymtab.h')
-rw-r--r--gdb/psymtab.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/gdb/psymtab.h b/gdb/psymtab.h
index ed400e9..a1cab96 100644
--- a/gdb/psymtab.h
+++ b/gdb/psymtab.h
@@ -21,6 +21,7 @@
#define PSYMTAB_H
#include "symfile.h"
+#include "common/next-iterator.h"
/* A bcache for partial symbols. */
@@ -35,12 +36,25 @@ extern const struct quick_symbol_functions psym_functions;
extern const struct quick_symbol_functions dwarf2_gdb_index_functions;
extern const struct quick_symbol_functions dwarf2_debug_names_functions;
+/* A range adapter that makes it possible to iterate over all
+ psymtabs in one objfile. */
+
+class objfile_psymtabs : public next_adapter<struct partial_symtab>
+{
+public:
+
+ explicit objfile_psymtabs (struct objfile *objfile)
+ : next_adapter<struct partial_symtab> (objfile->psymtabs)
+ {
+ }
+};
+
/* Ensure that the partial symbols for OBJFILE have been loaded. If
VERBOSE is non-zero, then this will print a message when symbols
- are loaded. This function always returns its argument, as a
- convenience. */
+ are loaded. This function returns a range adapter suitable for
+ iterating over the psymtabs of OBJFILE. */
-extern struct objfile *require_partial_symbols (struct objfile *objfile,
- int verbose);
+extern objfile_psymtabs require_partial_symbols (struct objfile *objfile,
+ int verbose);
#endif /* PSYMTAB_H */