如何获得没有核心文件的回溯? [英] How to get backtrace without core file?

查看:149
本文介绍了如何获得没有核心文件的回溯?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果未生成core-dump(由于任何可能的原因)。而我想知道后面的跟踪(指令的执行顺序)。如何做到这一点?

In case core-dump is not generated(due to any possible reason). And I want to know back trace (execution sequence of instructions). How Can I do that?

由于/ proc / pid / maps存储进程的内存映射。
是否有任何存储用户空间或进程内核空间的linux文件?(可能是使用错误的单词来表达)

As /proc/pid/maps stores the memory map of a process. Is there any file in linux which stores userspace or kernel space of a process?(May be I'm using wrong words to express)

我的意思是说出所有地址按地址执行指令的顺序。

I mean to say all address by address sequence of execution of instructions.

推荐答案

要查看进程的内核栈是什么样的时间:

To see what the kernel stack for a process looks like at the present time:

sudo cat / proc / PID / stack

如果您想查看进程的用户堆栈,并且可以在运行时得到它(即使它被卡住等待系统调用返回),运行 gdb 并附加它使用其PID。然后使用 backtrace 命令。如果程序使用调试符号编译,这将更加翔实。

If you want to see the user stack for a process, and can get to it while it is still running (even if it is stuck waiting for a system call to return), run gdb and attach to it using its PID. Then use the backtrace command. This will be much more informative if the program was compiled with debug symbols.

这篇关于如何获得没有核心文件的回溯?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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