【发布时间】:2012-03-25 00:20:55
【问题描述】:
我的 C++ 程序以 std::logic_error 退出,我想追踪导致它的源代码行。我该怎么做?
TBH,我正在使用 gdb,使用 g++ -g 来添加调试信息。我能得到的只有这些消息:
此应用程序已请求运行时以不寻常的方式终止它。 请联系应用程序的支持团队以获取更多信息。 在抛出 'std::logic_error' 的实例后调用终止 what(): basic_string::_S_construct null 无效
Catchpoint 1 (exception thrown), 0x0045ffa0 in __cxa_throw ()
(gdb) bt
#0 0x0045ffa0 in __cxa_throw ()
#1 0x004601e8 in std::__throw_logic_error(char const*) ()
#2 0x00502238 in typeinfo for std::__timepunct<wchar_t> ()
#3 0x004685f8 in std::runtime_error::what() const ()
#4 0x03210da8 in ?? ()
#5 0x002efbcc in ?? ()
#6 0x00468734 in std::domain_error::~domain_error() ()
#7 0x00000000 in ?? ()
(gdb)
【问题讨论】:
标签: c++ runtime-error