2012-10-06 101 views
8

我有一個字符串被移動,我想打印它基於寄存器。從GDB的寄存器指向的打印字符串

我做了以下內容:

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" 

有沒有辦法一步到位做到這一點?

回答

9

有沒有辦法一步到位呢?

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

'(GDB)X/S $ esp'也適用 – Panic