From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20436 invoked by alias); 30 Jul 2012 16:42:50 -0000 Received: (qmail 20404 invoked by uid 22791); 30 Jul 2012 16:42:47 -0000 X-SWARE-Spam-Status: No, hits=-6.9 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; Mon, 30 Jul 2012 16:42:30 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6UGgSGS029509 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 30 Jul 2012 12:42:28 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6UGgQpw010188 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Mon, 30 Jul 2012 12:42:27 -0400 Message-ID: <5016B972.3060804@redhat.com> Date: Mon, 30 Jul 2012 16:42: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: "gdb-patches@sourceware.org ml" Subject: Re: [RFA] Fix number lexing, again References: <5016B87B.8070004@redhat.com> In-Reply-To: <5016B87B.8070004@redhat.com> Content-Type: multipart/mixed; boundary="------------000504030505040001050508" 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/msg00763.txt.bz2 This is a multi-part message in MIME format. --------------000504030505040001050508 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 382 On 07/30/2012 09:38 AM, Keith Seitz wrote: Gah! This time with the tests included! > ChangeLog > 2012-07-30 Keith Seitz > > * linespec.c (linespec_lex_number): A number followed > by quotes is a valid number, too. testsuite/ChangeLog 2012-07-30 Keith Seitz * gdb.linespec/ls-errs.exp: Check some quote-enclosed linespecs. --------------000504030505040001050508 Content-Type: text/x-patch; name="lex_number-quotes.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lex_number-quotes.patch" Content-length: 1355 diff --git a/gdb/linespec.c b/gdb/linespec.c index 3d7f62f..51994c8 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -391,10 +391,11 @@ linespec_lexer_lex_number (linespec_parser *parser, linespec_token *tokenp) } /* If the next character in the input buffer is not a space, comma, - or colon, this input does not represent a number. */ + quote, or colon, this input does not represent a number. */ if (*PARSER_STREAM (parser) != '\0' && !isspace (*PARSER_STREAM (parser)) && *PARSER_STREAM (parser) != ',' - && *PARSER_STREAM (parser) != ':') + && *PARSER_STREAM (parser) != ':' + && !strchr (linespec_quote_characters, *PARSER_STREAM (parser))) { PARSER_STREAM (parser) = LS_TOKEN_STOKEN (*tokenp).ptr; return 0; diff --git a/gdb/testsuite/gdb.linespec/ls-errs.exp b/gdb/testsuite/gdb.linespec/ls-errs.exp index 7db8ae4..5668397 100644 --- a/gdb/testsuite/gdb.linespec/ls-errs.exp +++ b/gdb/testsuite/gdb.linespec/ls-errs.exp @@ -146,6 +146,8 @@ add the_tests "$srcfile:3 foo" unexpected_opt "string" "foo" foreach x $invalid_offsets { add the_tests "$srcfile:$x" invalid_offset_f $x $srcfile + add the_tests "\"$srcfile:$x\"" invalid_offset_f $x $srcfile + add the_tests "'$srcfile:$x'" invalid_offset_f $x $srcfile } # Test invalid filespecs starting with function. --------------000504030505040001050508--