https://github.com/Michael137 created 
https://github.com/llvm/llvm-project/pull/132911

The regex we use to find the compiler-rt library is already Darwin-specific, so 
no need to run this on non-Darwin platforms.

>From 219355ada6f01f2c5e1a0654a2dc6231e70340ad Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuc...@gmail.com>
Date: Tue, 25 Mar 2025 10:20:04 +0000
Subject: [PATCH] [lldb][Instrumentation] GetPreferredAsanModule should be
 no-op on non-Darwin platforms

The regex we use to find the compiler-rt library is already
Darwin-specific, so no need to run this on non-Darwin platforms.
---
 .../source/Plugins/InstrumentationRuntime/Utility/Utility.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lldb/source/Plugins/InstrumentationRuntime/Utility/Utility.cpp 
b/lldb/source/Plugins/InstrumentationRuntime/Utility/Utility.cpp
index 3cbd03b24297a..0f69a5e9e57c8 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/Utility/Utility.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/Utility/Utility.cpp
@@ -18,6 +18,10 @@ namespace lldb_private {
 ///< This helper searches the target for such a dylib. Returns nullptr if no
 ///< such dylib was found.
 lldb::ModuleSP GetPreferredAsanModule(const Target &target) {
+  // Currently only supported on Darwin.
+  if (!target.GetArchitecture().GetTriple().isOSDarwin())
+    return nullptr;
+
   lldb::ModuleSP module;
   llvm::Regex pattern(R"(libclang_rt\.asan_.*_dynamic\.dylib)");
   target.GetImages().ForEach([&](const lldb::ModuleSP &m) {

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to