This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Regression for gdb.pascal/* [Re: [RFA 4/4] Constify parse_linesepc]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>, Sergio Durigan Junior <sergiodj at redhat dot com>
- Date: Fri, 18 Oct 2013 21:34:45 +0200
- Subject: Re: Regression for gdb.pascal/* [Re: [RFA 4/4] Constify parse_linesepc]
- Authentication-results: sourceware.org; auth=none
- References: <5249C987 dot 50809 at redhat dot com> <87d2no4uim dot fsf at fleche dot redhat dot com> <524BA344 dot 2070802 at redhat dot com> <20131016095743 dot GA17072 at host2 dot jankratochvil dot net> <m3zjq8hnub dot fsf at redhat dot com> <m3vc0wg4yg dot fsf at redhat dot com> <52602A08 dot 4020705 at redhat dot 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