From 0c5bf5a97d48620c93deb4dbc65da9cd94c2ef8f Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Mon, 28 May 2012 20:37:29 +0000
Subject: gdb/ 	* solib-svr4.c (svr4_current_sos): New comment on 
 svr4_current_sos_via_xfer_libraries fall back.

gdb/gdbserver/
	* linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.

gdb/testsuite/
	* gdb.server/solib-list-lib.c: New file.
	* gdb.server/solib-list-main.c: New file.
	* gdb.server/solib-list.exp: New file.
---
 gdb/solib-svr4.c | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'gdb/solib-svr4.c')

diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index a639f4dabcb..bd0141acef8 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1260,6 +1260,14 @@ svr4_current_sos (void)
   int ignore_first;
   struct svr4_library_list library_list;
 
+  /* Fall back to manual examination of the target if the packet is not
+     supported or gdbserver failed to find DT_DEBUG.  gdb.server/solib-list.exp
+     tests a case where gdbserver cannot find the shared libraries list while
+     GDB itself is able to find it via SYMFILE_OBJFILE.
+
+     Unfortunately statically linked inferiors will also fall back through this
+     suboptimal code path.  */
+
   if (svr4_current_sos_via_xfer_libraries (&library_list))
     {
       if (library_list.main_lm)
-- 
cgit v1.2.1