From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21573 invoked from network); 29 Sep 2008 08:53:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 29 Sep 2008 08:53:41 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 72815 invoked from network); 29 Sep 2008 08:53:10 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Sep 2008 08:53:10 -0000 Received: (qmail 23482 invoked by alias); 29 Sep 2008 08:52:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25766 Received: (qmail 23472 invoked from network); 29 Sep 2008 08:52:51 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 29 Sep 2008 08:52:51 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 558908030847 for ; Mon, 29 Sep 2008 10:52:45 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly32d.srv.mailcontrol.com (MailControl) with ESMTP id m8T8q60u010776 for ; Mon, 29 Sep 2008 09:52:26 +0100 Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Mon, 29 Sep 2008 09:52:06 +0100 Date: Mon, 29 Sep 2008 09:52:01 +0100 From: Peter Stephenson To: "Zsh hackers list" Subject: Re: Help me track down a tough bug? (probably funcfiletrace, subshells and possibly I/O redirection) Message-ID: <20080929095201.451381d0@news01> In-Reply-To: <6cd6de210809281932u2e04a844l219d1db5a7568a73@mail.gmail.com> References: <6cd6de210809281219i4bf1ed18mefa45b967fa835a6@mail.gmail.com> <20080928221651.6ee7f671@pws-pc> <6cd6de210809281932u2e04a844l219d1db5a7568a73@mail.gmail.com> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 29 Sep 2008 08:52:06.0252 (UTC) FILETIME=[A65A32C0:01C92210] X-Scanned-By: MailControl A-08-50-15 (www.mailcontrol.com) on 10.68.0.142 X-Virus-Scanned: ClamAV 0.92.1/8352/Mon Sep 29 05:25:01 2008 on bifrost X-Virus-Status: Clean On Sun, 28 Sep 2008 22:32:19 -0400 "Rocky Bernstein" wrote: > In general I think this will help. Not just because it helps the > debugger. Later (* * * * below) I'll elaborate on this. > > But in short, either this patch doesn't solve this particular problem > or I hand-applied the patch incorrectly. >... > When I run zsh with those patches on this program: > ( > x=$(print $LINENO); print $x > ) > > I still get 1. Is that what one gets with the patch applied? No, you should get the line number in the file as I do, and you shouldn't get any additional test failures. I don't think your version is working. I've now committed it, but with one additional change: parse_string() still has the key additional reset_lineno logic, but it once again always saves and restores the line number locally. That wouldn't make a difference in this particular case but sometimes with the previous version (I haven't bothered tracking down the exact places) you might get the global line number being incremented too much. I don't think there's any case where parsing the string should affect the line number from the surrounding context. > Let me see if I understand the situation correctly: there is an > internal routine called parse_string() which can be called though eval > as well as backtick. For eval, one can argue its the right thing, but > for backtick seeing 1 as the value of $LINENO might be a bit odd. Right. However, I've now tried to arrange it so that the line number is only reset in places where zsh provides (through the function stack) enough supporting for finding out what's actually going on. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070