diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp @@ -772,7 +772,8 @@ // check whether we have a windows path, and so the first character is a // drive-letter not a hostname. - if (host.size() == 1 && llvm::isAlpha(host[0]) && path.startswith("\\")) + if (host.size() == 1 && llvm::isAlpha(host[0]) && + (path.startswith("\\") || path.startswith("/"))) return path_from_dwarf; return path; diff --git a/lldb/source/Utility/FileSpec.cpp b/lldb/source/Utility/FileSpec.cpp --- a/lldb/source/Utility/FileSpec.cpp +++ b/lldb/source/Utility/FileSpec.cpp @@ -311,7 +311,8 @@ if (absolute_path.startswith(R"(\\)")) return Style::windows; if (absolute_path.size() >= 3 && llvm::isAlpha(absolute_path[0]) && - absolute_path.substr(1, 2) == R"(:\)") + (absolute_path.substr(1, 2) == R"(:\)" || + absolute_path.substr(1, 2) == R"(:/)")) return Style::windows; return llvm::None; } diff --git a/lldb/unittests/Utility/FileSpecTest.cpp b/lldb/unittests/Utility/FileSpecTest.cpp --- a/lldb/unittests/Utility/FileSpecTest.cpp +++ b/lldb/unittests/Utility/FileSpecTest.cpp @@ -196,9 +196,12 @@ EXPECT_EQ(FileSpec::Style::posix, FileSpec::GuessPathStyle("//net/bar.txt")); EXPECT_EQ(FileSpec::Style::windows, FileSpec::GuessPathStyle(R"(C:\foo.txt)")); + EXPECT_EQ(FileSpec::Style::windows, + FileSpec::GuessPathStyle(R"(C:/foo.txt)")); EXPECT_EQ(FileSpec::Style::windows, FileSpec::GuessPathStyle(R"(\\net\foo.txt)")); EXPECT_EQ(FileSpec::Style::windows, FileSpec::GuessPathStyle(R"(Z:\)")); + EXPECT_EQ(FileSpec::Style::windows, FileSpec::GuessPathStyle(R"(Z:/)")); EXPECT_EQ(llvm::None, FileSpec::GuessPathStyle("foo.txt")); EXPECT_EQ(llvm::None, FileSpec::GuessPathStyle("foo/bar.txt")); EXPECT_EQ(llvm::None, FileSpec::GuessPathStyle("Z:"));