diff options
author | Tom Tromey <tromey@redhat.com> | 2012-07-18 19:42:26 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-07-18 19:42:26 +0000 |
commit | f9a062ffb59ebed937221b852eab2abbd43111ed (patch) | |
tree | 448939f7d9453e4624e1af78b4fee3bf9fd5fa11 /gdb | |
parent | d6ad71ba41afb220549d1c7fe61edd6bddd128ad (diff) | |
download | gdb-f9a062ffb59ebed937221b852eab2abbd43111ed.zip gdb-f9a062ffb59ebed937221b852eab2abbd43111ed.tar.gz gdb-f9a062ffb59ebed937221b852eab2abbd43111ed.tar.bz2 |
* utils.c (make_cleanup_bfd_unref): Rename from
make_cleanup_bfd_close.
* defs.h (make_cleanup_bfd_unref): Rename from
make_cleanup_bfd_close.
* cli/cli-dump.c (bfd_openr_with_cleanup): Update.
(bfd_openw_with_cleanup): Update.
* corelow.c (core_open): Update.
* dsrec.c (load_srec): Update.
* m32r-rom.c (m32r_load, m32r_upload_command): Update.
* remote-m32r-sdi.c (m32r_load): Update.
* remote-mips.c (mips_load_srec): Update.
(pmon_load_fast): Update.
* solib-darwin.c (darwin_solib_get_all_image_info_addr_at_init):
Update.
(darwin_bfd_open): Update.
* solib.c (solib_bfd_fopen): Update.
* symfile-mem.c (symbol_file_add_from_memory): Update.
* symfile.c (symbol_file_add_with_addrs_or_offsets): Update.
(symfile_bfd_open): Update.
(generic_load): Update.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 23 | ||||
-rw-r--r-- | gdb/cli/cli-dump.c | 4 | ||||
-rw-r--r-- | gdb/corelow.c | 2 | ||||
-rw-r--r-- | gdb/defs.h | 2 | ||||
-rw-r--r-- | gdb/dsrec.c | 2 | ||||
-rw-r--r-- | gdb/m32r-rom.c | 4 | ||||
-rw-r--r-- | gdb/remote-m32r-sdi.c | 2 | ||||
-rw-r--r-- | gdb/remote-mips.c | 4 | ||||
-rw-r--r-- | gdb/solib-darwin.c | 6 | ||||
-rw-r--r-- | gdb/solib.c | 2 | ||||
-rw-r--r-- | gdb/symfile-mem.c | 2 | ||||
-rw-r--r-- | gdb/symfile.c | 8 | ||||
-rw-r--r-- | gdb/utils.c | 2 |
13 files changed, 43 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 29ccc0c..1ce1cf6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,28 @@ 2012-07-18 Tom Tromey <tromey@redhat.com> + * utils.c (make_cleanup_bfd_unref): Rename from + make_cleanup_bfd_close. + * defs.h (make_cleanup_bfd_unref): Rename from + make_cleanup_bfd_close. + * cli/cli-dump.c (bfd_openr_with_cleanup): Update. + (bfd_openw_with_cleanup): Update. + * corelow.c (core_open): Update. + * dsrec.c (load_srec): Update. + * m32r-rom.c (m32r_load, m32r_upload_command): Update. + * remote-m32r-sdi.c (m32r_load): Update. + * remote-mips.c (mips_load_srec): Update. + (pmon_load_fast): Update. + * solib-darwin.c (darwin_solib_get_all_image_info_addr_at_init): + Update. + (darwin_bfd_open): Update. + * solib.c (solib_bfd_fopen): Update. + * symfile-mem.c (symbol_file_add_from_memory): Update. + * symfile.c (symbol_file_add_with_addrs_or_offsets): Update. + (symfile_bfd_open): Update. + (generic_load): Update. + +2012-07-18 Tom Tromey <tromey@redhat.com> + * 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. diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index 7dce32a..1244767 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -117,7 +117,7 @@ bfd_openr_with_cleanup (const char *filename, const char *target) error (_("Failed to open %s: %s."), filename, bfd_errmsg (bfd_get_error ())); - make_cleanup_bfd_close (ibfd); + make_cleanup_bfd_unref (ibfd); if (!bfd_check_format (ibfd, bfd_object)) error (_("'%s' is not a recognized file format."), filename); @@ -136,7 +136,7 @@ bfd_openw_with_cleanup (const char *filename, const char *target, if (obfd == NULL) error (_("Failed to open %s: %s."), filename, bfd_errmsg (bfd_get_error ())); - make_cleanup_bfd_close (obfd); + make_cleanup_bfd_unref (obfd); if (!bfd_set_format (obfd, bfd_object)) error (_("bfd_openw_with_cleanup: %s."), bfd_errmsg (bfd_get_error ())); } diff --git a/gdb/corelow.c b/gdb/corelow.c index 1fd60e4..380c0dc 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -333,7 +333,7 @@ core_open (char *filename, int from_tty) /* FIXME: should be checking for errors from bfd_close (for one thing, on error it does not free all the storage associated with the bfd). */ - make_cleanup_bfd_close (temp_bfd); + make_cleanup_bfd_unref (temp_bfd); error (_("\"%s\" is not a core dump: %s"), filename, bfd_errmsg (bfd_get_error ())); } @@ -315,7 +315,7 @@ extern struct cleanup *make_cleanup_close (int fd); extern struct cleanup *make_cleanup_fclose (FILE *file); -extern struct cleanup *make_cleanup_bfd_close (bfd *abfd); +extern struct cleanup *make_cleanup_bfd_unref (bfd *abfd); struct obstack; extern struct cleanup *make_cleanup_obstack_free (struct obstack *obstack); diff --git a/gdb/dsrec.c b/gdb/dsrec.c index 8eefe1e..66d4c13 100644 --- a/gdb/dsrec.c +++ b/gdb/dsrec.c @@ -68,7 +68,7 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset, return; } - cleanup = make_cleanup_bfd_close (abfd); + cleanup = make_cleanup_bfd_unref (abfd); if (bfd_check_format (abfd, bfd_object) == 0) { printf_filtered (_("File is not an object file\n")); diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c index 9dbcd26..ffda6f9 100644 --- a/gdb/m32r-rom.c +++ b/gdb/m32r-rom.c @@ -133,7 +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); + cleanup = make_cleanup_bfd_unref (abfd); if (bfd_check_format (abfd, bfd_object) == 0) error (_("File is not an object file.")); gettimeofday (&start_time, NULL); @@ -530,7 +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); + cleanup = make_cleanup_bfd_unref (abfd); if (abfd != NULL) { /* Download is done -- print section statistics. */ if (bfd_check_format (abfd, bfd_object) == 0) diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index 0536ccf..b4b7324 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -1264,7 +1264,7 @@ m32r_load (char *args, int from_tty) perror_with_name (filename); return; } - old_chain = make_cleanup_bfd_close (pbfd); + old_chain = make_cleanup_bfd_unref (pbfd); if (!bfd_check_format (pbfd, bfd_object)) error (_("\"%s\" is not an object file: %s"), filename, diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 5020d2a..b46325f 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -2796,7 +2796,7 @@ mips_load_srec (char *args) return; } - cleanup = make_cleanup_bfd_close (abfd); + cleanup = make_cleanup_bfd_unref (abfd); if (bfd_check_format (abfd, bfd_object) == 0) { printf_filtered ("File is not an object file\n"); @@ -3382,7 +3382,7 @@ pmon_load_fast (char *file) printf_filtered ("Unable to open file %s\n", file); return; } - cleanup = make_cleanup_bfd_close (abfd); + cleanup = make_cleanup_bfd_unref (abfd); if (bfd_check_format (abfd, bfd_object) == 0) { diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index 8d8da7e..7109ead 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -376,13 +376,13 @@ darwin_solib_get_all_image_info_addr_at_init (struct darwin_info *info) { bfd *sub; - make_cleanup_bfd_close (dyld_bfd); + make_cleanup_bfd_unref (dyld_bfd); sub = bfd_mach_o_fat_extract (dyld_bfd, bfd_object, gdbarch_bfd_arch_info (target_gdbarch)); if (sub) { dyld_bfd = gdb_bfd_ref (sub); - make_cleanup_bfd_close (sub); + make_cleanup_bfd_unref (sub); } else dyld_bfd = NULL; @@ -517,7 +517,7 @@ darwin_bfd_open (char *pathname) gdbarch_bfd_arch_info (target_gdbarch)); if (!res) { - make_cleanup_bfd_close (abfd); + make_cleanup_bfd_unref (abfd); error (_("`%s': not a shared-library: %s"), bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ())); } diff --git a/gdb/solib.c b/gdb/solib.c index 4ddf91a..0fd955d 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -424,7 +424,7 @@ solib_bfd_open (char *pathname) /* Check bfd format. */ if (!bfd_check_format (abfd, bfd_object)) { - make_cleanup_bfd_close (abfd); + make_cleanup_bfd_unref (abfd); error (_("`%s': not in executable format: %s"), bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ())); } diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c index 0470d97..ad87abd 100644 --- a/gdb/symfile-mem.c +++ b/gdb/symfile-mem.c @@ -113,7 +113,7 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, char *name, if (!bfd_check_format (nbfd, bfd_object)) { - make_cleanup_bfd_close (nbfd); + make_cleanup_bfd_unref (nbfd); error (_("Got object file from memory but can't read symbols: %s."), bfd_errmsg (bfd_get_error ())); } diff --git a/gdb/symfile.c b/gdb/symfile.c index 99427ae..c904011 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1075,7 +1075,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, add_flags &= ~SYMFILE_NO_READ; } - my_cleanups = make_cleanup_bfd_close (abfd); + my_cleanups = make_cleanup_bfd_unref (abfd); /* Give user a chance to burp if we'd be interactively wiping out any existing symbols. */ @@ -1731,7 +1731,7 @@ symfile_bfd_open (char *name) if (!bfd_check_format (sym_bfd, bfd_object)) { - make_cleanup_bfd_close (sym_bfd); + make_cleanup_bfd_unref (sym_bfd); error (_("`%s': can't read symbols: %s."), name, bfd_errmsg (bfd_get_error ())); } @@ -1775,7 +1775,7 @@ symfile_bfd_open (char *name) if (!bfd_check_format (sym_bfd, bfd_object)) { - make_cleanup_bfd_close (sym_bfd); + make_cleanup_bfd_unref (sym_bfd); error (_("`%s': can't read symbols: %s."), name, bfd_errmsg (bfd_get_error ())); } @@ -2113,7 +2113,7 @@ generic_load (char *args, int from_tty) return; } - make_cleanup_bfd_close (loadfile_bfd); + make_cleanup_bfd_unref (loadfile_bfd); if (!bfd_check_format (loadfile_bfd, bfd_object)) { diff --git a/gdb/utils.c b/gdb/utils.c index d268999..a2bc00d 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -203,7 +203,7 @@ do_bfd_close_cleanup (void *arg) } struct cleanup * -make_cleanup_bfd_close (bfd *abfd) +make_cleanup_bfd_unref (bfd *abfd) { return make_cleanup (do_bfd_close_cleanup, abfd); } |