From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22954 invoked by alias); 5 Aug 2010 12:12:02 -0000 Received: (qmail 22944 invoked by uid 22791); 5 Aug 2010 12:12:01 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_40,MSGID_MULTIPLE_AT,TW_BJ,TW_GJ X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Aug 2010 12:11:55 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o75CBqrj023542 for ; Thu, 5 Aug 2010 14:11:52 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms7.u-strasbg.fr [IPv6:2001:660:2402:d::16]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o75CBpad020010 for ; Thu, 5 Aug 2010 14:11:52 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id o75CBp8N062793 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Thu, 5 Aug 2010 14:11:51 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: References: <002a01cb3492$5ba5c050$12f140f0$@muller@ics-cnrs.unistra.fr> In-Reply-To: <002a01cb3492$5ba5c050$12f140f0$@muller@ics-cnrs.unistra.fr> Subject: RE: [RFC] breakpoint.c: Fix nasty problem with msvcrt DLL on Windows Date: Thu, 05 Aug 2010 12:12:00 -0000 Message-ID: <003601cb3497$8ac36b80$a04a4280$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00030.txt.bz2 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 * 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\""),