From: Tom Tromey <tromey@redhat.com>
To: Jonas Maebe <jonas.maebe@elis.ugent.be>
Cc: gdb@sourceware.org
Subject: Re: Symbolic constants inside classes
Date: Mon, 20 Dec 2010 21:23:00 -0000 [thread overview]
Message-ID: <m3ei9c6svb.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1DD38938-E7BD-491F-905C-FCA963E5E941@elis.ugent.be> (Jonas Maebe's message of "Sat, 18 Dec 2010 21:17:28 +0100")
>>>>> "Jonas" == Jonas Maebe <jonas.maebe@elis.ugent.be> writes:
Jonas> Consider this C++ program:
[...]
Jonas> g++ -gdwarf-2 generates a definition for both MAGIC_NUM constants
Jonas> both in the respective class scopes, and also in the global
Jonas> namespace:
What version of g++?
Jonas> In gdb (7.0),
Jonas> 1) p MAGIC_NUM prints 42
Jonas> 2) "p Xyz::MAGIC_NUM" and "p Xyz2::MAGIC_NUM" print "static field MAGIC_NUM has been optimized out"
Jonas> 3) "p C.MAGIC_NUM" and "p C2.MAGIC_NUM" print "field MAGIC_NUM is nonexistent or has been optimised out"
I tried this example with svn trunk gcc and CVS head gdb, and it worked.
I didn't try to find out whether the fix was in gcc or gdb.
Tom
next prev parent reply other threads:[~2010-12-20 21:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-18 20:17 Jonas Maebe
2010-12-20 21:23 ` Tom Tromey [this message]
2010-12-20 22:56 ` Jonas Maebe
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=m3ei9c6svb.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb@sourceware.org \
--cc=jonas.maebe@elis.ugent.be \
/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