[fpc-devel] Dwarf3 and the encoding of classes

Joost van der Sluis joost at cnoc.nl
Sun Jan 9 21:16:02 CET 2011

On Sun, 2011-01-09 at 18:21 +0100, Jonas Maebe wrote:
> 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).

You are right. I thought it was some internal (inferior) gdb-address.
This makes this argument moot.

To sum up, as far as I can see now, the current gw2 implementation has
only two disadvantages: it doesn't show nil, and to show the complete
class you have to add '^'. 

Both can be fixed in gdb, and current Lazarus already has work-arounds
for this or they can be added.

Martin, do you still have any problems with classes and the -gw2 output?

Any other new arguments/problems?


More information about the fpc-devel mailing list