Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: gdb, c++ & namespaces
@ 2004-01-14 14:17 Michael Elizabeth Chastain
  2004-01-14 14:26 ` Marcel Lanz
  2004-01-15  8:02 ` Eli Zaretskii
  0 siblings, 2 replies; 18+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-14 14:17 UTC (permalink / raw)
  To: marcel.lanz; +Cc: gdb

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


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: gdb, c++ & namespaces
@ 2004-01-15 12:51 Michael Elizabeth Chastain
  2004-01-15 14:07 ` Marcel Lanz
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-15 12:51 UTC (permalink / raw)
  To: eliz; +Cc: gdb

eli> The manual doesn't mention "static type" and "dynamic type" in the
eli> section that describes "set pruint".  I think it should, if this
eli> terminology is to be widely accepted.

I don't know what the popular usage in the C++ community is.
I don't want to invent new phrases if there are existing phrases.

I checked "The C++ Programming Language" and it does not have
any nice phrases to distinguish "the type that the pointer says"
versus "the type that the object in memory has".

Michael C


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: gdb, c++ & namespaces
@ 2004-01-14 12:02 Michael Elizabeth Chastain
  2004-01-14 12:43 ` Marcel Lanz
  2004-01-14 13:49 ` Marcel Lanz
  0 siblings, 2 replies; 18+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-14 12:02 UTC (permalink / raw)
  To: marcel.lanz, mec.gnu; +Cc: gdb

> But It would be interesting to me to know why it fails ? just a line.

Honestly, we have so much work to do for gdb 6.0 and gdb 6.1,
it's unlikely that anyone will want to diagnose a problem with
gdb 5.2.1.  So you might get a response to this, but don't be
surprised if you don't.

Michael C
GDB QA Guy


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: gdb, c++ & namespaces
@ 2004-01-14 11:36 Michael Elizabeth Chastain
  2004-01-14 11:54 ` Marcel Lanz
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Elizabeth Chastain @ 2004-01-14 11:36 UTC (permalink / raw)
  To: gdb, marcel.lanz

Hi Marcel,

You have an old version of gdb.  The current version is gdb 6.0.
There has been a lot of C++ work done in gdb 5.3 and gdb 6.0,
so please try gdb 6.0 first.

Michael C


^ permalink raw reply	[flat|nested] 18+ messages in thread
* gdb, c++ & namespaces
@ 2004-01-14 10:16 Marcel Lanz
  0 siblings, 0 replies; 18+ messages in thread
From: Marcel Lanz @ 2004-01-14 10:16 UTC (permalink / raw)
  To: gdb

I have a C++ program using namespaces.
If I try to display a pointer to an instance like

sys::net::UDPSocket* s;

I get the following error from gdb (trough ddd):

can't find class named sys::net::UDPSocket, as given by C++ RTTI

If I have a reference to such an instance. No problem.
I use -g to compile with debug information.


Is there a limitation for namespace support in gdb, g++ ?

-V outputs:
GNU gdb 5.2.1
gcc version 3.3.1
ddd 3.3.1

-- 
Marcel Lanz
http://www.ds9.ch/lanz/
marcel.lanz@ds9.ch | marcel.lanz@n-1.ch
GnuPG: F975 C6F7 04C8 642B 6DF4  4DF4 2945 F02A 797E 7DAB


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2004-01-16 22:09 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-14 14:17 gdb, c++ & namespaces Michael Elizabeth Chastain
2004-01-14 14:26 ` Marcel Lanz
2004-01-15  8:02 ` Eli Zaretskii
2004-01-16 22:04   ` Gabriel Dos Reis
  -- strict thread matches above, loose matches on Subject: below --
2004-01-15 12:51 Michael Elizabeth Chastain
2004-01-15 14:07 ` Marcel Lanz
2004-01-15 14:26 ` Robert Zeh
2004-01-16 22:09 ` Gabriel Dos Reis
2004-01-14 12:02 Michael Elizabeth Chastain
2004-01-14 12:43 ` Marcel Lanz
2004-01-14 13:49 ` Marcel Lanz
2004-01-14 13:55   ` Daniel Jacobowitz
2004-01-14 15:29   ` Andrew Cagney
2004-01-14 15:35     ` Marcel Lanz
2004-01-14 16:00       ` Andrew Cagney
2004-01-14 11:36 Michael Elizabeth Chastain
2004-01-14 11:54 ` Marcel Lanz
2004-01-14 10:16 Marcel Lanz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox