This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdb, c++ & namespaces
- From: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- To: marcel dot lanz at ds9 dot ch
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 14 Jan 2004 09:17:30 -0500 (EST)
- Subject: 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