diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-06-09 00:53:21 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-06-09 00:53:21 +0000 |
| commit | 2ad6d48b0c631d7fa8416c07f8b47f167cfd2fd8 (patch) | |
| tree | 3d828acb25a67cb8ec584877faa300c9c8ae2289 /llvm/lib/Support/Windows | |
| parent | 6d1d27542fd66465f5e1e3e4248910b15f47a8b2 (diff) | |
| download | bcm5719-llvm-2ad6d48b0c631d7fa8416c07f8b47f167cfd2fd8.tar.gz bcm5719-llvm-2ad6d48b0c631d7fa8416c07f8b47f167cfd2fd8.zip | |
Search for llvm-symbolizer binary in the same directory as argv[0], before
looking for it along $PATH. This allows installs of LLVM tools outside of
$PATH to find the symbolizer and produce pretty backtraces if they crash.
llvm-svn: 272232
Diffstat (limited to 'llvm/lib/Support/Windows')
| -rw-r--r-- | llvm/lib/Support/Windows/Signals.inc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Support/Windows/Signals.inc b/llvm/lib/Support/Windows/Signals.inc index 3a0e5569f93..834f50ad10e 100644 --- a/llvm/lib/Support/Windows/Signals.inc +++ b/llvm/lib/Support/Windows/Signals.inc @@ -206,6 +206,8 @@ static PTOP_LEVEL_EXCEPTION_FILTER OldFilter = NULL; static CRITICAL_SECTION CriticalSection; static bool CriticalSectionInitialized = false; +static StringRef Argv0; + enum { #if defined(_M_X64) NativeMachineType = IMAGE_FILE_MACHINE_AMD64 @@ -240,7 +242,7 @@ static bool printStackTraceWithLLVMSymbolizer(llvm::raw_ostream &OS, break; } - return printSymbolizedStackTrace(&StackTrace[0], Depth, OS); + return printSymbolizedStackTrace(Argv0, &StackTrace[0], Depth, OS); } namespace { @@ -496,7 +498,10 @@ void sys::DisableSystemDialogsOnCrash() { /// PrintStackTraceOnErrorSignal - When an error signal (such as SIBABRT or /// SIGSEGV) is delivered to the process, print a stack trace and then exit. -void sys::PrintStackTraceOnErrorSignal(bool DisableCrashReporting) { +void sys::PrintStackTraceOnErrorSignal(StringRef Argv0, + bool DisableCrashReporting) { + ::Argv0 = Argv0; + if (DisableCrashReporting || getenv("LLVM_DISABLE_CRASH_REPORT")) Process::PreventCoreFiles(); |

