[Lazarus] properties (delphi does it wrong too) [Re: debugger feature request created]

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri Oct 2 14:30:35 CEST 2009


Martin schrieb:

> Well as I already mailed: Some properties can be inspected now (using 
> fpc 2.3.1 and dwarf). So this is (partly) fixed.
> 
> "Some properties"  means properties that have an read-accessor pointing 
> to a variable.
> 
> Properties that have a function to provide the value can not be inspected.
> * And I am more than happy they can not *
> 
> Yes Delphi can do this and does do this. And what does it mean? If in 
> Delphi I accidentally hover the mouse over a property, The function is 
> called (actually Delphi calls it twice). As a result all Values on the 
> object change (because many functions do more than just read values, 
> they update values too).
> The application is in a state that is no longer correct (because the 
> values have changed to something they where not supposed to be). And I 
> have to abort my debug session and start over. What help is that?

Right. A C++ style "const" attribute were helpful, in order to 
distinguish between mere "inspectors" and other getters that change the 
state of an object. Or we could add an "inspect" directive to the 
property "read" and "write" directives...

   "property" ... "read" GetProp ["const"] ["inspect" SeeProp] ...

DoDi





More information about the Lazarus mailing list