From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28477 invoked by alias); 14 Dec 2010 17:41:27 -0000 Received: (qmail 28353 invoked by uid 22791); 14 Dec 2010 17:41:25 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_YY,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; Tue, 14 Dec 2010 17:41:20 +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.13.8/8.13.8) with ESMTP id oBEHfGWD020804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Dec 2010 12:41:16 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oBEHfFx3026215; Tue, 14 Dec 2010 12:41:15 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id oBEHfF6Y000724; Tue, 14 Dec 2010 12:41:15 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id DEA0237848F; Tue, 14 Dec 2010 10:41:14 -0700 (MST) From: Tom Tromey To: Greg Watson Cc: gdb-patches@sourceware.org Subject: Re: Improve handling of Fortran keywords References: <5503A4B2-EB18-40A9-9182-27E05D73D0EF@computer.org> Date: Tue, 14 Dec 2010 17:41:00 -0000 In-Reply-To: <5503A4B2-EB18-40A9-9182-27E05D73D0EF@computer.org> (Greg Watson's message of "Tue, 14 Dec 2010 11:18:16 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2010-12/txt/msg00248.txt.bz2 >>>>> "Greg" == Greg Watson writes: Greg> Currently, gdb 7.2 will not allow me to use identifier names such Greg> as "integer_var" as it treats the first "integer" part as a Greg> keyword without checking that the identifier is actually longer Greg> than the keyword. Here's a simple patch to fix this (and make Greg> Fortran debugging more useful). Could you try this patch instead? I think it should have the same effect, but it is simpler. Tom diff --git a/gdb/f-exp.y b/gdb/f-exp.y index 415819a..487b00d 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -1150,8 +1150,7 @@ yylex () /* Catch specific keywords. */ for (i = 0; f77_keywords[i].operator != NULL; i++) - if (strncmp (tokstart, f77_keywords[i].operator, - strlen(f77_keywords[i].operator)) == 0) + if (strncmp (tokstart, f77_keywords[i].operator, namelen)) == 0) { /* lexptr += strlen(f77_keywords[i].operator); */ yylval.opcode = f77_keywords[i].opcode;