|
From: Phillip B. <phi...@um...> - 2025-10-23 22:43:42
|
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 |