[PATCH] D20403: Search for llvm-symbolizer binary in same directory as argv[0]

Richard Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 16:53:50 PDT 2016


rsmith added inline comments.

================
Comment at: lib/Support/Signals.cpp:85-86
@@ +84,4 @@
+    StringRef Parent = llvm::sys::path::parent_path(Argv0);
+    if (Parent.empty())
+      Parent = ".";
+    sys::findProgramByName("llvm-symbolizer", Parent);
----------------
rnk wrote:
> So, if 'clang' was on PATH, argv0 would be 'clang', parent_path will return an empty string, and then we'll try './llvm-symbolizer'? Are you sure that's what we want? Maybe just skip to the PATH search in that case?
`argv[0]` typically has the corresponding element of `$PATH` prepended to it in that case, but I agree it makes sense to skip the search entirely if we get a weird `argv[0]` rather than searching in `.`.


Repository:
  rL LLVM

http://reviews.llvm.org/D20403





More information about the llvm-commits mailing list