最近刚刚安装了c++builder,将已有的代码进行调试时添加的断点总是不执行,在网上搜了一堆说要转到debug模式下,说根据下面步骤执行即可““C++Builder–>Project–>Option…–>Compiler–>Full Debug”,说的太简单了,根本没找到这样的选项,最后上谷歌搜了一下,呵呵呵呵,完美解决,只需要进行如下设置即可。
· [C++ Compiler] → [Debugging] → [Debug information] = True;
· [C++ Compiler] → [Debugging] → [Debug line number information] = True;
· [C++ Compiler] → [Optimizations] → [Disable all optimizations] = True;
· [C++ Compiler] → [Optimizations] → [Generate fastest possible code] = False;
· [C++ Linker] → [Full Debug information] = True;
· [Delphi Compiler] → [Optimization] = False;
· [Delphi Compiler] → [Use debug .dcus] = True;
(e.g. the default configuration template for MDI application is wrong)
· delete all the .pch, .# and .tds files and let the compiler recreate
· if you are running the IDE under VirtualBox consider that some versions have problem with breakpoints (v4.3.x)
实际上我只是操作了上面几条,最后两条没弄,设置后添加的断点就可以执行了。下面附上网址以供参考
https://stackoverflow.com/questions/26999818/c-breakpoints-are-ignored-missed
但是后面看到release和debug版本之间的转换工具,入下图所示,在编辑界面右侧的Project manager对话框中有下面选项,刚开始默认的是release版本,可以双击转到debug下,但是进过前面的修正可以执行断点故没有尝试过:
使用c++builder调试代码时总是错过/忽略断点的解决方法