我正在尝试从我的 32 位英特尔笔记本电脑在远程英特尔 64 位机器上调试(一个简单的 Hello World 应用程序,没有测试错误)。
我跑
gcc -g -o cexecute cexecute.c
gdbserver localhost:2345 cexecute
在远程机器上。
在我将笔记本本地端口转发2345
到同一个远程端口后,运行gdb
并输入
target remote localhost:2345
我得到:
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) target remote localhost:2345
Remote debugging using localhost:2345
warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
of GDB. Attempting to continue with the default i386:x86-64 settings.
warning: Architecture rejected target-supplied description
Remote register badly formatted: T0506:0000000000000000;07:e0dbffffff7f0000;10:c0b6ddf7ff7f0000;thread:p64bc.64bc;core:6;
here: 00000000;07:e0dbffffff7f0000;10:c0b6ddf7ff7f0000;thread:p64bc.64bc;core:6;
我很困惑,因为我以前做过这个工作。建议执行的反向问题(来自 64 位机器的 32 位应用程序)也有类似的问题set architecture
:
Remote debug error with GDB
我用各种论据尝试了这个,但没有成功。目标平台类型i386:x86-64
似乎也是正确的。两台机器都运行 ubuntu linux。自从我上次成功运行 gdb 以来,我在两台机器上都安装了版本更新。缺陷在哪里?