gpt4 book ai didi

linux - 32位机器远程调试64位进程

转载 作者:IT王子 更新时间:2023-10-29 01:27:20 28 4
gpt4 key购买 nike

我正在尝试通过我的 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;

我很困惑,因为我以前有过这个工作。对于建议执行 set architecture 的反向问题(来自 64 位机器的 32 位应用程序)也有类似的问题: Remote debug error with GDB

我尝试了各种参数,但没有成功。此外,目标平台类型 i386:x86-64 似乎是正确的。两台机器都运行 ubuntu linux。由于我上次成功运行了 gdb,所以我在两台机器上都安装了版本更新。漏洞在哪里?

最佳答案

Since I ran gdb successfully last time I installed version updates on both machines. Where is the flaw?

缺陷一定是你的内存:i*86-linux-* 版本的 GDB 不能调试 x86-64 进程,你必须gdb 构建为交叉调试器(正如 Mats Petersson 已经建议的那样),或者从某处获取预构建的调试器。

类似于:

./configure --target=x86_64-linux-gnu --host=i686-linux-gnu \
--build=i686-linux-gnu CC=gcc AR=ar RANLIB=ranlib

应该可以。

关于linux - 32位机器远程调试64位进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14424786/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com