X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fobjfiles.h;h=2cf61957ec1d1a3b534c0acbce71f045a24a653b;hb=b669c95337903d39aa2254e8ea0405c0ac117d24;hp=94b415c4e07268a0e9aba548d1204719329a559e;hpb=d320c2b5e181828418224521f2acd2ff48e127f4;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 94b415c4e0..2cf61957ec 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -293,6 +293,24 @@ struct objfile DISABLE_COPY_AND_ASSIGN (objfile); + /* Reset the storage for the partial symbol tables. */ + + void reset_psymtabs () + { + psymbol_map.clear (); + partial_symtabs.reset (new psymtab_storage ()); + } + + typedef next_adapter compunits_range; + + /* A range adapter that makes it possible to iterate over all + compunits in one objfile. */ + + compunits_range compunits () + { + return compunits_range (compunit_symtabs); + } + /* All struct objfile's are chained together by their next pointers. The program space field "objfiles" (frequently referenced via the macro "object_files") points to the first link in this chain. */ @@ -407,7 +425,7 @@ struct objfile Although this is a tree structure, GDB only support one level (ie a separate debug for a separate debug is not supported). Note that separate debug object are in the main chain and therefore will be - visited by all_objfiles & co iterators. Separate debug objfile always + visited by objfiles & co iterators. Separate debug objfile always has a non-nul separate_debug_objfile_backlink. */ /* Link to the first separate debug object, if any. */ @@ -544,56 +562,6 @@ extern void default_iterate_over_objfiles_in_search_order void *cb_data, struct objfile *current_objfile); -/* An iterarable object that can be used to iterate over all - objfiles. The basic use is in a foreach, like: - - for (objfile *objf : all_objfiles (pspace)) { ... } */ - -class all_objfiles : public next_adapter -{ -public: - - explicit all_objfiles (struct program_space *pspace) - : next_adapter (pspace->objfiles) - { - } -}; - -/* An iterarable object that can be used to iterate over all - objfiles. The basic use is in a foreach, like: - - for (objfile *objf : all_objfiles_safe (pspace)) { ... } - - This variant uses a basic_safe_iterator so that objfiles can be - deleted during iteration. */ - -class all_objfiles_safe - : public next_adapter>> -{ -public: - - explicit all_objfiles_safe (struct program_space *pspace) - : next_adapter>> - (pspace->objfiles) - { - } -}; - -/* A range adapter that makes it possible to iterate over all - compunits in one objfile. */ - -class objfile_compunits : public next_adapter -{ -public: - - explicit objfile_compunits (struct objfile *objfile) - : next_adapter (objfile->compunit_symtabs) - { - } -}; - /* A range adapter that makes it possible to iterate over all minimal symbols of an objfile. */