+2013-05-30 Tom Tromey <tromey@redhat.com>
+
+ * remote-mips.c (mips_exit_debug): Call do_cleanups on all
+ return paths.
+ (mips_initialize): Likewise.
+ (common_open): Call do_cleanups.
+
2013-05-30 Tom Tromey <tromey@redhat.com>
* utils.c (internal_vproblem): Call do_cleanups.
mips_request ('x', 0, 0, NULL, mips_receive_wait, NULL);
mips_need_reply = 0;
if (!mips_expect (" break!"))
- return -1;
+ {
+ do_cleanups (old_cleanups);
+ return -1;
+ }
}
else
mips_request ('x', 0, 0, &err, mips_receive_wait, NULL);
if (!mips_expect (mips_monitor_prompt))
- return -1;
+ {
+ do_cleanups (old_cleanups);
+ return -1;
+ }
do_cleanups (old_cleanups);
mips_initialize (void)
{
int err;
- struct cleanup *old_cleanups = make_cleanup (mips_initialize_cleanups, NULL);
+ struct cleanup *old_cleanups;
int j;
/* What is this code doing here? I don't see any way it can happen, and
return;
}
+ old_cleanups = make_cleanup (mips_initialize_cleanups, NULL);
+
mips_wait_flag = 0;
mips_initializing = 1;
char *remote_name = 0;
char *local_name = 0;
char **argv;
+ struct cleanup *cleanup;
if (name == 0)
error (_("\
/* Parse the serial port name, the optional TFTP name, and the
optional local TFTP name. */
argv = gdb_buildargv (name);
- make_cleanup_freeargv (argv);
+ cleanup = make_cleanup_freeargv (argv);
serial_port_name = xstrdup (argv[0]);
if (argv[1]) /* Remote TFTP name specified? */
stop_pc = regcache_read_pc (get_current_regcache ());
print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
xfree (serial_port_name);
+
+ do_cleanups (cleanup);
}
/* Open a connection to an IDT board. */