This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: display an error message if libunwind-XX cannot be load


Hi,

no message was reported if libunwind cannot be loaded, which serially impairs debugging.  Hence this patchlet to fill the gap.

The message is not highly user friendly (it appears before the banner), but this is not unlike sol-thread.c
I haven't handle the case where a symbol couldn't be resolved, but in practice this happens less frequently.

Ok for trunk ?

Manually tested only.

Tristan.

2012-02-01  Tristan Gingold  <gingold@adacore.com>

	* libunwind-frame.c (libunwind_load): Display message if dlopen failed.

diff --git a/gdb/libunwind-frame.c b/gdb/libunwind-frame.c
index 53ce1e2..360a28e 100644
--- a/gdb/libunwind-frame.c
+++ b/gdb/libunwind-frame.c
@@ -509,7 +509,11 @@ libunwind_load (void)
 
   handle = dlopen (LIBUNWIND_SO, RTLD_NOW);
   if (handle == NULL)
-    return 0;
+    {
+      fprintf_unfiltered (gdb_stderr, "\
+[GDB failed to load %s: %s]\n", LIBUNWIND_SO, dlerror ());
+      return 0;
+    }
 
   /* Initialize pointers to the dynamic library functions we will use.  */
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]