From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26762 invoked by alias); 28 Jul 2012 10:24:17 -0000 Received: (qmail 26752 invoked by uid 22791); 28 Jul 2012 10:24:16 -0000 X-SWARE-Spam-Status: No, hits=-4.4 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; Sat, 28 Jul 2012 10:24:02 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Sv4Bl-0003zC-05 from Yao_Qi@mentor.com ; Sat, 28 Jul 2012 03:24:01 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sat, 28 Jul 2012 03:24:00 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Sat, 28 Jul 2012 03:23:59 -0700 From: Yao Qi To: CC: Pedro Alves Subject: Re: 7.4->7.5 Regression gdb.base/pending.exp with gdbserver [Re: [PATCH] Dynamic printf for a target agent] Date: Sat, 28 Jul 2012 10:24:00 -0000 Message-ID: <3480554.LITosdQYbn@qiyao.dyndns.org> User-Agent: KMail/4.8.3 (Linux/3.3.7-1.fc16.i686; KDE/4.8.3; i686; ; ) In-Reply-To: <5012C373.4050006@redhat.com> References: <4FC57340.6070306@earthlink.net> <2625393.59PdMiRRzQ@qiyao.dyndns.org> <5012C373.4050006@redhat.com> 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/msg00719.txt.bz2 On Friday, July 27, 2012 05:36:03 PM Pedro Alves wrote: > @@ -2938,14 +2938,12 @@ process_point_options (CORE_ADDR point_addr, char > **packet) } > else > { > - /* Unrecognized token, just skip it. */ > fprintf (stderr, "Unknown token %c, ignoring.\n", > *dataptr); > + /* Skip tokens until we find one that we recognize. */ > + while (*dataptr && *dataptr !=3D ';') > + dataptr++; > } > - > - /* Skip tokens until we find one that we recognize. */ > - while (*dataptr && *dataptr !=3D 'X' && *dataptr !=3D ';') > - dataptr++; > } > *packet =3D dataptr; Pedro, I like it. It is better to remove 'X' out of condition checking, so that i= t=20 is easier to add other new tokens in the future. I am wondering that the original code can skip some "bad" chars in 'X' and= =20 'cmds:' to go to next ';', and I don't know this case does exist. We may a= dd=20 an assertion at the end of 'while (*dataptr)' loop, like this, while (*dataptr) { ... gdb_assert (*dataptr =3D=3D 0 || *dataptr =3D=3D ';'); } or we don't have to worry about this at all. --=20 Yao (=E9=BD=90=E5=B0=A7)