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

Martin Frb lazarus at mfriebe.de
Sat Feb 21 20:33:44 CET 2026


On 21/02/2026 20:17, Graeme Geldenhuys via fpc-devel wrote:
> 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.
...
> 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.
>

As I said, not really an issue with debug format. No format can fix that.

And  yes exception frame info is one answer (still on my todo for fpdebug).
Unwinding is never 100% possible, unless all code adheres to the rules 
known by the debugger. But such compliance can't be guaranteed when 
unknown libs are involved.

Anyway, I was just interested in you take on that side.
Describing data (incl type) is one huge part. But by far not all.

Line info is of course also huge. Not so many special cases
Well, fpc attributes some "end" code to the "begin" block. Afaik that is 
in the node/code gen, not related to debug info, but then makes it way 
into debug info.

Jump pads are an interesting bit too.
I don't know if you added line info to the entry points of interfaces 
(the small bit of code that adjust the self pointer, and jumps to the 
real method).
But IIRC you also can get jump pads in large loops, where the 
conditional jump doesn't reach the target, and so it goes to an 
unconditional jump statement that jumps to the real target.
Again, less a question of debug info (unless you want to actually mark 
them as such). More a task for the engine to detect those bits of code.


Btw, how do you handle "step over" into a finally block (which is a 
hidden "step in")?


More information about the fpc-devel mailing list