2012-07-25 29 views
0

我想調試一些應用程序,我想通過一些數據使用以下命令,但我得到錯誤。GDB錯誤值無法轉換爲整數

.... 
    .... 
    (gdb) x/20x $esp 
    Value can't be converted to integer. 
    (gdb) 

我的GDB版本跟隨着:

#gdb -v 
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5) 
Copyright (C) 2009 Free Software Foundation, Inc. 
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 
This is free software: you are free to change and redistribute it. 
There is NO WARRANTY, to the extent permitted by law. Type "show copying" 
and "show warranty" for details. 
This GDB was configured as "x86_64-redhat-linux-gnu". 
For bug reporting instructions, please see: 
<http://www.gnu.org/software/gdb/bugs/>. 
+1

也許你的CPU不具備ESP寄存器($ ESP)?試試'info registers',你看到了什麼? – fork0 2012-07-25 20:07:14

+0

我只是想出了..你搖滾! – Satish 2012-07-25 20:15:07

回答

2

(gdb) x/20x $esp
Value can't be converted to integer.

嘗試x/20x $rspx/20x $sp

0

你[R從64位系統統一它,所以你應該使用寄存器名稱作爲rip而不是eip等所有寄存器。

例如:

 
(gdb) x/x $rip 
0x4004c8 : 0x4005d8b8 

獲取信息註冊,查看所有 (GDB)的信息登記

 
rax   0x7ffff7dd9f60 140737351884640 

rbx   0x0 0 

rcx   0x0 0 

rdx   0x7fffffffe188 140737488347528 

rsi   0x7fffffffe178 140737488347512 

rdi   0x1 1 

rbp   0x7fffffffe090 0x7fffffffe090 

rsp   0x7fffffffe090 0x7fffffffe090 

r8    0x7ffff7dd8300 140737351877376 

r9    0x7ffff7deb9e0 140737351956960 

r10   0x7fffffffdee0 140737488346848 

r11   0x7ffff7a68be0 140737348275168 

r12   0x4003e0 4195296 

r13   0x7fffffffe170 140737488347504 

r14   0x0 0 

r15   0x0 0 

rip   0x4004c8 0x4004c8 

eflags   0x246 [ PF ZF IF ] 

cs    0x33 51 

ss    0x2b 43 

ds    0x0 0 

es    0x0 0 

fs    0x0 0 

相關問題