+2019-01-16 Tom Tromey <tom@tromey.com>
+
+ * objfiles.h (struct objfile) <psymtabs>: New method.
+ (class objfile_psymtabs): Remove.
+ * psymtab.h (class psymtab_storage) <partial_symtab_range>: New
+ typedef.
+ <range>: New method.
+ (require_partial_symbols): Change return type.
+ * psymtab.c (require_partial_symbols)
+ (psym_expand_symtabs_matching): Update.
+ * mdebugread.c (parse_partial_symbols): Update.
+ * dbxread.c (dbx_end_psymtab): Update.
+
2019-01-15 Tom Tromey <tom@tromey.com>
* symtab.c (lookup_objfile_from_block)
address, set it to our starting address. Take care to not set our
own ending address to our starting address. */
- for (partial_symtab *p1 : objfile_psymtabs (objfile))
+ for (partial_symtab *p1 : objfile->psymtabs ())
if (!p1->text_high_valid && p1->text_low_valid && p1 != pst)
p1->set_text_high (pst->raw_text_low ());
}
&& save_pst->text_low_valid
&& !(objfile->flags & OBJF_REORDERED))
{
- for (partial_symtab *iter : objfile_psymtabs (objfile))
+ for (partial_symtab *iter : objfile->psymtabs ())
{
if (save_pst != iter
&& save_pst->raw_text_low () >= iter->raw_text_low ()
DISABLE_COPY_AND_ASSIGN (objfile);
+ /* A range adapter that makes it possible to iterate over all
+ psymtabs in one objfile. */
+
+ psymtab_storage::partial_symtab_range psymtabs ()
+ {
+ return partial_symtabs->range ();
+ }
+
/* Reset the storage for the partial symbol tables. */
void reset_psymtabs ()
struct objfile *m_objfile;
};
-/* 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->partial_symtabs->psymtabs)
- {
- }
-};
-
#define ALL_OBJFILE_OSECTIONS(objfile, osect) \
for (osect = objfile->sections; osect < objfile->sections_end; osect++) \
if (osect->the_bfd_section == NULL) \
/* See psymtab.h. */
-objfile_psymtabs
+psymtab_storage::partial_symtab_range
require_partial_symbols (struct objfile *objfile, int verbose)
{
if ((objfile->flags & OBJF_PSYMTABS_READ) == 0)
}
}
- return objfile_psymtabs (objfile);
+ return objfile->psymtabs ();
}
/* Helper function for psym_map_symtabs_matching_filename that
for (partial_symtab *ps : require_partial_symbols (objfile, 1))
ps->searched_flag = PST_NOT_SEARCHED;
- for (partial_symtab *ps : objfile_psymtabs (objfile))
+ for (partial_symtab *ps : objfile->psymtabs ())
{
QUIT;
struct partial_symtab *allocate_psymtab ();
+ typedef next_adapter<struct partial_symtab> partial_symtab_range;
+
+ /* A range adapter that makes it possible to iterate over all
+ psymtabs in one objfile. */
+
+ partial_symtab_range range ()
+ {
+ return partial_symtab_range (psymtabs);
+ }
+
/* Each objfile points to a linked list of partial symtabs derived from
this file, one partial symtab structure for each compilation unit
are loaded. This function returns a range adapter suitable for
iterating over the psymtabs of OBJFILE. */
-class objfile_psymtabs;
-extern objfile_psymtabs require_partial_symbols (struct objfile *objfile,
- int verbose);
+extern psymtab_storage::partial_symtab_range require_partial_symbols
+ (struct objfile *objfile, int verbose);
#endif /* PSYMTAB_H */