From 5fe41fbfa22275d2a277b408bf52fedec34e8336 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 27 Jun 2011 19:21:51 +0000 Subject: * 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. --- gdb/stack.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gdb/stack.c') diff --git a/gdb/stack.c b/gdb/stack.c index 0888b69..1e44367 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1425,7 +1425,7 @@ backtrace_command_stub (void *data) static void backtrace_command (char *arg, int from_tty) { - struct cleanup *old_chain = NULL; + struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); int fulltrace_arg = -1, arglen = 0, argc = 0; struct backtrace_command_args btargs; @@ -1435,7 +1435,7 @@ backtrace_command (char *arg, int from_tty) int i; argv = gdb_buildargv (arg); - old_chain = make_cleanup_freeargv (argv); + make_cleanup_freeargv (argv); argc = 0; for (i = 0; argv[i]; i++) { @@ -1481,8 +1481,7 @@ backtrace_command (char *arg, int from_tty) if (fulltrace_arg >= 0 && arglen > 0) xfree (arg); - if (old_chain) - do_cleanups (old_chain); + do_cleanups (old_chain); } static void -- cgit v1.1