简体   繁体   English

调试以发布模式构建的库

[英]Debugging a library built in release mode

I have a library that needs to be built in Release Mode with Debug Info for reasons out of my control.由于我无法控制的原因,我有一个需要在带有调试信息的发布模式下构建的库。

I have an executable to run unit tests that links to a dynamic build of the library.我有一个可执行文件来运行链接到库的动态构建的单元测试。

I tried using breakpoints to debug the code but step by step won't go into methods defined in the library.我尝试使用断点来调试代码,但一步一步不会进入库中定义的方法。 I then tried to write to std::cerr and std::cout , flushing or not flushing but I can't see the statements in the console when running the unit tests, even when passing --verbose .然后我尝试写入std::cerrstd::cout ,刷新或不刷新,但在运行单元测试时我看不到控制台中的语句,即使通过--verbose

How can I get std::cerr/out to work or is there a third way to debug the library I am not seeing?我怎样才能让 std::cerr/out 工作,或者有没有第三种方法来调试我没有看到的库?

所以基本上我在执行测试时没有将共享库的新版本复制到测试可执行目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM