c++ abort override
问题 Some C++ libraries call abort() function in the case of error (for example, SDL). No helpful debug information is provided in this case. It is not possible to catch abort call and to write some diagnostics log output. I would like to override this behaviour globally without rewriting/rebuilding these libraries. I would like to throw exception and handle it. Is it possible? 回答1: Note that abort raises the SIGABRT signal, as if it called raise(SIGABRT) . You can install a signal handler that