[fpc-devel] A little something I've been working on...

mailinglists at geldenhuys.co.uk mailinglists at geldenhuys.co.uk
Sat Feb 21 20:17:10 CET 2026


On 2026-02-21 18:42, Martin Frb via fpc-devel wrote:
> Then you are in RTL code => Many people using Lazarus, use the prebuild 
> RTL.
> That prebuild RTL is O2 (and without debug info, so encoding stack in 
> debug info wont help in this case).

Umm, an honest oversight on my part -- I had not considered the prebuilt
RTL scenario. The frame-pointer chain breaking when you hit optimised
code. I have added it to the OPDF roadmap as a known limitation.

One partial mitigation worth exploring: FPC could emit frame pointers
for the RTL even at -O2, similar to how GCC now defaults to
-fno-omit-frame-pointer on many Linux distros (it was re-enabled
specifically because profiling and debugging tools kept breaking
without it). Whether the FPC team would accept that trade-off for the
RTL is another question -- it does cost a register.

Longer term, the OPDF debugger could fall back to reading .eh_frame
sections when no OPDF data is available for a given frame. Those
unwind tables should be present even in release builds, so they could
bridge the gap for frameless RTL functions.


Regards,
   - Graeme -



More information about the fpc-devel mailing list