Eclipse 出现调试错误

Debug Error Occurred in Eclipse

我正在尝试在 Debian 中调试一个开源包,在 Eclipse 中称为 libprotoident,Kepler 版本。因为它有 Makefile,我选择创建一个空的 Makefile 项目,然后将所有源添加到工作区中。因此,在使用 Makefile 在命令行中成功编译源代码并 运行 之后。 由于它有4个应用程序可以使用,我选择在运行配置window中运行lpi_protoident打包,如下图所示。

因此程序 运行 成功。现在我正在尝试调试它,但它会生成以下错误。

如何解决这个错误并调试项目?

关于您遇到的错误的一般答案

not in executable format: File format not reconized 错误意味着 lpi_protoident 不是您正在使用的平台上的可执行文件。

您确定您可以运行(例如从命令行)执行此操作吗?

您使用的 GDB 也有可能与可执行文件不兼容,但这种可能性较小。

从源代码构建 libprotoident

(假设您正在尝试构建 https://github.com/wanduow/libprotoident

您正在尝试构建一个 automake 项目。正常的方法是通过配置创建 Makefile,您不应该制作自己的 makefile。请参考项目中的README,但你需要做的关键部分是:

Installation

After having installed the required libraries, running the following series of commands should install libprotoident

    ./bootstrap.sh (only if you've cloned the source from GitHub)
    ./configure
    make
    make install

By default, libprotoident installs to /usr/local - this can be changed by appending the --prefix= option to ./configure.

The libprotoident tools are built by default - this can be changed by using the --with-tools=no option with ./configure.

您尝试调试的文件很可能是 automake 创建的 shell 脚本,它充当真实可执行文件的包装器,已构建在隐藏目录中。

与其告诉 Eclipse tools/protoident/lpi_protoident 是您的应用程序,不如尝试使用 tools/protoident/.libs/lpi_protoident