Lazarus

Free Pascal => Beginners => Topic started by: ssawgift on November 28, 2022, 05:32:22 pm

Title: How debug RTL/Lazarus source code?
Post by: ssawgift on November 28, 2022, 05:32:22 pm
Is there any official method to step into (F7) source code of RTL/Lazarus components?
Title: Re: How debug RTL/Lazarus source code?
Post by: Martin_fr on November 28, 2022, 07:30:19 pm
It should work for any code compiled with debug info.

So if the method you are looking for is in the LCL, then make sure the LCL has debug info (Dwarf, if you are using FpDebug / and you should use FpDebug).
If it is in LazUtils => then same for LazUtils.
Those can be set in the options of each package.
Those can also be set in project options "additions and overrides".
Those can also be set in menu Tools > "configure build lazarus" (custom options)



If you want to step into the RTL (or packages that are part of FPC) => then you need to build Fpc from scratch.... (with debug info)
Title: Re: How debug RTL/Lazarus source code?
Post by: duzenko on August 25, 2023, 12:44:45 pm
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39574
Title: Re: How debug RTL/Lazarus source code?
Post by: Leledumbo on August 27, 2023, 08:06:01 am
Recompile as deep as you need with debug info on, preferably also with optimizations off. Although I feel like these days the debug info is smart enough to consider optimizations into account as well, but since you're stepping at source level which might be erased / modified by optimizations, you might feel weird if the highlight skips certain lines. AFAIK RTL/FCL must be recompiled outside the IDE, as it only has direct access to LCL.
TinyPortal © 2005-2018