From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22939 invoked from network); 28 Jul 2008 08:34:31 -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; 28 Jul 2008 08:34:31 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 85895 invoked from network); 28 Jul 2008 08:34:24 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Jul 2008 08:34:24 -0000 Received: (qmail 13050 invoked by alias); 28 Jul 2008 08:34:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25343 Received: (qmail 13036 invoked from network); 28 Jul 2008 08:34:20 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 28 Jul 2008 08:34:20 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 1E22980561C5 for ; Mon, 28 Jul 2008 10:34:17 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly09d.srv.mailcontrol.com (MailControl) with ESMTP id m6S8YFCq018108 for ; Mon, 28 Jul 2008 09:34:15 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Mon, 28 Jul 2008 09:34:14 +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 m6S8YEKB026330 for ; Mon, 28 Jul 2008 09:34:14 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m6S8YEVo026326 for ; Mon, 28 Jul 2008 09:34:14 +0100 Message-Id: <200807280834.m6S8YEVo026326@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: Getting source file and line number of a function. In-reply-to: <6cd6de210807261806r7ff184fdtcc7859cca0a98aef@mail.gmail.com> References: <6cd6de210807261806r7ff184fdtcc7859cca0a98aef@mail.gmail.com> Comments: In-reply-to "Rocky Bernstein" message dated "Sat, 26 Jul 2008 21:06:33 -0400." Date: Mon, 28 Jul 2008 09:34:14 +0100 From: Peter Stephenson X-OriginalArrivalTime: 28 Jul 2008 08:34:14.0702 (UTC) FILETIME=[B7A264E0:01C8F08C] X-Scanned-By: MailControl A-08-50-03 (www.mailcontrol.com) on 10.68.0.119 X-Virus-Scanned: ClamAV 0.92.1/7861/Mon Jul 28 09:07:56 2008 on bifrost X-Virus-Status: Clean "Rocky Bernstein" wrote: > I see that zsh has now has array variables functrace and > funcstack. Functrace stack gives a function name and a line offset > from the function. But for many things involving location reporting, > it would more be desirable to have a filename and absolute line > location. > > Alternatively, if there were a way to get the filename and line number > of the beginning of a given function, one can do some arithmetic to > get the absolute position. > > Is there currently a way to get this information. Should I try at > submitting a patch? It would be useful to have information referred to the autoload file, and I've wondered about how to do it, but I don't think it's trivial with the current way line numbers work. We would probably need to add an extra internal variable for file line numbers, and present another variable (or array, if in the funcstack style) to users to distinguish the two. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070