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]

Re: Regression for gdb.pascal/* [Re: [RFA 4/4] Constify parse_linesepc]


On Thu, 17 Oct 2013 20:18:48 +0200, Keith Seitz wrote:
> There are two little sections of code, though, which violate
> const-ness of the input, and I've removed those, since they don't
> seem necessary. [This is the two loops that deal with changing the
> case of `tokstart' -- which can easily be removed because we already
> have a temporary buffer that is used for this.]
> 
> I could not think of any reasons why pascal_lex would need to change
> the input. The only thing that came to mind was completion, and the
> behavior for that is, as far as I can tell, identical to how 7.0,
> 7.3, 7.4, 7.5, and 7.6 behave. [both case-sensitive 'on' and 'off']

Maybe we could juse use
	[pascal patch] Use case_sensitive_off [Re: Regression for gdb.pascal/* [Re: [RFA 4/4] Constify parse_linesepc]]
	https://sourceware.org/ml/gdb-patches/2013-10/msg00581.html

and forget about all the case changes then.


> @@ -1369,11 +1368,8 @@ yylex (void)
>  	    break;
>  	  case '\\':
>  	    {
> -	      const char *s, *o;
> -
> -	      o = s = ++tokptr;
> -	      c = parse_escape (parse_gdbarch, &s);
> -	      *tokptr += s - o;
> +	      ++tokptr;
> +	      c = parse_escape (parse_gdbarch, &tokptr);
>  	      if (c == -1)
>  		{
>  		  continue;

coding/patch style:
This change is a bit unfortunate that together with your previous patch it
just reformats the code, moreover not simplifying it.


diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index da8d5f7..8cb98c0 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -1361,13 +1367,15 @@ yylex (void)
 	    /* Do nothing, loop will terminate.  */
 	    break;
 	  case '\\':
-	    tokptr++;
-	    c = parse_escape (parse_gdbarch, &tokptr);
-	    if (c == -1)
-	      {
-		continue;
-	      }
-	    tempbuf[tempbufindex++] = c;
+	    {
+	      ++tokptr;
+	      c = parse_escape (parse_gdbarch, &tokptr);
+	      if (c == -1)
+		{
+		  continue;
+		}
+	      tempbuf[tempbufindex++] = c;
+	    }
 	    break;
 	  default:
 	    tempbuf[tempbufindex++] = *tokptr++;


Pierre's reply would be great to check in the case changes removal with the
case_sensitive_off patch.  Otherwise it is not clear to me it is safe.


Thanks,
Jan


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