static void
guile_repl_command (char *arg, int from_tty)
{
- struct cleanup *cleanup;
-
- cleanup = make_cleanup_restore_integer (¤t_ui->async);
- current_ui->async = 0;
+ scoped_restore restore_async = make_scoped_restore (¤t_ui->async, 0);
arg = skip_spaces (arg);
dont_repeat ();
gdbscm_enter_repl ();
}
-
- do_cleanups (cleanup);
}
/* Implementation of the gdb "guile" command.
static void
guile_command (char *arg, int from_tty)
{
- struct cleanup *cleanup;
-
- cleanup = make_cleanup_restore_integer (¤t_ui->async);
- current_ui->async = 0;
+ scoped_restore restore_async = make_scoped_restore (¤t_ui->async, 0);
arg = skip_spaces (arg);
if (msg != NULL)
{
+ /* It is ok that this is a "dangling cleanup" because we
+ throw immediately. */
make_cleanup (xfree, msg);
error ("%s", msg);
}
execute_control_command_untraced (l.get ());
}
-
- do_cleanups (cleanup);
}
/* Given a command_line, return a command string suitable for passing
TRY
{
- struct cleanup *inner_cleanups;
-
- inner_cleanups = make_cleanup_restore_integer (¤t_ui->async);
- current_ui->async = 0;
+ scoped_restore restore_async = make_scoped_restore (¤t_ui->async,
+ 0);
scoped_restore preventer = prevent_dont_repeat ();
if (to_string)
/* Do any commands attached to breakpoint we stopped at. */
bpstat_do_actions ();
-
- do_cleanups (inner_cleanups);
}
CATCH (ex, RETURN_MASK_ALL)
{