[Lazarus] what can we do to get a better debugger

Martin Frb lazarus at mfriebe.de
Wed Nov 21 13:42:48 CET 2018


On 21/11/2018 13:08, Joost van der Sluis via lazarus wrote:
> Op 20-11-18 om 12:19 schreef Martin Frb via lazarus:
>>
>> That work is already in process (though very slowly / work has 
>> started/stopped plenty of times over the past many years). It is 
>> called FpDebug.
>> Donations are still welcome.
>> Under Windows and Linux you can install the package LazDebuggerFp. 
>> (You can do on Mac too, but then you need to codesign the entire IDE).
>> Best use Lazarus trunk (it is already ahead of fixes 2.0 branch, but 
>> by very little only)
>
> You do not have to sign the ide. You can use FpDebug as external 
> debugger, then you only have to sigh the FpDebug executable itself.
I wasn't sure if that is fully working...

What class/package is that in the IDE?

>
>> Support for threaded apps in fpdebug is not yet there.
>> Under Linux only the main thread is debugged. Windows has bare 
>> minimumĀ  (and untested) support for dealing with threads.
>
> Strange, debugging threads works fine. At least on Linux and OS/X. 
> There were some memory-leaks in the show-threads window, though. I've 
> asked you to look at it.
When I tested (last week), using "Pause" button, only the main thread 
stopped.
There was no way to pause the other threads.

Each one of them would stop, if reaching a breakpoint. But then the main 
thread (and others) would continues running.

If I had a test thread, that loops an a single "a:=1;" (consuming cpu 
like hell), and I try to set a breakpoint, I got occasional crashes of 
the debugged exe. (Not verified, I think it pauses the main thread while 
setting the breakpoint?, but the sub thread in which the breakpoint will 
be set, is still running...).
Need to dig deeper into that.

So need to check, about pausing all threads.


--------
A good way to find thread issues, is to debug the IDE, and inside the 
debugged IDE compile your project (uses thread), and then debug your 
project (does fork processes).



More information about the Lazarus mailing list