From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7260 invoked from network); 29 Sep 2008 11:26:33 -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 11:26:33 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 16233 invoked from network); 29 Sep 2008 11:26:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Sep 2008 11:26:28 -0000 Received: (qmail 11084 invoked by alias); 29 Sep 2008 11:26:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25768 Received: (qmail 11066 invoked from network); 29 Sep 2008 11:26:17 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 29 Sep 2008 11:26:17 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [208.87.233.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 25F1F8030847 for ; Mon, 29 Sep 2008 13:26:12 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly02g.srv.mailcontrol.com (MailControl) with ESMTP id m8TBPrGj013550 for ; Mon, 29 Sep 2008 12:26:05 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Mon, 29 Sep 2008 12:25:59 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m8TBPsW2005260 for ; Mon, 29 Sep 2008 12:25:54 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m8TBPsQM005256 for ; Mon, 29 Sep 2008 12:25:54 +0100 Message-Id: <200809291125.m8TBPsQM005256@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: "Zsh hackers list" Subject: Re: Help me track down a tough bug? (probably funcfiletrace, subshells and possibly I/O redirection) In-reply-to: <6cd6de210809290411m60cb669bk3817d768adce378a@mail.gmail.com> References: <6cd6de210809281219i4bf1ed18mefa45b967fa835a6@mail.gmail.com> <20080928221651.6ee7f671@pws-pc> <6cd6de210809281932u2e04a844l219d1db5a7568a73@mail.gmail.com> <20080929095201.451381d0@news01> <6cd6de210809290411m60cb669bk3817d768adce378a@mail.gmail.com> Comments: In-reply-to "Rocky Bernstein" message dated "Mon, 29 Sep 2008 07:11:34 -0400." Date: Mon, 29 Sep 2008 12:25:54 +0100 From: Peter Stephenson X-OriginalArrivalTime: 29 Sep 2008 11:25:59.0159 (UTC) FILETIME=[25980070:01C92226] X-Scanned-By: MailControl A-08-50-15 (www.mailcontrol.com) on 10.71.0.112 X-Virus-Scanned: ClamAV 0.92.1/8353/Mon Sep 29 11:57:09 2008 on bifrost X-Virus-Status: Clean "Rocky Bernstein" wrote: > Thanks. This addresses one of the problem seen. There are still the > others -- output disappearing and weird line numbers shown further up > in the trace. But we will take these one at a time. Please could you send a simple example of a remaining incorrect line number. I would expect it would be reproducible without the debugger. > How do you feel about noting the subshell level in one of the > traceback stacks and allowing an optional parameter to set $LINENO in > those cases where it is reset to 1. I'm not entirely sure what you're referring to, please could you give an example of what behaviour you'd like. > (Is there a corresponding variable for the filename? LINENO itself doesn't necessarily relate to a file, but for now you can use ${(%):-%x} and ${(%):-%I} for the filename and line number in the shell code which is probably what you need. I'll add variables for these later if they turn out to be useful (probably ZSH_SOURCE_FILE and ZSH_SOURCE_LINE). > I note that in > x=" > $LINENO" > > LINENO has the x's line number rather than the one it's on. No doubt > this is an artifact of xtrace wanting to show for tracing purposes x's > line. However probably more correct would be to keep that but have > $LINENO be the line that it itself is on. I think we'd have to track the line number in subst.c:stringsubst(). That may or may not be simple, I'll have to try it. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070