Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Keith Seitz <keiths@redhat.com>
Cc: "gdb-patches@sourceware.org ml" <gdb-patches@sourceware.org>,
	       Sergio Durigan Junior <sergiodj@redhat.com>
Subject: Re: Regression for gdb.pascal/*  [Re: [RFA 4/4] Constify parse_linesepc]
Date: Fri, 18 Oct 2013 19:34:00 -0000	[thread overview]
Message-ID: <20131018193445.GA12496@host2.jankratochvil.net> (raw)
In-Reply-To: <52602A08.4020705@redhat.com>

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


  parent reply	other threads:[~2013-10-18 19:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-30 18:57 [RFA 4/4] Constify parse_linesepc Keith Seitz
2013-10-01  4:15 ` Sergio Durigan Junior
2013-10-01 20:16 ` Tom Tromey
2013-10-02  4:38   ` Keith Seitz
2013-10-16  9:57     ` Regression for gdb.pascal/* [Re: [RFA 4/4] Constify parse_linesepc] Jan Kratochvil
2013-10-16 22:07       ` Sergio Durigan Junior
2013-10-16 23:40         ` Sergio Durigan Junior
2013-10-17 18:18           ` Keith Seitz
2013-10-17 20:52             ` Tom Tromey
2013-10-18 17:20               ` Jan Kratochvil
2013-10-18 19:09                 ` [pascal patch] Use case_sensitive_off [Re: Regression for gdb.pascal/* [Re: [RFA 4/4] Constify parse_linesepc]] Jan Kratochvil
2013-10-18 19:34             ` Jan Kratochvil [this message]
2013-10-20 13:17               ` Regression for gdb.pascal/* [Re: [RFA 4/4] Constify parse_linesepc] Pierre Muller
2013-10-20 13:27                 ` Jan Kratochvil
2013-10-29 16:39               ` Tom Tromey
2013-10-31 16:14                 ` Pierre Muller
2013-11-13 20:43                   ` Keith Seitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131018193445.GA12496@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    --cc=sergiodj@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox