From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26822 invoked by alias); 3 May 2002 07:49:23 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 26754 invoked from network); 3 May 2002 07:49:18 -0000 Received: from unknown (HELO cerbere.u-strasbg.fr) (130.79.112.7) by sources.redhat.com with SMTP; 3 May 2002 07:49:18 -0000 Received: from laocoon (laocoon.u-strasbg.fr [130.79.112.72]) by cerbere.u-strasbg.fr (8.9.3/8.8.7) with ESMTP id JAA07296; Fri, 3 May 2002 09:49:12 +0200 Message-Id: <4.2.0.58.20020503093143.018d5a00@ics.u-strasbg.fr> X-Sender: muller@ics.u-strasbg.fr Date: Fri, 03 May 2002 00:49:00 -0000 To: Michael Snyder From: Pierre Muller Subject: Re: Resend: [RFC] p-exp.y enhancements. Cc: gdb-patches@sources.redhat.com In-Reply-To: <3CD17D16.A61F19D8@redhat.com> References: <4.2.0.58.20020502144659.02489e38@ics.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-SW-Source: 2002-05/txt/msg00063.txt.bz2 At 19:53 02/05/2002 , Michael Snyder a écrit: >Pierre Muller wrote: > > > > (Second posting with the patch attached, > > this way you should have less problems to > > apply the patch). > > > > This patch has several benefits: > > > > 1) it adds support for S[exp] if S is a pascal string. > > I must admit that this only works for Free Pascal Compiler > > for now, because GPC uses BITSTRING type > > for the array containg the chars which confuses GDB. > > I informed the GPC developper team, but their answer > > seems to be that they didn't really directly change any code > > regarding debug information output for pascal... > >What will happen if a GPC user tries to do that? Well, before it gave an error that there is no [] operator, after it will give a different error. ( > > 2) it adds support for case insensitive searches of record > > (pascal struct) fields. > >This seems like a good thing... > > > > 3) It prepares to a more simple RFC > > about the enhancement to the completer for > > structure field that I sent some time ago. See > > http://sources.redhat.com/ml/gdb-patches/2002-04/msg00774.html > >This seems like a good thing too, but is pretty >unrelated to the two above. Would you mind breaking >this patch down into functional units? Since I'm a >little rusty in both Pascal and Yacc, that will make >it considerably easier to review. No, it is clearly related because, in order to get a way to get the completer to work of struct fields, we need of course to know the current_type of a part of an expression, which is the core of this patch! > > The way current_type is treated in my patch is > > not completely correct, in the sense that > > current_type is often non NULL when it should be NULL > > (like for instance after an operator like '+' or '*', > > but this has no influence on its functionallity, so I did not > > add all the rules that would reset current_type > > (which would have made the patch much bigger). > > > > If I get no observations about this patch, I will commit it > > in the next days. > > > > 2002-05-02 Pierre Muller > > > > * p-exp.y (current_type): New static variable. > > Carries the type of the expression at the position that is parsed. > > (push_current_type, pop_current_type): Two new functions. Used > > to store/restore current_type in expression on specific tokens. > > (search_filed): New static variable. Set to one after parsing a point as > > at that point only a FIELDNAME token should be searched. > > (FIELDNAME): New token. After a point only a token belonging to > > current_type type definition is allowed. > > (all over token rules): reset and change current_type according > > to rules. > > (exp '[' rule): insert implicit array index field if exp is a pascal string type. Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99