diff options
author | Jeff Law <law@redhat.com> | 1995-09-13 14:50:51 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1995-09-13 14:50:51 +0000 |
commit | 2e977a3ae49f9c9508b2e2ad0113efecebc7a890 (patch) | |
tree | 192e4b98cee3c7d80700898d372c508cf2519aa9 /gdb/somsolib.c | |
parent | 5be86c5672fdafe0043af4c2fde581588cf4898f (diff) | |
download | gdb-2e977a3ae49f9c9508b2e2ad0113efecebc7a890.zip gdb-2e977a3ae49f9c9508b2e2ad0113efecebc7a890.tar.gz gdb-2e977a3ae49f9c9508b2e2ad0113efecebc7a890.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/somsolib.c')
-rw-r--r-- | gdb/somsolib.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/gdb/somsolib.c b/gdb/somsolib.c index cd065cc..9ac429d 100644 --- a/gdb/somsolib.c +++ b/gdb/somsolib.c @@ -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); + } |