From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27814 invoked from network); 12 Nov 2022 22:16:55 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Nov 2022 22:16:55 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668291415; b=THC1kvZEYW5BYYoODQgvhMu4xahF/El7x1Fy9he/F9po/gIpnDDI1rqDSbbOY6wDm+tYlZNkXR Rqlc2b6eIMBeYskksAcf51RC8312DxU8HTf5e8m+G4t1mh6YEpcJnPNMIrWfP8uhwZsexraby1 vppgXKVxlioVatJ69O9h3u7PQU0Q6gSEMpwv5MH258B1zTkFe/ziTPxz1qfTCoONpeOi4xi2/U fkZoZnQ1Hu3pyBu8+U/vw5u2w9Bs7tQBmxRSz3fdHBWYidFLUuy9695Tmf94kS+A4knaDyccPd ODBRb68+w/05Bxu1RKrWxTVy9l4Ksoe5ks1R5l7cW/rX5g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vs1-f50.google.com) smtp.remote-ip=209.85.217.50; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1668291415; bh=e+B2bfxAMgK3A7HzsLolAsEvddP6ySfrQS4IQ5KnDxQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=Oh54jeUbjzgfLSXt4E68/mvCD7FhutEyMrodh1XU1djsmmU/0i8xduEOrMOKH8qzkQYJf6heSz ffQpDTkBs1nu+2+xz8ltfLFaL9MA3/PYZdPGgdfGc5kTTM7bVQqRS+ejAiFwTP4aAei1uVlpVw XXO6i2W3svzscaxYkTp+driVyW+KNRWaQ6GBRabe6NT2Mpvs4GRQFYkkVpz/GEUL6tv5ZdF8iK Zy8BHGn0RmuhWhFc0iJsjC/cUMGiBgG+ysLgkuqv3vGBxxQs+J8oxdfk9Iz2UNK2tYxylyQcUq ZBsK0bZ2h/VdeMG2SxMRDTe7c73Z7APLV9aXxZmidPLJHg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=SVq4zAk6I4MoVtFI9muhC3B8CpDGoUeL3r+z2bqifHI=; b=ko5V4SFXXDlyu4zG8P04iGwxkm YyW/eV5nvGE57l6X8deIrLXt8O7+Nlmf/zEUzqDUKJGgabI6mLh1z/qLuwEKHVxDw68P3Lt6Wut4u hWZl2EXCAytPCkdiDjtIna5P2Mf32AEoV3oVsk+Bha3aOoqB6qLzT12VLmjO1CtfGMW+KCC5MVQGq j9OECq71L9qH49/ybaolhjU6hjx5JjGRWVk/EGLMCrL8UqvyfQWO/dw4Te6r55KMoPR5EqnChmvsB aYzjdkXOiJWoikU8mdo6LMbFEpHuQaPJ9A2v4nmzp5Xg+Q/jnJ0hehf3WRI/yhC0cABOJTEUuFrK+ gK5knTHg==; Received: by zero.zsh.org with local id 1otyo1-0004Oc-FI; Sat, 12 Nov 2022 22:16:53 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vs1-f50.google.com) smtp.remote-ip=209.85.217.50; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-vs1-f50.google.com ([209.85.217.50]:40518) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1otynO-00041V-VC; Sat, 12 Nov 2022 22:16:16 +0000 Received: by mail-vs1-f50.google.com with SMTP id q127so8223424vsa.7 for ; Sat, 12 Nov 2022 14:16:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=SVq4zAk6I4MoVtFI9muhC3B8CpDGoUeL3r+z2bqifHI=; b=Q0hPcddLj7u+g88h/53PlfkzGhe9Yu9AXn982n9D1Ol8ifvwaGprtbF+ZTcpoJ4uBf tEdrzr3hXlAYvK62qJVnG7eM/ohKhrWGQIvExG142WI7nXW0Ba/q8p/zLIHFSPVv4his tYS8sBdpxP6wswSHVHh9ftSB1tC6pYG7Noi6dgCgmkrmg8qs5WSAFqEkjggM01Sx1Jhw uu5lvpWsCYYDu1Uqjx06zqSanAdoO8yr8Q26ymze8kcNicOVDDVSvuyMDxfH5P3OGN3a rN11lxUDtwwzWDi1pa4CFH+/U1ebHF6nbgGDGPYLSDU2H/5SqDbmFSL7YzCRKf/xOXiH 50Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=SVq4zAk6I4MoVtFI9muhC3B8CpDGoUeL3r+z2bqifHI=; b=dLumTPglvDN5MKejitp5vdntFfPBmzdLG5TKZobI25XkbIbXbTf8PP9JvIW6PiMdsq ZSE8RJsgEcEJ83chqlDp1bgcvHoUGT6yVpNQmPSW50ni4k4tSXW0hubd/8T9td0cDWxl omTsQ5fDfw4uGXFSq3K1OOD1iyMW9M83hxtPfRgTDQN0y8IzR1JePG8Bxyv74rOdp5Jt FNe6Xr9XI2FW81P3ESGWlu1rACbgn0qMiq77qprZ5gFShlWcfPygNORiyNlw60/41bRj y3/LsKSP8lAFyuWaV3JMc7jKIThPgD5C39psleS5ne/jRr6xF9CylMZfJ46/0ipnorqv RPDw== X-Gm-Message-State: ANoB5pnz02qf8ANQt1bKk4jS0cS7D5nm0HWsYiC8ioUzWf5eZAcObBNr Ckk3s3TiQWARDi+oBW3bPId3UiD/RZpvi7Ql2aP1U3Sz4W4= X-Google-Smtp-Source: AA0mqf7gD47t3FcVc7yilQnA+qsO2kwRf5L0g47NfRpu02DBv2OcpwMfOmr9bnaFvxXMLu9OhqfjB9uKSKuBpI0w6H0= X-Received: by 2002:a05:6102:e0b:b0:3af:2ddf:32a1 with SMTP id o11-20020a0561020e0b00b003af2ddf32a1mr1177905vst.81.1668291373131; Sat, 12 Nov 2022 14:16:13 -0800 (PST) MIME-Version: 1.0 From: Philippe Altherr Date: Sat, 12 Nov 2022 23:16:02 +0100 Message-ID: Subject: Documentation and tools to understand and debug the Zsh codebase To: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="000000000000ad699805ed4d5af7" X-Seq: 50943 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000ad699805ed4d5af7 Content-Type: text/plain; charset="UTF-8" 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 --000000000000ad699805ed4d5af7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi everyone,

