From patchwork Fri Jan 23 00:26:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Muller X-Patchwork-Id: 4771 Received: (qmail 20937 invoked by alias); 23 Jan 2015 00:26:56 -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 20905 invoked by uid 89); 23 Jan 2015 00:26:53 -0000 Authentication-Results: sourceware.org; auth=none 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.215) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Jan 2015 00:26:52 +0000 Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antispam (Postfix) with ESMTP id 825B5A12D6; Fri, 23 Jan 2015 01:26:49 +0100 (CET) Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antivirus (Postfix) with ESMTP id 724DBA139B; Fri, 23 Jan 2015 01:26:49 +0100 (CET) Received: from lmr.u-strasbg.fr (lmr3.u-strasbg.fr [172.30.21.3]) by mr5.u-strasbg.fr (Postfix) with ESMTP id 5141DA12D6; Fri, 23 Jan 2015 01:26:47 +0100 (CET) Received: from lmr.u-strasbg.fr (localhost [127.0.0.1]) by antivirus (Postfix) with ESMTP id 1F822CC; Fri, 23 Jan 2015 01:26:47 +0100 (CET) Received: from E6510Muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (Authenticated sender: mullerp) by lmr3.u-strasbg.fr (Postfix) with ESMTPSA id 69DDCBA; Fri, 23 Jan 2015 01:26:43 +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> In-Reply-To: <001501d02c27$9fe84350$dfb8c9f0$@muller@ics-cnrs.unistra.fr> Subject: [RFA PATCH 1/3 V3] Remember the case pattern that allowed finding a field of this. Date: Fri, 23 Jan 2015 01:26:43 +0100 Message-ID: <002f01d036a3$456c29b0$d0447d10$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 For this one also, an update is necessary: I realized that I got wrong output for some field of this variables, and it turned out to be due to missing initialization of some local variables. gdb/ChangeLog entry: 2015-01-22 Pierre Muller PR pascal/17815 * p-exp.y (yylex): Remember the case pattern that allowed finding 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; } }