Eclipse调试错误:没有这样的文件或目录 [英] Eclipse Debug Error: No such file or directory\n

查看:425
本文介绍了Eclipse调试错误:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Eclipse Neon(在Linux上)中以调试模式运行C ++项目,但遇到一个奇怪的错误,我找不到任何引用。

I am trying to run a C++ project in Eclipse Neon (on Linux) in debug mode and I am getting a weird error I can find no reference to.

这就是我的意思右键单击Debug As>>后,在控制台中看到本地C / C ++应用程序:

This is what I see in the console after right clicking Debug As >> Local C/C++ Application:


&无法执行-c exec / correct / path / to / executable .\n

&"Cannot exec -c exec /correct/path/to/executable .\n"

&错误:没有这样的文件或目录\n

&"Error: No such file or directory\n"

否则该应用程序将生成并正常运行。我可以右键单击并运行方式>>本地C / C ++应用程序。造成此错误的原因是什么?

The application otherwise builds and runs fine. I can right click and Run As >> Local C/C++ Application. What is causing this error?

编辑:

我发现了一些似乎在正确的轨道上。此问题和答案( https://unix.stackexchange.com/questions/167918 / gdb-cannot-exec-my-test-program )讨论设置SHELL环境。我的默认shell是bash。

I have found out some more info which appears to be on the right track. This question and answer (https://unix.stackexchange.com/questions/167918/gdb-cannot-exec-my-test-program) talks about setting the SHELL environment. My default shell is bash.

如果我通过命令行在GDB中运行程序,它会给出与Eclipse相同的错误,但没有\n:

If I run my program in GDB through the command line it gives the same error as Eclipse, but without the \n:


不能执行-c exec / correct / path / to / executable。

Cannot exec -c exec /correct/path/to/executable .

错误:没有这样的文件或目录

Error: No such file or directory

如果我再输入 SHELL = / bin / sh SHELL = / bin / bash 并再次运行GDB,它可以很好地调试。我的计算机上还安装了旧版本的Eclipse,该版本正在用于另一个项目。这个版本在调试中运行程序没有问题,据我所知,所有调试设置都是相同的。

If I then type SHELL=/bin/sh or SHELL=/bin/bash and run GDB again it debugs fine. I also have an old version of Eclipse installed on my computer which was being used for another project. This version has no problem running programs in debug and as far as I can tell all the debug settings are the same.

即使我只是构建了一个可执行文件,此问题在所有可执行文件中也是相同的简单的C hello world程序。

This problem is the same across all executables, even if I just build a simple C hello world program.

推荐答案

我按照本文中的说明进行操作(https://unix.stackexchange.com/questions/167918/gdb-cannot-exec-my-test-program )。在关闭Eclipse,重新引导,打开Eclipse并清理所有内容,重新构建索引并构建所有内容的情况下完成所有操作。现在可以正确调试了。

I followed the instruction in this post (https://unix.stackexchange.com/questions/167918/gdb-cannot-exec-my-test-program) again. Do it all with Eclipse closed, re-boot, open Eclipse and clean all, re-build indexes and build everything. Can now de-bug properly.

这篇关于Eclipse调试错误:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