From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24594 invoked by alias); 14 Dec 2010 16:18:26 -0000 Received: (qmail 24582 invoked by uid 22791); 14 Dec 2010 16:18:23 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from omr9.networksolutionsemail.com (HELO omr9.networksolutionsemail.com) (205.178.146.59) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Dec 2010 16:18:18 +0000 Received: from cm-omr6 (mail.networksolutionsemail.com [205.178.146.50]) by omr9.networksolutionsemail.com (8.13.6/8.13.6) with ESMTP id oBEGIGe8023206 for ; Tue, 14 Dec 2010 11:18:16 -0500 Authentication-Results: cm-omr6 smtp.user=greg@watson.id.au; auth=pass (LOGIN) X-Authenticated-UID: greg@watson.id.au Received: from [108.21.104.164] ([108.21.104.164:46300] helo=[10.0.1.3]) by cm-omr6 (envelope-from ) (ecelerity 2.2.2.41 r(31179/31189)) with ESMTPA id 52/D1-30320-8C8970D4; Tue, 14 Dec 2010 11:18:16 -0500 From: Greg Watson Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Improve handling of Fortran keywords Date: Tue, 14 Dec 2010 16:18:00 -0000 Message-Id: <5503A4B2-EB18-40A9-9182-27E05D73D0EF@computer.org> To: gdb-patches@sourceware.org Mime-Version: 1.0 (Apple Message framework v1082) 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: 2010-12/txt/msg00235.txt.bz2 Hi, Currently, gdb 7.2 will not allow me to use identifier names such as "integ= er_var" as it treats the first "integer" part as a keyword without checking= that the identifier is actually longer than the keyword. Here's a simple p= atch to fix this (and make Fortran debugging more useful). Regards, Greg *** f-exp.y.orig 2010-12-14 10:28:34.542834692 -0500 --- f-exp.y 2010-12-14 11:06:04.798853514 -0500 *************** *** 955,960 **** --- 955,961 ---- { int c; int namelen; + int keylen; unsigned int i,token; char *tokstart; =20=20=20=20 *************** *** 1149,1162 **** =20=20=20=20 /* Catch specific keywords. */ =20=20=20=20 ! for (i =3D 0; f77_keywords[i].operator !=3D NULL; i++) ! if (strncmp (tokstart, f77_keywords[i].operator, ! strlen(f77_keywords[i].operator)) =3D=3D 0) { /* lexptr +=3D strlen(f77_keywords[i].operator); */=20 yylval.opcode =3D f77_keywords[i].opcode; return f77_keywords[i].token; } =20=20=20=20 yylval.sval.ptr =3D tokstart; yylval.sval.length =3D namelen; --- 1150,1165 ---- =20=20=20=20 /* Catch specific keywords. */ =20=20=20=20 ! for (i =3D 0; f77_keywords[i].operator !=3D NULL; i++) { ! keylen =3D strlen(f77_keywords[i].operator); ! if (strlen(tokstart) =3D=3D keylen && ! strncmp (tokstart, f77_keywords[i].operator, keylen) =3D=3D 0) { /* lexptr +=3D strlen(f77_keywords[i].operator); */=20 yylval.opcode =3D f77_keywords[i].opcode; return f77_keywords[i].token; } + } =20=20=20=20 yylval.sval.ptr =3D tokstart; yylval.sval.length =3D namelen;