从核心文件恢复程序状态 [英] Restoring program state from a core file

查看:142
本文介绍了从核心文件恢复程序状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在任何情况下,是否有可能将程序状态恢复到核心文件生成过程中的状态?

我问的原因是为了利用gdb的能力来执行函数等等,你需要有一个正在运行的实例。当然,应该有可能产生一个相同的可执行文件的模拟过程,其状态设置为核心的内容?



如果不是这种排序的替代方案这首先让我想要做这件事的情况?在这种情况下,内核的反向跟踪导致了库函数,我想将输入复制到此函数调用中,但其中一个输入是复杂的对象,可以很容易地在运行时通过函数调用序列化为一个字符串但在核心转储中不是这样。

解决方案

理论上可以做到你想要的,但是(AFAICT)那里在 GDB (尚未)中不支持。



最好的办法是使用 GDB-7.0 并使用其嵌入式Python脚本重新实现序列化功能。


Is it possible, under any circumstances, to restore the state of a program to what it was during the generation of a core file?

The reason I ask is that in order to take advantage of gdb's ability to execute functions and so forth you need to have a running instance. Surely it should be possible to produce a mock process of the same executable with the state set to be the contents of the core?

If not what alternatives are there for the sort of situation that made me want to do this in the first place? In this case the back-trace of the core led to a library function and I wanted to replicate the inputs to this function call but one of the inputs is was complex object which could easily be serialized to a string with a function call in a running instance but not so in a core dump.

解决方案

It is theoretically possible to do exactly what you want, but (AFAICT) there is no support for this in GDB (yet).

Your best bet is to use GDB-7.0 and use its embedded python scripting to re-implement the serialization function.

这篇关于从核心文件恢复程序状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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