* remote-mips.c (mips_load_srec): Use make_cleanup_bfd_close.

(pmon_load_fast): Likewise.
	* m32r-rom.c (m32r_load): Use make_cleanup_bfd_close.
	(m32r_upload_command): Likewise.
	* dsrec.c (load_srec): Use make_cleanup_bfd_close.
	* solib-darwin.c (darwin_solib_get_all_image_info_addr_at_init):
	Use make_cleanup_bfd_close.
This commit is contained in:
Tom Tromey
2012-07-18 19:38:39 +00:00
parent a4453b7e0b
commit d6ad71ba41
5 changed files with 41 additions and 6 deletions

View File

@@ -125,6 +125,7 @@ m32r_load (char *filename, int from_tty)
bfd *abfd;
unsigned int data_count = 0;
struct timeval start_time, end_time;
struct cleanup *cleanup;
if (filename == NULL || filename[0] == 0)
filename = get_exec_file (1);
@@ -132,6 +133,7 @@ m32r_load (char *filename, int from_tty)
abfd = gdb_bfd_ref (bfd_openr (filename, 0));
if (!abfd)
error (_("Unable to open file %s."), filename);
cleanup = make_cleanup_bfd_close (abfd);
if (bfd_check_format (abfd, bfd_object) == 0)
error (_("File is not an object file."));
gettimeofday (&start_time, NULL);
@@ -189,6 +191,7 @@ m32r_load (char *filename, int from_tty)
confused... */
clear_symtab_users (0);
do_cleanups (cleanup);
}
static void
@@ -435,6 +438,7 @@ m32r_upload_command (char *args, int from_tty)
char buf[1024];
struct hostent *hostent;
struct in_addr inet_addr;
struct cleanup *cleanup;
/* First check to see if there's an ethernet port! */
monitor_printf ("ust\r");
@@ -526,6 +530,7 @@ m32r_upload_command (char *args, int from_tty)
gettimeofday (&end_time, NULL);
abfd = gdb_bfd_ref (bfd_openr (args, 0));
cleanup = make_cleanup_bfd_close (abfd);
if (abfd != NULL)
{ /* Download is done -- print section statistics. */
if (bfd_check_format (abfd, bfd_object) == 0)
@@ -566,6 +571,7 @@ m32r_upload_command (char *args, int from_tty)
confused... */
clear_symtab_users (0);
do_cleanups (cleanup);
}
/* Provide a prototype to silence -Wmissing-prototypes. */