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: gdb, c++ & namespaces


Hi Marcel,

The two debugging formats are: dwarf-2 and stabs+ (not dwarf and stabs).
dwarf-2 is supported much better than stabs+ now, so try building
your program with -gdwarf-2.

> (netsilicon-gdb) print *dp
> warning: can't find class named `tnos::net::DatagramPacket', as given by
> C++ RTTI
> $2 = {_vptr.DatagramPacket = 0xeffb0, ia = 0x206548, isa = 0x206690,
> buffer = 0x206558 "", bufferLength = 0xff, length = 0xff}

Try playing with the "set print object" flag:

  (gdb) set print object off
  (gdb) print *dp
  (gdb) set print object on
  (gdb) print *dp

When "set print object" is off, gdb will print an object of the type
of the pointer (we call this the "static type").  When "set print object"
is on, gdb will print the type of the object in memory (we call this
the "dynamic type".

That warning is sometimes harmless if the data fields are what you
expect.  Are they?

Michael C
GDB QA Guy


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