About a year ago, a friend= of mine finally convinced me to look into Zsh. I quickly became a big=C2= =A0fan. All the little extra features and behavior tweaks add up and make i= t in my opinion a much better shell than Bash, which I was using until then= . Nevertheless, I still stumbled=C2=A0on a few bugs and shortcomings. Since= I have some free time on my hands, I figured=C2=A0that I could maybe one d= ay help address some of these. Last week, I finally took the plunge and sta= rted looking into the codebase to understand what was going on with ERR_EXI= T (see relat= ed thread).

So far, I have mainly studied exec.c= and loop.c, which seem to constitute=C2=A0the bulk of the evaluation= loop. I have also seen that=C2=A0zsh.h=C2=A0contains most of the importan= t data structures and I he found the description of word codes in=C2=A0parse.c, which=C2=A0was very helpful. I think that I = now have a relatively good overall understanding but I still lack many of t= he 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 una= ble to accurately=C2=A0translate a Zsh expression into a sequence of word c= odes.

Here are some of my most pressing questions:=
- Are there other=C2=A0files that I should read?
- Is = there a way to print the parsed word codes? Or to print them as they get ev= aluated?
- What tools do you use to debug zsh? Are there flags or= modules I should be aware of?
- How do you=C2=A0search the maili= ng list? I don't see a search box on=C2=A0www.zsh.org/mla/.
=C2=A0 - I somehow stumbled on=C2= =A0inbox.vuxu.org/zsh-worke= rs/, which has one. Is that the way to go?

Phi= lippe

--000000000000ad699805ed4d5af7--