* symfile.c (separate_debug_file_exists): Update.
[deliverable/binutils-gdb.git] / gdb / solib-svr4.c
index 9be582c152b23ab3859f6a00996d403a0ec3b4f1..307e48392fe17ef3ca0d6dcf45df1b500ed99dbf 100644 (file)
@@ -1,8 +1,7 @@
 /* Handle SVR4 shared libraries for GDB, the GNU Debugger.
 
-   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
-   2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1990-1996, 1998-2001, 2003-2012 Free Software
+   Foundation, Inc.
 
    This file is part of GDB.
 
@@ -961,6 +960,30 @@ struct svr4_library_list
   CORE_ADDR main_lm;
 };
 
+/* Implementation for target_so_ops.free_so.  */
+
+static void
+svr4_free_so (struct so_list *so)
+{
+  xfree (so->lm_info);
+}
+
+/* Free so_list built so far (called via cleanup).  */
+
+static void
+svr4_free_library_list (void *p_list)
+{
+  struct so_list *list = *(struct so_list **) p_list;
+
+  while (list != NULL)
+    {
+      struct so_list *next = list->next;
+
+      svr4_free_so (list);
+      list = next;
+    }
+}
+
 #ifdef HAVE_LIBEXPAT
 
 #include "xml-support.h"
@@ -1050,30 +1073,6 @@ static const struct gdb_xml_element svr4_library_list_elements[] =
   { NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL }
 };
 
-/* Implementation for target_so_ops.free_so.  */
-
-static void
-svr4_free_so (struct so_list *so)
-{
-  xfree (so->lm_info);
-}
-
-/* Free so_list built so far (called via cleanup).  */
-
-static void
-svr4_free_library_list (void *p_list)
-{
-  struct so_list *list = *(struct so_list **) p_list;
-
-  while (list != NULL)
-    {
-      struct so_list *next = list->next;
-
-      svr4_free_so (list);
-      list = next;
-    }
-}
-
 /* Parse qXfer:libraries:read packet into *SO_LIST_RETURN.  Return 1 if
 
    Return 0 if packet not supported, *SO_LIST_RETURN is not modified in such
@@ -1261,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)
@@ -1700,7 +1707,7 @@ enable_break (struct svr4_info *info, int from_tty)
        }
     }
 
-  if (!current_inferior ()->attach_flag)
+  if (interp_name != NULL && !current_inferior ()->attach_flag)
     {
       for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++)
        {
@@ -2250,13 +2257,13 @@ svr4_solib_create_inferior_hook (int from_tty)
 
   clear_proceed_status ();
   inf->control.stop_soon = STOP_QUIETLY;
-  tp->suspend.stop_signal = TARGET_SIGNAL_0;
+  tp->suspend.stop_signal = GDB_SIGNAL_0;
   do
     {
       target_resume (pid_to_ptid (-1), 0, tp->suspend.stop_signal);
       wait_for_inferior ();
     }
-  while (tp->suspend.stop_signal != TARGET_SIGNAL_TRAP);
+  while (tp->suspend.stop_signal != GDB_SIGNAL_TRAP);
   inf->control.stop_soon = NO_STOP_QUIETLY;
 #endif /* defined(_SCO_DS) */
 }
This page took 0.024123 seconds and 4 git commands to generate.