From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16599 invoked from network); 18 Sep 2006 03:37:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.5 (2006-08-29) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Sep 2006 03:37:21 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 35822 invoked from network); 18 Sep 2006 03:37:15 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Sep 2006 03:37:15 -0000 Received: (qmail 28071 invoked by alias); 18 Sep 2006 03:37:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22734 Received: (qmail 28061 invoked from network); 18 Sep 2006 03:37:12 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Sep 2006 03:37:12 -0000 Received: (qmail 35371 invoked from network); 18 Sep 2006 03:37:12 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 18 Sep 2006 03:37:11 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id CF0AA70055; Sun, 17 Sep 2006 23:37:08 -0400 (EDT) Date: Sun, 17 Sep 2006 23:37:08 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: Re: PATCH: functrace [was Re: funcstack and backtraces] Message-ID: <20060918033708.GA6522@scowler.net> Mail-Followup-To: zsh-workers@sunsite.dk References: <20060901191034.GA31335@scowler.net> <060904142643.ZM9472@torch.brasslantern.com> <20060917191418.GA22898@scowler.net> <060917153954.ZM32752@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <060917153954.ZM32752@torch.brasslantern.com> User-Agent: Mutt/1.5.13 (2006-08-11) > } and that it should be filename:file_lineno in all cases. > > So for functions defined at the command line you're supposed to output > "stdin" and the number of input lines since the interpreter started? Well, I don't think the intended use has anything to do with interactive input. However, I'm happy to leave it the way it is but for the breakage. > In any event: > > schaefer<502> (foo() { print $functrace } ; foo ) > zsh: segmentation fault (core dumped) (; foo () { ... }; foo; ) % Src/zsh -f zsh: failed to load module: zsh/zle da% module_path=(Src/Modules Src/Zle) da% zmodload parameter da% (foo() { print $functrace } ; foo ) Src/zsh:3 da% > #24 0x0807a46a in zsh_main (argc=1, argv=0xbff08f94) > at ../../zsh-4.0/Src/init.c:1332 Operator precedence might be a good thing to pay attention to, though I don't know if it's your problem. Index: Src/Modules/parameter.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/parameter.c,v retrieving revision 1.38 diff -u -r1.38 parameter.c --- Src/Modules/parameter.c 17 Sep 2006 19:28:46 -0000 1.38 +++ Src/Modules/parameter.c 18 Sep 2006 03:35:58 -0000 @@ -568,7 +568,7 @@ for (f = funcstack, p = ret; f; f = f->prev, p++) { char *colonpair; - colonpair = zhalloc(strlen(f->caller) + f->lineno > 9999 ? 24 : 6); + colonpair = zhalloc(strlen(f->caller) + (f->lineno > 9999 ? 24 : 6)); sprintf(colonpair, "%s:%d", f->caller, f->lineno); *p = colonpair;