From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3774 invoked by alias); 11 Dec 2017 21:57:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42112 Received: (qmail 10828 invoked by uid 1010); 11 Dec 2017 21:57:18 -0000 X-Qmail-Scanner-Diagnostics: from mail-it0-f50.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.214.50):SA:0(-2.6/5.0):. Processed in 4.407337 secs); 11 Dec 2017 21:57:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=kRXOh/Bm1zJ2hmDmGLNCWC8NTjEAii9U0ZCKwBRerjQ=; b=LJL2FwCZl5ZrtDHk2r4O24OGYwuaPKOQUKlg6rFM7w4oFY2Bif56rrCCYzcRvPBlAk ReMDpUlNQYXmt1gLTtZ6qXZOKQ7b0W+jj7SapMwKTYvT0mHWJnb9YM5pcvVPLk4+TljR bqZuu8oSngvA8eOrDeHevg2jERTVvYw8HwKzw2ZhhOuamnOnOuHpI6cbCMcHeT457kqb JCqfIfnfNIwL1up7VMg/iRqML72o+KQdxkxhU0qr6e2WMgOhcffrsq7LAWEsD7NA/JVH 9jbYTuY+6B1z0dLh1DhchsK46gQUWQDK7hsObIj0V67KavU5iXOFL88S2Dy6+n89TvXR VSog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=kRXOh/Bm1zJ2hmDmGLNCWC8NTjEAii9U0ZCKwBRerjQ=; b=QxBonsF8Ux0nEX5n9jey3TGPAcSAgJatezm3dRoA3DUYh0K1gdeGrBNJakQSf4Poq3 uoa1aT7qb8q0vDEmRqKG378cnoSzDydggv48rHp81j8APHBoy1vUZuoo2juRVEVXGA9B Lq6+5L2lDuodBxzCl0UuTIm942Va2IWwoU2Sja3tJNo5EKz8sEOpnOfHEAkQK2IPpmav d4koYZ8j6lzL20AbEigC5rivOahtc9Yk5G1AZFD2Yl3njH5kzfLJAEf/oQlljc9pvqpZ SkgoFxSMOtGjkL09te9YNUeobHdyyyKkZyzD/0ScPtYWpIvttbvUant+VwWhZij5JbmS l3OA== X-Gm-Message-State: AKGB3mJHdg0neoT5hlaoM86MFpPUbVmdePUR4t0JMKLxa8HObHMCqmOR 8zzMnsenN6bGPSHORgwWAlgjqKG8HJo= X-Google-Smtp-Source: ACJfBouCkuKCtjRre2NCrMET33GR6UYJCxz89jyY9ZPn5egil7+w5llhyJCZbdw9aWXQdEmoOulzjg== X-Received: by 10.107.11.36 with SMTP id v36mr2519680ioi.13.1513029431336; Mon, 11 Dec 2017 13:57:11 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [BUG] Anonymous functions cause funcfiletrace to produce function-relative line numbers From: dana In-Reply-To: <20171211101238.410a91b1@pwslap01u.europe.root.pri> Date: Mon, 11 Dec 2017 15:57:06 -0600 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <26AB704C-51B8-49FE-87E2-3BCDE5F7DF42@dana.is> References: <20171211094116.48e29012@pwslap01u.europe.root.pri> <20171211101238.410a91b1@pwslap01u.europe.root.pri> To: Peter Stephenson X-Mailer: Apple Mail (2.3273) On 11 Dec 2017, at 04:12, Peter Stephenson = wrote: > Oops, try this instead. This one does not seem to have been entirely successful. The reason i encountered this is that i was playing with a 'panic' = function that prints a trace-back. Here's a test script that replicates the basic = 'stack' i had going before: panic() { print -rC2 -- $functrace $funcfiletrace exit 1 } puts() { panic } main() { () { puts } } main The output, after applying the patch: puts:1 tracetest.zsh:15 (anon):0 tracetest.zsh:9 main:1 tracetest.zsh:9 tracetest.zsh:11 tracetest.zsh:11 The line number for the (anon) call is correct now, but the one for the = puts call is wrong =E2=80=94 there aren't even 15 lines in the script. With my real-world code that line number seemed to be the sum of the = current function-relative number and the previous file-absolute number. That = isn't the case in this example, but maybe it had something to do with the fact = that my functions were all in separate files, unlike the ones here. Or it could = be a coincidence i guess. dana