So I'm doing some stack/heap digging with gdb and trying to grab the value for someInt
, but have thrown my limited gdb knowledge to get at it w/o effect. I need to get the value of someInt
using gdb, and it's only referenced at one location outside of the #define, line 20
#define someInt 0x11111111
void someFunc() {
// ...
int a = 0;
if(a==someInt) { //line 20
//...
}
}
After calling gdb on the compiled program I've tried gdb break 20
and then gdb x\dw $someInt
I get No symbol 'someInt' in current context.
If I try x/dw 0x11111111
I get 'Cannot access memory at address 0x11111111'. I can't recompile the code a la How do I print a #defined constant in GDB? and thus am lost as to how to print the value at that space.
How do I use gdb (most likely with x) to print out the value of someInt?