This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]