[Lazarus] Debugging on macOS

Martin Frb lazarus at mfriebe.de
Sat Mar 9 19:57:54 CET 2019


On 09/03/2019 18:25, Zoë Peterson via lazarus wrote:
> Are there still obvious optimizations/improvements to be done with the 
> "LLDB with fpdebug" debugger on macOS? We're on trunk and it's largely 
> not usable right now.  I'm sure it has something to do with the size 
> of our project, but it currently has random, lengthy hangs when doing 
> things like single stepping.  If I wait long enough it does eventually 
> come back, but it is very much in the range of "Is this hung?" and not 
> just sluggish.  It adds 10+ seconds to actually launching the app too, 
> which is unpleasant, but at least something I can expect and work around.
>
It all depends on usable bug/issue reports.

There are steps on how to generate a logfile.
http://forum.lazarus-ide.org/index.php/topic,42869.0.html

Startup is known to take some time. Both the IDE, and lldb need to parse 
the debug info, and both take some time to do so. (both running in 
parallel threads for this).
To speed up, make sure that you disable debug info for any package, you 
do not need to step into.

In case of hangs while stepping, it would be useful to know the 
start/endpoint (file/line). So it can be found in the log.

It may be the debugger is evaluating locals, watches or stack, and that 
any of them have large objects.
1) Do you have locals/watches windows open? Are there any variables that 
may have a bigger size? Or objects with plenty of strings?
2) Try to
  - close the locals window
  - close or disable the watches window
  - open the history window, and disable it (this is important, for else 
it will go and start reading locals and watches)

When you press step, the debugger will (should?) abort reading locals 
and watches. But it will only do so between 2 watches.
If a single watch takes a lot of time, this may add delays.

--------------------
If it is for speed only, you can try the lldb without fpdebug (there is 
a package under components/lazdebuggers/lazdebuggerlldb  ; with NO "fp" 
in it)
This package comes "as is".
All watches expect lldb readable (c-style) input: form1->fvalue
And results are displayed as llbd likes.

But for an object with lots of strings, lldb gets the entire value. THe 
IDE only needs to do a single request.
FpDebug, needs to first read the mem of the object, and because strings 
are pointer, it then needs a further request to lldb for each string.





More information about the lazarus mailing list