aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-03-05 17:11:48 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-03-05 17:11:48 +0000
commit75528772a7c1d29fc900c139641ab10b1a5e6cec (patch)
tree9805ccaa9f8f57b8884e681b040e347f9da0e88c
parente237a7e2c51159a40c2a623a379c2086610b5e55 (diff)
downloadgdb-75528772a7c1d29fc900c139641ab10b1a5e6cec.zip
gdb-75528772a7c1d29fc900c139641ab10b1a5e6cec.tar.gz
gdb-75528772a7c1d29fc900c139641ab10b1a5e6cec.tar.bz2
gdb/
* libunwind-frame.c (LIBUNWIND_SO): Change .7 to .8. [!LIBUNWIND_SO] (LIBUNWIND_SO_7): New #define. (libunwind_load): New variable so_error, use it for dlerror. Try to load also LIBUNWIND_SO_7.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/libunwind-frame.c24
2 files changed, 28 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cb9ebaf..2da944d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-05 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * libunwind-frame.c (LIBUNWIND_SO): Change .7 to .8.
+ [!LIBUNWIND_SO] (LIBUNWIND_SO_7): New #define.
+ (libunwind_load): New variable so_error, use it for dlerror. Try to
+ load also LIBUNWIND_SO_7.
+
2012-03-05 Pedro Alves <palves@redhat.com>
* i387-tdep.c (i387_supply_xsave): Assert the xsave section buffer
diff --git a/gdb/libunwind-frame.c b/gdb/libunwind-frame.c
index babdecc..1421d92 100644
--- a/gdb/libunwind-frame.c
+++ b/gdb/libunwind-frame.c
@@ -95,7 +95,11 @@ struct libunwind_frame_cache
#ifndef LIBUNWIND_SO
/* Use the stable ABI major version number. `libunwind-ia64.so' is a link time
only library, not a runtime one. */
-#define LIBUNWIND_SO "libunwind-" STRINGIFY(UNW_TARGET) ".so.7"
+#define LIBUNWIND_SO "libunwind-" STRINGIFY(UNW_TARGET) ".so.8"
+
+/* Provide also compatibility with older .so. The two APIs are compatible, .8
+ is only extended a bit, GDB does not use the extended API at all. */
+#define LIBUNWIND_SO_7 "libunwind-" STRINGIFY(UNW_TARGET) ".so.7"
#endif
static char *get_reg_name = STRINGIFY(UNW_OBJ(get_reg));
@@ -491,14 +495,28 @@ static int
libunwind_load (void)
{
void *handle;
+ char *so_error = NULL;
handle = dlopen (LIBUNWIND_SO, RTLD_NOW);
if (handle == NULL)
{
+ so_error = xstrdup (dlerror ());
+#ifdef LIBUNWIND_SO_7
+ handle = dlopen (LIBUNWIND_SO_7, RTLD_NOW);
+#endif /* LIBUNWIND_SO_7 */
+ }
+ if (handle == NULL)
+ {
fprintf_unfiltered (gdb_stderr, _("[GDB failed to load %s: %s]\n"),
- LIBUNWIND_SO, dlerror ());
- return 0;
+ LIBUNWIND_SO, so_error);
+#ifdef LIBUNWIND_SO_7
+ fprintf_unfiltered (gdb_stderr, _("[GDB failed to load %s: %s]\n"),
+ LIBUNWIND_SO_7, dlerror ());
+#endif /* LIBUNWIND_SO_7 */
}
+ xfree (so_error);
+ if (handle == NULL)
+ return 0;
/* Initialize pointers to the dynamic library functions we will use. */