aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-darwin.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2013-12-13 18:21:37 +0100
committerJoel Brobecker <brobecker@adacore.com>2013-12-15 10:59:18 +0100
commitb030cf11d6572eea467acf0ead3dad9474431033 (patch)
treee46d1c3d3a69857d9810d59c3699eaffff475136 /gdb/solib-darwin.c
parent07d100d43e70e856c802fec9b584f94c8efbd79d (diff)
downloadgdb-b030cf11d6572eea467acf0ead3dad9474431033.zip
gdb-b030cf11d6572eea467acf0ead3dad9474431033.tar.gz
gdb-b030cf11d6572eea467acf0ead3dad9474431033.tar.bz2
Revert "Do not overwrite so_list's so_name in solib_map_sections"
This reverts commit 07293be44859c607a36c313e51bec2dcdcd3c243, as it causes an unintended change of behavior with GDB/MI's =library-loaded events: The host-name="<path>" part of the event is now showing the target-side path instead of the host-side path. This revert affects Darwin and AIX systems, however, where the BFD is either artificial or icomplete, leading to the outputt of "info shared" not containing the information we'd like. For instance, on Darwin, we would see: (top-gdb) info shared From To Syms Read Shared Object Library 0x00007fff8d060de4 0x00007fff8d09ce1f Yes (*) i386:x86-64 0x00007fff8af08b10 0x00007fff8b1c6f73 Yes (*) i386:x86-64 To compensate for that, we overwrite the filename of the associated bfd. gdb/ChangeLog: Revert the following commit: * solib.c (solib_map_sections): Remove code overwriting SO->SO_NAME with the bfd's filename. Make the following changes required after the revert above: * solib-aix.c (solib_aix_bfd_open): Set the filename of the returned bfd to a copy of the synthetic pathname. * solib-darwin.c (darwin_bfd_open): Set the filename of the returned bfd to a copy of PATHNAME.
Diffstat (limited to 'gdb/solib-darwin.c')
-rw-r--r--gdb/solib-darwin.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
index c37049a..4de8cb4 100644
--- a/gdb/solib-darwin.c
+++ b/gdb/solib-darwin.c
@@ -618,6 +618,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;
}