+/* Save/restore inferior_ptid, current program space and current
+ inferior. Only use this if the current context points at an exited
+ inferior (and therefore there's no current thread to save). */
+class scoped_restore_exited_inferior
+{
+public:
+ scoped_restore_exited_inferior ()
+ : m_saved_ptid (&inferior_ptid)
+ {}
+
+private:
+ scoped_restore_tmpl<ptid_t> m_saved_ptid;
+ scoped_restore_current_program_space m_pspace;
+ scoped_restore_current_inferior m_inferior;
+};
+