This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFC] breakpoint.c: Fix nasty problem with msvcrt DLL on Windows
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: <gdb-patches at sourceware dot org>
- Date: Thu, 5 Aug 2010 14:12:58 +0200
- Subject: RE: [RFC] breakpoint.c: Fix nasty problem with msvcrt DLL on Windows
- References: <002a01cb3492$5ba5c050$12f140f0$@muller@ics-cnrs.unistra.fr>
Just one short follow-up:
I ran the testsuite with my patch on a x86_64 machine
and got two regressions:
First:
< PASS: gdb.base/attach.exp: attach1 detach
---
> FAIL: gdb.base/attach.exp: attach1 detach
Detaching from program:
/home/muller/auto-test-gdb/build/gdb/testsuite/gdb.base/
attach, process 16517^M
warning: Temporarily disabling breakpoints for unloaded shared library
"/lib/lib
c.so.6"^M
(gdb) FAIL: gdb.base/attach.exp: attach1 detach
The failure comes from the new warning introduced by my patch.
Second:
< PASS: gdb.server/ext-attach.exp: detach
---
> FAIL: gdb.server/ext-attach.exp: detach
Same reason.
With the updated patch below these two regressions disappear.
Pierre
2010-08-05 Pierre Muller <muller@ics.u-strasbg.fr>
* breakpoint.c (set_longjmp_breakpoint): Only insert breakpoints
if the dynamic library was not unloaded.
(disable_breakpoints_in_unloaded_shlib): Disable also 'longjmp'
breakpoints.
Index: src/gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.506
diff -u -p -r1.506 breakpoint.c
--- src/gdb/breakpoint.c 3 Aug 2010 22:35:41 -0000 1.506
+++ src/gdb/breakpoint.c 5 Aug 2010 10:03:14 -0000
@@ -5573,10 +5573,12 @@ set_longjmp_breakpoint (int thread)
/* To avoid having to rescan all objfile symbols at every step,
we maintain a list of continually-inserted but always disabled
longjmp "master" breakpoints. Here, we simply create momentary
- clones of those and enable them for the requested thread. */
+ clones of those and enable them for the requested thread.
+ Do not try to insert 'longjmp' breakpoints of unloaded libraries. */
ALL_BREAKPOINTS_SAFE (b, temp)
if (b->pspace == current_program_space
- && b->type == bp_longjmp_master)
+ && b->type == bp_longjmp_master
+ && b->loc && !b->loc->shlib_disabled)
{
struct breakpoint *clone = clone_momentary_breakpoint (b);
@@ -5801,7 +5805,8 @@ disable_breakpoints_in_unloaded_shlib (s
succeeding so we must mark the breakpoint as not inserted
to prevent future errors occurring in remove_breakpoints. */
loc->inserted = 0;
- if (!disabled_shlib_breaks)
+ if (!disabled_shlib_breaks && b->type != bp_longjmp_master
+ && b->type != bp_longjmp)
{
target_terminal_ours_for_output ();
warning (_("Temporarily disabling breakpoints for unloaded
shared library \"%s\""),