diff options
author | Tom Tromey <tromey@redhat.com> | 2012-07-18 19:38:39 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-07-18 19:38:39 +0000 |
commit | d6ad71ba41afb220549d1c7fe61edd6bddd128ad (patch) | |
tree | bd5c076fbabda8c8d31b3ec64689f40213168276 /gdb/remote-mips.c | |
parent | a4453b7e0b9b84dd18c844ef43fbb9f6e2e75433 (diff) | |
download | gdb-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/remote-mips.c')
-rw-r--r-- | gdb/remote-mips.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 30fd948..5020d2a 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; } |