From: Joel Brobecker Date: Thu, 11 Apr 2013 01:24:09 +0000 (+0000) Subject: solib-darwin: Overwrite filename of unpeeled fat-binary bfd. X-Git-Tag: gdb_7_6-2013-04-26-release~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebf6b2ba6b5a91ca01c61958794fe6aa1d781ab0;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8b57165d3df..20a2072b0f4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-04-10 Joel Brobecker + + * solib-darwin.c (darwin_bfd_open): Set the filename of the + returned bfd to a copy of PATHNAME. + 2013-04-09 Markus Metzger * NEWS: Mention new btrace RSP packets. diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index b9a4be1c600..9b61de58805 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; }