我的堆栈GDB输出如下所示
0xffffd688: 0x98 0xd6 0xff 0xff 0x75 0x84 0x04 0x08
我希望它看起来更像这个
0xbffff3b0: 0xbffff620 0xbffff3c9 0×00000006 0xbffff3d8
有选择吗?我在这里错过了一些小事吗?
答案 0 :(得分:1)
你确实想要(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.
在这种情况下,重复计数为4
,格式字母为x
(十六进制)和尺寸字母是w
(字,4个字节)。