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

Re: Logging/debugging from within Src/Zle/compmatch.c

On Jun 8, 12:25pm, nicolas.canceill wrote:
} Following up on a discussion on zsh-users [1], I wish to try and debug
} the internals of Src/Zle/compmatch.c, but I am not a gdb guru so I
} prefer to log a bunch of stuff from within the C functions. Can anyone
} advise on the best way to do so? Do you think a simple syslog(3) will
} do?

Syslog would certainly do the job, but seems a bit of overkill unless
you're trying to collect logs from several zsh at once to see how they

I probably didn't understand your question properly before.  I think
what you want is to sprinkle some calls to dputs(ERRMSG(...)) around
the functions you're interested in.

If you do use syslog, using ERRMSG(...) will add helpful stuff like
the file name and line number.

For both dputs and ERRMSG you need to compile with DEBUG defined to the

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