Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: functrace [was Re: funcstack and backtraces]



On Sep 17,  3:14pm, Clint Adams wrote:
}
} This is buggy when either FUNCTIONARGZERO is unset, int is larger than
} 64-bits, or... I forget.

 ... lineno is greater than MAXINT?

} Furthermore, I am told that function_name:function_lineno is useless

Nonsense.

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

I'd say whoever is telling you this stuff is not thinking clearly.  In
several cases it's not even possible to know the filename.

In any event:

schaefer<502> (foo() { print $functrace } ; foo )
zsh: segmentation fault (core dumped)  (; foo () { ... }; foo; )

#0  0x001e3de6 in strcpy () from /lib/tls/libc.so.6
#1  0x080aa616 in dupstring (
    s=0xb7d96590 "Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:"...)
    at ../../zsh-4.0/Src/string.c:40
#2  0x080ac028 in strcatsub (d=0xbff08010, pb=0xb7d96578 "", pe=0xb7d96578 "", 
    src=0xb7d96590 "Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:"..., l=9, 
    s=0xb7d96582 "", glbsub=0, copied=0) at ../../zsh-4.0/Src/subst.c:564
#3  0x080b1857 in paramsubst (l=0xb7d96548, n=0xb7d96560, str=0xbff081a8, 
    qt=0, ssub=0) at ../../zsh-4.0/Src/subst.c:3154
#4  0x080ab18b in stringsubst (list=0xb7d96548, node=0xb7d96560, ssub=0, 
    asssub=0) at ../../zsh-4.0/Src/subst.c:156
#5  0x080aabdc in prefork (list=0xb7d96548, flags=0)
    at ../../zsh-4.0/Src/subst.c:91
#6  0x08063052 in execcmd (state=0xbff08650, input=0, output=0, how=18, 
    last1=2) at ../../zsh-4.0/Src/exec.c:1963
#7  0x080616ce in execpline2 (state=0xbff08650, pcode=67, how=18, input=0, 
    output=0, last1=0) at ../../zsh-4.0/Src/exec.c:1301
#8  0x08060bd2 in execpline (state=0xbff08650, slcode=4098, how=18, last1=0)
    at ../../zsh-4.0/Src/exec.c:1087
#9  0x08060576 in execlist (state=0xbff08650, dont_change_job=1, exiting=0)
    at ../../zsh-4.0/Src/exec.c:893
#10 0x08060285 in execode (p=0x8d82728, dont_change_job=1, exiting=0)
    at ../../zsh-4.0/Src/exec.c:793
#11 0x08067e3f in runshfunc (prog=0x8d82728, wrap=0x0, name=0xb7d96538 "foo")
    at ../../zsh-4.0/Src/exec.c:3915
#12 0x08067bea in doshfunc (name=0x8d78020 "foo", prog=0x8d82728, 
    doshargs=0xb7d96508, flags=0, noreturnval=0)
    at ../../zsh-4.0/Src/exec.c:3824
#13 0x08067511 in execshfunc (shf=0x8daf8e8, args=0xb7d96508)
    at ../../zsh-4.0/Src/exec.c:3612
#14 0x0806501d in execcmd (state=0xbff08e50, input=0, output=0, how=18, 
    last1=1) at ../../zsh-4.0/Src/exec.c:2583
#15 0x080616ce in execpline2 (state=0xbff08e50, pcode=195, how=18, input=0, 
    output=0, last1=1) at ../../zsh-4.0/Src/exec.c:1301
#16 0x08060bd2 in execpline (state=0xbff08e50, slcode=3074, how=18, last1=1)
    at ../../zsh-4.0/Src/exec.c:1087
#17 0x08060576 in execlist (state=0xbff08e50, dont_change_job=0, exiting=1)
    at ../../zsh-4.0/Src/exec.c:893
#18 0x080653e2 in execcmd (state=0xbff08e50, input=0, output=0, how=18, 
    last1=2) at ../../zsh-4.0/Src/exec.c:2666
#19 0x080616ce in execpline2 (state=0xbff08e50, pcode=195, how=18, input=0, 
    output=0, last1=0) at ../../zsh-4.0/Src/exec.c:1301
#20 0x08060bd2 in execpline (state=0xbff08e50, slcode=24578, how=18, last1=0)
    at ../../zsh-4.0/Src/exec.c:1087
#21 0x08060576 in execlist (state=0xbff08e50, dont_change_job=0, exiting=0)
    at ../../zsh-4.0/Src/exec.c:893
#22 0x08060285 in execode (p=0xb7d96420, dont_change_job=0, exiting=0)
    at ../../zsh-4.0/Src/exec.c:793
#23 0x08077866 in loop (toplevel=1, justonce=0) at ../../zsh-4.0/Src/init.c:167
#24 0x0807a46a in zsh_main (argc=1, argv=0xbff08f94)
    at ../../zsh-4.0/Src/init.c:1332
#25 0x0804c2ae in main (argc=1, argv=0xbff08f94) at ../../zsh-4.0/Src/main.c:93



Messages sorted by: Reverse Date, Date, Thread, Author