[fpc-devel] Re: Debugger for FPC

Michael Schnell mschnell at lumino.de
Tue Mar 17 10:14:13 CET 2009


> And in fact, the same can be done to generate for properties that 
> directly map to variables/fields. Just one question: what should the 
> debug information point the debugger to in case of
> a) a property without a read specifier, but with a write specifier 
> going directly to a field? Nothing, or that field?
> b) a property with a read specifier that is a function call, but with 
> a write specifier directly going to a field? Nothing, or that field? 
> (as long as we do not support encoding property accessor function 
> calls into the debug information, and/or when we do but determine that 
> the accessor can have side effects)
I still did not yet get any discussion rolling on the issue of "pure" 
read functions (that have no side-effect). The debugger might use a 
"pure" read function to show the property value, but it can't if the 
read function is not pure. gcc does know about pure functions, thus I 
suppose DWARF also does so. In gcc there is an appropriate procedure 
attribute that lets the programmer define a function as "pure" but I 
suppose that the compiler also can do this automatically.

Delphi seems to do do something similar, as the debugger can show values 
for _some_ properties with read functions, but not for all of them. I 
suppose FPC can be made recognize many read functions as "pure" and thus 
instruct gdb to use the read functions to show the property value.

-Michael



More information about the fpc-devel mailing list