Core dump analysis using gdb(使用 gdb 进行核心转储分析)
问题描述
我有几个关于核心转储的问题.我在 Windows 上有 gdb,使用 Cygwin.
I have a couple of questions regarding core dumps. I have gdb on Windows, using Cygwin.
核心转储文件的位置在哪里?它是一个 .exe.stackdump 文件吗?(这是崩溃后生成的唯一文件)我在其他论坛上读到核心转储文件名为core".但我没有看到任何名为core"的文件.
What is the location of core dump file? Is it a.exe.stackdump file? (This is the only file that generated after crash) I read on other forums that the core dump file is named "core". But I don't see any file with name "core".
打开和理解核心转储文件的命令是什么?
What is the command for opening and understanding core dump file?
推荐答案
您需要配置 Cygwin 以通过包含来生成核心转储
You need to configure Cygwin to produce core dumps by including
error_start=x:path odumper.exe
在您的 CYGWIN
环境变量中(参见 这里 在自卸车"部分了解更多信息).如果你不这样做,你只会得到一个堆栈跟踪——不过,这也可以帮助你诊断问题.
error_start=x:path odumper.exe
in your CYGWIN
environment variable (see here in section "dumper" for more information). If you didn't do this, you will only get a stacktrace -- which may also help you in diagnosing the problem, though.
按如下方式启动 gdb 以将其附加到核心转储文件:
Start gdb as follows to attach it to a core dump file:
gdb myexecutable --core=mycorefile
您现在可以使用常用的 gdb 命令来打印堆栈跟踪、检查变量的值等等.
gdb myexecutable --core=mycorefile
You can now use the usual gdb commands to print a stacktrace, examine the values of variables, and so on.
这篇关于使用 gdb 进行核心转储分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 gdb 进行核心转储分析


- 一起使用 MPI 和 OpenCV 时出现分段错误 2022-01-01
- C++ 协变模板 2021-01-01
- Stroustrup 的 Simple_window.h 2022-01-01
- 从python回调到c++的选项 2022-11-16
- 使用/clr 时出现 LNK2022 错误 2022-01-01
- 如何对自定义类的向量使用std::find()? 2022-11-07
- STL 中有 dereference_iterator 吗? 2022-01-01
- 静态初始化顺序失败 2022-01-01
- 近似搜索的工作原理 2021-01-01
- 与 int by int 相比,为什么执行 float by float 矩阵乘法更快? 2021-01-01