aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-06-28 16:06:02 +0000
committerJason Molenda <jmolenda@apple.com>1999-06-28 16:06:02 +0000
commit085dd6e638eca9d348100c8f0e8cae04e20d58a1 (patch)
tree1e740197cdfedb994222a003ea531ec2febaf173 /gdb/solib.c
parent303f629d619e7bf37b97c2af6f72aba488669044 (diff)
downloadgdb-085dd6e638eca9d348100c8f0e8cae04e20d58a1.zip
gdb-085dd6e638eca9d348100c8f0e8cae04e20d58a1.tar.gz
gdb-085dd6e638eca9d348100c8f0e8cae04e20d58a1.tar.bz2
import gdb-1999-06-28 snapshot
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index aa2dd46..2bd8a2e 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1306,11 +1306,35 @@ solib_address (address)
/* Called by free_all_symtabs */
void
-clear_solib()
+clear_solib ()
{
struct so_list *next;
char *bfd_filename;
+ /* This function is expected to handle ELF shared libraries. It is
+ also used on Solaris, which can run either ELF or a.out binaries
+ (for compatibility with SunOS 4), both of which can use shared
+ libraries. So we don't know whether we have an ELF executable or
+ an a.out executable until the user chooses an executable file.
+
+ ELF shared libraries don't get mapped into the address space
+ until after the program starts, so we'd better not try to insert
+ breakpoints in them immediately. We have to wait until the
+ dynamic linker has loaded them; we'll hit a bp_shlib_event
+ breakpoint (look for calls to create_solib_event_breakpoint) when
+ it's ready.
+
+ SunOS shared libraries seem to be different --- they're present
+ as soon as the process begins execution, so there's no need to
+ put off inserting breakpoints. There's also nowhere to put a
+ bp_shlib_event breakpoint, so if we put it off, we'll never get
+ around to it.
+
+ So: disable breakpoints only if we're using ELF shared libs. */
+ if (exec_bfd != NULL
+ && bfd_get_flavour (exec_bfd) != bfd_target_aout_flavour)
+ disable_breakpoints_in_shlibs (1);
+
while (so_list_head)
{
if (so_list_head -> sections)