+2001-11-01 Fred Fish <fnf@redhat.com>
+
+ * coff-solib.c (coff_solib_add): Add new readsyms arg.
+ * irix5-nat.c (solib_add): Ditto.
+ * osfsolib.c (solib_add): Ditto.
+ * pa64solib.c (pa64_solib_add): Ditto.
+ * pa64solib.c (add_to_solist): Ditto.
+ * pa64solib.c (read_dld_descriptor): Ditto.
+ * solib.c (solib_add): Ditto.
+ * somsolib.c (som_solib_add): Ditto.
+ * win32-nat.c (child_solib_add): Ditto.
+ * xcoffsolib.c (solib_add): Ditto.
+
+ * coff-solib.h (coff_solib_add): Add new readsyms arg to prototype.
+ * pa64solib.c (add_to_solist): Ditto.
+ * pa64solib.c (read_dld_descriptor): Ditto.
+ * pa64solib.h (pa64_solib_add): Ditto.
+ * solib.h (solib_add): Ditto.
+ * somsolib.h (som_solib_add): Ditto.
+ * config/i386/tm-cygwin.h (child_solib_add): Ditto.
+
+ * coff-solib.c (coff_solib_add): If readsyms is zero don't read
+ symbols but do any other needed work for shared libs.
+ * irix5-nat.c: Ditto.
+ * osfsolib.c (solib_add): Ditto.
+ * solib.c (solib_add): Ditto.
+ * win32-nat.c (child_solib_add): Ditto.
+ * xcoffsolib.c (solib_add): Ditto.
+
+ * irix5-nat.c (sharedlibrary_command): Pass 1 as readsyms to
+ solib_add to force reading of shared library symbols.
+ * osfsolib.c (sharedlibrary_command;): Ditto.
+ * pa64solib.c (pa64_solib_sharedlibrary_command): Ditto.
+ * solib.c (sharedlibrary_command): Ditto.
+ * somsolib.c (som_solib_sharedlibrary_command): Ditto.
+ * xcoffsolib.c (sharedlibrary_command): Ditto.
+
+ * coff-solib.c (coff_solib_create_inferior_hook): Call solib_add
+ unconditionally with auto_solib_add.
+ * irix5-nat.c (solib_create_inferior_hook): Ditto.
+ * osfsolib.c (solib_create_inferior_hook): Ditto.
+ * solib.c (solib_create_inferior_hook): Ditto.
+ * solib-osf.c (osf_solib_create_inferior_hook): Ditto.
+ * solib-svr4.c (enable_break): Ditto.
+ * solib-sunos.c (sunos_solib_create_inferior_hook): Ditto.
+
+ * corelow.c (solib_add_stub): Add auto_solib_add to args passed
+ via SOLIB_ADD.
+ * sol-thread.c (sol_thread_attach): Ditto.
+ * config/rs6000/nm-rs6000.h (SOLIB_ADD): Ditto.
+
+ * infcmd.c (attach_command): Remove auto_solib_add decl.
+ Call SOLIB_ADD directly with auto_solib_add.
+ * infrun.c (handle_inferior_event): Ditto.
+
+ * coff-solib.h (SOLIB_ADD): Add readsyms arg.
+ * pa64solib.h (SOLIB_ADD): Ditto.
+ * solib.h (SOLIB_ADD): Ditto.
+ * somsolib.h (SOLIB_ADD): Ditto.
+ * config/i386/tm-cygwin.h (SOLIB_ADD): Ditto.
+
+ * fork-child.c (clone_and_follow_inferior): Remove unused
+ auto_solib_add decl.
+
+ * pa64solib.c (pa64_solib_add): Call add_to_solist with readsyms.
+ (read_dld_descriptor): Ditto.
+ (pa64_solib_add): Call read_dld_descriptor with readsyms.
+ (pa64_solib_in_dynamic_linker): Ditto.
+
+ * corelow.c (symfile.h): Need this for auto_solib_add declaration.
+ * sol-thread.c (symfile.h): Ditto.
+
2001-10-31 Andrew Cagney <ac131313@redhat.com>
* s390-nat.c (s390_remove_watchpoint): Use xfree.
SYNOPSIS
void coff_solib_add (char *arg_string, int from_tty,
- struct target_ops *target)
+ struct target_ops *target, int readsyms)
DESCRIPTION
*/
void
-coff_solib_add (char *arg_string, int from_tty, struct target_ops *target)
+coff_solib_add (char *arg_string, int from_tty, struct target_ops *target, int readsyms)
{
asection *libsect;
+ if (!readsyms)
+ return;
+
libsect = bfd_get_section_by_name (exec_bfd, ".lib");
if (libsect)
void
coff_solib_create_inferior_hook (void)
{
- coff_solib_add ((char *) 0, 0, (struct target_ops *) 0);
+ coff_solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
}
/* Called to add symbols from a shared library to gdb's symbol table. */
-#define SOLIB_ADD(filename, from_tty, targ) \
- coff_solib_add (filename, from_tty, targ)
+#define SOLIB_ADD(filename, from_tty, targ, readsyms) \
+ coff_solib_add (filename, from_tty, targ, readsyms)
-extern void coff_solib_add (char *, int, struct target_ops *);
+extern void coff_solib_add (char *, int, struct target_ops *, int);
/* Function to be called when the inferior starts up, to discover the names
of shared libraries that are dynamically linked, the base addresses to
#endif
#define ATTACH_NO_WAIT
-#define SOLIB_ADD(filename, from_tty, targ) child_solib_add(filename, from_tty, targ)
+#define SOLIB_ADD(filename, from_tty, targ, readsyms) child_solib_add(filename, from_tty, targ, readsyms)
#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_pathname(pid)
#define CLEAR_SOLIB child_clear_solibs
#define ADD_SHARED_SYMBOL_FILES dll_symbol_command
struct target_ops;
char *cygwin_pid_to_str (ptid_t ptid);
-void child_solib_add (char *, int, struct target_ops *);
+void child_solib_add (char *, int, struct target_ops *, int);
char *child_solib_loaded_library_pathname(int);
void child_clear_solibs (void);
void dll_symbol_command (char *, int);
/* When a target process or core-file has been attached, we sneak in
and figure out where the shared libraries have got to. */
-#define SOLIB_ADD(a, b, c) \
+#define SOLIB_ADD(a, b, c, d) \
if (PIDGET (inferior_ptid)) \
/* Attach to process. */ \
xcoff_relocate_symtab (PIDGET (inferior_ptid)); \
#include "gdbcore.h"
#include "gdbthread.h"
#include "regcache.h"
+#include "symfile.h"
#ifndef O_BINARY
#define O_BINARY 0
static int
solib_add_stub (PTR from_ttyp)
{
- SOLIB_ADD (NULL, *(int *) from_ttyp, ¤t_target);
+ SOLIB_ADD (NULL, *(int *) from_ttyp, ¤t_target, auto_solib_add);
re_enable_breakpoints_in_shlibs ();
return 0;
}
+2001-11-01 Fred Fish <fnf@redhat.com>
+
+ * gdbint.texinfo (SOLIB_ADD): Document additional new
+ "readsyms" arg.
+
2001-10-30 Don Howard <dhoward@redhat.com>
* gdb.texinfo: (Command Files) Added documentation for the
@page
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.41 $} % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.42 $} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Solutions\par
\hfill \manvers\par
If defined, this is the name of the shell to use to run the inferior.
Defaults to @code{"/bin/sh"}.
-@item SOLIB_ADD (@var{filename}, @var{from_tty}, @var{targ})
+@item SOLIB_ADD (@var{filename}, @var{from_tty}, @var{targ}, @var{readsyms})
@findex SOLIB_ADD
Define this to expand into an expression that will cause the symbols in
-@var{filename} to be added to @value{GDBN}'s symbol table.
+@var{filename} to be added to @value{GDBN}'s symbol table. If
+@var{readsyms} is zero symbols are not read but any necessary low level
+processing for @var{filename} is still done.
@item SOLIB_CREATE_INFERIOR_HOOK
@findex SOLIB_CREATE_INFERIOR_HOOK
void
clone_and_follow_inferior (int child_pid, int *followed_child)
{
- extern int auto_solib_add;
-
int debugger_pid;
int status;
char pid_spelling[100]; /* Arbitrary but sufficient length. */
void
attach_command (char *args, int from_tty)
{
-#ifdef SOLIB_ADD
- extern int auto_solib_add;
-#endif
-
char *exec_file;
char *full_exec_path = NULL;
}
#ifdef SOLIB_ADD
- if (auto_solib_add)
- {
- /* Add shared library symbols from the newly attached process, if any. */
- SOLIB_ADD ((char *) 0, from_tty, ¤t_target);
- re_enable_breakpoints_in_shlibs ();
- }
+ /* Add shared library symbols from the newly attached process, if any. */
+ SOLIB_ADD ((char *) 0, from_tty, ¤t_target, auto_solib_add);
+ re_enable_breakpoints_in_shlibs ();
#endif
/* Take any necessary post-attaching actions for this platform.
remove_breakpoints ();
/* Check for any newly added shared libraries if we're
- supposed to be adding them automatically. */
- if (auto_solib_add)
- {
- /* Switch terminal for any messages produced by
- breakpoint_re_set. */
- target_terminal_ours_for_output ();
- SOLIB_ADD (NULL, 0, NULL);
- target_terminal_inferior ();
- }
+ supposed to be adding them automatically. Switch
+ terminal for any messages produced by
+ breakpoint_re_set. */
+ target_terminal_ours_for_output ();
+ SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
+ target_terminal_inferior ();
/* Reinsert breakpoints and continue. */
if (breakpoints_inserted)
breakpoints_inserted = 0;
/* Check for any newly added shared libraries if we're
- supposed to be adding them automatically. */
- if (auto_solib_add)
- {
- /* Switch terminal for any messages produced by
- breakpoint_re_set. */
- target_terminal_ours_for_output ();
- SOLIB_ADD (NULL, 0, NULL);
- target_terminal_inferior ();
- }
+ supposed to be adding them automatically. Switch
+ terminal for any messages produced by
+ breakpoint_re_set. */
+ target_terminal_ours_for_output ();
+ SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
+ target_terminal_inferior ();
/* Try to reenable shared library breakpoints, additional
code segments in shared libraries might be mapped in now. */
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 */
int count;
int old;
+ if (!readsyms)
+ return;
+
if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
{
error ("Invalid regexp: %s", re_err);
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;
}
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
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 */
int count;
int old;
+ if (!readsyms)
+ return;
+
if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
{
error ("Invalid regexp: %s", re_err);
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;
}
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
static void *pa64_target_read_memory (void *, CORE_ADDR, size_t, int);
-static boolean read_dld_descriptor (struct target_ops *);
+static boolean read_dld_descriptor (struct target_ops *, int readsyms);
static boolean read_dynamic_info (asection *, dld_cache_t *);
-static void add_to_solist (boolean, char *, struct load_module_desc *,
+static void add_to_solist (boolean, char *, int, struct load_module_desc *,
CORE_ADDR, struct target_ops *);
/* When examining the shared library for debugging information we have to
be exceeded. */
void
-pa64_solib_add (char *arg_string, int from_tty, struct target_ops *target)
+pa64_solib_add (char *arg_string, int from_tty, struct target_ops *target, int readsyms)
{
struct minimal_symbol *msymbol;
CORE_ADDR addr;
/* Read in the load map pointer if we have not done so already. */
if (! dld_cache.have_read_dld_descriptor)
- if (! read_dld_descriptor (target))
+ if (! read_dld_descriptor (target, readsyms))
return;
/* If the libraries were not mapped private, warn the user. */
if (!dll_path)
error ("pa64_solib_add, unable to read shared library path.");
- add_to_solist (from_tty, dll_path, &dll_desc, 0, target);
+ add_to_solist (from_tty, dll_path, readsyms, &dll_desc, 0, target);
}
}
return 0;
if (!dld_cache.have_read_dld_descriptor)
- if (!read_dld_descriptor (¤t_target))
+ if (!read_dld_descriptor (¤t_target, auto_solib_add))
return 0;
return (pc >= dld_cache.dld_desc.text_base
pa64_solib_sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
- pa64_solib_add (args, from_tty, (struct target_ops *) 0);
+ pa64_solib_add (args, from_tty, (struct target_ops *) 0, 1);
}
/* Return the name of the shared library containing ADDR or NULL if ADDR
return nonzero. */
static boolean
-read_dld_descriptor (struct target_ops *target)
+read_dld_descriptor (struct target_ops *target, int readsyms)
{
char *dll_path;
asection *dyninfo_sect;
pa64_target_read_memory,
0,
dld_cache.load_map);
- add_to_solist(0, dll_path, &dld_cache.dld_desc, 0, target);
+ add_to_solist(0, dll_path, readsyms, &dld_cache.dld_desc, 0, target);
return 1;
}
be read from the inferior process at the address load_module_desc_addr. */
static void
-add_to_solist (boolean from_tty, char *dll_path,
+add_to_solist (boolean from_tty, char *dll_path, int readsyms,
struct load_module_desc *load_module_desc_p,
CORE_ADDR load_module_desc_addr, struct target_ops *target)
{
st_size = pa64_solib_sizeof_symbol_table (dll_path);
pa64_solib_st_size_threshhold_exceeded =
!from_tty
- && auto_solib_add
+ && readsyms
&& ( (st_size + pa64_solib_total_st_size)
> (auto_solib_limit * (LONGEST) (1024 * 1024)));
if (pa64_solib_st_size_threshhold_exceeded)
/* Called to add symbols from a shared library to gdb's symbol table. */
-#define SOLIB_ADD(filename, from_tty, targ) \
- pa64_solib_add (filename, from_tty, targ)
+#define SOLIB_ADD(filename, from_tty, targ, readsyms) \
+ pa64_solib_add (filename, from_tty, targ, readsyms)
-extern void pa64_solib_add (char *, int, struct target_ops *);
+extern void pa64_solib_add (char *, int, struct target_ops *, int);
extern CORE_ADDR pa64_solib_get_got_by_pc (CORE_ADDR);
#include "gdbcmd.h"
#include "gdbcore.h"
#include "regcache.h"
+#include "symfile.h"
extern struct target_ops sol_thread_ops; /* Forward declaration */
extern struct target_ops sol_core_ops; /* Forward declaration */
procfs_ops.to_attach (args, from_tty);
/* Must get symbols from solibs before libthread_db can run! */
- SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0);
+ SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0, auto_solib_add);
if (sol_thread_active)
{
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;
/* Enable breakpoints disabled (unnecessarily) by clear_solib(). */
warning ("shared library handler failed to disable breakpoint");
}
- 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);
}
static void
if (inferior_sos)
{
/* Connected to a running target. Update our shared library table. */
- solib_add (NULL, 0, NULL);
+ solib_add (NULL, 0, NULL, auto_solib_add);
}
while (inferior_sos)
{
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,
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
/* Called to add symbols from a shared library to gdb's symbol table. */
-#define SOLIB_ADD(filename, from_tty, targ) \
- solib_add (filename, from_tty, targ)
+#define SOLIB_ADD(filename, from_tty, targ, readsyms) \
+ solib_add (filename, from_tty, targ, readsyms)
-extern void solib_add (char *, int, struct target_ops *);
+extern void solib_add (char *, int, struct target_ops *, int);
/* Function to be called when the inferior starts up, to discover the names
of shared libraries that are dynamically linked, the base addresses to
be exceeded. */
void
-som_solib_add (char *arg_string, int from_tty, struct target_ops *target)
+som_solib_add (char *arg_string, int from_tty, struct target_ops *target, int readsyms)
{
struct minimal_symbol *msymbol;
struct so_list *so_list_tail;
st_size = som_solib_sizeof_symbol_table (name);
som_solib_st_size_threshold_exceeded =
!from_tty &&
- auto_solib_add &&
+ readsyms &&
((st_size + som_solib_total_st_size) > (auto_solib_limit * (LONGEST) (1024 * 1024)));
if (som_solib_st_size_threshold_exceeded)
som_solib_sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
- som_solib_add (args, from_tty, (struct target_ops *) 0);
+ som_solib_add (args, from_tty, (struct target_ops *) 0, 1);
}
/* Called to add symbols from a shared library to gdb's symbol table. */
-#define SOLIB_ADD(filename, from_tty, targ) \
- som_solib_add (filename, from_tty, targ)
+#define SOLIB_ADD(filename, from_tty, targ, readsyms) \
+ som_solib_add (filename, from_tty, targ, readsyms)
-extern void som_solib_add (char *, int, struct target_ops *);
+extern void som_solib_add (char *, int, struct target_ops *, int);
extern CORE_ADDR som_solib_get_got_by_pc (CORE_ADDR);
}
void
-child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty, struct target_ops *target)
+child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty, struct target_ops *target, int readsyms)
{
+ if (!readsyms)
+ return;
if (core_bfd)
{
child_clear_solibs ();