Reputation: 345
my GDB output for the stack looks like this
0xffffd688: 0x98 0xd6 0xff 0xff 0x75 0x84 0x04 0x08
I'd like it to look more like this
0xbffff3b0: 0xbffff620 0xbffff3c9 0×00000006 0xbffff3d8
is there an option? am I missing something trivial here?
Upvotes: 1
Views: 643
Reputation: 7228
You indeed want (gdb) x/4xw $sp
:
(gdb) help x
Examine memory: x/FMT ADDRESS.
ADDRESS is an expression for the memory address to examine.
FMT is a repeat count followed by a format letter and a size letter.
Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),
t(binary), f(float), a(address), i(instruction), c(char) and s(string).
Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).
The specified number of objects of the specified size are printed
according to the format.
In this case, the repeat count is 4
, the format letter is x
(hex) and the size letter is w
(word, 4 bytes).
Upvotes: 1