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 生成了一个 vgcore.NNNN 文件——如何使用 GDB 调试内核?我是否需要使用原始可执行文件并提供核心,还是有其他方法可以做到这一点?
使用 valgrind 作为根可执行文件似乎不起作用,并且使用在核心 GDB 中直接在 valgrind 下运行的可执行文件似乎会产生不好的回溯。
这对我来说很好:
gdb ./a.out vgcore.21650
这就是你应该如何使用 vgcore。
如果您的程序在崩溃之前损坏了堆栈,那么显然您不会从 vgcore 获得良好的堆栈跟踪。您可能希望使用导致崩溃的实际 Valgrind 报告来扩展您的问题。