From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11634 invoked by alias); 25 Jul 2012 13:11:50 -0000 Received: (qmail 11512 invoked by uid 22791); 25 Jul 2012 13:11:48 -0000 X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from imr4.ericy.com (HELO imr4.ericy.com) (198.24.6.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Jul 2012 13:11:34 +0000 Received: from eusaamw0711.eamcs.ericsson.se ([147.117.20.178]) by imr4.ericy.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id q6PDBUrK005275; Wed, 25 Jul 2012 08:11:32 -0500 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.135]) by eusaamw0711.eamcs.ericsson.se ([147.117.20.178]) with mapi; Wed, 25 Jul 2012 09:11:25 -0400 From: Marc Khouzam To: "'Tom Tromey'" CC: "'gdb-patches@sourceware.org'" Date: Wed, 25 Jul 2012 13:11:00 -0000 Subject: RE: [patch] MI ignores conditions for pending breakpoints Message-ID: References: <87txwypa85.fsf@fleche.redhat.com> In-Reply-To: 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/msg00520.txt.bz2 > -----Original Message----- > From: gdb-patches-owner@sourceware.org=20 > [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Marc Khouzam > Sent: Tuesday, July 24, 2012 1:42 PM > To: 'Tom Tromey' > Cc: 'gdb-patches@sourceware.org' > Subject: RE: [patch] MI ignores conditions for pending breakpoints >=20 > > -----Original Message----- > > From: Tom Tromey [mailto:tromey@redhat.com]=20 > > Sent: Monday, July 23, 2012 3:08 PM > > To: Marc Khouzam > > Cc: gdb-patches@sourceware.org > > Subject: Re: [patch] MI ignores conditions for pending breakpoints > >=20 > > >>>>> "Marc" =3D=3D Marc Khouzam writes: > >=20 > > Marc> 2012-07-20 Marc Khouzam > > Marc> * breakpoint.c (create_breakpoint): Store=20 > > condition for pending > > Marc> breakpoints. > >=20 > > This is ok for trunk and the 7.5 branch. > > Thanks. >=20 > Committed to both. >=20 > Thanks! >=20 > >=20 > > Marc> Broken session: > > Marc> -------------- > >=20 > > A patch to the test suite would be nice. Here is a test case for the problem. I'm not thrilled with it but it does fail before the fix and pass after, so it is probably sufficient. What I don't like about it is that it verifies that the condition prevents the breakpoint from hitting instead of making sure a breakpoint hits at the right condition. I had to do that because the alternative is to use a variable in the sharedlib for the condition, but then I would need to explicitly specify the sharedlib file name and line number when setting the breakpoint which didn't seem very future-proof. What do you think? ### Eclipse Workspace Patch 1.0 #P src Index: gdb/testsuite/gdb.mi/mi-pending.exp =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/testsuite/gdb.mi/mi-pending.exp,v retrieving revision 1.16 diff -u -r1.16 mi-pending.exp --- gdb/testsuite/gdb.mi/mi-pending.exp 10 Jul 2012 15:32:51 -0000 1.16 +++ gdb/testsuite/gdb.mi/mi-pending.exp 25 Jul 2012 13:03:42 -0000 @@ -53,7 +53,14 @@ ".*\\^done,bkpt=3D\{number=3D\"1\",type=3D\"breakpoint\",disp=3D\"keep= \",enabled=3D\"y\",addr=3D\"\",pending=3D\"pendfunc1\",times=3D\"0= \",original-location=3D\"pendfunc1\"\}"\ "MI pending breakpoint on pendfunc1" =20 +# Set pending breakpoint with a condition via MI +# We use a condition that will prevent the bp from hitting +mi_gdb_test "-break-insert -f -c 1=3D=3D4 pendfunc0" \ + ".*\\^done,bkpt=3D\{number=3D\"2\",type=3D\"breakpoint\",disp=3D\"keep= \",enabled=3D\"y\",addr=3D\"\",pending=3D\"pendfunc0\",cond=3D\"1= =3D=3D4\",times=3D\"0\",original-location=3D\"pendfunc0\"\}"\ + "MI pending breakpoint on pendfunc0 if 1=3D=3D4" + mi_run_cmd +# We should not stop on the breakpiont at pendfunc0 mi_expect_stop "breakpoint-hit" "pendfunc1" ".*" ".*" ".*" \ { "" "disp=3D\"keep\"" } \ "Run till MI pending breakpoint on pendfunc1" Index: gdb/testsuite/gdb.mi/mi-pendshr.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/testsuite/gdb.mi/mi-pendshr.c,v retrieving revision 1.7 diff -u -r1.7 mi-pendshr.c --- gdb/testsuite/gdb.mi/mi-pendshr.c 4 Jan 2012 08:17:54 -0000 1.7 +++ gdb/testsuite/gdb.mi/mi-pendshr.c 25 Jul 2012 13:03:42 -0000 @@ -17,6 +17,12 @@ =20 #include =20 +void pendfunc0 (int x) +{ + int y =3D x + 4; + printf ("in pendfunc0, x is %d\n", x); +} + void pendfunc1 (int x) { int y =3D x + 4; @@ -25,5 +31,6 @@ =20 void pendfunc (int x) { + pendfunc0 (x); pendfunc1 (x); }