From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 761 invoked by alias); 25 Jul 2012 17:45:37 -0000 Received: (qmail 720 invoked by uid 22791); 25 Jul 2012 17:45:34 -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 17:45:21 +0000 Received: from eusaamw0707.eamcs.ericsson.se ([147.117.20.32]) by imr4.ericy.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id q6PHiiaO006238; Wed, 25 Jul 2012 12:45:19 -0500 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.135]) by eusaamw0707.eamcs.ericsson.se ([147.117.20.32]) with mapi; Wed, 25 Jul 2012 13:45:02 -0400 From: Marc Khouzam To: "'Tom Tromey'" CC: "'gdb-patches@sourceware.org'" Date: Wed, 25 Jul 2012 17:45:00 -0000 Subject: RE: [patch] MI ignores conditions for pending breakpoints Message-ID: References: <87txwypa85.fsf@fleche.redhat.com> <87k3xrkfgo.fsf@fleche.redhat.com> In-Reply-To: <87k3xrkfgo.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/msg00560.txt.bz2 =20 > I think as long as it exercises the bug -- fails before the patch and > passes after -- and is reasonably clean, then it is fine. >=20 > Coding in the name of the library, etc, is also fine; there are some > tools in the test suite to make this a bit less fragile, namely using > variables in place of file names and using gdb_get_line_number. I updated to a better test based on what you said. The test now makes sure the breakpoint is skipped when it should and hits when it should. Ok? Thanks! 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 17:39:48 -0000 @@ -24,8 +24,9 @@ return 0 } =20 -standard_testfile mi-pending.c mi-pendshr.c -set lib_sl [standard_output_file mi-pendshr.sl] +set libfile "mi-pendshr" +standard_testfile mi-pending.c $libfile.c +set lib_sl [standard_output_file $libfile.sl] =20 set lib_opts debug set exec_opts [list debug shlib=3D$lib_sl] @@ -48,12 +49,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 ${libfile}.c:pendfunc2" \ + ".*\\^done,bkpt=3D\{number=3D\"2\",type=3D\"breakpoint\",disp=3D\"keep= \",enabled=3D\"y\",addr=3D\"\",pending=3D\"${libfile}.c:pendfunc2\= ",cond=3D\"x=3D=3D4\",times=3D\"0\",original-location=3D\"${libfile}.c:pend= func2\"\}"\ + "MI pending breakpoint on ${libfile}.c: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" ".*" ".*" ".*" \ + { "" "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 17:39:48 -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); }