linux - GDB错误值无法转换为整数

标签 linux debugging 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/>.

最佳答案

您从 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

关于linux - GDB错误值无法转换为整数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11657637/

相关文章:

C Unix/Linux 编程 : Which type is md_addr_t?

linux - 放入 bash 脚本中时 sed 的行为不同

java - Solr 身份验证可能吗? (或者 apache 端口身份验证也可以)

debugging - glibc 回溯 - 无法将输出重定向到文件

debugging - 黑莓:设备上的高效调试?

c++ - 在 emacs 中设置断点时隐藏源缓冲区

gdb - 是否有addr2line可以分析内存中的代码?

linux - QT下打开已有的sqlite3数据库

java - 如何使用 Visual Studio Code 调试 java dropwizard 应用程序

linux - 加载核心文件时,gdb 不会加载共享库符号,甚至 libc.so (musl)