Debugging Pascal

Having a spare day to actually work on what I want, I get back into my Pascal adventure, and I’m blocked by inobvious bugs.

Thanks to Sierra breaking gdb (unless you disable SIP entirely, which I’m not going to do), Lazarus can’t run ggdb, so forget about GUI debugging. I’ve tried all the code-signing, rebooting suggestions, none of that works.

I’m not a giant fan of the debugger, but even caveman Mark needs a backtrace sometimes. Happily, lldb works from the command line:

lldb -o "breakpoint set -n fpc_raiseexception" -o run foo.app

Then at the lldb prompt after a crash, type ‘bt’ for backtrace, ‘cont’ to carry on with the usual exception handling. Most of the lldb tutorial works the same.