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

Documentation and tools to understand and debug the Zsh codebase



Hi everyone,

About a year ago, a friend of mine finally convinced me to look into Zsh. I quickly became a big fan. All the little extra features and behavior tweaks add up and make it in my opinion a much better shell than Bash, which I was using until then. Nevertheless, I still stumbled on a few bugs and shortcomings. Since I have some free time on my hands, I figured that I could maybe one day help address some of these. Last week, I finally took the plunge and started looking into the codebase to understand what was going on with ERR_EXIT (see related thread).

So far, I have mainly studied exec.c and loop.c, which seem to constitute the bulk of the evaluation loop. I have also seen that zsh.h contains most of the important data structures and I he found the description of word codes in parse.c, which was very helpful. I think that I now have a relatively good overall understanding but I still lack many of the details. While the role of the functions in loop.c is self-explanatory, it's less true for some of the functions in exec.c. I would also be unable to accurately translate a Zsh _expression_ into a sequence of word codes.

Here are some of my most pressing questions:
- Are there other files that I should read?
- Is there a way to print the parsed word codes? Or to print them as they get evaluated?
- What tools do you use to debug zsh? Are there flags or modules I should be aware of?
- How do you search the mailing list? I don't see a search box on www.zsh.org/mla/.
  - I somehow stumbled on inbox.vuxu.org/zsh-workers/, which has one. Is that the way to go?

Philippe



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