diff options
Diffstat (limited to 'gdb/solib-darwin.c')
-rw-r--r-- | gdb/solib-darwin.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index d52fb46..bc2cd79 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -28,6 +28,7 @@ #include "inferior.h" #include "regcache.h" #include "gdbthread.h" +#include "gdb_bfd.h" #include "gdb_assert.h" @@ -367,7 +368,7 @@ darwin_solib_get_all_image_info_addr_at_init (struct darwin_info *info) return; /* Create a bfd for the interpreter. */ - dyld_bfd = bfd_openr (interp_name, gnutarget); + dyld_bfd = gdb_bfd_ref (bfd_openr (interp_name, gnutarget)); if (dyld_bfd) { bfd *sub; @@ -378,7 +379,7 @@ darwin_solib_get_all_image_info_addr_at_init (struct darwin_info *info) dyld_bfd = sub; else { - bfd_close (dyld_bfd); + gdb_bfd_unref (dyld_bfd); dyld_bfd = NULL; } } @@ -395,7 +396,7 @@ darwin_solib_get_all_image_info_addr_at_init (struct darwin_info *info) info->all_image_addr = lookup_symbol_from_bfd (dyld_bfd, "_dyld_all_image_infos"); - bfd_close (dyld_bfd); + gdb_bfd_unref (dyld_bfd); if (info->all_image_addr == 0) return; @@ -509,7 +510,7 @@ darwin_bfd_open (char *pathname) gdbarch_bfd_arch_info (target_gdbarch)); if (!res) { - bfd_close (abfd); + gdb_bfd_unref (abfd); make_cleanup (xfree, found_pathname); error (_("`%s': not a shared-library: %s"), found_pathname, bfd_errmsg (bfd_get_error ())); |