Recent

Author Topic: Xcode Command Line Tools 15 Breaks lldb (macOS Ventura 13.6/Sonoma 14.0 ARM64)  (Read 13200 times)

msintle

  • Sr. Member
  • ****
  • Posts: 299
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

  • Administrator
  • Hero Member
  • *
  • Posts: 10900
  • Debugger - SynEdit - and more
    • wiki
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][+][-]
  1. (lldb) process continue
  2. Process 38234 resuming
  3. (lldb)    p/x $rdi
  4. (unsigned long) 0x000000010f4c3780
  5. (lldb)    p/x $rdx
  6. (unsigned long) 0x0000000305989850
  7. (lldb)    p ((char ***)$rdi)[0][3]
  8. (char *) 0x000000010082de38 "\rEConvertError"
  9. (lldb)    p ((char **)$rdi)[1]
  10. (char *) 0x0000000111246cd8 "\"\" is not a valid boolean."
  11. Process 38234 stopped
  12. * thread #1: tid=0x1fdf0f: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:    &&//SHORT:    &&//LINE:    &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME, stop reason = breakpoint 3.1
  13. ...
  14. Process 38234 stopped
  15. * thread #1: tid=0x1fdf0f: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:    &&//SHORT:    &&//LINE:    &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME, stop reason = breakpoint 3.1
  16.         frame #0: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:    &&//SHORT:    &&//LINE:    &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME
  17. Target 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][+][-]
  1. 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

  • Administrator
  • Hero Member
  • *
  • Posts: 10900
  • Debugger - SynEdit - and more
    • wiki
I think I can see what happens. lldb prints the result as
Code: Text  [Select][+][-]
  1. (lldb)    p ((char ***)$rdi)[0][3]

But the IDE expects a "=" in that line.
So lldb changed its output.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10900
  • Debugger - SynEdit - and more
    • wiki
Please ASAP test the following patch
Code: Diff  [Select][+][-]
  1. diff --git a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas
  2. index 44853e1dd6..462211109d 100644
  3. --- a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas
  4. +++ b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas
  5. @@ -1113,6 +1113,15 @@ function TLldbInstructionExpressionBase.ProcessInputFromDbg(const AData: String
  6.      if ParseStruct(found[2]) then
  7.        SetContentReceieved;
  8.      exit;
  9. +  end
  10. +  else
  11. +  // (char *) 0x0000000111246cd8 "\"\" is not a valid boolean."
  12. +  if StrMatches(AData, ['(', ') 0x', ' ', ''], found) then begin
  13. +    FRes := AData;
  14. +    FCurly := 0;
  15. +    if ParseStruct(found[2]) then
  16. +      SetContentReceieved;
  17. +    exit;
  18.    end;
  19.  // error: use of undeclared identifier 'i'
  20.  // (int) $0 = 133
  21.  

Otherwise it could miss the deadline for RC2
« Last Edit: October 06, 2023, 06:06:33 pm by Martin_fr »

msintle

  • Sr. Member
  • ****
  • Posts: 299
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)

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).

Your 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.

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?

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

  • Sr. Member
  • ****
  • Posts: 299
