zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: functrace [was Re: funcstack and backtraces]
Date: Sun, 17 Sep 2006 23:37:08 -0400	[thread overview]
Message-ID: <20060918033708.GA6522@scowler.net> (raw)
In-Reply-To: <060917153954.ZM32752@torch.brasslantern.com>

> } 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;


  reply	other threads:[~2006-09-18  3:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-01 19:10 funcstack and backtraces Clint Adams
2006-09-04 21:26 ` Bart Schaefer
2006-09-04 23:15   ` Clint Adams
2006-09-17 19:14   ` PATCH: functrace [was Re: funcstack and backtraces] Clint Adams
2006-09-17 22:39     ` Bart Schaefer
2006-09-18  3:37       ` Clint Adams [this message]
2006-09-18  5:57         ` Bart Schaefer
2006-09-18 11:07           ` Clint Adams
2006-09-18 15:16             ` Bart Schaefer
2006-09-17 22:52     ` Bart Schaefer
2006-09-17 23:38       ` Clint Adams
2006-09-18  2:20         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060918033708.GA6522@scowler.net \
    --to=clint@zsh.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).