diff options
Diffstat (limited to 'gdb/progspace.h')
-rw-r--r-- | gdb/progspace.h | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/gdb/progspace.h b/gdb/progspace.h index 7906847..fb348ca 100644 --- a/gdb/progspace.h +++ b/gdb/progspace.h @@ -25,6 +25,7 @@ #include "gdb_bfd.h" #include "gdbsupport/gdb_vecs.h" #include "registry.h" +#include "solist.h" #include "gdbsupport/next-iterator.h" #include "gdbsupport/safe-iterator.h" #include <list> @@ -59,8 +60,8 @@ public: typedef typename objfile_list::iterator::iterator_category iterator_category; typedef typename objfile_list::iterator::difference_type difference_type; - unwrapping_objfile_iterator (const objfile_list::iterator &iter) - : m_iter (iter) + unwrapping_objfile_iterator (objfile_list::iterator iter) + : m_iter (std::move (iter)) { } @@ -89,29 +90,7 @@ private: /* A range that returns unwrapping_objfile_iterators. */ -struct unwrapping_objfile_range -{ - typedef unwrapping_objfile_iterator iterator; - - unwrapping_objfile_range (objfile_list &ol) - : m_list (ol) - { - } - - iterator begin () const - { - return iterator (m_list.begin ()); - } - - iterator end () const - { - return iterator (m_list.end ()); - } - -private: - - objfile_list &m_list; -}; +using unwrapping_objfile_range = iterator_range<unwrapping_objfile_iterator>; /* A program space represents a symbolic view of an address space. Roughly speaking, it holds all the data associated with a @@ -222,7 +201,7 @@ struct program_space a program space. */ ~program_space (); - typedef unwrapping_objfile_range objfiles_range; + using objfiles_range = unwrapping_objfile_range; /* Return an iterable object that can be used to iterate over all objfiles. The basic use is in a foreach, like: @@ -230,10 +209,12 @@ struct program_space for (objfile *objf : pspace->objfiles ()) { ... } */ objfiles_range objfiles () { - return unwrapping_objfile_range (objfiles_list); + return objfiles_range + (unwrapping_objfile_iterator (objfiles_list.begin ()), + unwrapping_objfile_iterator (objfiles_list.end ())); } - typedef basic_safe_range<objfiles_range> objfiles_safe_range; + using objfiles_safe_range = basic_safe_range<objfiles_range>; /* An iterable object that can be used to iterate over all objfiles. The basic use is in a foreach, like: @@ -244,7 +225,10 @@ struct program_space deleted during iteration. */ objfiles_safe_range objfiles_safe () { - return objfiles_safe_range (objfiles_list); + return objfiles_safe_range + (objfiles_range + (unwrapping_objfile_iterator (objfiles_list.begin ()), + unwrapping_objfile_iterator (objfiles_list.end ()))); } /* Add OBJFILE to the list of objfiles, putting it just before @@ -270,7 +254,8 @@ struct program_space program space. Use it like: for (so_list *so : pspace->solibs ()) { ... } */ - next_adapter<struct so_list> solibs () const; + so_list_range solibs () const + { return so_list_range (this->so_list); } /* Close and clear exec_bfd. If we end up with no target sections to read memory from, this unpushes the exec_ops target. */ |