[PATCH] D48525: Handle NetBSD specific path in findDebugBinary()

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 23 17:02:29 PDT 2018


krytarowski created this revision.
krytarowski added reviewers: joerg, vitalybuka.
Herald added a subscriber: JDevlieghere.

The NetBSD Operating System installs debuginfo
files into /usr/libdata/debug, rather than other path
like in some other popular distribution.

This change makes llvm-symbolizer functional with
the basesystem executables.


Repository:
  rL LLVM

https://reviews.llvm.org/D48525

Files:
  lib/DebugInfo/Symbolize/Symbolize.cpp


Index: lib/DebugInfo/Symbolize/Symbolize.cpp
===================================================================
--- lib/DebugInfo/Symbolize/Symbolize.cpp
+++ lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -192,8 +192,13 @@
     Result = DebugPath.str();
     return true;
   }
+#if defined(__NetBSD__)
+  // Try /usr/libdata/debug/path/to/original_binary/debuglink_name
+  DebugPath = "/usr/libdata/debug";
+#else
   // Try /usr/lib/debug/path/to/original_binary/debuglink_name
   DebugPath = "/usr/lib/debug";
+#endif
   llvm::sys::path::append(DebugPath, llvm::sys::path::relative_path(OrigDir),
                           DebuglinkName);
   if (checkFileCRC(DebugPath, CRCHash)) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48525.152608.patch
Type: text/x-patch
Size: 679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180624/9f95a19b/attachment.bin>


More information about the llvm-commits mailing list