I am trying to understand how to read memory address and find out its value using GDB.
In code, I assigned a value:
xyz->a = -1;
In GDB I see this:
(gdb) p xyz->a
$1 = 65535
(gdb) p/x xyz->a
$2 = 0xffff
(gdb) p &(xyz->a)
$3 = (some_type *) 0x172e750
(gdb) x/40xb 0x172e750
0x172e750: 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00
0x172e758: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x172e760: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x172e768: 0xc0 0xe0 0x5b 0x01 0x00 0x00 0x00 0x00
0x172e770: 0xd8 0x00 0x00 0x00 0x29 0x00 0x00 0x00
Firstly, how do I read the memory addresses and their values to determine xyz->a value?
Second, looks like there is an Endian issue going on? How do I confirm that?