【发布时间】:2013-07-16 14:43:39
【问题描述】:
我正在对崩溃的程序进行事后分析。我在 Linux(Ubuntu 12.04,x86)上,代码是用 C++ 编写的。该程序正在使用一些可能包含有价值信息的单例。如果它是这样创建的,是否可以找到指向单例实例的指针:
SingletonType& SingletonType::getInstance(){
static SingletonType* instance = new SingletonType();
return *instance;
}
如果可能的话,它是如何在 GDB 中完成的?
【问题讨论】:
-
p/x &SingletonType::getInstance()? -
不,很遗憾,如果没有正在运行的进程,您无法执行此操作。
标签: c++ linux gdb postmortem-debugging