海合会 (GCC) 4.5.3
GNU gdb (GDB) 7.5.50.20130309-cvs (cygwin-special)
网豆 7.3
在我的代码中捕获 SIGSEGV(Segment Fault Exception)时遇到了一些麻烦。try-catch 不会捕获它(下面的代码)。这是一个不可捕获的异常吗?有什么办法可以抓到吗?(当然)我做错了什么?
艺术
string SlipStringOp::dump(const SlipCell& X) const {
stringstream pretty;
PTR ptr = *getPtr(X);
pretty << "[string ] " << dumpLink(X) << " = "
<< setfill('0') << setw(8) << hex << ptr
<< " -> ";
try {
pretty << ptr->dump();
} catch(exception& e) {
pretty << e.what();
postError(SlipErr::E3023, "SlipStringOp::dump", "", "Deletion of cell deleted the pointer.");
} catch(...) {
postError(SlipErr::E3023, "SlipStringOp::dump", "", "Deletion of cell deleted the pointer.");
}
return pretty.str();
}; // string SlipStringOp::dump(const SlipCell& X) const