I am analyzing core dump of my application and as I go to frame #1, I print value of variable that is stored in EAX. Gdb prints value, which if was true program wouldn't call panic (disassemble shows, that it compares value from register, so no other thread could've changed it). I invoked info reg and apart of instruction pointer gave me the same result for both frame #0 and #1.
Is it possible, that Gdb shows value of register EAX for frame #0 when in frame #1?
EDIT: code looks like that:
switch(myVar){
case -1:
break;
default:
panic();
}
gdb shows:
(gdb) bt
#0 panic()
#1 0x0891a3e9 in myFunc() at myFunc.c:10
(gdb) up
#1 0x0891a3e9 in myFunc() at myFunc.c:10
10 panic();
(gdb) print myVar
$1 = -1
(gdb) print &myVar
Address requested for identifier "myVar" which is in register $eax