From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9873 invoked by alias); 30 Jul 2012 16:38:40 -0000 Received: (qmail 9792 invoked by uid 22791); 30 Jul 2012 16:38:36 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,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:38:23 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6UGcMAx011769 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 30 Jul 2012 12:38:22 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6UGcJrr007393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Jul 2012 12:38:21 -0400 Message-ID: <5016B87B.8070004@redhat.com> Date: Mon, 30 Jul 2012 16:38: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" CC: asmwarrior@gmail.com Subject: [RFA] Fix number lexing, again Content-Type: multipart/mixed; boundary="------------090807060709030802030209" 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/msg00762.txt.bz2 This is a multi-part message in MIME format. --------------090807060709030802030209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 675 Hi, As someone pointed out, I did not fix all the corner cases with linespec_lexer_lex_number. [See http://sourceware.org/ml/gdb/2012-07/msg00078.html - the issue affects all platforms] Since it is still quite common for MI-based UIs to quote the entire linespec, we need to terminate numbers successfully on any quotation. While the list of growing terminations for the string is getting tediously long, I don't think inverting the test would be any shorter/clearer. WDYT? Keith PS. Also recommending this for 7.5. ChangeLog 2012-07-30 Keith Seitz * linespec.c (linespec_lex_number): A number followed by quotes is a valid number, too. --------------090807060709030802030209 Content-Type: text/x-patch; name="lex_number-quotes.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lex_number-quotes.patch" Content-length: 782 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; --------------090807060709030802030209--