[Support] Optionally call signal handlers when a function wrapped by the the CrashRec...
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Sat, 11 Jan 2020 20:27:07 +0000 (15:27 -0500)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Sat, 11 Jan 2020 20:27:07 +0000 (15:27 -0500)
commita1f16998f371870ca4da8b3c00a093c607a36ddd
tree16c485a7efd204626905f09dfbc073c02740cf12
parent179abb091d8a1d67115d21b54001d10250756042
[Support] Optionally call signal handlers when a function wrapped by the the CrashRecoveryContext fails

This patch allows for handling a failure inside a CrashRecoveryContext in the same way as the global exception/signal handler. A failure will have the same side-effect, such as cleanup of temporarty file, printing callstack, calling relevant signal handlers, and finally returning an exception code. This is an optional feature, disabled by default.
This is a support patch for D69825.

Differential Revision: https://reviews.llvm.org/D70568
llvm/include/llvm/Support/CrashRecoveryContext.h
llvm/include/llvm/Support/Signals.h
llvm/lib/Support/CrashRecoveryContext.cpp
llvm/lib/Support/Unix/Signals.inc
llvm/lib/Support/Windows/Signals.inc
llvm/unittests/Support/CrashRecoveryTest.cpp