StackTrace c++应用程序
StackTrace C++ application
我编写了一个c++堆栈应用程序,并使用cygwin++编译器运行它。异常处理不完美导致应用程序崩溃
它给了我stacktrace dump作为文件Stack.exe.stackdump。我是StackTrace的新手,有人能告诉我怎么读它,它意味着什么吗?
根据收到的注释,只是为了澄清,堆栈数据结构只是一个例子,使应用程序崩溃,并给出stackTrace。我的意思是,这个堆栈跟踪是在程序崩溃的任何情况下生成的,与我的堆栈数据结构应用程序无关,我只是将其用作程序崩溃的现有代码。
生成异常的代码片段:
class RuntimeException{
private:
string errorMsg;
public:
RuntimeException(const string& err){errorMsg = err;}
string getMessage() const {return errorMsg;}
};
class StackEmpty : public RuntimeException{
public:
StackEmpty(const string& err) : RuntimeException(err){}
};
template <typename E >
const E& ArrayStack<E> ::top() const throw(StackEmpty)
{
if(empty()) throw StackEmpty("Top of Empty Stack");
return S[t];
}
int main()
{
ArrayStack <int> A;
cout << "######n";
cout << A.top() << "n";
cout << "######n";
}
输出:
$ ./Stack
######
Aborted (core dumped)
生成一个文件Stack.exe.stackdump,其内容如下:
Stack trace:
Frame Function Args
0022A774 7608C313 (000000C0, 0000EA60, 00000000, 0022A8A8)
0022A788 7608C2C2 (000000C0, 0000EA60, 000000A4, 0022A884)
0022A8A8 610DC559 (00000000, 00000000, 00000000, 00000000)
0022A998 610D9913 (00000000, 6110073E, 003B0023, 00230000)
0022A9F8 610D9DEE (0022A9D0, 6110073E, 003B0023, 00000006)
0022AAA8 610D9F40 (000008F4, 00000006, 00000000, 00000000)
0022AAC8 610D9F6C (00000006, 00000006, 0022AB38, 00404C6B)
0022AAF8 610DA233 (0022AB28, 611A1E9B, 0022ABAC, 00000001)
0022AB48 00404777 (00000000, 00000000, 0022AC18, 004142CB)
0022AB58 00404166 (20048588, 004460E0, 00410F78, 0040F89F)
0022AC18 004142CB (0022AC50, 00445218, 20010100, 004011B5)
0022AC68 004011EC (00000001, 0022AC90, 20010100, 612756CA)
0022ACF8 6100763A (00000000, 0022CD78, 61006C50, 00000000)
End of stack trace
我想知道这个文件意味着什么以及如何阅读它,谷歌了很多,但无法找到令人满意的答案。
谢谢
我会尝试在调试器中解码转储的核心。
gdb ./Stack.exe ./Stack.exe.stackdump
backtrace
这给出了崩溃时的调用堆栈。这与您试图实现的堆栈数据结构无关。
对于调用堆栈上的每个函数,堆栈转储显示堆栈指针、函数地址和前四个参数。与尝试使用堆栈转储相比,使用调试器可能更容易对程序进行故障排除。
相关文章:
- 试图在visual studio上用C++创建一个桌面应用程序
- FFmpeg:制作一个应用程序比直接使用ffmepg更好吗
- 在C应用程序中运行C++(带有STL)函数
- 使用VerQueryValue检索应用程序的文件描述
- Qt C++静态thread_local QNetworkAccessManager是线程应用程序的好选择吗
- 使用调试/崩溃报告将应用程序部署到客户端
- C++控制台应用程序阻止退出
- 码头化的C++应用程序是否向后兼容早期的内核版本
- 将应用程序从32位移植到64位时出现问题
- 如何改变c++应用程序的视觉效果
- WM_CTLCOLORSTATIC从未在WIN32应用程序中触发
- PC中的程序和PHONE中的本机描述应用程序之间的数据连接
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- 示例外壳应用程序显示的 V8 "segmentation fault (core dumped)"错误
- phytec phyBOARD iMX-6在从闪存而不是SD卡运行qt5 opengles应用程序时表现不佳(FPS减半
- 为什么导入Mixed native/CLR lib.dll的本机C++应用程序没有在Mixed lib.dll中的外部变
- 如何从Windows应用程序输出到标准?
- C++应用程序 MySQL odbc 数据库连接错误:在引发"otl_tmpl_exception<>"实例后终止调用
- 如何在 64 位 vb.net Windows 应用程序中引用 32 位 dll
- 如果整个应用程序是虚拟映射的,为什么 new 会进行系统调用?