This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA PATCH 1/3] Remember the case pattern that allowed finding a field of this.


  In the pascal parser, there is special code
that will try to emulate case-insensivity despite the
fact that pascal is not registered as a 'case-insensitive' language.

  This code does not work as expected for fields of a class,
for which exact casing is currently required.
  The patch below fixes this problem.

Pierre Muller

gdb/ChangeLog entry:

2015-01-07  Pierre Muller  <muller@sourceware.org>

       PR pascal/17815
       * p-exp.y (yylex): Remember the case pattern that allowed finding
       a field of this.

---
 gdb/p-exp.y | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index a1c78bf..3a4905a 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -1598,7 +1598,7 @@ 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);
@@ -1606,7 +1606,11 @@ yylex (void)
 	yylval.sval.ptr = tempbuf;
 	yylval.sval.length = namelen;
 	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 +1743,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;
   }
 }
-- 
2.1.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]