【发布时间】:2013-01-03 16:33:36
【问题描述】:
我正在尝试使用我的 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 以来,我在两台机器上都安装了版本更新。缺陷在哪里?
【问题讨论】:
-
你的 gdbserver 是什么版本?
-
如果您确实找到了答案,请发布,因为我相信它对其他人有帮助。我的回答显然不够具体。
-
如果你仍然有你的修改
--target=x86_64-*-linux,我会接受:) -
用 ssh 连接到另一台机器并通过它运行 gdb 怎么样?似乎是一个更简单的解决方案......
-
我正在为 gdb 使用图形前端,所有基础设施也在我的笔记本上。