+ typedef unwrapping_objfile_range objfiles_range;
+
+ /* Return an iterable object that can be used to iterate over all
+ objfiles. The basic use is in a foreach, like:
+
+ for (objfile *objf : pspace->objfiles ()) { ... } */
+ objfiles_range objfiles ()
+ {
+ return unwrapping_objfile_range (objfiles_list);
+ }
+
+ typedef basic_safe_range<objfiles_range> objfiles_safe_range;
+
+ /* An iterable object that can be used to iterate over all objfiles.
+ The basic use is in a foreach, like:
+
+ for (objfile *objf : pspace->objfiles_safe ()) { ... }
+
+ This variant uses a basic_safe_iterator so that objfiles can be
+ deleted during iteration. */
+ objfiles_safe_range objfiles_safe ()
+ {
+ return objfiles_safe_range (objfiles_list);
+ }
+
+ /* Add OBJFILE to the list of objfiles, putting it just before
+ BEFORE. If BEFORE is nullptr, it will go at the end of the
+ list. */
+ void add_objfile (std::shared_ptr<objfile> &&objfile,
+ struct objfile *before);
+
+ /* Remove OBJFILE from the list of objfiles. */
+ void remove_objfile (struct objfile *objfile);
+
+ /* Return true if there is more than one object file loaded; false
+ otherwise. */
+ bool multi_objfile_p () const
+ {
+ return objfiles_list.size () > 1;
+ }
+
+ /* Free all the objfiles associated with this program space. */
+ void free_all_objfiles ();
+
+ /* Return a range adapter for iterating over all the solibs in this
+ program space. Use it like:
+
+ for (so_list *so : pspace->solibs ()) { ... } */
+ next_adapter<struct so_list> solibs () const;
+