diff options
| author | Dmitry Vasilyev <dvassiliev@accesssoftek.com> | 2024-05-23 13:59:02 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-23 13:59:02 +0400 |
| commit | 4d9e7b14e45120557e57da2f00f6d23cf122dd95 (patch) | |
| tree | 36392c7cf1262fd18ef23a506c2414c972dc1a70 /lldb/source/Breakpoint/BreakpointResolverFileLine.cpp | |
| parent | 45a95c3c543c88a669cffd3f7ee2a1b7e02b44e8 (diff) | |
[lldb][Windows] Fixed the TestBreakpointCommand test (#93122)
The TestBreakpointCommand test is incorrectly disabled for Windows
target. We can disable it for Windows host instead or just fix the
issue. This patch fixes the path separator in
BreakpointResolverFileLine::DeduceSourceMapping() and the Windows
specific absolute path in the test in case of the Windows host.
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointResolverFileLine.cpp')
| -rw-r--r-- | lldb/source/Breakpoint/BreakpointResolverFileLine.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp index d7d8c714867e..16c4ee1b88d1 100644 --- a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp +++ b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp @@ -198,16 +198,16 @@ void BreakpointResolverFileLine::DeduceSourceMapping( return; Log *log = GetLog(LLDBLog::Breakpoints); - const llvm::StringRef path_separator = llvm::sys::path::get_separator( - m_location_spec.GetFileSpec().GetPathStyle()); // Check if "b" is a suffix of "a". // And return std::nullopt if not or the new path // of "a" after consuming "b" from the back. auto check_suffix = - [path_separator](llvm::StringRef a, llvm::StringRef b, - bool case_sensitive) -> std::optional<llvm::StringRef> { + [](llvm::StringRef a, llvm::StringRef b, + bool case_sensitive) -> std::optional<llvm::StringRef> { if (case_sensitive ? a.consume_back(b) : a.consume_back_insensitive(b)) { - if (a.empty() || a.ends_with(path_separator)) { + // Note sc_file_dir and request_file_dir below are normalized + // and always contain the path separator '/'. + if (a.empty() || a.ends_with("/")) { return a; } } |
