summaryrefslogtreecommitdiff
path: root/gdb/remote-mips.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-18 19:38:38 +0000
committerTom Tromey <tromey@redhat.com>2012-07-18 19:38:38 +0000
commit1f20395dc965144313da256a2f46448787cb7219 (patch)
tree48ab396f83e8456bef88e3c3f1de7652ea309ec2 /gdb/remote-mips.c
parent6bae30f0df82cae05a3d708223dbe7783202295c (diff)
downloadgdb-1f20395dc965144313da256a2f46448787cb7219.tar.gz
* 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/remote-mips.c')
-rw-r--r--gdb/remote-mips.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index 30fd94835a9..5020d2aa73f 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -2784,6 +2784,7 @@ mips_load_srec (char *args)
unsigned int i;
unsigned int srec_frame = 200;
int reclen;
+ struct cleanup *cleanup;
static int hashmark = 1;
buffer = alloca (srec_frame * 2 + 256);
@@ -2795,9 +2796,11 @@ mips_load_srec (char *args)
return;
}
+ cleanup = make_cleanup_bfd_close (abfd);
if (bfd_check_format (abfd, bfd_object) == 0)
{
printf_filtered ("File is not an object file\n");
+ do_cleanups (cleanup);
return;
}
@@ -2851,6 +2854,7 @@ mips_load_srec (char *args)
send_srec (srec, reclen, abfd->start_address);
serial_flush_input (mips_desc);
+ do_cleanups (cleanup);
}
/*
@@ -3367,6 +3371,7 @@ pmon_load_fast (char *file)
int bintotal = 0;
int final = 0;
int finished = 0;
+ struct cleanup *cleanup;
buffer = (char *) xmalloc (MAXRECSIZE + 1);
binbuf = (unsigned char *) xmalloc (BINCHUNK);
@@ -3377,10 +3382,12 @@ pmon_load_fast (char *file)
printf_filtered ("Unable to open file %s\n", file);
return;
}
+ cleanup = make_cleanup_bfd_close (abfd);
if (bfd_check_format (abfd, bfd_object) == 0)
{
printf_filtered ("File is not an object file\n");
+ do_cleanups (cleanup);
return;
}
@@ -3504,6 +3511,7 @@ pmon_load_fast (char *file)
pmon_end_download (final, bintotal);
}
+ do_cleanups (cleanup);
return;
}