From c77cdff7df21b5351f471faaf4d34dd423c7c385 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 28 Mar 2013 21:48:36 -0400 Subject: [PATCH] solib-darwin: Overwrite filename of unpeeled fat-binary bfd. gdb/ChangeLog: * solib-darwin.c (darwin_bfd_open): Set the filename of the returned bfd to a copy of PATHNAME. --- gdb/solib-darwin.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index b9a4be1..9b61de5 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -621,6 +621,16 @@ darwin_bfd_open (char *pathname) bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ())); } + /* The current filename for fat-binary BFDs is a name generated + by BFD, usually a string containing the name of the architecture. + Reset its value to the actual filename. */ + { + char *data = bfd_alloc (res, strlen (pathname) + 1); + + strcpy (data, pathname); + res->filename = data; + } + gdb_bfd_unref (abfd); return res; } -- 1.7.0.4