aboutsummaryrefslogtreecommitdiff
path: root/gdb/m32r-rom.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-18 19:38:39 +0000
committerTom Tromey <tromey@redhat.com>2012-07-18 19:38:39 +0000
commitd6ad71ba41afb220549d1c7fe61edd6bddd128ad (patch)
treebd5c076fbabda8c8d31b3ec64689f40213168276 /gdb/m32r-rom.c
parenta4453b7e0b9b84dd18c844ef43fbb9f6e2e75433 (diff)
downloadgdb-d6ad71ba41afb220549d1c7fe61edd6bddd128ad.zip
gdb-d6ad71ba41afb220549d1c7fe61edd6bddd128ad.tar.gz
gdb-d6ad71ba41afb220549d1c7fe61edd6bddd128ad.tar.bz2
* 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.
Diffstat (limited to 'gdb/m32r-rom.c')
-rw-r--r--gdb/m32r-rom.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c
index 92a73d0..9dbcd26 100644
--- a/gdb/m32r-rom.c
+++ b/gdb/m32r-rom.c
@@ -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. */