Skip to content

[lldb][Instrumentation] GetPreferredAsanModule should be no-op on non-Darwin platforms #132911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

Michael137
Copy link
Member

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

…-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.
@llvmbot
Copy link
Member

llvmbot commented Mar 25, 2025

@llvm/pr-subscribers-lldb

Author: Michael Buch (Michael137)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/132911.diff

1 Files Affected:

  • (modified) lldb/source/Plugins/InstrumentationRuntime/Utility/Utility.cpp (+4)
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) {

Copy link
Collaborator

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to have this call into platform, but this is better than what was there before.

@Michael137 Michael137 merged commit 1bb755f into llvm:main Mar 25, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants