From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4552 invoked by alias); 22 Jul 2012 06:30:57 -0000 Received: (qmail 4544 invoked by uid 22791); 22 Jul 2012 06:30:56 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ob0-f169.google.com (HELO mail-ob0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Jul 2012 06:30:44 +0000 Received: by obhx4 with SMTP id x4so9352177obh.0 for ; Sat, 21 Jul 2012 23:30:43 -0700 (PDT) Received: by 10.50.222.170 with SMTP id qn10mr7999423igc.45.1342938642919; Sat, 21 Jul 2012 23:30:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.146.205 with HTTP; Sat, 21 Jul 2012 23:30:02 -0700 (PDT) From: Hui Zhu Date: Sun, 22 Jul 2012 06:30:00 -0000 Message-ID: Subject: [PATCH Bug breakpoints/14381] Fix linespec to parse file name that begin with decimal numbers To: gdb-patches ml Cc: Joel Brobecker Content-Type: text/plain; charset=ISO-8859-1 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/msg00420.txt.bz2 Hi, This issue is because function linespec_lexer_lex_one handle the string that begin with decimal numbers decimal numbers directly and use linespec_lexer_lex_number handle it directly. So when there are a file name that begin with decimal numbers, will a lot of error around it. I post a patch make linespec_lexer_lex_number if number followed by non-space string, use linespec_lexer_lex_string handle linespec as a string. Joel, this issue affect 7.5. Does this patch can add to 7.5 branch? Thanks, Hui 2012-07-22 Hui Zhu * linespec.c (linespec_lexer_lex_number): Call linespec_lexer_lex_string if the number is followed by non-space string. --- linespec.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/linespec.c +++ b/linespec.c @@ -368,6 +368,8 @@ static const char *const linespec_quote_ /* Lex a number from the input in PARSER. This only supports decimal numbers. */ +static linespec_token linespec_lexer_lex_string (linespec_parser *parser); + static linespec_token linespec_lexer_lex_number (linespec_parser *parser) { @@ -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; }