From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27039 invoked by alias); 22 Jul 2012 14:12:06 -0000 Received: (qmail 27012 invoked by uid 22791); 22 Jul 2012 14:12:05 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Jul 2012 14:11:47 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6MEBkrq005417 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 22 Jul 2012 10:11:46 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6MEBhkH029676 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 22 Jul 2012 10:11:45 -0400 Message-ID: <500C0A1F.8040106@redhat.com> Date: Sun, 22 Jul 2012 14:12:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Hui Zhu CC: gdb-patches ml Subject: Re: [PATCH Bug breakpoints/14381] Fix linespec to parse file name that begin with decimal numbers References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00427.txt.bz2 On 07/21/2012 11:30 PM, Hui Zhu wrote: > @@ -390,6 +392,12 @@ linespec_lexer_lex_number (linespec_pars > ++(PARSER_STREAM (parser)); > } > > + if (*PARSER_STREAM (parser) != '\0' && !isspace(*PARSER_STREAM (parser))) > + { > + PARSER_STREAM (parser) = LS_TOKEN_STOKEN (token).ptr; > + return linespec_lexer_lex_string (parser); > + } > + > return token; > } > This obfuscates the meaning of linespec_lexer_lex_number. A better place to deal with this is in linespec_lexer_lex_one directly where the decision to call linespec_lexer_lex_number is made. That can either be done by inspecting the input stream directly in *_lex_one or by having *_lex_number error (add a new error token type) and then having linespec_lexer_lex_one fallback to string lexing. Keith