diff options
author | Tom Tromey <tom@tromey.com> | 2019-01-23 18:58:33 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2019-01-23 19:05:50 +0000 |
commit | 694c6bf5425024a8654a5541dec88e4dd6ddafb5 (patch) | |
tree | 41d60d864814e18ddffe9477d443d7edd1f85d2a /gdb/top.c | |
parent | 4c41382ac101f10071f92074bab7c33242ef5b15 (diff) | |
download | gdb-694c6bf5425024a8654a5541dec88e4dd6ddafb5.zip gdb-694c6bf5425024a8654a5541dec88e4dd6ddafb5.tar.gz gdb-694c6bf5425024a8654a5541dec88e4dd6ddafb5.tar.bz2 |
Remove make_bpstat_clear_actions_cleanup
This removes make_bpstat_clear_actions_cleanup, replacing it with uses
of scope_exit.
gdb/ChangeLog:
2019-01-23 Tom Tromey <tom@tromey.com>
Andrew Burgess <andrew.burgess@embecosm.com>
Pedro Alves <palves@redhat.com>
* infrun.c (fetch_inferior_event): Use scope_exit.
* utils.h (make_bpstat_clear_actions_cleanup): Don't declare.
* top.c (execute_command): Use scope_exit.
* breakpoint.c (bpstat_do_actions): Use scope_exit.
* utils.c (do_bpstat_clear_actions_cleanup)
(make_bpstat_clear_actions_cleanup): Remove.
Diffstat (limited to 'gdb/top.c')
-rw-r--r-- | gdb/top.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -52,6 +52,7 @@ #include "frame.h" #include "buffer.h" #include "gdb_select.h" +#include "common/scope-exit.h" /* readline include files. */ #include "readline/readline.h" @@ -539,12 +540,11 @@ set_repeat_arguments (const char *args) void execute_command (const char *p, int from_tty) { - struct cleanup *cleanup_if_error; struct cmd_list_element *c; const char *line; const char *cmd_start = p; - cleanup_if_error = make_bpstat_clear_actions_cleanup (); + auto cleanup_if_error = make_scope_exit (bpstat_clear_actions); scoped_value_mark cleanup = prepare_execute_command (); /* Force cleanup of any alloca areas if using C alloca instead of @@ -554,7 +554,7 @@ execute_command (const char *p, int from_tty) /* This can happen when command_line_input hits end of file. */ if (p == NULL) { - discard_cleanups (cleanup_if_error); + cleanup_if_error.release (); return; } @@ -649,7 +649,7 @@ execute_command (const char *p, int from_tty) if (has_stack_frames () && inferior_thread ()->state != THREAD_RUNNING) check_frame_language_change (); - discard_cleanups (cleanup_if_error); + cleanup_if_error.release (); } /* Run execute_command for P and FROM_TTY. Capture its output into the |