This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
printing static const variables
- From: Eric Gorr <mailist at ericgorr dot net>
- To: gdb at sourceware dot org
- Date: Thu, 16 Jul 2009 12:16:45 -0400
- Subject: printing static const variables
I have a function which looks like:
Boolean TestFunction( void )
{
static const int doubleByteDegreeMark = 42;
static int anotherVar = 12;
return ( doubleByteDegreeMark == 42 && anotherVar == 12 );
}
I set a breakpoint inside of this function and when it stops at this
breakpoint, I do 'info locals' and it prints out:
(gdb) info locals
anotherVar = 12
if I try to print out the value of doubleByteDegreeMark, it gives me
the error message:
(gdb) print doubleByteDegreeMark
No symbol "doubleByteDegreeMark" in current context.
So, my (probably really simple) question is how can I print out the
value of doubleByteDegreeMark from GDB?
Thank you.