调试由valgrind生成的核心 [英] Debugging a core produced by valgrind

查看:1140
本文介绍了调试由valgrind生成的核心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Valgrind生成了一个vgcore.NNNN文件 - 如何使用GDB调试核心?我需要使用原始的可执行文件并提供核心,还是还有其他一些方法呢?

Valgrind produced a vgcore.NNNN file -- how do I debug the core using GDB? Do I need to use the original executable and supply the core, or is there some other way to do it?

使用valgrind作为根可执行文件似乎不起作用,并且使用直接在GDB中运行在valgrind下的可执行文件与核心似乎产生了不良的后跟。

Using valgrind as the root executable doesn't seem to work, and using the executable that was being run under valgrind directly in GDB with the core seems to produce bad backtraces.

推荐答案

这对我很好:

gdb ./a.out vgcore.21650

这就是你应该如何使用vgcore。

and that's how you are supposed to use the vgcore.

如果您的程序在崩溃之前损坏了堆栈,那么显然你不会从vgcore获得好的堆栈跟踪。您可能想要使用实际的Valgrind报告来扩大您的问题,导致崩溃。

If your program corrupted stack before crashing, then obviously you wouldn't get good stack traces from vgcore. You might want to expand your question with actual Valgrind report that led to the crash.

这篇关于调试由valgrind生成的核心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