There doesn't seem to be anything special necessary, for me at least.
Code:
$ cat basegdb.cpp
#include <iostream>
class object {
private:
int id;
public:
object(int id) : id(id) {}
};
class physical_object : public object {
private:
bool solid;
public:
physical_object(int id, bool solid) : object(id), solid(solid) {}
};
int main() {
physical_object o(42, true);
return 0;
}
$ g++ -g basegdb.cpp -o basegdb
$ gdb ./basegdb
GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) break main
Breakpoint 1 at 0x8048535: file basegdb.cpp, line 18.
(gdb) r
Starting program: ./basegdb
Breakpoint 1, main () at basegdb.cpp:18
18 physical_object o(42, true);
(gdb) n
19 return 0;
(gdb) p o
$1 = {<object> = {id = 42}, solid = true}
(gdb)
Note that I'm sure you'd need to compile all of your source files with debugging information available. Also, if you have a pointer to a base class which actually points to a derived class, you may need to cast the pointer if you want to see derived class data; but this doesn't seem to be your problem.