aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-11-11 16:39:59 +0000
committerAndrew Cagney <cagney@redhat.com>2001-11-11 16:39:59 +0000
commitb18c45ede9baf61a2db0857850df5df0fa84c4ca (patch)
treee2743708983946093d39c6bc6875c38bfa89829b
parent19222dc016df98d9c80c9c28f638a9a7aa9d759d (diff)
downloadgdb-b18c45ede9baf61a2db0857850df5df0fa84c4ca.zip
gdb-b18c45ede9baf61a2db0857850df5df0fa84c4ca.tar.gz
gdb-b18c45ede9baf61a2db0857850df5df0fa84c4ca.tar.bz2
From Mark Kettenis <kettenis@gnu.org>:
* breakpoint.c (breakpoint_re_set_one): Don't discard SHLIB breakpoints when they fail.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/breakpoint.c28
2 files changed, 31 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 97fc046..d766ee2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-11 Andrew Cagney <ac131313@redhat.com>
+
+ From Mark Kettenis <kettenis@gnu.org>:
+ * breakpoint.c (breakpoint_re_set_one): Don't discard SHLIB
+ breakpoints when they fail.
+
2001-11-10 Andrew Cagney <ac131313@redhat.com>
* printcmd.c, valprint.c, language.c, linespec.c, infcmd.c,
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 848a07f..cf2b6c0 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -7014,10 +7014,32 @@ breakpoint_re_set_one (PTR bint)
delete_breakpoint (b);
return 0;
}
- /* In case we have a problem, disable this breakpoint. We'll restore
- its status if we succeed. */
+ /* HACK: cagney/2001-11-11: kettenis/2001-11-11: MarkK wrote:
+
+ ``And a hack it is, although Apple's Darwin version of GDB
+ contains an almost identical hack to implement a "future
+ break" command. It seems to work in many real world cases,
+ but it is easy to come up with a test case where the patch
+ doesn't help at all.''
+
+ ``It seems that the way GDB implements breakpoints - in -
+ shared - libraries was designed for a.out shared library
+ systems (SunOS 4) where shared libraries were loaded at a
+ fixed address in memory. Since ELF shared libraries can (and
+ will) be loaded at any address in memory, things break.
+ Fixing this is not trivial. Therefore, I'm not sure whether
+ we should add this hack to the branch only. I cannot
+ guarantee that things will be fixed on the trunk in the near
+ future.''
+
+ In case we have a problem, disable this breakpoint. We'll
+ restore its status if we succeed. Don't disable a
+ shlib_disabled breakpoint though. There's a fair chance we
+ can't re-set it if the shared library it's in hasn't been
+ loaded yet. */
save_enable = b->enable_state;
- b->enable_state = bp_disabled;
+ if (b->enable_state != bp_shlib_disabled)
+ b->enable_state = bp_disabled;
set_language (b->language);
input_radix = b->input_radix;