This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: nested class


In your test program, there are no fields or data members
of type A:AA, so the compiler is likely to discard the
debug info for that type.

Change the test program to:

  class A {
    public:
      int i;
    } x;
    int j;
  };

  int main () {
    A::AA * p = new A::AA();
    return p->i;  // break here
  }

Then in gdb:

  (gdb) break main
  (gdb) run
  (gdb) next
  (gdb) print ('A:AA' *) p

The second trick is to use single quotes around the name
of the nested type.

This works for me with gcc 3.3.4, gdb 6.1, dwarf-2.


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