From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32172 invoked by alias); 25 Jul 2012 18:26:27 -0000 Received: (qmail 32099 invoked by uid 22791); 25 Jul 2012 18:26:25 -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 18:26:12 +0000 Received: from eusaamw0712.eamcs.ericsson.se ([147.117.20.181]) by imr4.ericy.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id q6PIPxjL016127; Wed, 25 Jul 2012 13:26:08 -0500 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.135]) by eusaamw0712.eamcs.ericsson.se ([147.117.20.181]) with mapi; Wed, 25 Jul 2012 14:25:53 -0400 From: Marc Khouzam To: "'Tom Tromey'" CC: "'gdb-patches@sourceware.org'" Date: Wed, 25 Jul 2012 18:26:00 -0000 Subject: RE: [patch] MI ignores conditions for pending breakpoints Message-ID: References: <87txwypa85.fsf@fleche.redhat.com> <87k3xrkfgo.fsf@fleche.redhat.com> <87zk6nhgu1.fsf@fleche.redhat.com> In-Reply-To: <87zk6nhgu1.fsf@fleche.redhat.com> 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/msg00569.txt.bz2 =20 > -----Original Message----- > From: Tom Tromey [mailto:tromey@redhat.com]=20 > Sent: Wednesday, July 25, 2012 1:49 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> -standard_testfile mi-pending.c mi-pendshr.c > Marc> -set lib_sl [standard_output_file mi-pendshr.sl] > Marc> +set libfile "mi-pendshr" > Marc> +standard_testfile mi-pending.c $libfile.c > Marc> +set lib_sl [standard_output_file $libfile.sl] >=20 > I think it is better to leave the standard_testfile call as-is: >=20 > standard_testfile mi-pending.c mi-pendshr.c > set lib_sl [standard_output_file mi-pendshr.sl] >=20 > and then >=20 > Marc> +mi_gdb_test "-break-insert -f -c x=3D=3D4 ${libfile}.c:pendfunc2" \ >=20 > ... use ${srcfile2} here instead of ${libfile}.c >=20 > Setting srcfile2 is part of the contract of standard_testfile. Thanks for that. I've also added a check to make sure x=3D=3D4 when the breakpoint hits. How about this? P.S. To save time, is there a good way to run a single test while writing it? I currently hack around to get it done, but I'm hoping there is a better way. 2012-07-25 Marc Khouzam * gdb.mi/mi-pending.c: New method to set a second pending breakpoint. * gdb.mi/mi-pending.exp: Set a pending breakpoint with a condition. ### 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 18:24:54 -0000 @@ -48,12 +48,29 @@ mi_gdb_load ${binfile} mi_load_shlibs $lib_sl =20 -# Set pending breakpoint via MI +# Set pending breakpoint via MI. mi_gdb_test "-break-insert -f pendfunc1" \ ".*\\^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. +mi_gdb_test "-break-insert -f -c x=3D=3D4 ${srcfile2}:pendfunc2" \ + ".*\\^done,bkpt=3D\{number=3D\"2\",type=3D\"breakpoint\",disp=3D\"keep= \",enabled=3D\"y\",addr=3D\"\",pending=3D\"${srcfile2}:pendfunc2\"= ,cond=3D\"x=3D=3D4\",times=3D\"0\",original-location=3D\"${srcfile2}:pendfu= nc2\"\}"\ + "MI pending breakpoint on ${srcfile2}:pendfunc2 if x=3D=3D4" + mi_run_cmd mi_expect_stop "breakpoint-hit" "pendfunc1" ".*" ".*" ".*" \ { "" "disp=3D\"keep\"" } \ "Run till MI pending breakpoint on pendfunc1" + +mi_send_resuming_command "exec-continue" "continuing execution to skip con= ditional bp" +# We should not stop on the conditional breakpoint yet, but we stop on the= original bp.=20 +mi_expect_stop "breakpoint-hit" "pendfunc1" ".*" ".*" ".*" \ + { "" "disp=3D\"keep\"" } \ + "Run till MI pending breakpoint on pendfunc1 a second time" + +mi_send_resuming_command "exec-continue" "continuing execution to conditio= nal bp" +# Now we should stop on the conditional breakpoint. +mi_expect_stop "breakpoint-hit" "pendfunc2" "\{name=3D\"x\",value=3D\"4\"\= }" ".*" ".*" \ + { "" "disp=3D\"keep\"" } \ + "Run till MI pending breakpoint on pendfunc2 with x=3D=3D4" 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 18:24:54 -0000 @@ -23,7 +23,13 @@ printf ("in pendfunc1, x is %d\n", x); } =20 +void pendfunc2 (int x) +{ + printf ("in pendfunc2, x is %d\n", x); +} + void pendfunc (int x) { pendfunc1 (x); + pendfunc2 (x); }