summaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-06-27 19:21:48 +0000
committerTom Tromey <tromey@redhat.com>2011-06-27 19:21:48 +0000
commit60595f5820e3987b84b49887de7ce27aa7c13430 (patch)
tree1d410f0e697d22f7092a01f3e2f00e0aec2d3b8b /gdb/top.c
parentf79d447e41fbeb163044c365335b08f8d363c854 (diff)
downloadgdb-60595f5820e3987b84b49887de7ce27aa7c13430.tar.gz
* valops.c (find_overload_match): Call do_cleanups before early
return. * top.c (execute_command): Call do_cleanups before early return. (command_loop): Likewise. * stack.c (backtrace_command): Make a null cleanup early. Don't conditionally call do_cleanups. * python/py-value.c (TRY_CATCH): Move cleanup handling into TRY_CATCH. * python/py-breakpoint.c (gdbpy_breakpoint_has_py_cond): Rearrange so cleanups are always run. * mi/mi-cmd-var.c (mi_cmd_var_delete): Reset old_cleanups. * findcmd.c (parse_find_args): Call do_cleanups on early return path. * dbxread.c (elfstab_build_psymtabs): Make a null cleanup early. Don't conditionally call do_cleanups. * cli/cli-script.c (execute_user_command): Initialize 'old_chain' later.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 58c50755c77..ecb91f2b0ef 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -378,7 +378,10 @@ execute_command (char *p, int from_tty)
/* This can happen when command_line_input hits end of file. */
if (p == NULL)
- return;
+ {
+ do_cleanups (cleanup);
+ return;
+ }
target_log_command (p);
@@ -542,7 +545,10 @@ command_loop (void)
get_prompt () : (char *) NULL,
instream == stdin, "prompt");
if (command == 0)
- return;
+ {
+ do_cleanups (old_chain);
+ return;
+ }
make_command_stats_cleanup (1);