summaryrefslogtreecommitdiff
path: root/gdb/machoread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-23 14:57:53 +0000
committerTom Tromey <tromey@redhat.com>2012-07-23 14:57:53 +0000
commit8b3d8cbf611383b5759061e49521fb3cd83d4a71 (patch)
treea7c849829cba1199098b003435e4bda47af69782 /gdb/machoread.c
parent8ee2b379b49d8132dc895ba40e80cf36044358ba (diff)
downloadgdb-8b3d8cbf611383b5759061e49521fb3cd83d4a71.tar.gz
* cli/cli-dump.c (bfd_openr_with_cleanup): Use gdb_bfd_openr.
(bfd_openw_with_cleanup): Use gdb_bfd_openw. * corelow.c (core_open): Use gdb_bfd_fopen. * dsrec.c (load_srec): Use gdb_bfd_openr. * exec.c (exec_file_attach): Use gdb_bfd_fopen. * gcore.c (gcore_memory_sections): Use gdb_bfd_openw. * gdb_bfd.c (gdb_bfd_fopen, gdb_bfd_openr, gdb_bfd_openw) (gdb_bfd_openr_iovec, gdb_bfd_openr_next_archived_file) (gdb_bfd_fdopenr): New functions. * gdb_bfd.h (gdb_bfd_fopen, gdb_bfd_openr, gdb_bfd_openw) (gdb_bfd_openr_iovec, gdb_bfd_openr_next_archived_file) (gdb_bfd_fdopenr): Declare. * jit.c (bfd_open_from_target_memory): Use gdb_bfd_openr_iovec. * m32-rom.c (m32r_load, m32r_upload_command): Use gdb_bfd_openr. * machoread.c (macho_symfile_read_all_oso): Use gdb_bfd_openr, gdb_bfd_openr_next_archived_file. (macho_check_dsym): Use gdb_bfd_openr. (macho_add_oso_symfile): Don't call gdb_bfd_stash_filename. * procfs.c (insert_dbx_link_bpt_in_file): Use gdb_bfd_fdopenr. * remote-m32r-sdi.c (m32r_load): Use gdb_bfd_openr. * remote-mips.c (mips_load_srec, pmon_load_fast): Use gdb_bfd_openr. * remote.c (remote_bfd_open): Use gdb_bfd_openr_iovec. * rs6000-nat.c (add_vmap): Use gdb_bfd_openr, gdb_bfd_fdopenr, gdb_bfd_openr_next_archived_file. * solib-darwin.c (darwin_solib_get_all_image_info_addr_at_init): Use gdb_bfd_openr. * solib-pa64.c (pa64_solib_create_inferior_hook): Use gdb_bfd_openr. * solib-spu.c (spu_bfd_fopen): Use gdb_bfd_openr_iovec. * solib.c (solib_bfd_fopen): Use gdb_bfd_fopen. * spu-linux-nat.c (spu_bfd_open): Use gdb_bfd_openr_iovec. * symfile.c (bfd_open_maybe_remote): Use gdb_bfd_openr. (symfile_bfd_open): Use gdb_bfd_fopen. (generic_load): Use gdb_bfd_openr. * windows-nat.c (windows_make_so): Use gdb_bfd_openr.
Diffstat (limited to 'gdb/machoread.c')
-rw-r--r--gdb/machoread.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 8ecd4c59ebc..5b9e2ba4f64 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -629,11 +629,6 @@ macho_add_oso_symfile (oso_el *oso, bfd *abfd,
bfd_hash_table_free (&table);
- /* Make sure that the filename has the correct lifetime. The
- current filename comes either from an OSO symbol name or from an
- archive name. Memory for both is not managed by gdb. */
- gdb_bfd_stash_filename (abfd);
-
/* We need to clear SYMFILE_MAINLINE to avoid interractive question
from symfile.c:symbol_file_add_with_addrs_or_offsets. */
symbol_file_add_from_bfd
@@ -689,8 +684,7 @@ macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags)
}
/* Open the archive and check the format. */
- archive_bfd = bfd_openr (archive_name, gnutarget);
- gdb_bfd_ref (archive_bfd);
+ archive_bfd = gdb_bfd_openr (archive_name, gnutarget);
if (archive_bfd == NULL)
{
warning (_("Could not open OSO archive file \"%s\""),
@@ -707,10 +701,7 @@ macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags)
continue;
}
- gdb_bfd_stash_filename (archive_bfd);
-
- member_bfd = bfd_openr_next_archived_file (archive_bfd, NULL);
- gdb_bfd_ref (member_bfd);
+ member_bfd = gdb_bfd_openr_next_archived_file (archive_bfd, NULL);
if (member_bfd == NULL)
{
@@ -746,9 +737,8 @@ macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags)
}
prev = member_bfd;
- member_bfd = bfd_openr_next_archived_file (archive_bfd,
- member_bfd);
- gdb_bfd_ref (member_bfd);
+ member_bfd = gdb_bfd_openr_next_archived_file (archive_bfd,
+ member_bfd);
/* Free previous member if not referenced by an oso. */
if (ix2 >= last_ix)
@@ -768,8 +758,7 @@ macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags)
{
bfd *abfd;
- abfd = bfd_openr (oso->name, gnutarget);
- gdb_bfd_ref (abfd);
+ abfd = gdb_bfd_openr (oso->name, gnutarget);
if (!abfd)
warning (_("`%s': can't open to read symbols: %s."), oso->name,
bfd_errmsg (bfd_get_error ()));
@@ -819,14 +808,12 @@ macho_check_dsym (struct objfile *objfile)
warning (_("can't find UUID in %s"), objfile->name);
return NULL;
}
- dsym_bfd = bfd_openr (dsym_filename, gnutarget);
- gdb_bfd_ref (dsym_bfd);
+ dsym_bfd = gdb_bfd_openr (dsym_filename, gnutarget);
if (dsym_bfd == NULL)
{
warning (_("can't open dsym file %s"), dsym_filename);
return NULL;
}
- gdb_bfd_stash_filename (dsym_filename);
if (!bfd_check_format (dsym_bfd, bfd_object))
{