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]

Re: printing static const variables


>>>>> "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


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