diff options
author | Tom Tromey <tromey@redhat.com> | 2012-07-23 14:56:11 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-07-23 14:56:11 +0000 |
commit | 520b0001c16bc59223bec1369d056787c1883f10 (patch) | |
tree | 350d92b68574f3dd5d803fdf55ef3524b6c45d80 /gdb/symfile.c | |
parent | d86492f2b7aea326a948476f13477bef5d4ceac9 (diff) | |
download | gdb-520b0001c16bc59223bec1369d056787c1883f10.zip gdb-520b0001c16bc59223bec1369d056787c1883f10.tar.gz gdb-520b0001c16bc59223bec1369d056787c1883f10.tar.bz2 |
* bfd-target.c (target_bfd_reopen): Update.
* cli/cli-dump.c (bfd_openr_with_cleanup)
(bfd_openw_with_cleanup): Update.
* corelow.c (core_open): Update.
* dsrec.c (load_srec): Update.
* exec.c (exec_file_attach): Update.
* gcore.c (create_gcore_bfd): Update.
* gdb_bfd.c (gdb_bfd_ref): Return void.
(gdb_bfd_open): Update.
* gdb_bfd.h (gdb_bfd_ref): Return void.
Update comments.
* jit.c (jit_bfd_try_read_symtab): Update.
* m32r-rom.c (m32r_load, m32r_upload_command): Update.
* machoread.c (macho_symfile_read_all_oso): Update.
(macho_check_dsym): Update.
* procfs.c (insert_dbx_link_bpt_in_file): Update.
* remote-m32r-sdi.c (m32r_load): Update.
* remote-mips.c (mips_load_srec, pmon_load_fast): Update.
* rs6000-nat.c (add_vmap): Update.
* solib-darwin.c (darwin_solib_get_all_image_info_addr_at_init):
Update.
* solib-pa64.c (pa64_solib_create_inferior_hook): Update.
* solib-spu.c (spu_bfd_open): Update.
* solib.c (solib_bfd_fopen, solib_read_symbols): Update.
* spu-linux-nat.c (spu_bfd_open): Update.
* symfile.c (bfd_open_maybe_remote, symfile_bfd_open)
(generic_load): Update.
* windows-nat.c (windows_make_so): Update.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index c904011..921ed30 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1697,16 +1697,19 @@ set_initial_language (void) bfd * bfd_open_maybe_remote (const char *name) { + bfd *result; + if (remote_filename_p (name)) - return gdb_bfd_ref (remote_bfd_open (name, gnutarget)); + result = remote_bfd_open (name, gnutarget); else { - bfd *result = gdb_bfd_ref (bfd_openr (name, gnutarget)); - + result = bfd_openr (name, gnutarget); if (result != NULL) gdb_bfd_stash_filename (result); - return result; } + + gdb_bfd_ref (result); + return result; } @@ -1724,7 +1727,8 @@ symfile_bfd_open (char *name) if (remote_filename_p (name)) { - sym_bfd = gdb_bfd_ref (remote_bfd_open (name, gnutarget)); + sym_bfd = remote_bfd_open (name, gnutarget); + gdb_bfd_ref (sym_bfd); if (!sym_bfd) error (_("`%s': can't open to read symbols: %s."), name, bfd_errmsg (bfd_get_error ())); @@ -1764,7 +1768,8 @@ symfile_bfd_open (char *name) name = absolute_name; make_cleanup (xfree, name); - sym_bfd = gdb_bfd_ref (bfd_fopen (name, gnutarget, FOPEN_RB, desc)); + sym_bfd = bfd_fopen (name, gnutarget, FOPEN_RB, desc); + gdb_bfd_ref (sym_bfd); if (!sym_bfd) { make_cleanup (xfree, name); @@ -2106,7 +2111,8 @@ generic_load (char *args, int from_tty) } /* Open the file for loading. */ - loadfile_bfd = gdb_bfd_ref (bfd_openr (filename, gnutarget)); + loadfile_bfd = bfd_openr (filename, gnutarget); + gdb_bfd_ref (loadfile_bfd); if (loadfile_bfd == NULL) { perror_with_name (filename); |