From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24346 invoked by alias); 21 Jul 2012 03:04:15 -0000 Received: (qmail 24334 invoked by uid 22791); 21 Jul 2012 03:04:14 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from imr3.ericy.com (HELO imr3.ericy.com) (198.24.6.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 21 Jul 2012 03:04:01 +0000 Received: from eusaamw0706.eamcs.ericsson.se ([147.117.20.31]) by imr3.ericy.com (8.13.8/8.13.8) with ESMTP id q6L332dN020444 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Fri, 20 Jul 2012 22:04:01 -0500 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.11]) by eusaamw0706.eamcs.ericsson.se ([147.117.20.31]) with mapi; Fri, 20 Jul 2012 23:03:25 -0400 From: Marc Khouzam To: "gdb-patches@sourceware.org" Date: Sat, 21 Jul 2012 03:04:00 -0000 Subject: [patch] MI ignores conditions for pending breakpoints Message-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes 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: 2012-07/txt/msg00418.txt.bz2 Hi, I got a bug report that conditions were ignored for pending breakpoints. It turns out to only happen for MI and I added a example session at the end of this mail. The below patch fixes this by storing the condition string for pending bp. The extra_string should receive the same treatment, but I'll send that in a separate patch. No regressions on Ubuntu 32bit (actually, I got better results, but I think it has to do with intermittent failures). Is this ok for HEAD and 7_5? Thanks Marc 2012-07-20 Marc Khouzam * breakpoint.c (create_breakpoint): Store condition for pending breakpoints. ### Eclipse Workspace Patch 1.0 #P src Index: gdb/breakpoint.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.694 diff -u -r1.694 breakpoint.c --- gdb/breakpoint.c 19 Jul 2012 15:38:16 -0000 1.694 +++ gdb/breakpoint.c 21 Jul 2012 02:30:14 -0000 @@ -9557,7 +9557,18 @@ init_raw_breakpoint_without_location (b, gdbarch, type_wanted, ops); =20 b->addr_string =3D copy_arg; - b->cond_string =3D NULL; + if (parse_condition_and_thread) + b->cond_string =3D NULL; + else + { + /* Create a private copy of condition string. */ + if (cond_string) + { + cond_string =3D xstrdup (cond_string); + make_cleanup (xfree, cond_string); + } + b->cond_string =3D cond_string; + } b->extra_string =3D NULL; b->ignore_count =3D ignore_count; b->disposition =3D tempflag ? disp_del : disp_donttouch; Broken session: -------------- > gdb myapp.exe GNU gdb (GDB) 7.5.50.20120720-cvs (gdb) interpreter-exec mi "-break-insert -f -c 1=3D=3D2 /home/lmckhou/runti= me-TestDSF/myLinuxDll/src/mydll.c:3" &"No source file named /home/lmckhou/runtime-TestDSF/myLinuxDll/src/mydll.c= .\n" ^done,bkpt=3D{number=3D"1",type=3D"breakpoint",disp=3D"keep",enabled=3D"y",= addr=3D"",pending=3D"/home/lmckhou/runtime-TestDSF/myLinuxDll/src/= mydll.c:3",times=3D"0",original-location=3D"/home/lmckhou/runtime-TestDSF/m= yLinuxDll/src/mydll.c:3"} (gdb) info b Num Type Disp Enb Address What 1 breakpoint keep y /home/lmckhou/runtime-TestDSF/my= LinuxDll/src/mydll.c:3 =3D> Note that there is no condition shown with the breakpoint above (gdb) r Starting program: /home/lmckhou/runtime-TestDSF/myapp/Debug/myapp.exe=20 warning: Cannot call inferior functions, you have broken Linux kernel i386 = NX (non-executable pages) support! Breakpoint 1, foo () at ../src/mydll.c:3 3 int j =3D 0; =3D> Breakpoint hits although condition was 1=3D=3D2