diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 11:55:28 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 11:55:28 +0000 |
commit | 66b75430a93929d6fc6ed63db14ca28e3ad5b1f6 (patch) | |
tree | 9ed5e1a91f242e2cb5911577356e487a55c01b78 /source/Host/common/HostInfoBase.cpp | |
parent | 23814158e5384f73c6fa951b66d5f807f9c24a2b (diff) | |
download | FreeBSD-src-66b75430a93929d6fc6ed63db14ca28e3ad5b1f6.zip FreeBSD-src-66b75430a93929d6fc6ed63db14ca28e3ad5b1f6.tar.gz |
Vendor import of stripped lldb trunk r256633:
https://llvm.org/svn/llvm-project/lldb/trunk@256633
Diffstat (limited to 'source/Host/common/HostInfoBase.cpp')
-rw-r--r-- | source/Host/common/HostInfoBase.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/source/Host/common/HostInfoBase.cpp b/source/Host/common/HostInfoBase.cpp index e969e33..0f4324f 100644 --- a/source/Host/common/HostInfoBase.cpp +++ b/source/Host/common/HostInfoBase.cpp @@ -20,6 +20,7 @@ #include "llvm/ADT/Triple.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Host.h" +#include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" #include <thread> @@ -102,7 +103,7 @@ HostInfoBase::GetVendorString() { static std::once_flag g_once_flag; std::call_once(g_once_flag, []() { - g_fields->m_vendor_string = std::move(HostInfo::GetArchitecture().GetTriple().getVendorName().str()); + g_fields->m_vendor_string = HostInfo::GetArchitecture().GetTriple().getVendorName().str(); }); return g_fields->m_vendor_string; } @@ -306,7 +307,10 @@ HostInfoBase::ComputeSharedLibraryDirectory(FileSpec &file_spec) FileSpec lldb_file_spec( Host::GetModuleFileSpecForHostAddress(reinterpret_cast<void *>(reinterpret_cast<intptr_t>(HostInfoBase::GetLLDBPath)))); - + + // This is necessary because when running the testsuite the shlib might be a symbolic link inside the Python resource dir. + FileSystem::ResolveSymbolicLink(lldb_file_spec, lldb_file_spec); + // Remove the filename so that this FileSpec only represents the directory. file_spec.GetDirectory() = lldb_file_spec.GetDirectory(); @@ -341,19 +345,9 @@ HostInfoBase::ComputeProcessTempFileDirectory(FileSpec &file_spec) bool HostInfoBase::ComputeTempFileBaseDirectory(FileSpec &file_spec) { - file_spec.Clear(); - - const char *tmpdir_cstr = getenv("TMPDIR"); - if (tmpdir_cstr == nullptr) - { - tmpdir_cstr = getenv("TMP"); - if (tmpdir_cstr == nullptr) - tmpdir_cstr = getenv("TEMP"); - } - if (!tmpdir_cstr) - return false; - - file_spec = FileSpec(tmpdir_cstr, false); + llvm::SmallVector<char, 16> tmpdir; + llvm::sys::path::system_temp_directory(/*ErasedOnReboot*/ true, tmpdir); + file_spec = FileSpec(std::string(tmpdir.data(), tmpdir.size()), true); return true; } |