debugging - Clion 调试会话:/proc/self/cwd 中的断点定位
问题描述
我在 linux (rh6) 版本 2019.3.2 上运行 Clion IDE。
运行调试会话时,我在项目源文件(例如 /path/to/myproject/myFile.cpp)中设置的断点被忽略 - 当我运行调试会话时,它们从红点变为灰色的“禁用”符号.
我意识到(通过使用“异常中断”功能)在调试会话期间,源文件是从 /proc/self/cwd/ 看到的,并且断点与该位置而不是原始文件相关联,因此我最终得到编辑器中的两个选项卡引用相同的源文件。我在 /proc/self/cwd/myFile.cpp 中设置的断点被命中。
Clion 是如何提出源重复的?有谁知道解决这个问题的方法?
请注意,我在 IDE 之外构建并使用 CMakeLists.txt 纯粹作为项目文件(以获得导航/包含分辨率)。我有一个 add_custom_target() 语句可以创建调试目标。
我的 CMakeLists.txt(已简化,因此易于理解):
cmake_minimum_required(VERSION 3.7)
project(MyProject)
set(SOURCE_FILES
Source1.C
Source1.H
Source2.C #has a main method
Source2.H
)
add_library(libMyProject STATIC ${SOURCE_FILES}) # that's so the source files are visible by Clion (to get syntax highlighting etc)
add_custom_target(myProject_exe) # The executable I am trying to debug. I am building using bazel from outside Clion so I need to make the IDE aware of that custom target
解决方案
推荐阅读
- sql - 更新另一个表中的值
- python-3.x - 0001:循环,提问直到有效响应
- javascript - Vue:如何根据 RadioButton 选择显示不同的图像
- xcode - 无法在 mac 上安装 hyper kit,因为它在 brew intall 期间显示错误
- android - 从数据有效负载构造通知
- ios - 如何在 SWIFT 中设计类似组合框的文本字段或按钮
- sql - 用名称中的句点重命名clickhouse中的列
- javascript - 检查用户是否正在与 $in 运算符进行对话
- javascript - 基于组的对象组数组
- firebase - 我无法从 Firestore 获取数据“‘Future 实例’
'"