Installation => macOS / Mac OS X => Topic started by: redspark on January 18, 2021, 07:11:36 pm
Title: MacBook M1 Silicon install debugger help
Post by: redspark on January 18, 2021, 07:11:36 pm
Today, I managed to get through this whole process except for the Debugger. I installed the packages for:
fpdebug
LazDebuggerFpLldb
LazDebuggerFp
But the Debugger isn't being found when I start Lazarus. Any idea what I missed? Do I just use the /usr/bin/lldb?
Thanks.
James
Title: Re: MacBook M1 Silicon install debugger help
Post by: trev on January 19, 2021, 12:15:50 am
Did you follow the Wiki Installing Lazarus on macOS (https://wiki.lazarus.freepascal.org/Installing_Lazarus_on_macOS) instructions? There's a section on setting up the debugger.
Title: Re: MacBook M1 Silicon install debugger help
Post by: Grahame Grieve on January 31, 2021, 10:21:36 am
I have followed these instructions, and I have FPC+Lazarus (3.3.1/2.1.0 - trunk) running on my Mac M1. I have, so far as I can figure, only one problem:
when I am debugging, and I try to see a variable value, I got the following message:
s = Internal error: Missing data location
Project options are -gw -godwarfsets -gl. Preferences say that the debugger backend is LLDB debugger (with fpdebug). (path = /usr/bin/lldb).
I do see a stack, and breakpoints work.
Debug Output shows this: (lldb) version lldb-1200.0.44.2 Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
but nothing useful in the dump of stuff that gets cut off above that
What can I do so I can see variable values?
Title: Re: MacBook M1 Silicon install debugger help
Post by: trev on January 31, 2021, 11:12:58 am
Did you follow the Wiki Installing Lazarus on macOS (https://wiki.lazarus.freepascal.org/Installing_Lazarus_on_macOS) instructions? There's a section on setting up the debugger.
I thought I had followed those instructions but it looks like I may have been in another document. There is a lot of jumping around for FPC and Lazarus to compile both. Anyway, I got lldb set as my debugger and Lazarus seems to like that. Thanks.
Title: Re: MacBook M1 Silicon install debugger help
Post by: Martin_fr on February 15, 2021, 04:46:27 pm
There isn't a good Lazarus debugger for M1 yet...
FpDebug (and anything based on it, like lldb+fpdebug) are Intel only. (and to some extend avr)
You can use the "pure" LLDB. Package LazDebuggerLldb (without any "FP" in the name). It should work -ish....
Not tested, but I would expect:
It will expect any watch in C-style. A single identifier (local var, global var, probably field?) should be fine.
Instead of "self" you need "this"
Instead of MyObject.FMyField you need MyObject->FMyField Instead of MyPointer^ you need *MyPointer
Also you should add the custom option -godwarfcpp
And keep it "dwarf + sets" / Do not use "dwarf 3".