diff --git a/lldb/source/API/SBPlatform.cpp b/lldb/source/API/SBPlatform.cpp --- a/lldb/source/API/SBPlatform.cpp +++ b/lldb/source/API/SBPlatform.cpp @@ -488,7 +488,7 @@ void SBPlatform::SetSDKRoot(const char *sysroot) { LLDB_INSTRUMENT_VA(this, sysroot); if (PlatformSP platform_sp = GetSP()) - platform_sp->SetSDKRootDirectory(sysroot); + platform_sp->SetSDKRootDirectory(llvm::StringRef(sysroot).str()); } SBError SBPlatform::Get(SBFileSpec &src, SBFileSpec &dst) {