Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* C++ and "no data fields" when printing objects
@ 2009-04-02 13:28 Stefano Sabatini
  2009-04-02 18:52 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Sabatini @ 2009-04-02 13:28 UTC (permalink / raw)
  To: gdb Mailing List

Hi all,

It often occurrs to me to find such situatons when debugging:

(gdb) p ptr
$8 = {
  <> = {<No data fields>}, <No data fields>}

and everytime I wonder why the object is not represented meanignfully.

I previously made many researches on the subject, maybe I also already
asked on this list, and came out with the following man of the road
wisdom notions:

1) the problem shows up when you use inlined functions (but the
problem here seems to be related to printing *objects* rather than
step over functions).

2) in order to avoid that you need to use -ggdb -O0

3) it depends on some compiler magic which you really can't
understand

I'm quite sure that even using code compiled with gcc and -ggdb -O0
the abovementioned problem shows anyway.

I'd happily spend months studying the objcode structure and the gdb
internals, but unfortunately I can't, so I'm here to just ask if you
can reply to this questions:

1) which are the conditions under which the abovementioned problem
occurrs (e.g. with shared/static lib, with some arch, only with some
compiler+flags/binary format)?

2) how can I do to be sure not to encounter this problem when
debugging, i.e. which magic do I need to add to the compilation
command, even affecting code size/speed?

Thanks in advance, and thanks for the great tool.

Cheers.


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

end of thread, other threads:[~2009-04-03  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-02 13:28 C++ and "no data fields" when printing objects Stefano Sabatini
2009-04-02 18:52 ` Daniel Jacobowitz
2009-04-03 10:04   ` Stefano Sabatini
2009-04-03  7:55     ` Stefano Sabatini

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