Approved by kev@cygnus.com
authorFred Fish <fnf@specifix.com>
Thu, 1 Nov 2001 16:17:08 +0000 (16:17 +0000)
committerFred Fish <fnf@specifix.com>
Thu, 1 Nov 2001 16:17:08 +0000 (16:17 +0000)
ChangeLog entry:

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.

Approved by eliz@is.elta.co.il
doc/ChangeLog entry:

2001-11-01  Fred Fish  <fnf@redhat.com>

* gdbint.texinfo (SOLIB_ADD): Document additional new
"readsyms" arg.

25 files changed:
gdb/ChangeLog
gdb/coff-solib.c
gdb/coff-solib.h
gdb/config/i386/tm-cygwin.h
gdb/config/rs6000/nm-rs6000.h
gdb/corelow.c
gdb/doc/ChangeLog
gdb/doc/gdbint.texinfo
gdb/fork-child.c
gdb/infcmd.c
gdb/infrun.c
gdb/irix5-nat.c
gdb/osfsolib.c
gdb/pa64solib.c
gdb/pa64solib.h
gdb/sol-thread.c
gdb/solib-osf.c
gdb/solib-sunos.c
gdb/solib-svr4.c
gdb/solib.c
gdb/solib.h
gdb/somsolib.c
gdb/somsolib.h
gdb/win32-nat.c
gdb/windows-nat.c

index 32df4a1..a2c8b38 100644 (file)
@@ -1,3 +1,75 @@
+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.
index fc13bca..64dca7b 100644 (file)
    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)
@@ -127,5 +130,5 @@ coff_solib_add (char *arg_string, int from_tty, struct target_ops *target)
 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);
 }
index be66a77..144f36d 100644 (file)
@@ -32,10 +32,10 @@ extern void coff_clear_solib (void);
 
 /* 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
index b0cb572..756a6ea 100644 (file)
@@ -32,14 +32,14 @@ extern CORE_ADDR skip_trampoline_code (CORE_ADDR pc, char *name);
 #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);
index 441b381..728497e 100644 (file)
@@ -43,7 +43,7 @@
 /* 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)); \
index 5d8d3ce..59318b1 100644 (file)
@@ -37,6 +37,7 @@
 #include "gdbcore.h"
 #include "gdbthread.h"
 #include "regcache.h"
+#include "symfile.h"
 
 #ifndef O_BINARY
 #define O_BINARY 0
@@ -222,7 +223,7 @@ core_close_cleanup (void *ignore)
 static int
 solib_add_stub (PTR from_ttyp)
 {
-  SOLIB_ADD (NULL, *(int *) from_ttyp, &current_target);
+  SOLIB_ADD (NULL, *(int *) from_ttyp, &current_target, auto_solib_add);
   re_enable_breakpoints_in_shlibs ();
   return 0;
 }
index d22fe87..dfde0f2 100644 (file)
@@ -1,3 +1,8 @@
+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
index 46b9e95..3e900c5 100644 (file)
@@ -4000,10 +4000,12 @@ inferior.
 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
index de148c6..21e5089 100644 (file)
@@ -388,8 +388,6 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
 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. */
index 51883f9..482db0f 100644 (file)
@@ -1633,10 +1633,6 @@ nofp_registers_info (char *addr_exp, int from_tty)
 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;
 
@@ -1698,12 +1694,9 @@ attach_command (char *args, int from_tty)
     }
 
 #ifdef SOLIB_ADD
-  if (auto_solib_add)
-    {
-      /* Add shared library symbols from the newly attached process, if any.  */
-      SOLIB_ADD ((char *) 0, from_tty, &current_target);
-      re_enable_breakpoints_in_shlibs ();
-    }
+  /* Add shared library symbols from the newly attached process, if any.  */
+  SOLIB_ADD ((char *) 0, from_tty, &current_target, auto_solib_add);
+  re_enable_breakpoints_in_shlibs ();
 #endif
 
   /* Take any necessary post-attaching actions for this platform.
index 0730f91..d563636 100644 (file)
@@ -1518,15 +1518,12 @@ handle_inferior_event (struct execution_control_state *ecs)
              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)
@@ -2446,15 +2443,12 @@ handle_inferior_event (struct execution_control_state *ecs)
            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. */
index 2781bf3..c3543b1 100644 (file)
@@ -862,14 +862,14 @@ symbol_add_stub (void *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 */
 
@@ -880,6 +880,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);
@@ -1252,8 +1255,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;
 }
 
@@ -1275,7 +1277,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
index ac5c4de..2ef7947 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);
@@ -888,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;
 }
 
@@ -912,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
index 441095e..0058cbf 100644 (file)
@@ -127,11 +127,11 @@ static void pa64_solib_sharedlibrary_command (char *, int);
 
 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
@@ -372,7 +372,7 @@ pa64_solib_load_symbols (struct so_list *so, char *name, int from_tty,
    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;
@@ -415,7 +415,7 @@ pa64_solib_add (char *arg_string, int from_tty, struct target_ops *target)
 
   /* 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.  */
@@ -439,7 +439,7 @@ pa64_solib_add (char *arg_string, int from_tty, struct target_ops *target)
       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);
     }
 }
 
@@ -700,7 +700,7 @@ pa64_solib_in_dynamic_linker (int pid, CORE_ADDR pc)
     return 0;
 
   if (!dld_cache.have_read_dld_descriptor)
-    if (!read_dld_descriptor (&current_target))
+    if (!read_dld_descriptor (&current_target, auto_solib_add))
       return 0;
 
   return (pc >= dld_cache.dld_desc.text_base
@@ -818,7 +818,7 @@ static void
 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
@@ -936,7 +936,7 @@ so_lib_thread_start_addr (struct so_list *so)
    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;
@@ -995,7 +995,7 @@ read_dld_descriptor (struct target_ops *target)
                        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;
 }
@@ -1102,7 +1102,7 @@ pa64_target_read_memory (void *buffer, CORE_ADDR ptr, size_t bufsiz, int ident)
    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)
 {
@@ -1166,7 +1166,7 @@ add_to_solist (boolean from_tty, char *dll_path,
   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)
index 3cf77db..7a3a068 100644 (file)
@@ -25,10 +25,10 @@ struct section_offsets;
 
 /* 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);
 
index f92c49e..18b812c 100644 (file)
@@ -60,6 +60,7 @@
 #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 */
@@ -415,7 +416,7 @@ sol_thread_attach (char *args, int from_tty)
   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)
     {
index eb78a41..a00e488 100644 (file)
@@ -336,8 +336,7 @@ osf_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;
 
   /* Enable breakpoints disabled (unnecessarily) by clear_solib().  */
index b5d9586..304657c 100644 (file)
@@ -852,8 +852,7 @@ sunos_solib_create_inferior_hook (void)
       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
index 8441fa1..987e776 100644 (file)
@@ -909,7 +909,7 @@ enable_break (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)
        {
index a2f4c81..853fab8 100644 (file)
@@ -493,7 +493,8 @@ update_solib_list (int from_tty, struct target_ops *target)
 
    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
 
@@ -501,10 +502,13 @@ update_solib_list (int from_tty, struct target_ops *target)
    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;
 
@@ -536,7 +540,7 @@ solib_add (char *pattern, int from_tty, struct target_ops *target)
                printf_unfiltered ("Symbols already loaded for %s\n",
                                   gdb->so_name);
            }
-         else
+         else if (readsyms)
            {
              if (catch_errors
                  (symbol_add_stub, gdb,
@@ -806,7 +810,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);
 }
 
 /* LOCAL FUNCTION
index 56a4a40..76f287b 100644 (file)
@@ -31,10 +31,10 @@ extern void clear_solib (void);
 
 /* 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
index 5f2b2cb..fdb2e16 100644 (file)
@@ -406,7 +406,7 @@ som_solib_load_symbols (struct so_list *so, char *name, int from_tty,
    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;
@@ -777,7 +777,7 @@ som_solib_add (char *arg_string, int from_tty, struct target_ops *target)
       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)
@@ -1470,7 +1470,7 @@ static void
 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);
 }
 
 
index 13944d4..4b23760 100644 (file)
@@ -29,10 +29,10 @@ struct section_offsets;
 
 /* 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);
 
index 10847b8..ab5f3f3 100644 (file)
@@ -1707,8 +1707,10 @@ out:
 }
 
 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 ();
index 10847b8..ab5f3f3 100644 (file)
@@ -1707,8 +1707,10 @@ out:
 }
 
 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 ();