Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Eric Gorr <mailist@ericgorr.net>
Cc: gdb@sourceware.org
Subject: Re: printing static const variables
Date: Thu, 16 Jul 2009 16:21:00 -0000	[thread overview]
Message-ID: <m3vdls8uqb.fsf@fleche.redhat.com> (raw)
In-Reply-To: <2C11E6EB-A5C0-4A12-8DC3-87E73C7755AC@ericgorr.net> (Eric Gorr's message of "Thu\, 16 Jul 2009 12\:16\:45 -0400")

>>>>> "Eric" == Eric Gorr <mailist@ericgorr.net> writes:

Eric> 	static const int doubleByteDegreeMark = 42;

Eric> if I try to print out the value of doubleByteDegreeMark, it gives me
Eric> the error message:

Eric> (gdb) print doubleByteDegreeMark
Eric> No symbol "doubleByteDegreeMark" in current context.

Eric> So, my (probably really simple) question is how can I print out the
Eric> value of doubleByteDegreeMark from GDB?

You didn't say how you compiled this, or what platform you're on.

Probably the compiler optimized this variable away.  If so, there's no
way to print it.

You can try dumping the debuginfo for your program to find out.  How to
do that is system-dependent, though.

Tom


  reply	other threads:[~2009-07-16 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-16 16:16 Eric Gorr
2009-07-16 16:21 ` Tom Tromey [this message]
2009-07-16 16:35   ` Eric Gorr
2009-07-16 16:56     ` Tom Tromey
2009-07-16 17:28     ` Grant Edwards

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=m3vdls8uqb.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=mailist@ericgorr.net \
    /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