核心转储文件分析 [英] Core dump file analysis

查看:127
本文介绍了核心转储文件分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在分析核心转储文件时,我需要检查哪些内容?
请从头开始告诉我。

解决方案

您只需要一个二进制文件(带有调试符号)生成核心的那个。然后你可以运行 gdb path / to / the / binary path / to / the / core 来调试它。

当它启动时,您可以使用 bt (用于回溯)从崩溃时间获取堆栈跟踪。在回溯中,每个函数调用都被赋予一个数字。您可以使用 frame number (用堆栈跟踪中相应的数字替换 number )来选择特定的堆栈帧。然后可以使用 list 查看该函数的代码,并使用 info locals 查看本地变量。您也可以使用 print name_of_variable (用变量名称替换name_of_variable)以查看其值。



在GDB中输入 help 会给你一个提示,让你看到更多的命令。


What are all the things I will need to check while analyzing core dump file? Please tell me from scratch.

解决方案

You just need a binary (with debugging symbols included) that is identical to the one that generated the core. Then you can run gdb path/to/the/binary path/to/the/core to debug it.

When it starts up, you can use bt (for backtrace) to get a stack trace from the time of the crash. In the backtrace, each function invocation is given a number. You can use frame number (replacing number with the corresponding number in the stack trace) to select a particular stack frame. You can then use list to see code around that function, and info locals to see the local variables. You can also use print name_of_variable (replacing "name_of_variable" with a variable name) to see its value.

Typing help within GDB will give you a prompt that will let you see additional commands.

这篇关于核心转储文件分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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