From 48379de60be44f30b57a463d6f66d23c9568a0d5 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 4 Feb 2010 22:54:41 +0000 Subject: [PATCH] * solib-svr4.c (enable_break): Add comment. --- gdb/ChangeLog | 4 ++++ gdb/solib-svr4.c | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1248c2d7ad..4fda810a80 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2010-02-04 Doug Evans + + * solib-svr4.c (enable_break): Add comment. + 2010-02-04 Anthony Green * moxie-tdep.c (moxie_analyze_prologue): Fail protocol analysis diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 5689bf328d..2833ed140d 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1318,6 +1318,25 @@ enable_break (struct svr4_info *info, int from_tty) sym_addr, ¤t_target)); + /* On at least some versions of Solaris there's a dynamic relocation + on _r_debug.r_brk and SYM_ADDR may not be relocated yet, e.g., if + we get control before the dynamic linker has self-relocated. + Check if SYM_ADDR is in a known section, if it is assume we can + trust its value. This is just a heuristic though, it could go away + or be replaced if it's getting in the way. + + On ARM we need to know whether the ISA of rtld_db_dlactivity (or + however it's spelled in your particular system) is ARM or Thumb. + That knowledge is encoded in the address, if it's Thumb the low bit + is 1. However, we've stripped that info above and it's not clear + what all the consequences are of passing a non-addr_bits_remove'd + address to create_solib_event_breakpoint. The call to + find_pc_section verifies we know about the address and have some + hope of computing the right kind of breakpoint to use (via + symbol info). It does mean that GDB needs to be pointed at a + non-stripped version of the dynamic linker in order to obtain + information it already knows about. Sigh. */ + os = find_pc_section (sym_addr); if (os != NULL) {