Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在完成一个代码模块,并想通过 Valgrind 运行我的程序以确保我已经考虑了所有内存,但是我的程序失败了一个断言,该断言在单独运行时不会失败。从 Valgrind 运行时是否可以在调试器中停止?我目前正在阅读手册,但我想我可以更快地从你们那里得到答案。
我发现了这个--db-attach=yes论点。每次检测到错误时都会停止,并询问您是否要在此时进入调试器。
--db-attach=yes
然而,对于我的程序,这被证明很难使用。我从标准输入中读取了一个文件进行初始化,我认为 Valgrind 将 EOL 解释为对其提示的响应。