|
From: Kevin W. <kw...@co...> - 2025-10-24 00:38:51
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">See this wiki page for more info on using the GNU makefile:</div><div dir="ltr"><br></div><div dir="ltr"><div style="display: block;" class=""><div style="-webkit-user-select: all; -webkit-user-drag: element; display: inline-block;" class="apple-rich-link" draggable="true" role="link" data-url="https://wiki.tcl-lang.org/page/New+Tcl%2FTkAqua+FAQ"><a style="border-radius:10px;font-family:-apple-system, Helvetica, Arial, sans-serif;display:block;-webkit-user-select:none;width:300px;user-select:none;-webkit-user-modify:read-only;user-modify:read-only;overflow:hidden;text-decoration:none;" class="lp-rich-link" rel="nofollow" href="https://wiki.tcl-lang.org/page/New+Tcl%2FTkAqua+FAQ" dir="ltr" role="button" draggable="false" width="300"><table style="table-layout:fixed;border-collapse:collapse;width:300px;background-color:#A19F9C;font-family:-apple-system, Helvetica, Arial, sans-serif;" class="lp-rich-link-emailBaseTable" cellpadding="0" cellspacing="0" border="0" width="300"><tbody><tr><td vertical-align="center"><table bgcolor="#A19F9C" cellpadding="0" cellspacing="0" width="300" style="table-layout:fixed;font-family:-apple-system, Helvetica, Arial, sans-serif;background-color:rgba(161, 159, 156, 1);-apple-color-filter:initial;" class="lp-rich-link-captionBar"><tbody><tr><td style="padding:8px 0px 8px 0px;" class="lp-rich-link-captionBar-textStackItem"><div style="max-width:100%;margin:0px 16px 0px 16px;overflow:hidden;" class="lp-rich-link-captionBar-textStack"><div style="word-wrap:break-word;font-weight:500;font-size:12px;overflow:hidden;text-overflow:ellipsis;text-align:left;" class="lp-rich-link-captionBar-textStack-topCaption-leading"><a rel="nofollow" href="https://wiki.tcl-lang.org/page/New+Tcl%2FTkAqua+FAQ" style="text-decoration: none" draggable="false"><font color="#FFFFFF" style="color: rgba(255, 255, 255, 1);">New Tcl/TkAqua FAQ</font></a></div><div style="word-wrap:break-word;font-weight:400;font-size:11px;overflow:hidden;text-overflow:ellipsis;text-align:left;" class="lp-rich-link-captionBar-textStack-bottomCaption-leading"><a rel="nofollow" href="https://wiki.tcl-lang.org/page/New+Tcl%2FTkAqua+FAQ" style="text-decoration: none" draggable="false"><font color="#FFFFFF" style="color: rgba(235, 235, 245, 0.6);">wiki.tcl-lang.org</font></a></div></div></td><td style="padding:6px 12px 6px 0px;" class="lp-rich-link-captionBar-rightIconItem" width="30"><a rel="nofollow" href="https://wiki.tcl-lang.org/page/New+Tcl%2FTkAqua+FAQ" draggable="false"><img style="pointer-events:none !important;display:inline-block;width:30px;height:30px;border-radius:3px;" width="30" height="30" draggable="false" class="lp-rich-link-captionBar-rightIcon" alt="favicon.ico" src="cid:5348581C-B5F0-4473-82D4-0DD24E0EF0E2"></a></td></tr></tbody></table></td></tr></tbody></table></a></div></div><br></div><div dir="ltr">Some of it’s a bit dated, but the build sections are still solid. </div><div dir="ltr"><br><blockquote type="cite">On Oct 23, 2025, at 8:29 PM, Kevin Walzer <kw...@co...> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div dir="ltr"></div><div dir="ltr">The GNU makefile in the macosx directory builds both deploy and debug versions by default. To link to the debug build set this var in your shell:</div><div dir="ltr"><br></div><div dir="ltr"><pre class="mkup_pre" style="box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.428571; color: rgb(51, 51, 51); word-break: break-all; overflow-wrap: break-word; background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-radius: 4px; caret-color: rgb(51, 51, 51); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">export DYLD_IMAGE_SUFFIX=_debug</pre></div><div dir="ltr">Then run in the debugger. </div><div dir="ltr"><br><blockquote type="cite">On Oct 23, 2025, at 8:10 PM, Phillip Brooks <phi...@um...> 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 gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Oct 23, 2025 at 4:22 PM Kevin Walzer <<a href="mailto:kw...@co...">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" target="_blank" style="font-family:-apple-system,Helvetica,Arial,sans-serif"><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" target="_blank" style="font-family:-apple-system,Helvetica,Arial,sans-serif"><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>tc...@li...</span><br><span>https://lists.sourceforge.net/lists/listinfo/tcl-mac</span><br></div></blockquote><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> |