调试器击错断点

时间:2019-12-01 02:03:49

标签: c++ debugging cmake breakpoints

我希望有人能帮助我...

我正在调试c ++程序以查找错误,

当我使用$ g++ -g main.cpp a.out进行编译时,调试器运行良好,但是当使用cmake时,调试器将击中我未放置断点的代码的另一部分。

这是我的CMakelists.txt

cmake_minimum_required(版本2.8.9)

项目(x)

SET(CMAKE_CXX_COMPILER“ / usr / bin / g ++”)

add_definitions(-g)

add_executable(a.out main.cpp)

编写CMakeLists.txt以便可执行文件执行与第一种方法完全相同的正确方法是什么?

谢谢!

使用$ g++ -g main.cpp a.out编译方法: The debugger hits the correct place of the breakpoint

使用CMake编译方法: Debugger highlights wrong breakpoint, I did not plced it there

0 个答案:

没有答案