zsh-users
 help / color / mirror / code / Atom feed
* Methods of shadowing a builtin call
@ 2016-01-29 21:33 Sebastian Gniazdowski
  2016-01-29 22:20 ` Sebastian Gniazdowski
  2016-01-29 23:09 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Sebastian Gniazdowski @ 2016-01-29 21:33 UTC (permalink / raw)
  To: Zsh Users

Hello,
I shadow setopt to gather data of what is being done in sourced
script. I currently use alias setopt=--setopt-shadow and then source a
script. This works fine except for z-sy-h. For that project, when I
source it with the alias being in place, interiors of it then still
use the shadowing function during their later operations. How to
suppress this? Self-insert is in some way catched by z-sy-h, and each
keypress invokes my shadowing function.

When I change:
    alias setopt=--shadow-setopt
to:
    setopt() { --shadow-setopt "$@" }

then Zsh segfaults. I'm not sure if on OS X gdb gives meaningful
output, but this is the backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00000001000184e4 in execrestore ()
(gdb) bt
#0  0x00000001000184e4 in execrestore ()
#1  0x00000001000135c4 in execlist ()
#2  0x0000000100012c27 in execlist ()
#3  0x0000000100012818 in execode ()
#4  0x0000000100016be2 in runshfunc ()
#5  0x0000000100016540 in doshfunc ()
#6  0x0000000100017ca6 in execrestore ()
#7  0x000000010001c031 in execrestore ()
#8  0x00000001000135c4 in execlist ()
#9  0x0000000100012d84 in execlist ()
#10 0x000000010003efae in execif ()
...

How to explain the segfault?

Is there any third method of attaching to setopt?

Best regards,
Sebastian Gniazdowski


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-30 20:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-29 21:33 Methods of shadowing a builtin call Sebastian Gniazdowski
2016-01-29 22:20 ` Sebastian Gniazdowski
2016-01-29 23:09 ` Bart Schaefer
2016-01-30  9:31   ` Sebastian Gniazdowski
2016-01-30 20:48     ` Bart Schaefer

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).