segvcatch

 

About

This is a crossplatform C++ library designed to convert a hardware exceptions, such as segmentation fault, or floating point errors, into a software language exceptions, which can be handled later with a try/catch construction.

Other words, it's a crossplatform structured exception handling (SEH).

For example, this code is working fine:

try
{
   
*(int*)0=0;
}
catch(std::exception& e)
{
    std
::cerr <<"Exception catched : "<< e.what()<< std::endl;
}

不错,经测试,可以用。
但是有些心虚,应为毕竟segment fault 之后,堆栈就已经被破坏了。。。 

相关文章:

  • 2021-08-05
  • 2021-07-31
  • 2022-12-23
  • 2021-07-26
猜你喜欢
  • 2021-12-24
  • 2021-10-12
  • 2021-09-17
  • 2021-10-29
  • 2021-12-09
  • 2021-05-24
  • 2021-11-28
相关资源
相似解决方案