|
From: Phillip B. <phi...@um...> - 2025-10-25 01:28:12
|
Yes: % tclsh % puts $::env(DYLD_IMAGE_SUFFIX) _debug zsh seems mostly compatible with bash as far as I can tell. Phil On Fri, Oct 24, 2025 at 5:28 PM Kevin Walzer <kw...@co...> wrote: > The “export” syntax was for bash - is zsh compatible? > > On Oct 24, 2025, at 8:19 PM, Phillip Brooks <phi...@um...> wrote: > > > OK - I am finally getting somewhere. > > 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. > > I am setting it using: > > export DYLD_IMAGE_SUFFIX=_debug > > > in zsh, then building with: > > > make -f GNUmakefile distclean > > make -f GNUmakefile > > sudo make -f GNUmakefile install > > > Running lldb still won't show source code for Tcl_ParseVarName. > > > 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. > > > Any other thoughts on what to try? > > > > > > > On Thu, Oct 23, 2025 at 8:23 PM Brian Griffin <bri...@ea...> > wrote: > >> It sounds like the file was not compiled for debug. >> Try confirming that flags are all applied correctly. >> >> I’ve had no problems with lldb on mac, but it’s been awhile (couple >> years) since I last used it. >> >> -Brian >> (from mobile device) >> >> On Oct 23, 2025, at 17:10, Phillip Brooks <phi...@um...> wrote: >> >> >> Thanks Kevin, >> >> 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. >> >> I am hung up on these two questions: >> >> What configure and build options will give me source level debugging on a >> MacOS tclsh build? >> >> Where is the debug version of tclsh after I do that build? >> >> Do I need to do anything special to avoid MacOS security (I.e. signing >> things)? >> >> Phil >> >> >> >> On Thu, Oct 23, 2025 at 4:22 PM Kevin Walzer <kw...@co...> wrote: >> >>> Debugging a Tcl extension written in C using gdb >>> <https://wiki.tcl-lang.org/page/Debugging+a+Tcl+extension+written+in+C+using+gdb?R=0> >>> wiki.tcl-lang.org >>> <https://wiki.tcl-lang.org/page/Debugging+a+Tcl+extension+written+in+C+using+gdb?R=0> >>> <favicon.ico> >>> >>> <https://wiki.tcl-lang.org/page/Debugging+a+Tcl+extension+written+in+C+using+gdb?R=0> >>> <https://wiki.tcl-lang.org/page/Debugging+a+Tcl+extension+written+in+C+using+gdb?R=0> >>> >>> This is a guide to using gdb with Tcl. >>> >>> GDB and LLDB Command Examples >>> <https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-command-examples.html> >>> developer.apple.com >>> <https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-command-examples.html> >>> <apple-touch-icon-precomposed.png> >>> >>> <https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-command-examples.html> >>> <https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-command-examples.html> >>> >>> This is a gdb-lldb translation guide. >>> >>> On Oct 23, 2025, at 6:43 PM, Phillip Brooks <phi...@um...> wrote: >>> >>> >>> >>> Can anyone point me toward a guide to running lldb on a built Tcl >>> executable on MacOS 26 Arm64? I found: >>> >>> https://wiki.tcl-lang.org/page/Tcl+on+MacOS >>> >>> 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. >>> >>> 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? >>> >>> Here is a detailed runthrough of what I last tried: >>> >>> I used the make command: >>> >>> $ CONFIGURE_ARGS="--enable-symbols" make -f GNUmakefile >>> >>> inside of the macosx directory, then ran lldb: >>> >>> $ lldb ../../build/tcl/Development//usr/local/bin/Development/tclsh >>> >>> I ran that tclsh in another shell window and 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. >>> >>> Typed "b Tcl_ParseVarName" and successfully set the breakpoint. >>> >>> 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. >>> >>> 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. >>> >>> Phil >>> >>> _______________________________________________ >>> Tcl-mac mailing list >>> tc...@li... >>> https://lists.sourceforge.net/lists/listinfo/tcl-mac >>> >>> _______________________________________________ >> Tcl-mac mailing list >> tc...@li... >> https://lists.sourceforge.net/lists/listinfo/tcl-mac >> >> _______________________________________________ > Tcl-mac mailing list > tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac > > |