Eclipse CDT 调试附加到进程 - 不是可执行格式 : File format not recognized

标签 eclipse gdb eclipse-cdt

我正在尝试使用带有 CDT 的 Eclipse 来调试 64 位二进制文​​件。该二进制文件是在 Eclipse 外部构建的,并且运行良好。我在 Eclipse 外部启动二进制文件,然后尝试使用“C/C++ Attach to Application”调试配置类型附加到进程。

我可以从运行调试配置时弹出的列表中选择进程,但是,我收到以下错误消息:

Error in final launch sequence
Failed to execute MI command:
attach 22014
Error message from debugger back end:
"program.x64": not in executable format: File format not recognized

如果我针对 i386 目标进行构建,则一切正常。

我不太确定该去哪里,我读到它可能与 Eclipse 中的二进制解析器有关:

This link提到解析器,并且 this link描述了已修复的 PE 解析器的错误。

我正在 Linux x64 上运行 Eclipse Indigo 和 Eclipse CDT 8.0.0。我已经尝试过project_properties/c++_build/settings 下的“Elf Parser”和“GNU Elf Parser”,但没有成功。

文件信息:

hostmachinea:file program.x64 
programs.x64: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

GDB 和 gdbinit 文件是 Eclipse 默认文件

最佳答案

听起来 Eclipse 使用的 GDB 是为 i386 构建的,因此无法调试 64 位二进制文​​件。您可能需要安装支持 64 位的 GDB。

当前 GDB 的错误消息如下所示:

$ ./gdb --version
GNU gdb (GDB) 7.3.50.20110809-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
...
This GDB was configured as "i686-linux".
...

$ ./gdb -q /bin/date
"/bin/date": not in executable format: File format not recognized

GDB and gdbinit files are the Eclipse defaults

您安装的是 32 位还是 64 位版本的 CDT?

关于Eclipse CDT 调试附加到进程 - 不是可执行格式 : File format not recognized,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7199557/

相关文章:

android - DDMS 不显示来自设备的线程

python - 部署 Python 应用程序时出现 Unicode 编码错误

eclipse - Eclipse 中的 headless 构建 : how to retrieve result value

java - 尝试遵循基本的如何将 Android 与 PHP、MySQL 教程连接起来 : application crashes - cannot import android. os.StrictMode

eclipse - Egit 已安装但未显示

c++ - 卡在 _dl_sysinfo_int80 上的多线程应用程序

c - GDB 影响 setcontext 结果

c - 测试 EINTR 信号

eclipse - 如何设置 Eclipse CDT 使用 GCC-4 而不是 GCC?

c++ - Eclipse conio.h 解决错误