* somsolib.c (auto_solib_add_at_startup): Define new global variable.
authorJeff Law <law@redhat.com>
Wed, 13 Sep 1995 14:50:51 +0000 (14:50 +0000)
committerJeff Law <law@redhat.com>
Wed, 13 Sep 1995 14:50:51 +0000 (14:50 +0000)
(som_solib_create_inferior_hook): Don't add libraries if
auto_solib_add_at_startup is zero.
(_initialize_som_solib): Add command to toggle
auto_solib_add_at_startup.

gdb/ChangeLog
gdb/somsolib.c

index 5ddea8175f29a875c254fbb5d8311393a1700709..1c23bdaa27051bc81bc3c44319bd9bb8451c31c6 100644 (file)
@@ -1,3 +1,11 @@
+Wed Sep 13 08:45:02 1995  Jeff Law  (law@fast.cs.utah.edu)
+
+       * somsolib.c (auto_solib_add_at_startup): Define new global variable.
+       (som_solib_create_inferior_hook): Don't add libraries if
+       auto_solib_add_at_startup is zero.
+       (_initialize_som_solib): Add command to toggle
+       auto_solib_add_at_startup.
+
 Tue Sep 12 19:37:24 1995  Jeff Law  (law@snake.cs.utah.edu)
 
        * monitor.c (monitor_make_srec): Fix thinkos in computation
index cd065cc94fd115916254a69f37fad614c3d56ec8..9ac429d204903d83a4a539aec3aac52c69b937da 100644 (file)
@@ -34,6 +34,7 @@ and by Cygnus Support.  */
 #include "objfiles.h"
 #include "inferior.h"
 #include "gdb-stabs.h"
+#include "gdbcmd.h"
 
 /* TODO:
 
@@ -95,6 +96,17 @@ struct so_list
   struct so_list *next;
 };
 
+/* If true, then shared library symbols will be added automatically
+   when the inferior is created.  This is almost always what users
+   will want to have happen; but for very large programs, the startup
+   time will be excessive, and so if this is a problem, the user can
+   clear this flag and then add the shared library symbols as needed.
+   Note that there is a potential for confusion, since if the shared
+   library symbols are not loaded, commands like "info fun" will *not*
+   report all the functions that are actually present.  */
+
+int auto_solib_add_at_startup = 1;
+
 static struct so_list *so_list_head;
 
 static void som_sharedlibrary_info_command PARAMS ((char *, int));
@@ -559,7 +571,8 @@ som_solib_create_inferior_hook()
       return;
     }
 
-  som_solib_add ((char *) 0, 0, (struct target_ops *) 0);
+  if (auto_solib_add_at_startup)
+    som_solib_add ((char *) 0, 0, (struct target_ops *) 0);
 }
 
 /* Return the GOT value for the shared library in which ADDR belongs.  If
@@ -692,4 +705,14 @@ _initialize_som_solib ()
            "Load shared object library symbols for files matching REGEXP.");
   add_info ("sharedlibrary", som_sharedlibrary_info_command,
            "Status of loaded shared object libraries.");
+  add_show_from_set
+    (add_set_cmd ("auto-solib-add", class_support, var_zinteger,
+                 (char *) &auto_solib_add_at_startup,
+                 "Set autoloading of shared library symbols at startup.\n\
+If nonzero, symbols from all shared object libraries will be loaded\n\
+automatically when the inferior begins execution.  Otherwise, symbols\n\
+must be loaded manually, using `sharedlibrary'.",
+                 &setlist),
+     &showlist);
+
 }
This page took 0.030888 seconds and 4 git commands to generate.