Skip to content

[lldb] Use correct path separator for C++ library files lookup #98144

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
Jul 9, 2024

Conversation

dzhidzhoev
Copy link
Member

Use POSIX-style path separators when checking for libcpp library path.
This is necessary to run API tests from 'std-module' group compiled on Windows host for Linux target.

Take into account separator style of target platorm.
This is necessary to run API tests from 'std-module' group compiled
on Windows host for Linux target.
@dzhidzhoev dzhidzhoev added the lldb label Jul 9, 2024
@dzhidzhoev dzhidzhoev self-assigned this Jul 9, 2024
@dzhidzhoev dzhidzhoev requested a review from JDevlieghere as a code owner July 9, 2024 11:47
@llvmbot
Copy link
Member

llvmbot commented Jul 9, 2024

@llvm/pr-subscribers-lldb

Author: Vladislav Dzhidzhoev (dzhidzhoev)

Changes

Use POSIX-style path separators when checking for libcpp library path.
This is necessary to run API tests from 'std-module' group compiled on Windows host for Linux target.


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

1 Files Affected:

  • (modified) lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp (+1-1)
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp b/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp
index f43a04488230f..f3aabc12f92b7 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp
@@ -71,7 +71,7 @@ bool CppModuleConfiguration::analyzeFile(const FileSpec &f,
   // If the path is in the libc++ include directory use it as the found libc++
   // path. Ignore subdirectories such as /c++/v1/experimental as those don't
   // need to be specified in the header search.
-  if (libcpp_regex.match(f.GetPath()) &&
+  if (libcpp_regex.match(convert_to_slash(f.GetPath())) &&
       parent_path(posix_dir, Style::posix).ends_with("c++")) {
     if (!m_std_inc.TrySet(posix_dir))
       return false;

@Teemperor
Copy link
Collaborator

This LGTM

@dzhidzhoev dzhidzhoev merged commit afee09c into llvm:main Jul 9, 2024
8 checks passed
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
…98144)

Use POSIX-style path separators when checking for libcpp library path.
This is necessary to run API tests from 'std-module' group compiled on
Windows host for Linux target.
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.

4 participants