“无源文件命名”错误调试Eclipse CDT [英] "No source file named" error debugging Eclipse CDT

查看:188
本文介绍了“无源文件命名”错误调试Eclipse CDT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个共享库的项目(动态加载),我正在尝试调试它。我收到以下错误消息:

 没有名为/ home / username / Code / path / to / project / MyFile的源文件。 cpp。 

在搜索其他线程后,我已经确保我正在使用-g进行编译,相应的文件夹位于调试配置的源路径选项卡上。奇怪的是,它给出了正确的绝对路径:它引用的文件确实存在,所以我不明白为什么它不认为它在那里。



任何人知道该怎么做?

解决方案

我刚刚遇到同样的问题,尽管我的断点在可执行文件本身,在共享库中。要解决这个问题,我不得不打开调试配置,选择我的调试配置并调整以下设置:




  • 有一个链接选择其他...来选择创建流程启动器。点击链接。勾选使用配置特定设置。选择标准创建流程启动器,然后按确定。

  • 转到调试器选项卡,在选项卡的顶部选择 Debugger:gdb / mi。什么可能/可能没有区别:在同一个选项卡上还有一个复选框使用完整的文件路径设置断点 - 我玩这个,但它似乎并不影响我们观察到的问题(显然,我们的源路径已经是完整路径)。



对于共享库中的断点,您可能需要其他信息(特别是关于延迟断点)从使用eclipse cdt和gdb调试为什么eclipse cdt忽略断点



注意:这是指Eclipse Kepler(4.3)和gdb 7.4。


I've got a project with a shared library (loaded dynamically), and I'm attempting to debug it. I get the following error message:

No source file named /home/username/Code/path/to/project/MyFile.cpp.

After having searched other threads, I've ensured that I'm compiling with -g, and that the appropriate folders are on the source paths tab of debug configurations. The strange part is that it's giving the correct absolute path: the file it references does exist, so I don't understand why it doesn't think it's there.

Anyone know what to do about this?

解决方案

I just came across the same issue, although my breakpoints were in the executable itself, not in a shared library. To solve this, I had to open the "Debug configuration", select my debug configuration and adjust the following settings:

  • At the bottom, there is a link "Select other ..." to select the Create Process launcher. Click the link. Tick the "Use configuration specific settings". Select "Standard Create Process Launcher" and press "Ok".
  • Go to the "Debugger" tab, and on the top of the tab select "Debugger: gdb/mi". What may/may not make a difference: On the same tab there is also a checkbox "Use full file path to set breakpoints" - I played with this, but it does not seem to affect the issue we observe (obviously, our source paths are already full paths).

For breakpoints in shared libraries, you might need additional information (especially about deferred breakpoints) from Debugging with eclipse cdt and gdb and Why does eclipse cdt ignore breakpoints.

Note: This refers to Eclipse Kepler (4.3) and gdb 7.4.

这篇关于“无源文件命名”错误调试Eclipse CDT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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