Please ASAP test the following patch
Code: Diff  [Select][+][-]
  1. diff --git a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas
  2. index 44853e1dd6..462211109d 100644
  3. --- a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas
  4. +++ b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas
  5. @@ -1113,6 +1113,15 @@ function TLldbInstructionExpressionBase.ProcessInputFromDbg(const AData: String
  6.      if ParseStruct(found[2]) then
  7.        SetContentReceieved;
  8.      exit;
  9. +  end
  10. +  else
  11. +  // (char *) 0x0000000111246cd8 "\"\" is not a valid boolean."
  12. +  if StrMatches(AData, ['(', ') 0x', ' ', ''], found) then begin
  13. +    FRes := AData;
  14. +    FCurly := 0;
  15. +    if ParseStruct(found[2]) then
  16. +      SetContentReceieved;
  17. +    exit;
  18.    end;
  19.  // error: use of undeclared identifier 'i'
  20.  // (int) $0 = 133
  21.  

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.
« Last Edit: October 07, 2023, 10:22:30 am by msintle »


msintle

  • Sr. Member
  • ****
  • Posts: 299
I 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.

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

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

  • Administrator
  • Hero Member
  • *
  • Posts: 10900
  • Debugger - SynEdit - and more
    • wiki
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

  • Sr. Member
  • ****
  • Posts: 299
Thank you very much Martin. I'm afraid the behavior has not changed. Here's the output:

Code: Text  [Select][+][-]
  1. >> 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"
  2. (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"
  3. >> 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"
  4. (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"
  5. >> 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"
  6. (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"
  7. >> target stop-hook add -o "thread list"
  8. (lldb) target stop-hook add -o "thread list"
  9. Stop hook #1 added.
  10. >> settings set -- stop-line-count-after 0
  11. (lldb) settings set -- stop-line-count-after 0
  12. >> settings set -- stop-line-count-before 0
  13. (lldb) settings set -- stop-line-count-before 0
  14. >> settings set -- stop-disassembly-count 0
  15. (lldb) settings set -- stop-disassembly-count 0
  16. >> settings set -- target.env-vars "USER=c"
  17. (lldb) settings set -- target.env-vars "USER=c"
  18. >> settings set -- target.env-vars "COMMAND_MODE=unix2003"
  19. (lldb) settings set -- target.env-vars "COMMAND_MODE=unix2003"
  20. >> settings set -- target.env-vars "__CFBundleIdentifier=com.company.lazarus"
  21. (lldb) settings set -- target.env-vars "__CFBundleIdentifier=com.company.lazarus"
  22. >> settings set -- target.env-vars "PATH=/usr/bin:/bin:/usr/sbin:/sbin"
  23. (lldb) settings set -- target.env-vars "PATH=/usr/bin:/bin:/usr/sbin:/sbin"
  24. >> settings set -- target.env-vars "LOGNAME=c"
  25. (lldb) settings set -- target.env-vars "LOGNAME=c"
  26. >> settings set -- target.env-vars "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.sZVsFwhhDI/Listeners"
  27. (lldb) settings set -- target.env-vars "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.sZVsFwhhDI/Listeners"
  28. >> settings set -- target.env-vars "HOME=/Users/c"
  29. (lldb) settings set -- target.env-vars "HOME=/Users/c"
  30. >> settings set -- target.env-vars "SHELL=/usr/local/bin/fish"
  31. (lldb) settings set -- target.env-vars "SHELL=/usr/local/bin/fish"
  32. >> settings set -- target.env-vars "TMPDIR=/var/folders/98/_nkjn6yd2mqf6_07pcq0qrx80000gn/T/"
  33. (lldb) settings set -- target.env-vars "TMPDIR=/var/folders/98/_nkjn6yd2mqf6_07pcq0qrx80000gn/T/"
  34. >> settings set -- target.env-vars "__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0"
  35. (lldb) settings set -- target.env-vars "__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0"
  36. >> settings set -- target.env-vars "XPC_SERVICE_NAME=application.com.company.lazarus.890002.3328763"
  37. (lldb) settings set -- target.env-vars "XPC_SERVICE_NAME=application.com.company.lazarus.890002.3328763"
  38. >> settings set -- target.env-vars "XPC_FLAGS=0x0"
  39. (lldb) settings set -- target.env-vars "XPC_FLAGS=0x0"
  40. >> target create /Users/c/Developer/miamp/miamp.app
  41. (lldb) target create /Users/c/Developer/miamp/miamp.app
  42. Current executable set to '/Users/c/Developer/miamp/miamp.app' (x86_64).
  43. >> settings clear target.run-args
  44. (lldb) settings clear target.run-args
  45. >> breakpoint set --func fpc_break_error -K false
  46. (lldb) breakpoint set --func fpc_break_error -K false
  47. Breakpoint 1: no locations (pending).
  48. >> breakpoint set --func fpc_runerror -K false
  49. WARNING:  Unable to resolve breakpoint to any actual locations.
  50. (lldb) breakpoint set --func fpc_runerror -K false
  51. Breakpoint 2: no locations (pending).
  52. >> breakpoint set --func fpc_raiseexception -K false
  53. WARNING:  Unable to resolve breakpoint to any actual locations.
  54. (lldb) breakpoint set --func fpc_raiseexception -K false
  55. Breakpoint 3: where = miamp`FPC_RAISEEXCEPTION, address = 0x0000000100017010
  56. >> breakpoint command add 3
  57. >> p/x $rdi
  58. >> p/x $rdx
  59. >> p ((char ***)$rdi)[0][3]
  60. >> p ((char **)$rdi)[1]
  61. >> DONE
  62. >> version
  63. (lldb) breakpoint command add 3
  64. (lldb) version
  65. >> breakpoint command add 2
  66. >> p/x $rdi
  67. >> DONE
  68. >> version
  69. lldb-1500.0.22.8
  70. Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
  71. (lldb) breakpoint command add 2
  72. (lldb) version
  73. >> breakpoint command add 1
  74. >> p/x $rdi
  75. >> DONE
  76. >> version
  77. lldb-1500.0.22.8
  78. Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
  79. (lldb) breakpoint command add 1
  80. (lldb) version
  81. >> breakpoint set --file process.inc --line 244
  82. lldb-1500.0.22.8
  83. Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
  84. (lldb) breakpoint set --file process.inc --line 244
  85. Breakpoint 4: no locations (pending).
  86. >> breakpoint set --file moptions.pas --line 398
  87. WARNING:  Unable to resolve breakpoint to any actual locations.
  88. (lldb) breakpoint set --file moptions.pas --line 398
  89. Breakpoint 5: where = miamp`FORMSHOW + 152 at moptions.pas:398:3, address = 0x00000001000e6498
  90. >> process launch -n
  91. (lldb) process launch -n
  92. Process 51372 launched: '/Users/c/Developer/miamp/miamp.app/Contents/MacOS/miamp' (x86_64)
  93. (lldb)  p/x $rdi
  94. (unsigned long) 0x000000010f4e37c0
  95. (lldb)  p/x $rdx
  96. (unsigned long) 0x0000000305989850
  97. (lldb)  p ((char ***)$rdi)[0][3]
  98. (char *) 0x000000010082de38 "\rEConvertError"
  99. (lldb)  p ((char **)$rdi)[1]
  100. (char *) 0x000000010ff8bcd8 "\"\" is not a valid boolean."
  101. Process 51372 stopped
  102. * thread #1: tid=0x27f36f: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME, stop reason = breakpoint 3.1
  103.   thread #2: tid=0x27f39f: 0x00007ff809563152, 0x0000000305a0fb18, 0x0000000305a0fb40 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME
  104.   thread #3: tid=0x27f3a0: 0x00007ff809563152, 0x0000000305a97b28, 0x0000000305a97b50 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME
  105.   thread #4: tid=0x27f3a1: 0x00007ff809563152, 0x0000000305b1ffa8, 0x0000000305b1ffd0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME
  106.   thread #5: tid=0x27f3e9: 0x00007ff809563152, 0x0000000305ba7b28, 0x0000000305ba7b50 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME
  107.   thread #6: tid=0x27f3ea: 0x00007ff809561a2e, 0x0000000305c29f58, 0x0000000305c29fc0 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: mach_msg2_trap <<&&//FRAME
  108.   thread #7: tid=0x27f3ed: 0x00007ff809563152, 0x0000000305cb3b18, 0x0000000305cb3b40 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: libsystem_kernel.dylib &&//FUNC: __workq_kernreturn <<&&//FRAME
  109. Process 51372 stopped
  110. * thread #1: tid=0x27f36f: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME, stop reason = breakpoint 3.1
  111.     frame #0: 0x0000000100017010, 0x0000000305989828, 0x0000000305989850 &&//FULL:  &&//SHORT:  &&//LINE:  &&//MOD: miamp &&//FUNC: FPC_RAISEEXCEPTION <<&&//FRAME
  112. Target 0: (miamp) stopped.
  113. >> process kill
  114. (lldb) process kill
  115. Process 51372 exited with status = 9 (0x00000009) killed
  116. >> process kill
  117. >> quit
  118.  

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/lazdebuggerlldb/lldbinstructions.pas
- Tools | Build Lazarus with Profile: Normal IDE
- Clean & Build my app and show the problematic window
« Last Edit: October 10, 2023, 03:59:35 pm by msintle »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10900
  • Debugger - SynEdit - and more
    • wiki
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

  • Administrator
  • Hero Member
  • *
  • Posts: 10900
  • Debugger - SynEdit - and more
    • wiki
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

  • Sr. Member
  • ****
  • Posts: 299
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

  • Administrator
  • Hero Member
  • *
  • Posts: 10900
  • Debugger - SynEdit - and more
    • wiki
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][+][-]
  1. 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][+][-]
  1. 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

  • New member
  • *
  • Posts: 7
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.

 

TinyPortal © 2005-2018