aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2001-08-29 19:34:08 +0000
committerKevin Buettner <kevinb@redhat.com>2001-08-29 19:34:08 +0000
commit8ad2fcde8d0df9e2cf361bfb9f0df8200a915a54 (patch)
treec068eb2e95e4aef4f42d62dfdfb962bec0bb5fd2 /gdb
parent7e0de7bf18a51fc072254ac7160f90d61096276b (diff)
downloadgdb-8ad2fcde8d0df9e2cf361bfb9f0df8200a915a54.zip
gdb-8ad2fcde8d0df9e2cf361bfb9f0df8200a915a54.tar.gz
gdb-8ad2fcde8d0df9e2cf361bfb9f0df8200a915a54.tar.bz2
Applied Daniel Jacobowitz's patch for reattaching in the presence of
remote SVR4 shared libraries.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/solib-svr4.c32
2 files changed, 34 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 253e8c5..a2854c9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2001-08-29 Kevin Buettner <kevinb@redhat.com>
+
+ From 2001-08-07 Daniel Jacobowitz <drow@mvista.com>:
+ * solib-svr4.c (enable_break): Check the inferior link map
+ before assuming the inferior PC is at the start of the dynamic
+ loader.
+
2001-08-28 Andrew Cagney <cagney@toribio.toronto.redhat.com>
* frame.h (struct frame_info): Fix documentation on fields
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 7da1481..a23b56c 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1198,7 +1198,9 @@ enable_break (void)
{
unsigned int interp_sect_size;
char *buf;
- CORE_ADDR load_addr;
+ CORE_ADDR load_addr = 0;
+ int load_addr_found = 0;
+ struct so_list *inferior_sos;
bfd *tmp_bfd = NULL;
int tmp_fd = -1;
char *tmp_pathname = NULL;
@@ -1235,10 +1237,30 @@ enable_break (void)
goto bkpt_at_symbol;
}
- /* We find the dynamic linker's base address by examining the
- current pc (which point at the entry point for the dynamic
- linker) and subtracting the offset of the entry point. */
- load_addr = read_pc () - tmp_bfd->start_address;
+ /* If the entry in _DYNAMIC for the dynamic linker has already
+ been filled in, we can read its base address from there. */
+ inferior_sos = svr4_current_sos ();
+ if (inferior_sos)
+ {
+ /* Connected to a running target. Update our shared library table. */
+ solib_add (NULL, 0, NULL);
+ }
+ while (inferior_sos)
+ {
+ if (strcmp (buf, inferior_sos->so_original_name) == 0)
+ {
+ load_addr_found = 1;
+ load_addr = LM_ADDR (inferior_sos);
+ break;
+ }
+ inferior_sos = inferior_sos->next;
+ }
+
+ /* Otherwise we find the dynamic linker's base address by examining
+ the current pc (which should point at the entry point for the
+ dynamic linker) and subtracting the offset of the entry point. */
+ if (!load_addr_found)
+ load_addr = read_pc () - tmp_bfd->start_address;
/* Record the relocated start and end address of the dynamic linker
text and plt section for svr4_in_dynsym_resolve_code. */