From: Michael Snyder Date: Sun, 5 Oct 2008 21:11:53 +0000 (+0000) Subject: 2008-10-05 Michael Snyder X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35c9f373d4b99ed11b61440eb14dc4016a13a986;p=thirdparty%2Fbinutils-gdb.git 2008-10-05 Michael Snyder * reverse.c (exec_reverse_once): Call do_cleanups explicitly. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1179da1c715..0c0c2d206c2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,6 @@ 2008-10-05 Michael Snyder + * reverse.c (exec_reverse_once): Call do_cleanups explicitly. * infrun.c (handle_inferior_event): Fix typo in comment. 2008-10-04 Michael Snyder diff --git a/gdb/reverse.c b/gdb/reverse.c index 661360c53f7..492706e7d22 100644 --- a/gdb/reverse.c +++ b/gdb/reverse.c @@ -95,6 +95,7 @@ exec_reverse_once (char *cmd, char *args, int from_tty) /* String buffer for command consing. */ char reverse_command[512]; enum exec_direction_kind dir = target_get_execution_direction (); + struct cleanup *old_chain; if (dir == EXEC_ERROR) error (_("Target %s does not support this command."), target_shortname); @@ -106,9 +107,10 @@ exec_reverse_once (char *cmd, char *args, int from_tty) if (target_set_execution_direction (EXEC_REVERSE) == EXEC_ERROR) error (_("Target %s does not support this command."), target_shortname); - make_cleanup (exec_direction_default, NULL); + old_chain = make_cleanup (exec_direction_default, NULL); sprintf (reverse_command, "%s %s", cmd, args ? args : ""); execute_command (reverse_command, from_tty); + do_cleanups (old_chain); } static void