+2018-09-17 Tom Tromey <tom@tromey.com>
+
+ * infrun.c (save_infcall_suspend_state): Return
+ infcall_suspend_state_up.
+ (save_infcall_control_state): Return infcall_control_state_up.
+ * inferior.h (save_infcall_suspend_state)
+ (save_infcall_control_state): Declare later. Return unique
+ pointers.
+
2018-09-17 Tom Tromey <tom@tromey.com>
* infrun.c (struct stop_context): Declare constructor,
struct infcall_suspend_state;
struct infcall_control_state;
-extern struct infcall_suspend_state *save_infcall_suspend_state (void);
-extern struct infcall_control_state *save_infcall_control_state (void);
-
extern void restore_infcall_suspend_state (struct infcall_suspend_state *);
extern void restore_infcall_control_state (struct infcall_control_state *);
typedef std::unique_ptr<infcall_suspend_state, infcall_suspend_state_deleter>
infcall_suspend_state_up;
+extern infcall_suspend_state_up save_infcall_suspend_state ();
+
/* A deleter for infcall_control_state that calls
restore_infcall_control_state. */
struct infcall_control_state_deleter
typedef std::unique_ptr<infcall_control_state, infcall_control_state_deleter>
infcall_control_state_up;
+extern infcall_control_state_up save_infcall_control_state ();
+
extern void discard_infcall_suspend_state (struct infcall_suspend_state *);
extern void discard_infcall_control_state (struct infcall_control_state *);
gdb::unique_xmalloc_ptr<gdb_byte> siginfo_data;
};
-struct infcall_suspend_state *
-save_infcall_suspend_state (void)
+infcall_suspend_state_up
+save_infcall_suspend_state ()
{
- struct infcall_suspend_state *inf_state;
struct thread_info *tp = inferior_thread ();
struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = regcache->arch ();
}
}
- inf_state = new struct infcall_suspend_state;
+ infcall_suspend_state_up inf_state (new struct infcall_suspend_state);
if (siginfo_data)
{
/* Save all of the information associated with the inferior<==>gdb
connection. */
-struct infcall_control_state *
-save_infcall_control_state (void)
+infcall_control_state_up
+save_infcall_control_state ()
{
- struct infcall_control_state *inf_status = new struct infcall_control_state;
+ infcall_control_state_up inf_status (new struct infcall_control_state);
struct thread_info *tp = inferior_thread ();
struct inferior *inf = current_inferior ();