This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: printing static const variables
- From: Tom Tromey <tromey at redhat dot com>
- To: Eric Gorr <mailist at ericgorr dot net>
- Cc: gdb at sourceware dot org
- Date: Thu, 16 Jul 2009 10:21:00 -0600
- Subject: Re: printing static const variables
- References: <2C11E6EB-A5C0-4A12-8DC3-87E73C7755AC@ericgorr.net>
- Reply-to: tromey at redhat dot com
>>>>> "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