[fpc-pascal] Debug a getter (was Lazarus vs MSEgui)

Martin fpc at mfriebe.de
Sun Apr 10 03:02:29 CEST 2016


On 09/04/2016 21:34, Michael Thompson wrote:
> On 8 April 2016 at 17:08, Santiago A. <svaa at ciberpiula.net 
> <mailto:svaa at ciberpiula.net>> wrote:
>
>     By the way, has anybody managed to debug strings.text or any property
>     with a getter?
>
>
> I was hoping someone would answer this.  I currently insert the 
> equivalent of
> sHack :=  MyStrings.Text;
>
> into code, and watch that....  Means I have to know I want the value 
> of that list before I start debugging...
>
getters are a long way to go still, and if the strings are involved, 
then even longer.

1) gdb does not support function calls to pascal
2) strings are managed, gdb does not know how to deal with them, if they 
are needed for function param or result. Special calls to string 
management are needed or memory will be leaked or corrupted
3) stabs, dwarf2 & 3 do not support encoding the above info
4) Due to 3 fpc can not make that info avail. (maybe later dwarf formats 
have it)

But often you can find the private variable that holds the value, and 
watch this.

In Lazarus use the debug INSPECTOR, you can double click any member 
variables, and go to nested objects etc. Once you found it copy it to 
watches.

for stringlist you can get all individual strings (but not the text). 
tstringlist.flist.... somewhere.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160410/a146ed60/attachment.html>


More information about the fpc-pascal mailing list