From patchwork Wed Feb 4 23:36:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Muller X-Patchwork-Id: 4919 Received: (qmail 27729 invoked by alias); 4 Feb 2015 23:37:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 27710 invoked by uid 89); 4 Feb 2015 23:37:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_00, MSGID_MULTIPLE_AT autolearn=no version=3.3.2 X-HELO: mailhost.u-strasbg.fr Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.222.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Feb 2015 23:37:03 +0000 Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antispam (Postfix) with ESMTP id E258E2208B2; Thu, 5 Feb 2015 00:37:00 +0100 (CET) Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antivirus (Postfix) with ESMTP id D287D2208AF; Thu, 5 Feb 2015 00:37:00 +0100 (CET) Received: from lmr.u-strasbg.fr (lmr4.u-strasbg.fr [172.30.21.4]) by mr1.u-strasbg.fr (Postfix) with ESMTP id B2DBA2208B2; Thu, 5 Feb 2015 00:36:58 +0100 (CET) Received: from lmr.u-strasbg.fr (localhost [127.0.0.1]) by antivirus (Postfix) with ESMTP id 82D3DC7; Thu, 5 Feb 2015 00:36:58 +0100 (CET) Received: from E6510Muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (Authenticated sender: mullerp) by lmr4.u-strasbg.fr (Postfix) with ESMTPSA id E2C3A9A; Thu, 5 Feb 2015 00:36:54 +0100 (CET) From: "Pierre Muller" To: "'Pierre Muller'" , "'Pedro Alves'" Cc: "'gdb-patches'" References: <54ae4586.01e3440a.7b06.fffff844SMTPIN_ADDED_BROKEN@mx.google.com> <54AE605A.8050308@redhat.com> <54ae7f9f.c323460a.36ed.ffffff30SMTPIN_ADDED_BROKEN@mx.google.com> <54AE8914.4010507@redhat.com> <54ae911b.85e3440a.1d96.5ffdSMTPIN_ADDED_BROKEN@mx.google.com> <54AFB2E5.5080307@redhat.com> <001501d02c27$9fe84350$dfb8c9f0$@muller@ics-cnrs.unistra.fr> <002f01d036a3$456c29b0$d0447d10$@muller@ics-cnrs.unistra.fr> In-Reply-To: <002f01d036a3$456c29b0$d0447d10$@muller@ics-cnrs.unistra.fr> Subject: [RFA PATCH 1/3 V4] Remember the case pattern that allowed finding a field of this. Date: Thu, 5 Feb 2015 00:36:54 +0100 Message-ID: <003001d040d3$7746f340$65d4d9c0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 This is the fix in the pascal parser (p-exp.y), to avoid the error that GDB does find normal variables case insensitively, but not fields of this, inside a class or object method. gdb/ChangeLog entry: 2015-02-04 Pierre Muller * p-exp.y (yylex): Reorganize code to return the matched pattern for a field of this. --- gdb/p-exp.y | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gdb/p-exp.y b/gdb/p-exp.y index a1c78bf..101de09 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -1551,7 +1551,7 @@ yylex (void) int is_a_field = 0; int hextype; - + is_a_field_of_this.type = NULL; if (search_field && current_type) is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL); if (is_a_field) @@ -1598,15 +1598,20 @@ yylex (void) VAR_DOMAIN, &is_a_field_of_this); } - if (is_a_field) + if (is_a_field || (is_a_field_of_this.type != NULL)) { tempbuf = (char *) realloc (tempbuf, namelen + 1); strncpy (tempbuf, tmp, namelen); tempbuf [namelen] = 0; yylval.sval.ptr = tempbuf; yylval.sval.length = namelen; + yylval.ssym.sym = NULL; free (uptokstart); - return FIELDNAME; + yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL; + if (is_a_field) + return FIELDNAME; + else + return NAME; } /* Call lookup_symtab, not lookup_partial_symtab, in case there are no psymtabs (coff, xcoff, or some future change to blow away the @@ -1739,7 +1744,6 @@ yylex (void) free(uptokstart); /* Any other kind of symbol. */ yylval.ssym.sym = sym; - yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL; return NAME; } }