From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4895 invoked by alias); 20 Jul 2012 02:28:32 -0000 Received: (qmail 4883 invoked by uid 22791); 20 Jul 2012 02:28:31 -0000 X-SWARE-Spam-Status: No, hits=-4.3 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 relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Jul 2012 02:28:18 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Ss2wz-0002i6-2G from Yao_Qi@mentor.com ; Thu, 19 Jul 2012 19:28:17 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 19 Jul 2012 19:28:21 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Thu, 19 Jul 2012 19:28:15 -0700 From: Yao Qi To: CC: Jan Kratochvil , Stan Shebs , Tom Tromey Subject: Re: 7.4->7.5 Regression gdb.base/pending.exp with gdbserver [Re: [PATCH] Dynamic printf for a target agent] Date: Fri, 20 Jul 2012 02:28:00 -0000 Message-ID: <2625393.59PdMiRRzQ@qiyao.dyndns.org> User-Agent: KMail/4.8.3 (Linux/3.3.7-1.fc16.i686; KDE/4.8.3; i686; ; ) In-Reply-To: <20120718191741.GA13886@host2.jankratochvil.net> References: <4FC57340.6070306@earthlink.net> <4FF1E5FA.2010801@earthlink.net> <20120718191741.GA13886@host2.jankratochvil.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/msg00381.txt.bz2 On Wednesday, July 18, 2012 09:17:41 PM Jan Kratochvil wrote: > 2885fb01788703023acfeb2bade84c20d8723853 is the first bad commit > commit 2885fb01788703023acfeb2bade84c20d8723853 > Author: Stan Shebs > Date: Mon Jul 2 15:29:29 2012 +0000 > Add target-side support for dynamic printf. >=20 > Running ./gdb.base/pending.exp ... > FAIL: gdb.base/pending.exp: continue to resolved breakpoint 2 > FAIL: gdb.base/pending.exp: continue to resolved breakpoint 1 > FAIL: gdb.base/pending.exp: continue to resolved breakpoint 3 (the program > exited) >=20 > There is somehow missed a breakpoint, IIUC. Hi, This regression is caused by the following change, On Monday, July 02, 2012 11:18:34 AM Stan Shebs wrote: > @@ -2916,22 +2918,33 @@ process_point_options (CORE_ADDR point_a >=20=20 > while (*dataptr) > { > - switch (*dataptr) > + if (*dataptr =3D=3D ';') > + ++dataptr; > + > + if (*dataptr =3D=3D 'X') > { > - case 'X': > - /* Conditional expression. */ > - if (remote_debug) > - fprintf (stderr, "Found breakpoint condition.\n"); > - add_breakpoint_condition (point_addr, &dataptr); > - break; > - default: > - /* Unrecognized token, just skip it. */ > - fprintf (stderr, "Unknown token %c, ignoring.\n", > - *dataptr); > + /* Conditional expression. */ > + fprintf (stderr, "Found breakpoint condition.\n"); > + add_breakpoint_condition (point_addr, &dataptr); > + } > + else if (strncmp (dataptr, "cmds:", strlen ("cmds:")) =3D=3D 0) > + { > + dataptr +=3D strlen ("cmds:"); > + if (debug_threads) > + fprintf (stderr, "Found breakpoint commands %s.\n", dataptr); > + persist =3D (*dataptr =3D=3D '1'); > + dataptr +=3D 2; > + add_breakpoint_commands (point_addr, &dataptr, persist); > + } > + else > + { > + /* Unrecognized token, just skip it. */ > + fprintf (stderr, "Unknown token %c, ignoring.\n", > + *dataptr); > } >=20=20 > /* Skip tokens until we find one that we recognize. */ > - while (*dataptr && *dataptr !=3D 'X' && *dataptr !=3D ';') > + while (*dataptr && *dataptr !=3D ';') It seems incorrect to remove "*dataptr !=3D 'X'" out of this condition chec= king. With the breakpoint commands added, the Z packet becomes "Z0xxxxXxxxx,Xxxxx;cmds:xxxxx" When parsing this packet, in current (wrong) GDBserver, only the first condition ('Xxxxx') in packet is added, and the rest of conditions are skip= ped, which is a mistake. The fix is just to revert this change. Regression tested on x86_64/gdbserv= er, and these fails are fixed. -FAIL: gdb.base/pending.exp: continue to resolved breakpoint 2 -FAIL: gdb.base/pending.exp: continue to resolved breakpoint 1 +PASS: gdb.base/pending.exp: continue to resolved breakpoint 2 +PASS: gdb.base/pending.exp: continue to resolved breakpoint 1 -FAIL: gdb.base/pending.exp: continue to resolved breakpoint 3 (the program= exited) +PASS: gdb.base/pending.exp: continue to resolved breakpoint 3 Regression tested on x86_64/native, no changes. --=20 Yao (=E9=BD=90=E5=B0=A7) gdb/gdbserver: 2012-07-20 Yao Qi * server.c (process_point_options): Stop at 'X' when parsing. --- gdb/gdbserver/server.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 963d575..4e15b3c 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -2944,7 +2944,7 @@ process_point_options (CORE_ADDR point_addr, char **p= acket) } =20 /* Skip tokens until we find one that we recognize. */ - while (*dataptr && *dataptr !=3D ';') + while (*dataptr && *dataptr !=3D 'X' && *dataptr !=3D ';') dataptr++; } *packet =3D dataptr; --=20 1.7.7.6