我在哪里可以看到Visual Studio 2012中未处理的std :: exception的what()消息? [英] Where can I see the what() message from an unhandled std::exception in Visual Studio 2012?
问题描述
是否有办法从未处理的异常中查看解释性字符串?我正在使用Visual Studio 2012 Express,但似乎找不到找到它的方法。
Is there a way to see the explanatory string from an unhandled exception? I'm using Visual Studio 2012 Express and can't seem to find a way to see it.
运行以下代码时:
#include <stdexcept>
int main(int argc, char* argv[])
{
throw std::runtime_error("warp core breach");
return 0;
}
我在输出窗口中得到的都是:
all I get in the output window is this:
First-chance exception at 0x7652C41F in vstest.exe: Microsoft C++ exception: std::runtime_error at memory location 0x0015F6A4.
Unhandled exception at at 0x7652C41F in vstest.exe: Microsoft C++ exception: std::runtime_error at memory location 0x0015F6A4.
我本来希望在此打印翘曲核心破坏消息。我将调试->输出窗口->常规输出设置下的所有选项都设置为开。
I would have expected the "warp core breach" message to be printed there. I have all options under Debugging->Output Window->General Output Settings set to On.
推荐答案
您将获得一个窗口当抛出异常并带有break / continue / ignore选项时。复制并粘贴此对话框报告的十六进制地址,然后单击 break
按钮。现在在监视窗口中,在第一列的单元格中输入以下内容:(std :: runtime_error *)(0x002cfbc8)
。
You'll get a window when the exception is thrown with the option to break/continue/ignore. Copy and paste the hex address this dialog reports, then click the break
button. Now in a watch window, enter something like: (std::runtime_error*)(0x002cfbc8)
into a cell in the first column.
这篇关于我在哪里可以看到Visual Studio 2012中未处理的std :: exception的what()消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!