Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Stefano Sabatini <stefano.sabatini-lala@poste.it>
To: gdb Mailing List <gdb@sources.redhat.com>
Subject: C++ and "no data fields" when printing objects
Date: Thu, 02 Apr 2009 13:28:00 -0000	[thread overview]
Message-ID: <20090402132811.GA9472@geppetto> (raw)

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.


             reply	other threads:[~2009-04-02 13:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02 13:28 Stefano Sabatini [this message]
2009-04-02 18:52 ` Daniel Jacobowitz
2009-04-03 10:04   ` Stefano Sabatini
2009-04-03  7:55     ` Stefano Sabatini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090402132811.GA9472@geppetto \
    --to=stefano.sabatini-lala@poste.it \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox