I'm having a problem analyzing core dump with gdb. I'm not able to view the contents of any structure in my C code. When I use:
print myStruct->val
I get
Cannot access memory at address 0x2031b860
Or
print *myStruct
I get the same error.
This happens when I try to print content from every other structure in the code. But when I try to print a local variable which is in a function, it prints ok.
The sequence of commands executed was:
gdb ./myApp ./core
(gdb)bt
.
.
.
#25 0x0868b276 in ikev2_check_icv (ike_sa=0x2031b860, packet=0x2031a950) at ikev2_payload.c:460
.
.
(gdb) frame 25
(gdb) print ike_sa
$1 = (struct ikev2_sa *) 0x2031b860
(gdb) print *ike_sa
Cannot access memory at address 0x2031b860
(gdb)
So my question is, does core dump catch memory blocks allocated with malloc? Not just stack frame memory, as it seems from this example.
I'm running this on Linux 2.6.32.45-0.3-xen x86_64
info filesin gdb and see if the core dump file mappings have an address range that includes 0x2031b860.