From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7785 invoked by alias); 25 Jul 2012 21:21:03 -0000 Received: (qmail 7773 invoked by uid 22791); 25 Jul 2012 21:21:02 -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; Wed, 25 Jul 2012 21:20:43 +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 q6PLKgrF020718 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 25 Jul 2012 17:20:42 -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 q6PLKdlQ005849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 25 Jul 2012 17:20:41 -0400 Message-ID: <50106327.5000004@redhat.com> Date: Wed, 25 Jul 2012 21:21: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 ml CC: Hui Zhu Subject: Re: [PATCH Bug breakpoints/14381] Fix linespec to parse file name that begin with decimal numbers References: <500C0A1F.8040106@redhat.com> <87k3xusgan.fsf@fleche.redhat.com> <87lii9ne95.fsf@fleche.redhat.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------010200030700090505060207" 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/msg00593.txt.bz2 This is a multi-part message in MIME format. --------------010200030700090505060207 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2124 On 07/25/2012 05:56 AM, Hui Zhu wrote: >>>> 2012-07-24 Hui Zhu >>>> * linespec.c (linespec_lexer_lex_number): Update comments, >>>> change the return and add check to make sure the input is >>>> the decimal numbers. >>>> (linespec_lexer_lex_one): If linespec_lexer_lex_number return >>>> false, call linespec_lexer_lex_string. This patch caused several regressions: FAIL: gdb.base/dprintf.exp: dprintf 26,"arg=%d, g=%d\n", arg, g (got interactive prompt) FAIL: gdb.base/dprintf.exp: 1st dprintf, gdb FAIL: gdb.base/dprintf.exp: 2nd dprintf, gdb FAIL: gdb.base/dprintf.exp: 1st dprintf, call FAIL: gdb.base/dprintf.exp: 2nd dprintf, call FAIL: gdb.base/dprintf.exp: 1st dprintf, fprintf FAIL: gdb.base/dprintf.exp: 2nd dprintf, fprintf FAIL: gdb.base/list.exp: list range; filename:line1,filename:line2 FAIL: gdb.base/list.exp: list range; line1,line2 FAIL: gdb.base/list.exp: list range; upper bound past EOF FAIL: gdb.base/list.exp: list range; both bounds past EOF FAIL: gdb.base/list.exp: list range, must be same files FAIL: gdb.linespec/ls-errs.exp: break 3: FAIL: gdb.linespec/ls-errs.exp: break +10: FAIL: gdb.linespec/ls-errs.exp: break -10: FAIL: gdb.linespec/ls-errs.exp: break 3: FAIL: gdb.linespec/ls-errs.exp: break +10: FAIL: gdb.linespec/ls-errs.exp: break -10: FAIL: gdb.linespec/ls-errs.exp: break 3 : FAIL: gdb.linespec/ls-errs.exp: break +10 : FAIL: gdb.linespec/ls-errs.exp: break -10 : FAIL: gdb.linespec/ls-errs.exp: break 3 : FAIL: gdb.linespec/ls-errs.exp: break +10 : FAIL: gdb.linespec/ls-errs.exp: break -10 : ERROR: (DejaGnu) proc "all tests in this module will fail.\"" does not exist. (backtrace.exp) This happens because numeric tokens may be terminated by a comma or colon (in addition to whitespace). The attached patch fixes these regressions (and fixes a typo in the comment for linespec_lexer_lex_one). Ok for HEAD and 7.5? Keith ChangeLog 2012-07-25 Keith Seitz * linespec.c (linespec_lexer_lex_number): The input is also a valid number if the next character is a comma or colon. --------------010200030700090505060207 Content-Type: text/x-patch; name="lex_number-comma.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lex_number-comma.patch" Content-length: 1013 diff --git a/gdb/linespec.c b/gdb/linespec.c index c72bb4b..9218db4 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -366,7 +366,8 @@ static const char *const linespec_quote_characters = "\"\'"; /* Lexer functions. */ /* Lex a number from the input in PARSER. This only supports - decimal numbers.\ + decimal numbers. + Return true if input is decimal numbers. Return false if not. */ static int @@ -389,7 +390,11 @@ linespec_lexer_lex_number (linespec_parser *parser, linespec_token *tokenp) ++(PARSER_STREAM (parser)); } - if (*PARSER_STREAM (parser) != '\0' && !isspace(*PARSER_STREAM (parser))) + /* If the next character in the input buffer is not a space, comma, + 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) = LS_TOKEN_STOKEN (*tokenp).ptr; return 0; --------------010200030700090505060207--