[fpc-devel] Dwarf3 and the encoding of classes

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Jan 9 18:21:44 CET 2011

On 09 Jan 2011, at 17:56, Joost van der Sluis wrote:

> I've done some more tests with -gw2. 'p classinstance' gives you the
> address of the class-instance and not the values within the class.
> That's a big issue to me. To show the class, you have to use 'p
> classinstance^', which is nonsense in a Pascal-way of view. 
> And if the classinstance is nil it shows '0x0' and not 'nil'. 'p
> @classinstance' will give you rubbish. 

It presumably gives you the address of the class instance pointer. It's the same in a plain Pascal program: @classinstance gives you the address in memory where the class instance pointer is located, and classinstance is the pointer (not the fields).

> Otoh, with gw3, this all works. The patch to show 'nil' when a class is
> not assigned for gdb is two lines. And to be honest, I think the 'p
> classinstance1=classinstance2' case is a real corner-case.

I think that giving the class instance pointer for "p @classinstance" is quite counterintuitive. And at least I use class instance pointers a lot during debugging the compiler (for conditional breakpoints during reruns).


More information about the fpc-devel mailing list