summaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-08-26 21:45:21 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-08-26 21:45:21 +0000
commit805e7fbd1685ce2082c06354cce5da0bd28bf30e (patch)
tree0e60b0aba6b6f859ffdcfd8fd7bbe0771ce1b7a2 /gdb/top.c
parentd81ce48c5589bb6018cab85e2476443f98ed4b70 (diff)
downloadgdb-805e7fbd1685ce2082c06354cce5da0bd28bf30e.tar.gz
gdb/
* breakpoint.c (bpstat_do_actions): New variable cleanup_if_error, call make_bpstat_clear_actions_cleanup and discard_cleanups for it. * defs.h (make_bpstat_clear_actions_cleanup): New declaration. * exceptions.c (throw_exception): Remove the bpstat_clear_actions call. * inf-loop.c (inferior_event_handler): New variable cleanup_if_error, call make_bpstat_clear_actions_cleanup and discard_cleanups for it. Call bpstat_clear_actions for failed fetch_inferior_event_wrapper. * infrun.c (fetch_inferior_event): Call make_bpstat_clear_actions_cleanup. * top.c (execute_command): New variable cleanup_if_error, call make_bpstat_clear_actions_cleanup and discard_cleanups for it. * utils.c (do_bpstat_clear_actions_cleanup) (make_bpstat_clear_actions_cleanup): New functions. gdb/testsuite/ * gdb.base/commands.exp (error_clears_commands_left): New function. (): Call it.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/top.c b/gdb/top.c
index da930ca2889..3112d393203 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -368,12 +368,13 @@ prepare_execute_command (void)
void
execute_command (char *p, int from_tty)
{
- struct cleanup *cleanup;
+ struct cleanup *cleanup_if_error, *cleanup;
struct cmd_list_element *c;
enum language flang;
static int warned = 0;
char *line;
+ cleanup_if_error = make_bpstat_clear_actions_cleanup ();
cleanup = prepare_execute_command ();
/* Force cleanup of any alloca areas if using C alloca instead of
@@ -477,7 +478,8 @@ execute_command (char *p, int from_tty)
}
}
- do_cleanups (cleanup);
+ do_cleanups (cleanup);
+ discard_cleanups (cleanup_if_error);
}
/* Run execute_command for P and FROM_TTY. Capture its output into the