|
From: Kevin W. <kw...@co...> - 2025-10-25 00:28:19
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">The “export” syntax was for bash - is zsh compatible?</div><div dir="ltr"><br><blockquote type="cite">On Oct 24, 2025, at 8:19 PM, Phillip Brooks <phi...@um...> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">OK - I am finally getting somewhere.<div><br></div><div>The environment variable doesn't seem to do anything (is it misspelled? Google certainly turns up hits for it - or has this changed under MacOS 26?). I tried it both as a build time variable, and as a runtime variable when running lldb, but the non-debug library always seems to come in.</div><div><br></div><div>I am setting it using:</div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">export DYLD_IMAGE_SUFFIX=_debug</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">in zsh, </span><span style="font-family:arial,sans-serif">then building with:</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p> <p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">make -f GNUmakefile distclean</span></p> <p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">make -f GNUmakefile<span class="gmail-Apple-converted-space"> </span></span></p> <p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">sudo make -f GNUmakefile install</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;line-height:normal;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif">Running lldb still won't show source code for Tcl_ParseVarName.</font></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;line-height:normal;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><font face="arial, sans-serif">Getting rid of the deploy step, however, seems to have helped keep the debug library intact, so now, if I copy the Tcl_debug library to Tcl, and then run lldb, it works fine, and I see source code in Tcl_ParseVarName.</font></p><p style="margin:0px;line-height:normal;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><br></font></p><p style="margin:0px;line-height:normal;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><font face="arial, sans-serif">Any other thoughts on what to try?</font></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><br></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(0,0,0)"><br></p><div><br></div><div><br></div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Oct 23, 2025 at 8:23 PM Brian Griffin <<a href="mailto:bri...@ea...">bri...@ea...</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> <div dir="auto"> It sounds like the file was not compiled for debug. <div>Try confirming that flags are all applied correctly. </div> <div><br> </div> <div>I’ve had no problems with lldb on mac, but it’s been awhile (couple years) since I last used it. </div> <div><br id="m_-1992164646803059025lineBreakAtBeginningOfSignature"> <div dir="ltr">-Brian <div>(from mobile device)</div> </div> <div dir="ltr"><br> <blockquote type="cite">On Oct 23, 2025, at 17:10, Phillip Brooks <<a href="mailto:phi...@um..." target="_blank">phi...@um...</a>> wrote:<br> <br> </blockquote> </div> <blockquote type="cite"> <div dir="ltr"> <div dir="auto">Thanks Kevin,</div> <div dir="auto"><br> </div> <div dir="auto">I am pretty familiar with gdb and debugging Tcl in a Linux environment. The gdb-lldb guide will be useful, but that isn’t where I am hung up. </div> <div dir="auto"><br> </div> <div dir="auto">I am hung up on these two questions:</div> <div dir="auto"><br> </div> <div dir="auto">What configure and build options will give me source level debugging on a MacOS tclsh build?</div> <div dir="auto"><br> </div> <div dir="auto">Where is the debug version of tclsh after I do that build?</div> <div dir="auto"><br> </div> <div dir="auto">Do I need to do anything special to avoid MacOS security (I.e. signing things)?</div> <div dir="auto"><br> </div> <div dir="auto">Phil</div> <div dir="auto"><br> </div> <div dir="auto"><br> </div> <div><br> <div class="gmail_quote"> <div dir="ltr" class="gmail_attr">On Thu, Oct 23, 2025 at 4:22 PM Kevin Walzer <<a href="mailto:kw...@co..." target="_blank">kw...@co...</a>> wrote:<br> </div> <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"> <div dir="auto"> <div dir="ltr"></div> <div dir="ltr"> <div style="display:block"> <div style="display:inline-block" role="link"><a style="border-radius:10px;font-family:-apple-system,Helvetica,Arial,sans-serif;display:block;width:300px;overflow:hidden;text-decoration:none" rel="nofollow" href="https://wiki.tcl-lang.org/page/Debugging+a+Tcl+extension+written+in+C+using+gdb?R=0" dir="ltr" role="button" width="300" target="_blank"> <table style="table-layout:fixed;border-collapse:collapse;width:300px;font-family:-apple-system,Helvetica,Arial,sans-serif;background-color:rgb(161,159,156)" cellpadding="0" cellspacing="0" border="0" width="300"> <tbody style="font-family:-apple-system,Helvetica,Arial,sans-serif"> <tr style="font-family:-apple-system,Helvetica,Arial,sans-serif"> <td style="font-family:-apple-system,Helvetica,Arial,sans-serif"> <table bgcolor="#A19F9C" cellpadding="0" cellspacing="0" width="300" style="table-layout:fixed;font-family:-apple-system,Helvetica,Arial,sans-serif;background-color:rgb(161,159,156)"> <tbody style="font-family:-apple-system,Helvetica,Arial,sans-serif"> <tr style="font-family:-apple-system,Helvetica,Arial,sans-serif"> <td style="padding:8px 0px;font-family:-apple-system,Helvetica,Arial,sans-serif"> <div style="max-width:100%;margin:0px 16px;overflow:hidden;font-family:-apple-system,Helvetica,Arial,sans-serif"> <div style="font-weight:500;font-size:12px;overflow:hidden;text-overflow:ellipsis;text-align:left;font-family:-apple-system,Helvetica,Arial,sans-serif"> <a rel="nofollow" href="https://wiki.tcl-lang.org/page/Debugging+a+Tcl+extension+written+in+C+using+gdb?R=0" style="text-decoration:none;font-family:-apple-system,Helvetica,Arial,sans-serif" target="_blank"><font style="font-family:-apple-system,Helvetica,Arial,sans-serif;color:rgb(255,255,255)">Debugging a Tcl extension written in C using gdb</font></a></div> <div style="font-weight:400;font-size:11px;overflow:hidden;text-overflow:ellipsis;text-align:left;font-family:-apple-system,Helvetica,Arial,sans-serif"> <a rel="nofollow" href="https://wiki.tcl-lang.org/page/Debugging+a+Tcl+extension+written+in+C+using+gdb?R=0" style="text-decoration:none;font-family:-apple-system,Helvetica,Arial,sans-serif" target="_blank"><font style="font-family:-apple-system,Helvetica,Arial,sans-serif;color:rgb(255,255,255)">wiki.tcl-lang.org</font></a></div> </div> </td> <td style="padding:6px 12px 6px 0px;font-family:-apple-system,Helvetica,Arial,sans-serif" width="30"> <a rel="nofollow" href="https://wiki.tcl-lang.org/page/Debugging+a+Tcl+extension+written+in+C+using+gdb?R=0" style="font-family:-apple-system,Helvetica,Arial,sans-serif" target="_blank"> <div><favicon.ico></div> </a></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </a></div> </div> <br> </div> <div dir="ltr">This is a guide to using gdb with Tcl. </div> <div dir="ltr"><br> </div> <div dir="ltr"> <div style="display:block"> <div style="display:inline-block" role="link"><a style="border-radius:10px;font-family:-apple-system,Helvetica,Arial,sans-serif;display:block;width:300px;overflow:hidden;text-decoration:none" rel="nofollow" href="https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-command-examples.html" dir="ltr" role="button" width="300" target="_blank"> <table style="table-layout:fixed;border-collapse:collapse;width:300px;font-family:-apple-system,Helvetica,Arial,sans-serif;background-color:rgb(217,217,217)" cellpadding="0" cellspacing="0" border="0" width="300"> <tbody style="font-family:-apple-system,Helvetica,Arial,sans-serif"> <tr style="font-family:-apple-system,Helvetica,Arial,sans-serif"> <td style="font-family:-apple-system,Helvetica,Arial,sans-serif"> <table bgcolor="#D9D9D9" cellpadding="0" cellspacing="0" width="300" style="table-layout:fixed;font-family:-apple-system,Helvetica,Arial,sans-serif;background-color:rgb(217,217,217)"> <tbody style="font-family:-apple-system,Helvetica,Arial,sans-serif"> <tr style="font-family:-apple-system,Helvetica,Arial,sans-serif"> <td style="padding:8px 0px;font-family:-apple-system,Helvetica,Arial,sans-serif"> <div style="max-width:100%;margin:0px 16px;overflow:hidden;font-family:-apple-system,Helvetica,Arial,sans-serif"> <div style="font-weight:500;font-size:12px;overflow:hidden;text-overflow:ellipsis;text-align:left;font-family:-apple-system,Helvetica,Arial,sans-serif"> <a rel="nofollow" href="https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-command-examples.html" style="text-decoration:none;font-family:-apple-system,Helvetica,Arial,sans-serif" target="_blank"><font style="font-family:-apple-system,Helvetica,Arial,sans-serif;color:rgb(0,0,0)">GDB and LLDB Command Examples</font></a></div> <div style="font-weight:400;font-size:11px;overflow:hidden;text-overflow:ellipsis;text-align:left;font-family:-apple-system,Helvetica,Arial,sans-serif"> <a rel="nofollow" href="https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-command-examples.html" style="text-decoration:none;font-family:-apple-system,Helvetica,Arial,sans-serif" target="_blank"><font style="font-family:-apple-system,Helvetica,Arial,sans-serif;color:rgb(162,162,169)">developer.apple.com</font></a></div> </div> </td> <td style="padding:6px 12px 6px 0px;font-family:-apple-system,Helvetica,Arial,sans-serif" width="30"> <a rel="nofollow" href="https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-command-examples.html" style="font-family:-apple-system,Helvetica,Arial,sans-serif" target="_blank"> <div><apple-touch-icon-precomposed.png></div> </a></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </a></div> </div> <br> </div> <div dir="ltr">This is a gdb-lldb translation guide. </div> <div dir="ltr"><br> <blockquote type="cite">On Oct 23, 2025, at 6:43 PM, Phillip Brooks <<a href="mailto:phi...@um..." target="_blank">phi...@um...</a>> wrote:<br> <br> </blockquote> </div> <blockquote type="cite"> <div dir="ltr"></div> </blockquote> </div> <div dir="auto"> <blockquote type="cite"> <div dir="ltr"> <div dir="ltr"> <div dir="ltr"> <div dir="ltr">Can anyone point me toward a guide to running lldb on a built Tcl executable on MacOS 26 Arm64? I found: <div><br> </div> <div><a href="https://wiki.tcl-lang.org/page/Tcl+on+MacOS" target="_blank">https://wiki.tcl-lang.org/page/Tcl+on+MacOS</a><br> </div> <div><br> </div> <div>on the wiki, but it seems more interested in wish than in Tcl, and also in exercising the full MacOS App mechanism and running Wish.app. There isn't much there about running the debugger and even less about tclsh. I have successfully built tclsh, and can invoke it under lldb, set breakpoints, run etc. but I seem unable to get a debug version of the file that I am trying to look at (tclParse.c). I can see source code around the call to Tcl_Main, but not at lower levels of the stack. When I stop, say in Tcl_ParseVarName, I just see assembly code.</div> <div><br> </div> <div>Can you describe how to build, invoke lldb, set a breakpoint at Tcl_ParseVarName and then have the debugger show source code for Tcl_ParseVarName?</div> <div><br> </div> <div>Here is a detailed runthrough of what I last tried:</div> <div><br> </div> <div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;text-decoration-style:initial;text-decoration-color:initial"><font style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;color:rgb(0,0,0)">I used the make command: </font></span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;text-decoration-style:initial;text-decoration-color:initial"><font style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;color:rgb(0,0,0)"><br> </font></span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;text-decoration-style:initial;text-decoration-color:initial"><font style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;color:rgb(0,0,0)">$ CONFIGURE_ARGS="--enable-symbols" make -f GNUmakefile</font></span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;text-decoration-style:initial;text-decoration-color:initial"><font style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;color:rgb(0,0,0)"><br> </font></span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;text-decoration-style:initial;text-decoration-color:initial"><font style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;color:rgb(0,0,0)"> inside of the macosx directory, then ran lldb:</font></span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;text-decoration-style:initial;text-decoration-color:initial"><font style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;color:rgb(0,0,0)"><br> </font></span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;text-decoration-style:initial;text-decoration-color:initial"><font style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;color:rgb(0,0,0)">$ lldb ../../build/tcl/Development//usr/local/bin/Development/tclsh</font></span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;text-decoration-style:initial;text-decoration-color:initial"><font style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;color:rgb(0,0,0)"><br> </font></span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;text-decoration-style:initial;text-decoration-color:initial"><font style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;color:rgb(0,0,0)">I ran that tclsh in another shell window and </font></span><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;color:rgb(0,0,0)">I used the attach <pid> command to attach to my running tclsh (I want to be able to type into Tcl and debug from another window at the same time), though I get the same result when I just use the run command from inside lldb.</span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;color:rgb(0,0,0)"><br> </span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;color:rgb(0,0,0)">Typed "b Tcl_ParseVarName" and successfully set the breakpoint.</span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;color:rgb(0,0,0)"><br> </span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;color:rgb(0,0,0)">Typed continue, but when it stops in Tcl_ParseVarName, I see only assembly code, no source. If I type list, I see source code, but it is only for the call to Tcl_Main. I can't go down the stack without diving into assembly code. I am thinking that I have only partial debug code for some reason, but I don't know enough about how the MacOS build works to know what is where and how it got there. It seems that things are built a couple times by default.</span></div> </div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;color:rgb(0,0,0)"><br> </span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;color:rgb(0,0,0)">I am running on MacOS 26 - newly installed, and have never tried running a debugger on MacOS before (my previous experience is all on Linux). I am also trying to build something close to the tip of Tcl 9.1 - i.e. the main branch. I am a complete newbie concerning things like codesigning etc.</span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;color:rgb(0,0,0)"><br> </span></div> <div><span style="font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;color:rgb(0,0,0)">Phil</span></div> </div> </div> </div> </div> </blockquote> </div> <div dir="auto"> <blockquote type="cite"> <div dir="ltr"><span>_______________________________________________</span><br> <span>Tcl-mac mailing list</span><br> <span><a href="mailto:tc...@li..." target="_blank">tc...@li...</a></span><br> <span><a href="https://lists.sourceforge.net/lists/listinfo/tcl-mac" target="_blank">https://lists.sourceforge.net/lists/listinfo/tcl-mac</a></span><br> </div> </blockquote> </div> </blockquote> </div> </div> <span>_______________________________________________</span><br> <span>Tcl-mac mailing list</span><br> <span><a href="mailto:tc...@li..." target="_blank">tc...@li...</a></span><br> <span><a href="https://lists.sourceforge.net/lists/listinfo/tcl-mac" target="_blank">https://lists.sourceforge.net/lists/listinfo/tcl-mac</a></span><br> </div> </blockquote> </div> </div> </blockquote></div> <span>_______________________________________________</span><br><span>Tcl-mac mailing list</span><br><span>tc...@li...</span><br><span>https://lists.sourceforge.net/lists/listinfo/tcl-mac</span><br></div></blockquote></body></html> |