如何检查 dbx 中的核心文件?
我正在 AIX 上工作,并且有一个进程不断崩溃。我从未检查过核心文件,如果可能的话,希望得到一些指导。我正在使用dbx。我怎样才能(a)确保核心文件到达我想要的位置并(b)查看进程崩溃之前的状态?
谢谢!
I'm working on AIX and have a process that keeps crashing. I've never examined core files, and would like some guidance if possible. I'm using dbx. How can I (a) make sure the core file is going where I want it to go and (b) see the state of the process before it crashed?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我可以单步执行运行,但也不确定如何调试核心。
我发现这些命令可能是值得关注的。可能还有更多。
一旦你的核心在 dbx 中运行:
“下查看此处”检查数据”帮助了我。
I do okay stepping through a run but also am not sure about debugging a core.
I found these commands are probably the ones to focus on. There are probably more.
Once you have your core running in dbx:
Looking here under "Examining Data" helped me out.
core 文件在进程的当前工作目录中创建。使用
getcwd()
检查,使用chdir(
)设置。使用 dbx /path/to/progname /path/to/corefile 将程序加载到 dbx 中,您可以开始查看堆栈跟踪(“where”命令等)。
如果不指定
corefile
,dbx 将自动加载名为“core”的匹配文件(如果该文件与加载的程序位于同一目录中)(并且它们与签名匹配)。阅读 dbx 的手册页,它提供了您需要的所有调试命令。
另请注意,您的程序需要在启用调试符号的情况下进行编译(而不是稍后“剥离”),以便堆栈跟踪最有用。如果不调试符号,您将在堆栈跟踪中看到函数名称,但不会看到其他内容。
core files are created in the current working directory of a process. Check with
getcwd()
, set withchdir(
).Load your program into dbx with
dbx /path/to/progname /path/to/corefile
and you can start looking at your stack trace ("where" command, etc).If you don't specify a
corefile
dbx will automatically load a matching file named "core" if its in the same directory as the program loaded (and they match signatures).Read the man page on dbx, it gives all the debugging commands you'll need.
Also note that your program will have needed to be compiled with debugging symbols enabled (and not later 'strip'ed) in order for the stack trace to be the most useful. Without debugging symbols you'll see the function names in the stack trace, but not much else.