From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1733 invoked by alias); 18 Oct 2013 19:34:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 1718 invoked by uid 89); 18 Oct 2013 19:34:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Oct 2013 19:34:50 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9IJYnKq022469 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 18 Oct 2013 15:34:49 -0400 Received: from host2.jankratochvil.net (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9IJYjrk025537 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 18 Oct 2013 15:34:47 -0400 Date: Fri, 18 Oct 2013 19:34:00 -0000 From: Jan Kratochvil To: Keith Seitz Cc: "gdb-patches@sourceware.org ml" , Sergio Durigan Junior Subject: Re: Regression for gdb.pascal/* [Re: [RFA 4/4] Constify parse_linesepc] Message-ID: <20131018193445.GA12496@host2.jankratochvil.net> References: <5249C987.50809@redhat.com> <87d2no4uim.fsf@fleche.redhat.com> <524BA344.2070802@redhat.com> <20131016095743.GA17072@host2.jankratochvil.net> <52602A08.4020705@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52602A08.4020705@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00582.txt.bz2 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