SYNOPSIS
- void solib_add (char *pattern, int from_tty, struct target_ops *TARGET)
+ void solib_add (char *pattern, int from_tty, struct target_ops
+ *TARGET, int readsyms)
DESCRIPTION
match PATTERN. (If we've already read a shared object's symbol
info, leave it alone.) If PATTERN is zero, read them all.
+ If READSYMS is 0, defer reading symbolic information until later
+ but still do any needed low level processing.
+
FROM_TTY and TARGET are as described for update_solib_list, above. */
void
-solib_add (char *pattern, int from_tty, struct target_ops *target)
+solib_add (char *pattern, int from_tty, struct target_ops *target, int readsyms)
{
struct so_list *gdb;
printf_unfiltered ("Symbols already loaded for %s\n",
gdb->so_name);
}
- else
+ else if (readsyms)
{
if (catch_errors
(symbol_add_stub, gdb,
{
struct so_list *so = so_list_head;
so_list_head = so->next;
+ if (so->abfd)
+ remove_target_sections (so->abfd);
free_so (so);
}
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);
}
/* LOCAL FUNCTION
"Unload all shared object library symbols.");
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);