[patch] print again like <=7.1: Error while reading shared library symbols

Jan Kratochvil jan.kratochvil@redhat.com
Sat Oct 9 19:48:00 GMT 2010


Hi,

isolated part of (with no interdependencies)
	[patch] python(+solib error): save/restore error state
	http://sourceware.org/ml/gdb-patches/2010-10/msg00153.html

This is a regression 7.1->7.2 by:
	e12b767fb287127671d514eef227486777f0a972
	Daniel Jacobowitz and Pedro Alves
	Group errors for many missing shared libraries.
	http://sourceware.org/ml/gdb-patches/2010-04/msg00342.html
	http://sourceware.org/ml/gdb-cvs/2010-04/msg00126.html

solib_read_symbols no longer prints GDB exceptions for from_tty == 0.
I understand "Loaded symbols for %s" should not be printed
for from_tty == 0 but I do not understand why exceptions should be hidden,
even for scripts.  I find this change of the patch could be a "typo".

run_command_1 calls post_create_inferior with from_tty == 0 - this is why
from_tty == 0 is in solib_read_symbols.
  /* Pass zero for FROM_TTY, because at this point the "run" command
     has done its thing; now we are setting up the running program.  */
  post_create_inferior (&current_target, 0);

No regressions on {x86_64,x86_64-m32,i686}-fedora14snapshot-linux-gnu.

I have verified that
	./gdb -nx -ex 'set sysroot /nO' -ex r --args true -nx
still works with no change printing only the summary, which was the goal of the
patch referenced above:
	warning: Could not load shared library symbols for 2 libraries, e.g. /lib64/libc.so.6.
	Use the "info sharedlibrary" command to see the complete listing.
	Do you need "set solib-search-path" or "set sysroot"?

But an artifical error in the symbols add callee now prints:
	Error while reading shared library symbols for /lib64/ld-linux-x86-64.so.2:
	ERROR
	Error while reading shared library symbols for /lib64/ld-linux-x86-64.so.2:
	ERROR
	ERROR
	Error while reading shared library symbols for /lib64/ld-linux-x86-64.so.2:
	ERROR
	Error while reading shared library symbols for /lib64/ld-linux-x86-64.so.2:
	ERROR
	Error while reading shared library symbols for /lib64/libc.so.6:
	ERROR

while only single ERROR with no headline has been printed in 7.2+ (for vDSO).
If the error messages should be summarized even in this case there is needed
some new summarizing patch as it is not handled by the one referenced above.
Just suppressing the errors completely makes troubleshooting difficult.

I would even check it in if there are no comments.


Thanks,
Jan


gdb/
2010-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>

        * solib.c (solib_read_symbols): Call exception_fprintf even without
        FROM_TTY.  Print also so->so_name.

--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -652,12 +652,9 @@ solib_read_symbols (struct so_list *so, int flags)
 	}
 
       if (e.reason < 0)
-	{
-	  if (from_tty)
-	    exception_fprintf
-	      (gdb_stderr, e,
-	       _("Error while reading shared library symbols:\n"));
-	}
+	exception_fprintf (gdb_stderr, e, _("Error while reading shared"
+					    " library symbols for %s:\n"),
+			   so->so_name);
       else
 	{
 	  if (from_tty || info_verbose)



More information about the Gdb-patches mailing list