Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: display an error message if libunwind-XX cannot be load
@ 2012-02-01 14:06 Tristan Gingold
  2012-02-01 15:33 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Tristan Gingold @ 2012-02-01 14:06 UTC (permalink / raw)
  To: gdb-patches@sourceware.org ml

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.  */
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RFA: display an error message if libunwind-XX cannot be load
  2012-02-01 14:06 RFA: display an error message if libunwind-XX cannot be load Tristan Gingold
@ 2012-02-01 15:33 ` Tom Tromey
  2012-02-01 16:24   ` Tristan Gingold
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2012-02-01 15:33 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: gdb-patches@sourceware.org ml

>>>>> "Tristan" == Tristan Gingold <gingold@adacore.com> writes:

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

Tristan> +      fprintf_unfiltered (gdb_stderr, "\
Tristan> +[GDB failed to load %s: %s]\n", LIBUNWIND_SO, dlerror ());

This is missing _().
This is ok with that change.

Do you want to print something for all the other failure cases in that
function?

Tom


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RFA: display an error message if libunwind-XX cannot be load
  2012-02-01 15:33 ` Tom Tromey
@ 2012-02-01 16:24   ` Tristan Gingold
  0 siblings, 0 replies; 3+ messages in thread
From: Tristan Gingold @ 2012-02-01 16:24 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches@sourceware.org ml


On Feb 1, 2012, at 4:32 PM, Tom Tromey wrote:

>>>>>> "Tristan" == Tristan Gingold <gingold@adacore.com> writes:
> 
> Tristan> 	* libunwind-frame.c (libunwind_load): Display message if
> Tristan> 	dlopen failed.
> 
> Tristan> +      fprintf_unfiltered (gdb_stderr, "\
> Tristan> +[GDB failed to load %s: %s]\n", LIBUNWIND_SO, dlerror ());
> 
> This is missing _().
> This is ok with that change.

Thanks, committed.

> Do you want to print something for all the other failure cases in that
> function?

Not yet.  Missing symbols is far unlikely to happen, and there are more important issues to be fixed with libunwind...

Tristan.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-01 16:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-01 14:06 RFA: display an error message if libunwind-XX cannot be load Tristan Gingold
2012-02-01 15:33 ` Tom Tromey
2012-02-01 16:24   ` Tristan Gingold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox