问题 打印从GDB中的Register指向的字符串


我有一个字符串被移动,我想根据寄存器打印它。

我做了以下事情:

gdb x $esp
0xbffff110:  "\274\205\004\b\324\361\377\277\334\361\377\277]\257\344\267\304s\374\267"

{then I copied the address}

>> x *0xbffff110
0x80485bc <__dso_handle+12>:     "test1"

有没有办法一步到位?


2079
2017-10-06 08:46


起源



答案:


有没有办法一步到位?

 (gdb) print *(char**)$esp

13
2017-10-06 14:08



(gdb) x/s $esp 也有效 - Panic


答案:


有没有办法一步到位?

 (gdb) print *(char**)$esp

13
2017-10-06 14:08



(gdb) x/s $esp 也有效 - Panic