problems with nested classes

Dirk-Jan Jongeneel dirkjjn@cobalt.et.tudelft.nl
Tue Jan 27 10:55:00 GMT 2004


Hi,

I don't know if this is related to a bug or just a user error. As I 
don't see a general help list I'll try this one.

I have a situation of classes like class A::C and class B::C. When there 
is somewere a B::C variable a print in gdb will use A::C. ptype 
my_variable will print :class C .....(which is of format A::C). I also 
can't manage to cast it to the correct class. if I do print (B::C*) 
my_variable I get a A parse error in expression, near `)'

How should I cast using subclasses? It seems it go wrong as soon as I 
use a :: in the cast.

I have tried gdb 5.3 and 6 and latest. Compilation is using gcc3.2.3

Dirk-Jan



More information about the Gdb mailing list