c++ - 为什么代码不会在代码块的断点处中断

标签 c++ debugging codeblocks breakpoints

我按照此视频中的说明逐行运行代码:

http://www.youtube.com/watch?v=6CGH9Z19dS8

但是,我按F8后,它只是跑了,没有走到断点处(我看不到黄色三角形)。另外,我也尝试了“attach to process”,也是一样。

我错过了什么吗?(​​顺便说一句,我的项目中有多个文件,但我想这不是问题,对吧?因为我可以在 VS studio 中轻松完成此操作。也许,我不太熟悉代码块)

感谢您的帮助!

如果你有兴趣,这是调试器日志:

Building to ensure sources are up-to-date
Selecting target: 
Release
Adding source dir: C:\Users\liuca_000\Documents\Lattice_Boltzmann_code\lattice_boltzmann\
Adding source dir: C:\Users\liuca_000\Documents\Lattice_Boltzmann_code\lattice_boltzmann\
Adding file: C:\Users\liuca_000\Documents\Lattice_Boltzmann_code\lattice_boltzmann\bin\Release\lattice_boltzmann.exe
Changing directory to: C:/Users/liuca_000/Documents/Lattice_Boltzmann_code/lattice_boltzmann/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\Python27\Lib\site-packages\PyQt4;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Python27;C:\Python27\DLLs;C:\Python27\Scripts;C:\Python27\Lib\site-packages\vtk;C:\Python27\gnuplot\binary;C:\Python27\Lib\site-packages\osgeo;C:\Program Files (x86)\pythonxy\SciTE-3.3.2-3;C:\Program Files (x86)\pythonxy\console;C:\MinGW32-xy\bin;C:\Program Files (x86)\pythonxy\swig;C:\Program Files (x86)\pythonxy\gettext\bin;C:\Program Files\MATLAB\R2012b\runtime\win64;C:\Program Files\MATLAB\R2012b\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MiKTeX 2.9\miktex\bin\x64;C:\Program Files (x86)\Windows Live\Shared;C:\Users\liuca_000\AppData\Roaming\MiKTeX\2.9\miktex\bin\x64;.;\
Starting debugger: C:\Program Files (x86)\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/Users/liuca_000/Documents/Lattice_Boltzmann_code/lattice_boltzmann/bin/Release/lattice_boltzmann.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Reading symbols from C:\Users\liuca_000\Documents\Lattice_Boltzmann_code\lattice_boltzmann\bin\Release\lattice_boltzmann.exe...(no debugging symbols found)...done.
Debugger name and version: GNU gdb (GDB) 7.5
Child process PID: 16672
[Inferior 1 (process 16672) exited normally]
Debugger finished with status 0

最佳答案

即使您已经标记了 -g 编译器选项,问题也可能是项目文件路径中的空格。移动到路径中没有空格的地方解决了我的问题。 看到:http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks#Path_with_spaces

关于c++ - 为什么代码不会在代码块的断点处中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19747706/

相关文章:

Xcode 8 调试器在输出中显示较少的字符

c - 我需要在 C 中实现 Butterworth 滤波器。获取具有此功能的库或编写代码是否更容易?

c - 在 CodeBlocks 中运行 ffmpeg 示例 c 程序时无法识别文件格式

c - 为什么 CodeBlocks 会突出显示关键字 class 并在没有任何错误的情况下编译它(我正在用 C 编程)?

c++ - 使用 zlib 将字节数组解压缩为字节数组

c++ - linux上的系统时间变化检测

c - 为什么gdb甚至介入memcpy和其他系统函数?

android - traceview无故崩溃

c++ - 未使用的链接器输入文件 c++ g++ make 文件

c++ - 比较字符串中的符号时出现 std::out_of_range 错误