Xcode Command Line Tools 15 Breaks lldb (macOS Ventura 13.6/Sonoma 14.0 ARM64) lazarus / 12-Debugger ---------------------------------------------------------------------- msintle · 2023-10-06 14:35 Has anyone else seen this? Might be worth mentioning the Messages window contains the following errors after a build, which starts happening only after Xcode Command Line Tools 15 are installed: Error: ld: warning: -multiply_defined is obsolete Error: -macosx_version_min has been renamed to -macos_version_min Error: ld: warning: ignoring duplicate libraries: '-lc' Error: ld: warning: no platform load command found in '/Users/c/Developer/miamp/lib/x86_64-darwin/miamp.or', assuming: macOS Debugging doesn't seem to work properly anymore and hangs, for example, the moment I display a secondary window. It happens only on one particular secondary window. The Lazarus IDE Debug Output window indicated an error of the sort <"\" is not a valid boolean>, after which my process was terminated automatically. Please note that there is no error with the code here, at least with code that I have written - it worked fine (and debugged fine) without this error immediately before my upgrade to Xcode Command Line Tools 15. Maybe the fact that I'm sharing the project between Lazarus 2.2.6 and Lazarus "3.9.9" installed by the latest FPCUPDELUXE trunk/Free Pascal 3.3.1 could have been an issue, but again, I had no problems debugging with that combination either before my upgrade to Xcode Command Line Tools 15. So anyways, the plot thickens. I went ahead and set a breakpoint in the function where the problematic secondary window is shown. Guess what, now lldb moves, but barely just inching along. After a few lines into the function, a spinning and stuttering beachball taking ages. I'll paste the entire Debug Output window, as the log may speak for itself? (please see attachment as the log is too big to paste here) Finally, the same crash happens on a line where I call TryStrToInt. No backslash conversion attempted into a boolean at all. Go figure? Can't be an LCL form streaming incompatibility issue either, can it? I also built gdb from Homebrew and signed and tried debugging with that. Fares even worse, doesn't even start the app at all. Just hangs where the attached log ends. (again please see the attachment) With gdb consuming 0% CPU and the app not showing at all in the Activity Monitor. ---------------------------------------------------------------------- Martin_fr · 2023-10-06 15:52 First of all, is your Computer intel based? Or at least: Is that code compiled for Intel 64bit (and maybe run in emulation)? Because it tries to access the register "RDI" (which is intel 64 bit) About "is not a valid boolean" Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i (lldb) process continueProcess 38234 resuming(lldb)    p/x $rdi(unsigned long) 0x000000010f4c3780(lldb)    p/x $rdx(unsigned long) 0x0000000305989850(lldb)    p ((char ***)$rdi)[0][3](char *) 0x000000010082de38 "\rEConvertError"(lldb)    p ((char **)$rdi)[1](char *) 0x0000000111246cd8 "\"\" is not a valid boolean."Process 38234 stopped* thread #1: tid=0x1fdf0f: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:  &&//SHORT:    &&//LINE:    &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME, stop reason = breakpoint 3.1...Process 38234 stopped* thread #1: tid=0x1fdf0f: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:    &&//SHORT:    &&//LINE:    &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME, stop reason = breakpoint 3.1        frame #0: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:    &&//SHORT:    &&//LINE:    &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAMETarget 0: (miamp) stopped. So your app raised an exception, LLDB correctly halts on the breakpoint (in FPC_RAISEEXCEPTION). The breakpoints has some commands to automatically execute. Those are to get the exception message, etc. Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i p ((char **)$rdi)[1]Should cast the RDI register to ppchar, deref it once, and get the exception message. Your exception is of class EConvertError, and has the message    "" is not a valid boolean. Up to this point everything is exactly as expected.... Though, what I haven't checked is if the syntax used by lldb is "as expected" => that is maybe some keyword changed, and the IDE does not recognise the output... So what happens at that point in the IDE? Since an exception was raised, It would be expected that the IDE displays a popup saying something about that exception, and offering to either "break" or "continue". Does it? ---------------------------------------------------------------------- Martin_fr · 2023-10-06 15:57 I think I can see what happens. lldb prints the result as Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i (lldb)    p ((char ***)$rdi)[0][3] But the IDE expects a "=" in that line. So lldb changed its output. ---------------------------------------------------------------------- Martin_fr · 2023-10-06 16:03 Please ASAP test the following patch Code: Diff  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i diff --git a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pasindex 44853e1dd6..462211109d 100644--- a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas+++ b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas@@ -1113,6 +1113,15 @@ function TLldbInstructionExpressionBase.ProcessInputFromDbg(const AData: String     if ParseStruct(found[2]) then       SetContentReceieved;   exit;+  end+  else+  // (char *) 0x0000000111246cd8 "\"\" is not a valid boolean."+  if StrMatches(AData, ['(', ') 0x', ' ', ''], found) then begin+    FRes := AData;+    FCurly := 0;+    if ParseStruct(found[2]) then+      SetContentReceieved;+    exit;   end; // error: use of undeclared identifier 'i' // (int) $0 = 133  Otherwise it could miss the deadline for RC2 ---------------------------------------------------------------------- msintle · 2023-10-07 07:52 Quote from: Martin_fr on October 06, 2023, 05:52:43 pmFirst of all, is your Computer intel based? Or at least: Is that code compiled for Intel 64bit (and maybe run in emulation)? Because it tries to access the register "RDI" (which is intel 64 bit) That is correct, running the Lazarus 2.2.6 Intel version installed from the official PKG/DMG downloads on Apple Silicon through emulation. Please note that I have never been able to get a recent FPCUPDELUXE based installation of Lazarus "3.9.9" for native Apple Silicon working with debugging, where recent is the last 6-9 months (although it may have worked at some point before that, if I vaguely remember correctly). Quote from: Martin_fr on October 06, 2023, 05:52:43 pmYour exception is of class EConvertError, and has the message    "" is not a valid boolean. As shocking as it is, that is entirely incorrect. The code I am stepping through has nothing to do with boolean conversions, as I already explained above. I do have one TryStrToInt call, which is designed to be safe to use with any value to begin with. Quote from: Martin_fr on October 06, 2023, 05:52:43 pmSince an exception was raised, It would be expected that the IDE displays a popup saying something about that exception, and offering to either "break" or "continue". Does it? That doesn't happen as you've already gathered, what happens instead is an infinitely spinning beachball and very brief breaks where the IDE seems momentarily responsive before going back to the beachball - and/or termination of the process being debugged and/or other inconsistencies. ---------------------------------------------------------------------- msintle · 2023-10-07 07:55 Quote from: Martin_fr on October 06, 2023, 06:03:03 pmPlease ASAP test the following patch Code: Diff  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i diff --git a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pasindex 44853e1dd6..462211109d 100644--- a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas+++ b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas@@ -1113,6 +1113,15 @@ function TLldbInstructionExpressionBase.ProcessInputFromDbg(const AData: String     if ParseStruct(found[2]) then       SetContentReceieved;   exit;+  end+  else+  // (char *) 0x0000000111246cd8 "\"\" is not a valid boolean."+  if StrMatches(AData, ['(', ') 0x', ' ', ''], found) then begin+    FRes := AData;+    FCurly := 0;+    if ParseStruct(found[2]) then+      SetContentReceieved;+    exit;   end; // error: use of undeclared identifier 'i' // (int) $0 = 133  Otherwise it could miss the deadline for RC2 Very happy to try this for you but not sure how to merge this patch into my existing 2.2.6 installation and rebuild Lazarus from there. I could try FPCUPDELUXE with trunk which is how I've obtained many LCL fixes, but with that, debugging has never worked to begin with. ---------------------------------------------------------------------- Martin_fr · 2023-10-07 09:04 I think there is a "patch.exe" in the fpc folder. Anyway here is the ready made file https://gitlab.com/martin_frb/lazarus/- /blob/f83f439f0db21c9d826eec4cc97487ad41be17a8/components/lazdebuggers /lazdebuggerlldb/lldbinstructions.pas there is a download button) or direct download https://gitlab.com/martin_frb/lazarus/- /raw/f83f439f0db21c9d826eec4cc97487ad41be17a8/components/lazdebuggers/ lazdebuggerlldb/lldbinstructions.pas?inline=false ---------------------------------------------------------------------- msintle · 2023-10-07 12:12 Quote from: Martin_fr on October 07, 2023, 11:04:37 amI think there is a "patch.exe" in the fpc folder. I can't run an EXE on a Mac, well I could but probably that's not what we want. Quote from: Martin_fr on October 07, 2023, 11:04:37 amAnyway here is the ready made file https://gitlab.com/martin_frb/lazarus/- /blob/f83f439f0db21c9d826eec4cc97487ad41be17a8/components/lazdebuggers /lazdebuggerlldb/lldbinstructions.pas there is a download button) or direct download https://gitlab.com/martin_frb/lazarus/- /raw/f83f439f0db21c9d826eec4cc97487ad41be17a8/components/lazdebuggers/ lazdebuggerlldb/lldbinstructions.pas?inline=false Thank you very much, Martin. Updating the file wouldn't be the issue but rebuilding Lazarus is - should I just reinstall any package to do that easily? Where on my Mac should I place the updated PAS file? I had much trouble manually patching earlier LCL fixes, so just making sure I'd be doing everything properly. ---------------------------------------------------------------------- Martin_fr · 2023-10-07 12:38 oh, I see. Unfortunately I am not a Mac user, so I don't know where the installer put the file. maybe sudo find / --name lldbinstructions.pas Or in Lazarus in the "Package" menu: "Open installed packag". Ther sholud be at least LazDebuggerFpLLDB, probably also LazDebuggerLLDB (without FP). LazDebuggerFpLLDB has LazDebuggerLLDB in its requirements. LazDebuggerLLDB  has the file, so you can open it in the IDE. But - you need to run as root, to be able to save it. - you can (and should) recompile the IDE as normal user (not root) ---------------------------------------------------------------------- msintle · 2023-10-07 13:10 Thank you very much Martin. I'm afraid the behavior has not changed. Here's the output: Code: Text  [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=c"(lldb) settings set -- target.env-vars "USER=c">> settings set -- target.env-vars "COMMAND_MODE=unix2003"(lldb) settings set -- target.env-vars "COMMAND_MODE=unix2003">> settings set -- target.env-vars "__CFBundleIdentifier=com.company.lazarus"(lldb) settings set -- target.env-vars "__CFBundleIdentifier=com.company.lazarus">> 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 "LOGNAME=c"(lldb) settings set -- target.env-vars "LOGNAME=c">> settings set -- target.env-vars "SSH_AUT H_SOCK=/private/tmp/com.apple.launchd.sZVsFwhhDI/Listeners"(lldb) settings set -- target.env-vars "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.sZVsFwhhDI/Listeners">> settings set -- target.env-vars "HOME=/Users/c"(lldb) settings set -- target.env-vars "HOME=/Users/c">> settings set -- target.env-vars "SHELL=/usr/local/bin/fish"(lldb) settings set -- target.env-vars "SHELL=/usr/local/bin/fish">> settings set -- target.env-vars "TMPDIR=/var/folders/98/_nkjn6yd2mqf6_07pcq0qrx80000gn/T/"(lldb) settings set -- target.env-vars "TMPDIR=/var/folders/98/_nkjn6yd2mqf6_07pcq0qrx80000gn/T/">> settings set -- target.env-vars "__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0"(lldb) settings set -- target.env-vars "__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0">> settings set -- target.env- vars "XPC_SERVICE_NAME=application.com.company.lazarus.890002.3328763" (lldb) settings set -- target.env-vars "XPC_SERVICE_NAME=application.com.company.lazarus.890002.3328763">> settings set -- target.env-vars "XPC_FLAGS=0x0"(lldb) settings set -- target.env-vars "XPC_FLAGS=0x0">> target create /Users/c/Developer/miamp/miamp.app(lldb) target create /Users/c/Developer/miamp/miamp.appCurrent executable set to '/Users/c/Developer/miamp/miamp.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 = miamp`FPC_RAISEEXCEPTION, address = 0x0000000100017010>> 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-1500.0.22.8Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)(lldb) breakpoint command add 2(lldb) version>> breakpoint command add 1>> p/x $rdi>> DONE>> versionlldb-1500.0.22.8Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)(lldb) breakpoint command add 1(lldb) version>> breakpoint set --file process.inc --line 244lldb-1500.0.22.8Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)(lldb) breakpoint set --file process.inc --line 244Breakpoint 4: no locations (pending).>> breakpoint set --file moptions.pas --line 398WARNING:  Unable to resolve breakpoint to any actual locations.(lldb) breakpoint set --file moptions.pas --line 398Breakpoint 5: where = miamp`FORMSHOW + 152 at moptions.pas:398:3, address = 0x00000001000e6498>> process launch -n(lldb) process launch -nProcess 51372 launched: '/Users/c/Developer/miamp/miamp.app/Contents/MacOS/miamp' (x86_64)(lldb)  p/x $rdi(unsigned long) 0x000000010f4e37c0(lldb)  p/x $rdx(unsigned long) 0x0000000305989850(lldb)  p ((char ***)$rdi)[0][3](char *) 0x000000010082de38 "\rEConvertError"(lldb)  p ((char **)$rdi)[1](char *) 0x000000010ff8bcd8 "\"\" is not a valid boolean."Process 51372 stopped* thread #1: tid=0x27f36f: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME, stop reason = breakpoint 3.1  thread #2: tid=0x27f39f: 0x00007ff809563152, 0x0000000305a0fb18, 0x0000000305a0fb40 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #3: tid=0x27f3a0: 0x00007ff809563152, 0x0000000305a97b28, 0x0000000305a97b50 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #4: tid=0x27f3a1: 0x00007ff809563152, 0x0000000305b1ffa8, 0x0000000305b1ffd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #5: tid=0x27f3e9: 0x00007ff809563152, 0x0000000305ba7b28, 0x0000000305ba7b50 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #6: tid=0x27f3ea: 0x00007ff809561a2e, 0x0000000305c29f58, 0x0000000305c29fc0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: mach_msg2_trap <<&&//FRAME  thread #7: tid=0x27f3ed: 0x00007ff809563152, 0x0000000305cb3b18, 0x0000000305cb3b40 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAMEProcess 51372 stopped* thread #1: tid=0x27f36f: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME, stop reason = breakpoint 3.1    frame #0: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAMETarget 0: (miamp) stopped.>> process kill(lldb) process killProcess 51372 exited with status = 9 (0x00000009) killed>> process kill>> quit  After "Target 0: (miamp) stopped.", I killed the process manually in Lazarus. Here's what I did: - Downloaded the pre-patched file - find / -name "lldbinstructions.pas" 2> /dev/null - Update the file in /Applications/Lazarus/components/lazdebuggers/laz debuggerlldb/lldbinstructions.pas - Tools | Build Lazarus with Profile: Normal IDE - Clean & Build my app and show the problematic window ---------------------------------------------------------------------- Martin_fr · 2023-10-07 13:51 OK, then I need to look into other options. Probably update lldb on my linux system. Hoping it is not a Mac only issue ... ---------------------------------------------------------------------- Martin_fr · 2023-10-07 22:29 Did you start lazarus using "startlazarus" ? Because when you rebuild (as non root) you get a shadow exe. And only startlazarus runs that. Trying to get a new lldb and keeping the old one, and on an older distro... no luck. Yet another VM needed. Until then, maybe you can run some tests. I added some code for debug output. https://gitlab.com/martin_frb/lazarus/- /commit/c0bb1f6c8538e6d1ac7c2df926f0676f0c0ce628 This will do 2 things: - get more info on what happens - verify your IDE runs the modified code. To get the output you need to install the package IdeLazLogger. THen (after restart), in the Tools menu there is "Logging" which opens a window. - On top of the window you can enter the path to a logfile - you can also check the boxes starting with DBG confirm with OK You should then get a logfile... ---------------------------------------------------------------------- msintle · 2023-10-09 09:42 Yes, startlazarus is what must be used once any package is installed anyways, right? Or the packages won't show. Note: Pressing space on a selected item in the Logging window instantly killed Lazarus for me (was just trying to use the keyboard for enabling the DBG options - I also added the FPCDBG's to be sure). Anyways, the results are attached - both at the place where the debug freeze occurs, and after when I've killed the debug session via the in-IDE button. I hope this is helpful. And than you very much once again, Martin. ---------------------------------------------------------------------- Martin_fr · 2023-10-09 11:05 Ok, so various news (afraid most of them bad). I tried to reproduce by using lldb on Linux. I ended up with lldb 16, while you have lldb 15. But on Linux (Fedora) lldb does not have the new output syntax. So I can't test myself. One of the other team members is able to reproduce the issue on his Mac. And from the feedback he provided there are multiple issues. I had only focused on what happens once the debugger hits 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 raise Exception.Create('foo bar');So my patch (and my failed attempts on Linux) were only to target this particular issue. Apparently there are more issues, various warnings on startup. Focus issues (not able to bring windows to front) .... Those may need to be fixed in the actual app (probably by an update to FPC, as I understand it, but then: I am not the Mac expert....) So about the issues If you can provide feedback for 2 and 3 that might be helpful. 1 * Focus / unable to bring debugged window to front => probably an issue outside the debugger... 2 * Not sure if there are any "pop up messages/warnings" by the IDE/debugger when you start your app in the debugger. If so, Details are needed to assess if they can be dealed with. 3 * Debugger hangs when an exception is hit. "hangs" means, that the debugged app does no longer run (it is like it is paused) but the IDE does not show that, and the IDE can not stop it either. None of the stop/pause/step/run buttons seems to do anything. (Hint the "reset debugger" in the "run" menu, should get you out of it) That last bit was what I tried to fix. For testing, create a new app, add a button, and in the on button click add 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 raise Exception.Create('foo bar'); Without the patch: My understanding (ignoring all other issues) is that when you click the button, nothing will happen. Your app is no longer reacting, and the debugger does not show anything, and "hangs". Have I got that bit right? Then with the patch: I was hoping the exception dialog (see image) would pop up. But apparently not.... Though the log file shows that with the patch, the IDE has read some more data (stackframes) from lldb. Which means internally the patch has worked. If there was no "exception dialog" then there are subsequent errors.... ---------------------------------------------------------------------- giuliano411 · 2023-10-09 18:42 I've met the same issues reported, i.e. errors and warnings when building, weird behavior of debugger, focus lost when debugging, etc. In order to have a better understanding I downgraded Xcode to 14.3 to verify if some issue was already present, and then reinstalled Xcode 15. All the issues have disappeared. No more errors and warnings on build, no more weird behavior of debugger and focus lost. My suggestion is to reinstall Xcode 15 from scratch. Or, if that fails, to downgrade to 14.3 and then upgrade to 15. ---------------------------------------------------------------------- msintle · 2023-10-10 07:35 Quote from: giuliano411 on October 09, 2023, 08:42:56 pmI've met the same issues reported, i.e. errors and warnings when building, weird behavior of debugger, focus lost when debugging, etc. In order to have a better understanding I downgraded Xcode to 14.3 to verify if some issue was already present, and then reinstalled Xcode 15. All the issues have disappeared. No more errors and warnings on build, no more weird behavior of debugger and focus lost. My suggestion is to reinstall Xcode 15 from scratch. Or, if that fails, to downgrade to 14.3 and then upgrade to 15. The problem for me stemmed from upgrading to Xcode Command Line Tools 15, without any prior involvement/installation of Xcode the full IDE itself. I suspect you still are on an older version of Xcode Command Line Tools and when it gets upgraded somehow you'll be hitting a brick wall again. ---------------------------------------------------------------------- msintle · 2023-10-10 07:48 @Martin_fr: Thank you very much for your continuing investigation. 1. This has happened with GDB I believe when I try to launch my product while debugging it. Out of scope for what we are trying to achieve here, surely - but just so you know, my main window never shows with GDB at all. I was just looking at GDB to work around LLDB issues after my upgrade to Xcode Command Line Tools 15. 2. None. 3. The Stop button in the IDE works. But thanks for the Reset Debugger trick which might come handy in the future. Other than the Stop button, the IDE is unusable and in a constantly spinning beachball state. The above reports are from memory running the main product. I shall repeat the tests with your minimized single-exception test case at my first opportunity. ---------------------------------------------------------------------- msintle · 2023-10-10 07:50 @Martin_fr: Would you like remote access to a Mac VM, which might surely aid speed up troubleshooting the issues? I could just install Lazarus and Xcode Command Line Tools 15 on a latest clean instance of macOS Sonoma and give you remote access via TeamViewer. ---------------------------------------------------------------------- msintle · 2023-10-10 08:30 Hi again, Martin! Here is the attached result on the latest patched Lazarus IDE with your minimum testing project. The debug output is as follows: Code: Text  [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=c"(lldb) settings set -- target.env-vars "USER=c">> settings set -- target.env-vars "COMMAND_MODE=unix2003"(lldb) settings set -- target.env-vars "COMMAND_MODE=unix2003">> settings set -- target.env-vars "__CFBundleIdentifier=com.company.lazarus"(lldb) settings set -- target.env-vars "__CFBundleIdentifier=com.company.lazarus">> 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 "LOGNAME=c"(lldb) settings set -- target.env-vars "LOGNAME=c">> settings set -- target.env-vars "SSH_AUT H_SOCK=/private/tmp/com.apple.launchd.j4uTBdQSC2/Listeners"(lldb) settings set -- target.env-vars "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.j4uTBdQSC2/Listeners">> settings set -- target.env-vars "HOME=/Users/c"(lldb) settings set -- target.env-vars "HOME=/Users/c">> settings set -- target.env-vars "SHELL=/usr/local/bin/fish"(lldb) settings set -- target.env-vars "SHELL=/usr/local/bin/fish">> settings set -- target.env-vars "TMPDIR=/var/folders/83/twjyhw09433804gtwys_4xsc0000gn/T/"(lldb) settings set -- target.env-vars "TMPDIR=/var/folders/83/twjyhw09433804gtwys_4xsc0000gn/T/">> settings set -- target.env-vars "__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0"(lldb) settings set -- target.env-vars "__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0">> settings set -- target.env- vars "XPC_SERVICE_NAME=application.com.company.lazarus.3669474.5112286 "(lldb) settings set -- target.env-vars "XPC_SERVICE_NAME=application.com.company.lazarus.3669474.5112286">> settings set -- target.env-vars "XPC_FLAGS=0x0"(lldb) settings set -- target.env-vars "XPC_FLAGS=0x0">> target create /Users/c/tmp/project1.app(lldb) target create /Users/c/tmp/project1.appCurrent executable set to '/Users/c/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 = 0x0000000100018b70>> 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-1500.0.22.8Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)(lldb) breakpoint command add 2(lldb) version>> breakpoint command add 1>> p/x $rdi>> DONE>> versionlldb-1500.0.22.8Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)(lldb) breakpoint command add 1(lldb) version>> process launch -nlldb-1500.0.22.8Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)(lldb) process launch -nProcess 3255 launched: '/Users/c/tmp/project1.app/Contents/MacOS/project1' (x86_64)(lldb)  p/x $rdi(unsigned long) 0x0000000100d5e580(lldb)  p/x $rdx(unsigned long) 0x00007ff7bfefe660(lldb)  p ((char ***)$rdi)[0][3](char *) 0x00000001003c96a0 "\tException"(lldb)  p ((char **)$rdi)[1](char *) 0x00000001003440f0 "foo bar"Process 3255 stopped* thread #1: tid=0x730ea: 0x0000000100018b70, 0x00007ff7bfefe648, 0x00007ff7bfefe660 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: project1 &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME, stop reason = breakpoint 3.1  thread #2: tid=0x731c4: 0x00007ff80f512152, 0x0000700007beffa8, 0x0000700007beffd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #3: tid=0x731c5: 0x00007ff80f512152, 0x0000700007c72fa8, 0x0000700007c72fd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #4: tid=0x731c8: 0x00007ff80f512152, 0x0000700007cf5fa8, 0x0000700007cf5fd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #5: tid=0x731ca: 0x00007ff80f512152, 0x0000700007d78fa8, 0x0000700007d78fd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #6: tid=0x73228: 0x00007ff80f512152, 0x0000700007dfbfa8, 0x0000700007dfbfd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #7: tid=0x73229: 0x00007ff80f510a2e, 0x0000700007e7df58, 0x0000700007e7dfc0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: mach_msg2_trap <<&&//FRAME  thread #8: tid=0x7322a: 0x00007ff80f512152, 0x0000700007f01fa8, 0x0000700007f01fd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #9: tid=0x7322b: 0x00007ff80f512152, 0x0000700007f84fa8, 0x0000700007f84fd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #10: tid=0x73234: 0x00007ff80f512152, 0x0000700008007fa8, 0x0000700008007fd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #11: tid=0x73235: 0x00007ff80f512152, 0x000070000808afa8, 0x000070000808afd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #12: tid=0x73236: 0x00007ff80f512152, 0x000070000810dfa8, 0x000070000810dfd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #13: tid=0x73237: 0x00007ff80f512152, 0x0000700008190fa8, 0x0000700008190fd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #14: tid=0x73238: 0x00007ff80f512152, 0x0000700008213b18, 0x0000700008213b40 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #15: tid=0x73239: 0x00007ff80f512152, 0x0000700008296fa8, 0x0000700008296fd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #16: tid=0x7323a: 0x00007ff80f512152, 0x0000700008319fa8, 0x0000700008319fd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME  thread #17: tid=0x7323b: 0x0000000000000000, 0x0000000000000000, 0x0000000000000000 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD:  &&//FUNC:  <<&&//FRAMEProcess 3255 stopped* thread #1: tid=0x730ea: 0x0000000100018b70, 0x00007ff7bfefe648, 0x00007ff7bfefe660 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: project1 &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME, stop reason = breakpoint 3.1    frame #0: 0x0000000100018b70, 0x00007ff7bfefe648, 0x00007ff7bfefe660 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: project1 &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAMETarget 0: (project1) stopped. The app is currently in "hung and invisible" state after the exception is shown and continue is clicked. Clicking the big red square button stops it normally, without needing to reset the debugger. So almost the same as what I see in my own app, except for the attached dialog that is shown (but which doesn't change any behavior, or contain any useful information). Trying to run the app again, and hitting break when the exception is shown instead of continue: 1. I see the assembler window, and again the very same break/continue window is on-screen. 2. Hitting break again here (so twice in succession) the window goes away and the IDE does not stop anywhere in particular. 3. I click the big green rectangular run button; which is when I actually get the expected application exception handler dialog: "foo bar. Press OK to ignore and risk data corruption. Press Abort to kill the program." (not the IDE exception handler dialog) shown natively by the application. 4. Abort and Continue work there as expected. I hope this is helpful in some shape or form. ---------------------------------------------------------------------- Martin_fr · 2023-10-10 10:32 I made some further changes to the code. https://gitlab.com/martin_frb/lazarus/- /commit/06f5b3bb664fb22587f6cf080fcb8fcf8e6f3fe2 The problem is (or hopefully was) that the IDE was still waiting for data from lldb, because the "end marker" is changed. And if the IDE is waiting , it does not sent new instruction, so you couldn't continue to run. Please pack the output into "code" tags [ code=plain ] I added this to your last post. ---------------------------------------------------------------------- msintle · 2023-10-10 17:01 Quote from: Martin_fr on October 10, 2023, 12:32:42 pmI made some further changes to the code. https://gitlab.com/martin_frb/lazarus/- /commit/06f5b3bb664fb22587f6cf080fcb8fcf8e6f3fe2 The problem is (or hopefully was) that the IDE was still waiting for data from lldb, because the "end marker" is changed. And if the IDE is waiting , it does not sent new instruction, so you couldn't continue to run. Wow! Congratulations, Martin!!! This did it Both the single exception demo and my own product now work properly. To clarify, the exception that is raised ("foo bar") is caught and displayed properly in the IDE. And my own product is able to spawn its own secondary dialog - without any frivolous exceptions or hangs! Quote from: Martin_fr on October 10, 2023, 12:32:42 pmPlease pack the output into "code" tags [ code=plain ] I added this to your last post. Thank you for your help. I also fixed my remaining post on this thread accordingly. ---------------------------------------------------------------------- msintle · 2023-10-10 17:25 Not sure if this is your responsibility, but also trying to patch the FPCUPDELUXE instance of Lazarus using your fixed files, I get the attached build error when trying to compile Lazarus itself. ---------------------------------------------------------------------- Martin_fr · 2023-10-10 17:49 Is your fpcupdeluxe on fixes-2-2, fixes-3 or main branch? In either case, that error shouldn't happen. Unless an entire file was copied from one branch to another. I.e. not just the patch, but the entire file. Then it would happen. The patch should apply. But you don't need to apply it to fixes-3 or main any more, I have just committed the changes. ---------------------------------------------------------------------- msintle · 2023-10-10 18:21 Quote from: Martin_fr on October 10, 2023, 07:49:59 pmIs your fpcupdeluxe on fixes-2-2, fixes-3 or main branch? In either case, that error shouldn't happen. Unless an entire file was copied from one branch to another. I.e. not just the patch, but the entire file. Then it would happen. The patch should apply. But you don't need to apply it to fixes-3 or main any more, I have just committed the changes. Ah yes, I copied the entire file indeed. I am on Trunk/Lazarus + FPC 3.3.1. Would a reinstall with FPCUPDELUXE address this concern, has your fix been propagated already? Once again, terrific work Martin. I am very grateful for your support. You are an ---------------------------------------------------------------------- Martin_fr · 2023-10-10 19:26 Quote from: msintle on October 10, 2023, 08:21:34 pmAh yes, I copied the entire file indeed. I am on Trunk/Lazarus + FPC 3.3.1. Would a reinstall with FPCUPDELUXE address this concern, has your fix been propagated already? Yes, the fix is in Lazarus trunk. (and in fixes 3-0 / but not on the tagged 30RC2, since the tag was done a few days ago) ---------------------------------------------------------------------- msintle · 2023-10-10 21:49 Quote from: Martin_fr on October 10, 2023, 09:26:54 pmQuote from: msintle on October 10, 2023, 08:21:34 pmAh yes, I copied the entire file indeed. I am on Trunk/Lazarus + FPC 3.3.1. Would a reinstall with FPCUPDELUXE address this concern, has your fix been propagated already? Yes, the fix is in Lazarus trunk. (and in fixes 3-0 / but not on the tagged 30RC2, since the tag was done a few days ago) Works, terrific! ---------------------------------------------------------------------- vonskie · 2023-11-06 19:35 So where do I get this fixed version if 30rc2 does not have it. Running into problems with xcode 15 the latest mac os and the debugger is not running. ---------------------------------------------------------------------- dbannon · 2023-11-07 11:46 Hmm, maybe back to the answer I gave you a couple of days ago ? https://forum.lazarus.freepascal.org/index.php/topic,65118.msg495851.h tml#msg495851 You apparently want Lazarus Fixes  3.0, its not available as a prebuilt binary install because it changes often.  So, you build it yourself. Its easy. David ---------------------------------------------------------------------- vonskie · 2023-11-07 15:45 I followed the guide at https://wiki.freepascal.org/Installing_Lazarus _on_macOS#Installing_non-release_versions_of_the_Lazarus_IDE Very helpful However when I try to debug even with the fixes 3_0 compiled I get the following in the debug output I have verified xcode and command line tools are signed I have reinstalled the command line tools Set it to dwarf3 and lldb Breakpoint 1: no locations (pending). WARNING:  Unable to resolve breakpoint to any actual locations. (lldb) breakpoint set --func fpc_runerror -K false Breakpoint 2: no locations (pending). WARNING:  Unable to resolve breakpoint to any actual locations. (lldb) breakpoint set --func fpc_raiseexception -K false Breakpoint 3: where = ELSIEasyCleaner`FPC_RAISEEXCEPTION, address = 0x00000001000182d0 (lldb) process launch -n Program will run but debugger will not load. I am stuck any suggestions? ---------------------------------------------------------------------- Martin_fr · 2023-11-07 16:36 Quote from: vonskie on November 07, 2023, 04:45:47 pmBreakpoint 1: no locations (pending). WARNING:  Unable to resolve breakpoint to any actual locations. (lldb) breakpoint set --func fpc_runerror -K false Breakpoint 2: no locations (pending). WARNING:  Unable to resolve breakpoint to any actual locations. (lldb) breakpoint set --func fpc_raiseexception -K false Breakpoint 3: where = ELSIEasyCleaner`FPC_RAISEEXCEPTION, address = 0x00000001000182d0 (lldb) process launch -n Program will run but debugger will not load. I am stuck any suggestions? The 2 "unable to resolve" are (probably) ok. They may actually not be in your app. But after the 3rd one, there should be additional instructions (if that is from the "Debug output" window and not from the stdout of the IDE). Just to be sure, you are using "lldb with fpdebug"?  (There is one without fpdebug, but it's normally not installed) ---------------------------------------------------------------------- Joseph · 2024-04-23 12:48 I'm facing the same problem as described in the first post of this thread. However, I'm not sure I understood what the solution was, despite the enthusiastic messages following the commit quoted by Martin. Have I missed something or has the problem just not been solved yet? ---------------------------------------------------------------------- Martin_fr · 2024-04-23 13:45 Please confirm you are using Lazarus 3.0 or 3.2 (or 3.3 / 3.99 fixes/trunk) Please post a log from your problem. - Before starting the debugger, go to menu: View > Ide Internals > Debug Output   Keep that window open. - Start the debugger with F9 Once you get an error: - copy (or screenshot) the text of the error. - copy and attach the entire content of the "debug output" window. Thanks. I have not checked, if this thread is about a single problem, or if problems other than the initial have been added in the middle of the thread. The initial problem should be fixed. ---------------------------------------------------------------------- Joseph · 2024-04-23 14:58 I posted here (https://forum.lazarus.freepascal.org/index.php/topic,67059.0.html) at first, but I'll past here the main info. Context: I have a compiled Delphi project that works as expected on a Windows. I'd like to use the source code to compile it for the Mac as well, but I'm at a sticking point. The project basically contains 6 .pas files and 1 .dpr file. I have installed Lazarus (following the tutorial here https://wiki.lazarus.freepascal.org/Installing_Lazarus_on_macOS), then FPC. I then converted the Delphi project into a Lazarus project using the tool provided in Lazarus. It worked as expected (some modifications in the files and appearance of a .lpr as well as .lpi etc). I then tried to compile the project. I've tried both "Compile" and "Clean up and Build", but both lead to the same errors after about 10/15 seconds of compilation: - Error: -macosx_version_min has been renamed to -macos_version_min - Error: linker: Undefined symbols for architecture x86_64: - Error: linker: "WSRegisterBevel", referenced from: - Error: ld: symbol(s) not found for architecture x86_64 - Error: Error while linking I should point out that I've managed to compile and run simple hello world type programs without any problems. I use: - MacOS M1 Sonoma 14.4.1 - Lazarus 3.2 - FPC 3.2.2 I put in message.txt the output of the "Messages" window (since the "Debut Output" does not display anything?) ---------------------------------------------------------------------- Martin_fr · 2024-04-23 15:12 I answered in the other thread. (As much as I know... ) I don't know why this thread was linked. This thread isn't related. Your problem is about compiling (probably incorrect project setup). This thread is about debugging (once compiling has succeeded). Any way, never mind, but please back to the original thread. ---------------------------------------------------------------------- Joseph · 2024-04-23 15:16 Ok, I'll go see it. thanks!