[Lldb-commits] [lldb] r332120 - Fix a regression in r332111. The LLDB.framework path component is not
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Fri May 11 12:00:59 PDT 2018
Author: adrian
Date: Fri May 11 12:00:58 2018
New Revision: 332120
URL: http://llvm.org/viewvc/llvm-project?rev=332120&view=rev
Log:
Fix a regression in r332111. The LLDB.framework path component is not
usually the last component.
Modified:
lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
lldb/trunk/unittests/Host/HostInfoTest.cpp
Modified: lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm?rev=332120&r1=332119&r2=332120&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm (original)
+++ lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm Fri May 11 12:00:58 2018
@@ -253,7 +253,13 @@ bool HostInfoMacOSX::ComputeClangDirecto
auto r_end = llvm::sys::path::rend(raw_path);
// Check for a Posix-style build of LLDB.
- if (rev_it == r_end || *rev_it != "LLDB.framework")
+ while (rev_it != r_end) {
+ if (*rev_it == "LLDB.framework")
+ break;
+ ++rev_it;
+ }
+
+ if (rev_it == r_end)
return HostInfoPosix::ComputeClangDirectory(file_spec);
// Inside Xcode and in Xcode toolchains LLDB is always in lockstep
Modified: lldb/trunk/unittests/Host/HostInfoTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/HostInfoTest.cpp?rev=332120&r1=332119&r2=332120&view=diff
==============================================================================
--- lldb/trunk/unittests/Host/HostInfoTest.cpp (original)
+++ lldb/trunk/unittests/Host/HostInfoTest.cpp Fri May 11 12:00:58 2018
@@ -63,8 +63,14 @@ TEST_F(HostInfoTest, MacOSX) {
std::string posix = "/usr/lib/liblldb.dylib";
EXPECT_FALSE(HostInfoMacOSXTest::ComputeClangDir(posix).empty());
+ std::string framework =
+ "/SharedFrameworks/LLDB.framework";
+ std::string framework_clang =
+ "/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/clang";
+ EXPECT_EQ(HostInfoMacOSXTest::ComputeClangDir(framework), framework_clang);
+
std::string xcode =
- "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework";
+ "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A";
std::string xcode_clang =
"/Applications/Xcode.app/Contents/Developer/Toolchains/"
"XcodeDefault.xctoolchain/usr/lib/swift/clang";
More information about the lldb-commits
mailing list