[fpc-devel] Insufficient Dwarf info for Interfaces

Sven Barth pascaldragon at googlemail.com
Thu Sep 15 21:35:42 CEST 2022

Am 15.09.2022 um 14:32 schrieb Martin Frb via fpc-devel:
> https://gitlab.com/freepascal.org/fpc/source/-/issues/39904
> On top of adding the functions in the interface to the dwarf info, it 
> would be great if the compiler could also add some sort of link to the 
> underlaying TObject.
> So the debugger could (if available) show the user the object/instance 
> that implements the interface.
> I am not sure how that would best be done (i.e. maybe add some 
> internal field, maybe there is some dwarf tag that can be used, maybe 
> a dwarf extension....)
> From what I  understand, this would require the offset between the 
> interface table and the class (i.e. the value that is subtracted from 
> "self" in the interface's method).
> If for a debug build the compiler could write that value in front of 
> the interface, then it could point the debugger to it....

You are aware that an interface can be implemented by multiple different 
class types and that the offsets for each class that implements a 
specific interface will be different depending on the amount of 
interfaces a class implements? So if you have a given interface neither 
you nor the compiler will know what is on the other side.


More information about the fpc-devel mailing list