Lazarus 2.2.4 debug console ? lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- Espectr0 · 2022-10-24 13:38 Hello, How can I enable the debug window in terminal? I can't find the "ConsoleTty" option now :S Thanks! ---------------------------------------------------------------------- Martin_fr · 2022-10-24 16:17 Tools > Options > Debugger Backend Which debugger do you have selected? There is a DropDown in the toolbar on top of that page. (ON Apple MAC) It should read something like   ... LLDB + FpDebug .... If this is selected, the property grid should have some option "open console" (I am not sure of the exact name). It will open a new console. The old "tty" using an existing console, only worked with GDB. (If you have a working gdb, you can configure the IDE to use it by switching to the "gdbmi" debugger) ---------------------------------------------------------------------- Espectr0 · 2022-10-24 16:52 Thanks @Martin_fr, I use LLDB beta and the option is "LaunchNewTerminal" but in my case Lazarus remains "Debugging..." and I can't stop it or close it :S ---------------------------------------------------------------------- Martin_fr · 2022-10-24 17:47 The Terminal indeed stays open (it is launched by LLDB, and I am not aware of a way to close it). But the app that you are debugging should run normally and terminate. And the debugger should also go back to "not running". You can always force the debugger back, by using "Reset debugger" from the "Run" menu. But that is only meant as a last recovery. So when you say "remains debugging" => has your app finished? Has it gone from the "ps ax" list? IIRC (I can't test right now), when your app finishes, there will be some message saying so in that console window. Is there? You can open (best before you start the debugger)    View -> IDE internals > Debug output Then when the problem occurs, see if lldb produced some output that may give a hint. -- You can also start lazarus itself from a console/terminal, and see if it outputs anything of value to the issue. ---------------------------------------------------------------------- Martin_fr · 2022-10-24 17:51 Quote from: Espectr0 on October 24, 2022, 06:52:08 pmI use LLDB beta Just "lldb" or "lldb +fpdbebug" ? I think the "just lldb" is "alpha". (And also not installed by default) So I guess you use "lldb + FpDebug (beta)" (which is recommended) Sorry I don't have the exact names at hand. I usually don't work on Mac / Except when I must make changes to the Mac debugger. ---------------------------------------------------------------------- Espectr0 · 2022-10-24 18:23 Sorry for my English is bad and I use a translator. QuoteJust "lldb" or "lldb +fpdbebug" ?Yes, lldb +fpdbebug. For example, a new empty gui application, run to debug, it says "Debugging", after a while the terminal window appears and it stays there, the "form1" does not appear (in this case) and when I give it stop i can't stop it and i have to force restart the mac to reopen lazarus. Maybe is my system? Lazarus 2.2.4 and macOS Monterey 12.6. View -> IDE internals > Debug output: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i >> settings set -- frame-format "frame #${frame.index}: ${frame.pc}, {${frame.sp}}, {${frame.fp}} &&//FULL: {${line.file.fullpath}} &&//SHORT: {${line.file.basename}} &&//LINE: {${line.number}} &&//MOD: {${module.file.basename}} &&//FUNC: {${function.name-with-args}} <<&&//FRAME\n"(lldb) settings set -- frame-format "frame #${frame.index}: ${frame.pc}, {${frame.sp}}, {${frame.fp}} &&//FULL: {${line.file.fullpath}} &&//SHORT: {${line.file.basename}} &&//LINE: {${line.number}} &&//MOD: {${module.file.basename}} &&//FUNC: {${function.name-with-args}} <<&&//FRAME\n">> settings set -- thread- format "thread #${thread.index}: tid=${thread.id%tid}: ${frame.pc}, {${frame.sp}}, {${frame.fp}} &&//FULL: {${line.file.fullpath}} &&//SHORT: {${line.file.basename}} &&//LINE: {${line.number}} &&//MOD: {${module.file.basename}} &&//FUNC: {${function.name-with-args}} <<&&//FRAME{, stop reason = ${thread.stop-reason}}\n"(lldb) settings set -- thread-format "thread #${thread.index}: tid=${thread.id%tid}: ${frame.pc}, {${frame.sp}}, {${frame.fp}} &&//FULL: {${line.file.fullpath}} &&//SHORT: {${line.file.basename}} &&//LINE: {${line.number}} &&//MOD: {${module.file.basename}} &&//FUNC: {${function.name-with-args}} <<&&//FRAME{, stop reason = ${thread.stop-reason}}\n">> settings set -- thread-stop-format "thread #${thread.index}: tid=${thread.id%tid}: ${frame.pc}, {${frame.sp}}, {${frame.fp}} &&//FULL: {${line.file.fullpath}} &&//SHORT: {${line.file.basename}} &&//LINE: {${line.number}} &&//MOD: {${module.file.basename}} &&//FUNC: {${function.name-with-args}} <<&&//FRAME{, stop reason = ${thread.stop-reason}}\n"(lldb) settings set -- thread-stop-format "thread #${thread.index}: tid=${thread.id%tid}: ${frame.pc}, {${frame.sp}}, {${frame.fp}} &&//FULL: {${line.file.fullpath}} &&//SHORT: {${line.file.basename}} &&//LINE: {${line.number}} &&//MOD: {${module.file.basename}} &&//FUNC: {${function.name-with-args}} <<&&//FRAME{, stop reason = ${thread.stop-reason}}\n">> target stop-hook add -o "thread list"(lldb) target stop-hook add -o "thread list"Stop hook #1 added.>> settings set -- stop-line-count-after 0(lldb) settings set -- stop- line-count-after 0>> settings set -- stop-line-count-before 0(lldb) settings set -- stop-line-count-before 0>> settings set -- stop- disassembly-count 0(lldb) settings set -- stop-disassembly-count 0>> settings set -- target.env-vars "USER=uruworks"(lldb) settings set -- target.env-vars "USER=uruworks">> settings set -- target.env-vars "__CFBundleIdentifier=com.company.lazarus"(lldb) settings set -- target.env-vars "__CFBundleIdentifier=com.company.lazarus">> settings set -- target.env-vars "COMMAND_MODE=unix2003"(lldb) settings set -- target.env-vars "COMMAND_MODE=unix2003">> settings set -- target.env- vars "LOGNAME=uruworks"(lldb) settings set -- target.env-vars "LOGNAME=uruworks">> settings set -- target.env-vars "PATH=/usr/bin:/bin:/usr/sbin:/sbin"(lldb) settings set -- target.env- vars "PATH=/usr/bin:/bin:/usr/sbin:/sbin">> settings set -- target.env-vars "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.LitrOYSt Th/Listeners"(lldb) settings set -- target.env-vars "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.LitrOYStTh/Listeners">> settings set -- target.env-vars "SHELL=/bin/zsh"(lldb) settings set -- target.env-vars "SHELL=/bin/zsh">> settings set -- target.env-vars "HOME=/Users/uruworks"(lldb) settings set -- target.env-vars "HOME=/Users/uruworks">> settings set -- target.env-vars "__CF_USER_TEXT_ENCODING=0x1F5:0:86"(lldb) settings set -- target.env- vars "__CF_USER_TEXT_ENCODING=0x1F5:0:86">> settings set -- target.env-vars "TMPDIR=/var/folders/q1/9xvs061s5c511pt1wy40v69c0000gn/T/"(lldb) settings set -- target.env-vars "TMPDIR=/var/folders/q1/9xvs061s5c511pt1wy40v69c0000gn/T/">> settings set -- target.env-vars "XPC_SERVICE_NAME=application.com.company.lazar us.1636557.1639758"(lldb) settings set -- target.env-vars "XPC_SERVICE_NAME=application.com.company.lazarus.1636557.1639758">> settings set -- target.env-vars "XPC_FLAGS=0x0"(lldb) settings set -- target.env-vars "XPC_FLAGS=0x0">> target create /Users/uruworks/tmp/project1.app(lldb) target create /Users/uruworks/tmp/project1.appCurrent executable set to '/Users/uruworks/tmp/project1.app' (x86_64).>> settings clear target.run-args(lldb) settings clear target.run-args>> breakpoint set --func fpc_break_error -K false (lldb) breakpoint set --func fpc_break_error -K false Breakpoint 1: no locations (pending).>> breakpoint set --func fpc_runerror -K false WARNING:  Unable to resolve breakpoint to any actual locations.(lldb) breakpoint set --func fpc_runerror -K false Breakpoint 2: no locations (pending).>> breakpoint set --func fpc_raiseexception -K false WARNING:  Unable to resolve breakpoint to any actual locations.(lldb) breakpoint set --func fpc_raiseexception -K false Breakpoint 3: where = project1`FPC_RAISEEXCEPTION, address = 0x00000001000179f0>> breakpoint command add 3>> p/x $rdi>> p/x $rdx>> p ((char ***)$rdi)[0][3]>> p ((char **)$rdi)[1]>> DONE>> version(lldb) breakpoint command add 3(lldb) version>> breakpoint command add 2>> p/x $rdi>> DONE>> versionlldb-1400.0.30.3Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)(lldb) breakpoint command add 2(lldb) version>> breakpoint command add 1>> p/x $rdi>> DONE>> versionlldb-1400.0.30.3Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)(lldb) breakpoint command add 1(lldb) version>> process launch --ttylldb-1400.0.30.3Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)(lldb) process launch --tty  and after click stop: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i >> process kill but never stop. ---------------------------------------------------------------------- Martin_fr · 2022-10-24 18:56 ok, so lldb hangs. It never finishes launching. The tty option is documented as "does not work on all platforms". But it had previously appeared to work on Mac. It's currently the only option to get a terminal. If it doesn't work, then I have no idea.