* A few more improvements to gx jit prototype.
[deliverable/binutils-gdb.git] / gdb / solib.c
index 2acd2faa6052debb9b6c922d9f4e8c918e20eac8..3f6e73002358c6f410de960e056c7eeb866dd791 100644 (file)
@@ -186,8 +186,8 @@ first_link_map_member PARAMS ((void));
 static CORE_ADDR
 locate_base PARAMS ((void));
 
-static void
-solib_map_sections PARAMS ((struct so_list *));
+static int
+solib_map_sections PARAMS ((char *));
 
 #ifdef SVR4_SHARED_LIBS
 
@@ -224,7 +224,7 @@ LOCAL FUNCTION
 
 SYNOPSIS
 
-       static void solib_map_sections (struct so_list *so)
+       static int solib_map_sections (struct so_list *so)
 
 DESCRIPTION
 
@@ -243,10 +243,11 @@ FIXMES
        expansion stuff?).
  */
 
-static void
-solib_map_sections (so)
-     struct so_list *so;
+static int
+solib_map_sections (arg)
+     char *arg;
 {
+  struct so_list *so = (struct so_list *) arg; /* catch_errors bogon */
   char *filename;
   char *scratch_pathname;
   int scratch_chan;
@@ -343,6 +344,8 @@ solib_map_sections (so)
 
   /* Free the file names, close the file now.  */
   do_cleanups (old_chain);
+
+  return (1);
 }
 
 #ifndef SVR4_SHARED_LIBS
@@ -986,12 +989,17 @@ find_solib (so_list_ptr)
          target_read_string ((CORE_ADDR) LM_NAME (new), &buffer,
                              MAX_PATH_SIZE - 1, &errcode);
          if (errcode != 0)
-           error ("find_solib: Can't read pathname for load map: %s\n",
-                  safe_strerror (errcode));
+           {
+             warning ("find_solib: Can't read pathname for load map: %s\n",
+                      safe_strerror (errcode));
+             return (so_list_next);
+           }
          strncpy (new -> so_name, buffer, MAX_PATH_SIZE - 1);
          new -> so_name[MAX_PATH_SIZE - 1] = '\0';
          free (buffer);
-         solib_map_sections (new);
+         catch_errors (solib_map_sections, (char *) new,
+                       "Error while mapping shared library sections:\n",
+                       RETURN_MASK_ALL);
        }      
     }
   return (so_list_next);
@@ -1008,7 +1016,7 @@ symbol_add_stub (arg)
 
   if (so -> textsection)
     text_addr = so -> textsection -> addr;
-  else
+  else if (so -> abfd != NULL)
     {
       asection *lowest_sect;
 
@@ -1544,7 +1552,7 @@ enable_break ()
 
         This address is stored on the stack.  However, I've been unable
         to find any magic formula to find it for Solaris (appears to
-        be trivial on Linux).  Therefore, we have to try an alternate
+        be trivial on GNU/Linux).  Therefore, we have to try an alternate
         mechanism to find the dynamic linker's base address.  */
       tmp_bfd = bfd_openr (buf, gnutarget);
       if (tmp_bfd == NULL)
@@ -1602,9 +1610,7 @@ enable_break ()
       /* For whatever reason we couldn't set a breakpoint in the dynamic
         linker.  Warn and drop into the old code.  */
 bkpt_at_symbol:
-      warning ("Unable to find dynamic linker breakpoint function.");
-      warning ("GDB will be unable to debug shared library initializers");
-      warning ("and track explicitly loaded dynamic code.");
+      warning ("Unable to find dynamic linker breakpoint function.\nGDB will be unable to debug shared library initializers\nand track explicitly loaded dynamic code.");
     }
 #endif
 
@@ -1705,8 +1711,8 @@ solib_create_inferior_hook()
       return;
     }
 
-#ifndef SVR4_SHARED_LIBS
-  /* Only SunOS needs the loop below, other systems should be using the
+#if !defined(SVR4_SHARED_LIBS) || defined(_SCO_DS)
+  /* SCO and SunOS need the loop below, other systems should be using the
      special shared library breakpoints and the shared library breakpoint
      service routine.
 
@@ -1725,7 +1731,8 @@ solib_create_inferior_hook()
     }
   while (stop_signal != TARGET_SIGNAL_TRAP);
   stop_soon_quietly = 0;
-  
+
+#if !defined(_SCO_DS)
   /* We are now either at the "mapping complete" breakpoint (or somewhere
      else, a condition we aren't prepared to deal with anyway), so adjust
      the PC as necessary after a breakpoint, disable the breakpoint, and
@@ -1744,6 +1751,7 @@ solib_create_inferior_hook()
 
   if (auto_solib_add)
     solib_add ((char *) 0, 0, (struct target_ops *) 0);
+#endif /* ! _SCO_DS */
 #endif
 }
 
This page took 0.036423 seconds and 4 git commands to generate.