Module Name:    src
Committed By:   christos
Date:           Fri Dec 11 18:25:45 UTC 2020

Modified Files:
        src/external/gpl3/gdb/dist/gdb: c-exp.y

Log Message:
PR/55851: Martin Husemann: recognize <symbol>.part.<n> names
This is gross; perhaps we should hide them completely (not print them
in stack traces etc.)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/gpl3/gdb/dist/gdb/c-exp.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/c-exp.y
diff -u src/external/gpl3/gdb/dist/gdb/c-exp.y:1.1.1.9 src/external/gpl3/gdb/dist/gdb/c-exp.y:1.2
--- src/external/gpl3/gdb/dist/gdb/c-exp.y:1.1.1.9	Mon Sep 14 21:43:28 2020
+++ src/external/gpl3/gdb/dist/gdb/c-exp.y	Fri Dec 11 13:25:45 2020
@@ -2608,6 +2608,8 @@ static bool last_was_structop;
 /* Depth of parentheses.  */
 static int paren_depth;
 
+static const char PART[] = ".part.";
+
 /* Read one token, getting characters through lexptr.  */
 
 static int
@@ -2723,6 +2725,13 @@ lex_one_token (struct parser_state *par_
       return c;
 
     case '.':
+      /* Gross! recognize <symbol>.part.N */
+      if (strncmp(pstate->lexptr, PART, sizeof(PART) - 1) == 0 &&
+	ISDIGIT(pstate->lexptr[sizeof(PART) - 1]) &&
+	pstate->lexptr[sizeof(PART)] == '\0')
+	{
+	  break;
+	}
       /* Might be a floating point number.  */
       if (pstate->lexptr[1] < '0' || pstate->lexptr[1] > '9')
 	{
@@ -2888,7 +2897,7 @@ lex_one_token (struct parser_state *par_
   /* It's a name.  See how long it is.  */
   namelen = 0;
   for (c = tokstart[namelen];
-       (c == '_' || c == '$' || c_ident_is_alnum (c) || c == '<');)
+       (c == '_' || c == '$' || c == '.' || c_ident_is_alnum (c) || c == '<');)
     {
       /* Template parameter lists are part of the name.
 	 FIXME: This mishandles `print $a<4&&$a>3'.  */

Reply via email to