[llvm] 960535d - Hint how to get a symbolized stack trace if llvm-symbolizer is not found on crashes

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 18:56:31 PDT 2020


Author: Mehdi Amini
Date: 2020-09-25T01:52:20Z
New Revision: 960535d65a927b27ff883250094492842c33ca86

URL: https://github.com/llvm/llvm-project/commit/960535d65a927b27ff883250094492842c33ca86
DIFF: https://github.com/llvm/llvm-project/commit/960535d65a927b27ff883250094492842c33ca86.diff

LOG: Hint how to get a symbolized stack trace if llvm-symbolizer is not found on crashes

Most users of LLVM tools hit the raw traces and don't know how to get LLVM to
symbolize automatically for them.

When we print the non-symbolized stack trace, we will add information about
how to get it symbolized.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D88269

Added: 
    

Modified: 
    llvm/lib/Support/Unix/Signals.inc

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc
index 03181a713257..1ac2e090dcb8 100644
--- a/llvm/lib/Support/Unix/Signals.inc
+++ b/llvm/lib/Support/Unix/Signals.inc
@@ -576,6 +576,9 @@ void llvm::sys::PrintStackTrace(raw_ostream &OS, int Depth) {
     Depth = depth;
   if (printSymbolizedStackTrace(Argv0, StackTrace, Depth, OS))
     return;
+  OS << "Stack dump without symbol names (ensure you have llvm-symbolizer in "
+        "your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point "
+        "to it):\n";
 #if HAVE_DLFCN_H && HAVE_DLADDR
   int width = 0;
   for (int i = 0; i < depth; ++i) {


        


More information about the llvm-commits mailing list