zsh-workers
 help / color / mirror / code / Atom feed
From: Philippe Altherr <philippe.altherr@gmail.com>
To: zsh-workers@zsh.org
Subject: Documentation and tools to understand and debug the Zsh codebase
Date: Sat, 12 Nov 2022 23:16:02 +0100	[thread overview]
Message-ID: <CAGdYcht9uiKSpmCYb44zoPciP+6k9MOVOF7Lep0Hi1+qAd7jCw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1911 bytes --]

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
<https://www.zsh.org/mla/workers/2022/msg01203.html>).

So far, I have mainly studied exec.c
<https://sourceforge.net/p/zsh/code/ci/master/tree/Src/exec.c> and loop.c
<https://sourceforge.net/p/zsh/code/ci/master/tree/Src/loop.c>, which seem
to constitute the bulk of the evaluation loop. I have also seen that zsh.h
<https://sourceforge.net/p/zsh/code/ci/master/tree/Src/zsh.h> contains most
of the important data structures and I he found the description of word
codes in parse.c
<https://sourceforge.net/p/zsh/code/ci/master/tree/Src/parse.c#l100>,
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

[-- Attachment #2: Type: text/html, Size: 2281 bytes --]

             reply	other threads:[~2022-11-12 22:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12 22:16 Philippe Altherr [this message]
2022-11-13  5:20 ` Daniel Shahaf
2022-11-17 18:07 ` Oliver Kiddle

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=CAGdYcht9uiKSpmCYb44zoPciP+6k9MOVOF7Lep0Hi1+qAd7jCw@mail.gmail.com \
    --to=philippe.altherr@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).