mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
Disable the crash reporter when running lit tests.
llvm-svn: 147965
This commit is contained in:
parent
18cdee3bee
commit
42ff94f069
@ -30,6 +30,10 @@
|
||||
#include <dlfcn.h>
|
||||
#include <cxxabi.h>
|
||||
#endif
|
||||
#if HAVE_MACH_MACH_H
|
||||
#include <mach/mach.h>
|
||||
#endif
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
static RETSIGTYPE SignalHandler(int Sig); // defined below.
|
||||
@ -261,6 +265,22 @@ static void PrintStackTrace(void *) {
|
||||
/// SIGSEGV) is delivered to the process, print a stack trace and then exit.
|
||||
void llvm::sys::PrintStackTraceOnErrorSignal() {
|
||||
AddSignalHandler(PrintStackTrace, 0);
|
||||
|
||||
#if defined(__APPLE__)
|
||||
// Environment variable to disable any kind of crash dialog.
|
||||
if (getenv("LLVM_DISABLE_CRASH_REPORT")) {
|
||||
mach_port_t self = mach_task_self();
|
||||
|
||||
exception_mask_t mask = EXC_MASK_CRASH;
|
||||
|
||||
kern_return_t ret = task_set_exception_ports(self,
|
||||
mask,
|
||||
NULL,
|
||||
EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES,
|
||||
NULL);
|
||||
(void)ret;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -239,7 +239,7 @@ static void RegisterHandler() {
|
||||
SetConsoleCtrlHandler(LLVMConsoleCtrlHandler, TRUE);
|
||||
|
||||
// Environment variable to disable any kind of crash dialog.
|
||||
if (getenv("LLVM_DISABLE_CRT_DEBUG")) {
|
||||
if (getenv("LLVM_DISABLE_CRASH_REPORT")) {
|
||||
#ifdef _MSC_VER
|
||||
_CrtSetReportHook(CRTReportHook);
|
||||
#endif
|
||||
|
@ -16,11 +16,11 @@ class TestingConfig:
|
||||
'PATH' : os.pathsep.join(litConfig.path +
|
||||
[os.environ.get('PATH','')]),
|
||||
'SYSTEMROOT' : os.environ.get('SYSTEMROOT',''),
|
||||
'LLVM_DISABLE_CRASH_REPORT' : '1',
|
||||
}
|
||||
|
||||
if sys.platform == 'win32':
|
||||
environment.update({
|
||||
'LLVM_DISABLE_CRT_DEBUG' : '1',
|
||||
'PATHEXT' : os.environ.get('PATHEXT',''),
|
||||
'PYTHONUNBUFFERED' : '1',
|
||||
'TEMP' : os.environ.get('TEMP',''),
|
||||
|
Loading…
Reference in New Issue
Block a user