Approved by kev@cygnus.com
[deliverable/binutils-gdb.git] / gdb / osfsolib.c
index 0173b634e23c4c5984ee35d02202060b3b06cf64..2ef7947676bde4e27c728663b474d9cc59660886 100644 (file)
@@ -596,14 +596,14 @@ symbol_add_stub (char *arg)
    SYNOPSIS
 
    void solib_add (char *arg_string, int from_tty,
-   struct target_ops *target)
+   struct target_ops *target, int readsyms)
 
    DESCRIPTION
 
  */
 
 void
-solib_add (char *arg_string, int from_tty, struct target_ops *target)
+solib_add (char *arg_string, int from_tty, struct target_ops *target, int readsyms)
 {
   register struct so_list *so = NULL;  /* link map state variable */
 
@@ -614,6 +614,9 @@ solib_add (char *arg_string, int from_tty, struct target_ops *target)
   int count;
   int old;
 
+  if (!readsyms)
+    return;
+
   if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
     {
       error ("Invalid regexp: %s", re_err);
@@ -802,6 +805,7 @@ clear_solib (void)
        }
       if (so_list_head->abfd)
        {
+         remove_target_sections (so_list_head->abfd);
          bfd_filename = bfd_get_filename (so_list_head->abfd);
          if (!bfd_close (so_list_head->abfd))
            warning ("cannot close \"%s\": %s",
@@ -876,7 +880,7 @@ solib_create_inferior_hook (void)
   stop_signal = TARGET_SIGNAL_0;
   do
     {
-      target_resume (-1, 0, stop_signal);
+      target_resume (minus_one_ptid, 0, stop_signal);
       wait_for_inferior ();
     }
   while (stop_signal != TARGET_SIGNAL_TRAP);
@@ -887,8 +891,7 @@ solib_create_inferior_hook (void)
      and will put out an annoying warning.
      Delaying the resetting of stop_soon_quietly until after symbol loading
      suppresses the warning.  */
-  if (auto_solib_add)
-    solib_add ((char *) 0, 0, (struct target_ops *) 0);
+  solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
   stop_soon_quietly = 0;
 }
 
@@ -911,7 +914,7 @@ static void
 sharedlibrary_command (char *args, int from_tty)
 {
   dont_repeat ();
-  solib_add (args, from_tty, (struct target_ops *) 0);
+  solib_add (args, from_tty, (struct target_ops *) 0, 1);
 }
 
 void
@@ -923,13 +926,13 @@ _initialize_solib (void)
            "Status of loaded shared object libraries.");
 
   add_show_from_set
-    (add_set_cmd ("auto-solib-add", class_support, var_zinteger,
+    (add_set_cmd ("auto-solib-add", class_support, var_boolean,
                  (char *) &auto_solib_add,
                  "Set autoloading of shared library symbols.\n\
-If nonzero, symbols from all shared object libraries will be loaded\n\
-automatically when the inferior begins execution or when the dynamic linker\n\
-informs gdb that a new library has been loaded.  Otherwise, symbols\n\
-must be loaded manually, using `sharedlibrary'.",
+If \"on\", symbols from all shared object libraries will be loaded\n\
+automatically when the inferior begins execution, when the dynamic linker\n\
+informs gdb that a new library has been loaded, or when attaching to the\n\
+inferior.  Otherwise, symbols must be loaded manually, using `sharedlibrary'.",
                  &setlist),
      &showlist);
 }
This page took 0.101395 seconds and 4 git commands to generate.