[Lazarus] Class operators

Martin lazarus at mfriebe.de
Thu Sep 8 11:38:49 CEST 2011


On 08/09/2011 09:10, Graeme Geldenhuys wrote:
> On 08/09/2011, Martin wrote:
>>>> [...]
>>>> (^^PChar(Sender)^+3)^+1
>>>>
>>>> It should give you the real classname
>>> Can this be used in the debugger hint, when moving the mouse over
>>> 'Sender'?
>> Done
> Please see the following bug report:
>
>     http://bugs.freepascal.org/view.php?id=20190
>
>
> Too much of a good thing can also be a bad thing. ;-)

How long did it take before? Can you get me the "Debug output" from your 
system, please [1]?

I have a 2.4GHZ "Intel Core 2 CPU 6600" (4 years old). On Windows (and I 
found that using gdb on Win is often slower than on for example Linux). 
Yet it takes between 1 and 2 secs, but true it took half a sec before..

Stabs or Dwarf?  gdb 7.0 and up, has a bug in relations to stabs. which 
may add a tiny fraction of time (but really tiny only); as it has to 
resend ONE dgb-command, which returns the bug-triggered error

Only, usually TSender is declared as TObject (well in LCL code, that may 
not be true for your code).
Displaying a TObject is showing you the vptr only  => or in other words, 
it's telling you if the variable is nil or none-nil. That's not too useful.

How fast (or slow) fills the watch window on you pc? (if you have 
several watches)?


------
About the size of the hint => that problem existed before (only not for 
this use case). You could already get hints for variables that were 
declared as TForm or similar.

and yes, obviously a more structured output would be better than the 
current "continues text" mess. But again that is an old problem. And the 
unstructured output; imho is still better than the VPTR info of TObject


------
[1]
debug output:
It will look like "TObject" Or whatever Sender is DECLARED in your case) 
is ask twice from gdb. It is not, the 2 ptype are different (and were 
both present before). They are needed because gdb make sno difference 
between PObject and TObject. In case of the hint that is minor, as the 
hint dereferences anyway (and did so before the latest change), but that 
code is used for other calls too.





More information about the Lazarus mailing list