summaryrefslogtreecommitdiff
path: root/gdb/symfile-mem.c
diff options
context:
space:
mode:
authorHui Zhu <teawater@gmail.com>2014-01-07 00:24:41 +0800
committerHui Zhu <teawater@gmail.com>2014-01-07 00:24:41 +0800
commitadcf2eed05bb041ba579d74102c18ea1e97b29d6 (patch)
tree54836e00abea7a4194e2ca56c46f72d6f769570e /gdb/symfile-mem.c
parentb0b0c9fc49b72ec4f0f38419f20bcafcae9736d8 (diff)
Remove gdb_bfd_stash_filename to fix crash with fix of binutils/11983
https://sourceware.org/ml/gdb-patches/2014-01/msg00029.html https://sourceware.org/ml/gdb-patches/2014-01/msg00053.html 2014-01-07 Hui Zhu <hui@codesourcery.com> * gdb_bfd.c (gdb_bfd_stash_filename): Removed. (gdb_bfd_open): Removed gdb_bfd_stash_filename. (gdb_bfd_fopen): Ditto. (gdb_bfd_openr): Ditto. (gdb_bfd_openw): Ditto. (gdb_bfd_openr_iovec): Ditto. (gdb_bfd_fdopenr): Ditto. * gdb_bfd.h (gdb_bfd_stash_filename): Removed. * solib-aix.c (solib_aix_bfd_open): Alloc object_bfd->filename with xstrdup. * solib-darwin.c (darwin_bfd_open): Alloc res->filename with xstrdup. * symfile-mem.c (symbol_file_add_from_memory): Removed gdb_bfd_stash_filename.
Diffstat (limited to 'gdb/symfile-mem.c')
-rw-r--r--gdb/symfile-mem.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c
index 87808e31b9..e3230de85d 100644
--- a/gdb/symfile-mem.c
+++ b/gdb/symfile-mem.c
@@ -101,14 +101,11 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, char *name,
error (_("Failed to read a valid object file image from memory."));
gdb_bfd_ref (nbfd);
+ xfree (bfd_get_filename (nbfd));
if (name == NULL)
- nbfd->filename = "shared object read from target memory";
+ nbfd->filename = xstrdup ("shared object read from target memory");
else
- {
- nbfd->filename = name;
- gdb_bfd_stash_filename (nbfd);
- xfree (name);
- }
+ nbfd->filename = name;
cleanup = make_cleanup_bfd_unref (nbfd);