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).


Jonas_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to