This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problem accessing inheritance information on Solaris - works fine in Linux


This could be a problem with egcs/gcc,  but it manifests itself in gdb,
therefore I present it here in hope of someone cross-referencing it if
needed.

I work on Solaris with egcs 1.1.2 and gdb 4.17. (The same behavior is
evident with gdb 4.18.) I also have a Linux workstation. The following code
produces different results:

Class A
{
public:
   int m_intA;
};

class B : public A
{
public:
   int m_intB;
};

int main()
{
   B b;
   return 0;
}

I load this program in gdb and break on main. When I issue "ptype b" command
in gdb, on Solaris I get the following output:

*	ptype b
struct B {
   int m_intB;
};

On Linux however, the output is:
Class B : public A {
   Int m_intB;
};

Obviously on Solaris the debugger cannot access the inheritance information.
Also, the debugger does not realize that B is a class and not a struct.

Any help is greatly appreciated.

Thank you

Cristian Diaconu