1

我的堆栈的 GDB 输出如下所示

0xffffd688:     0x98    0xd6    0xff    0xff    0x75    0x84    0x04    0x08

我希望它看起来更像这样

0xbffff3b0: 0xbffff620 0xbffff3c9 0×00000006 0xbffff3d8

有选择吗?我在这里错过了一些微不足道的事情吗?

4

1 回答 1

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 字节)。

于 2013-03-09T02:49:19.577 回答