diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 |
| commit | 94994d372d014ce4c8758b9605d63fae651bd8aa (patch) | |
| tree | 51c0b708bd59f205d6b35cb2a8c24d62f0c33d77 /source/Host/linux | |
| parent | 39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff) | |
Diffstat (limited to 'source/Host/linux')
| -rw-r--r-- | source/Host/linux/Host.cpp | 11 | ||||
| -rw-r--r-- | source/Host/linux/HostInfoLinux.cpp | 12 |
2 files changed, 10 insertions, 13 deletions
diff --git a/source/Host/linux/Host.cpp b/source/Host/linux/Host.cpp index 1a0eb767eb34..bd596f8cbfe0 100644 --- a/source/Host/linux/Host.cpp +++ b/source/Host/linux/Host.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// C Includes #include <dirent.h> #include <errno.h> #include <fcntl.h> @@ -18,20 +17,17 @@ #include <sys/utsname.h> #include <unistd.h> -// C++ Includes -// Other libraries and framework includes #include "llvm/Object/ELF.h" #include "llvm/Support/ScopedPrinter.h" -// Project includes #include "lldb/Target/Process.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Host/linux/Support.h" -#include "lldb/Utility/DataBufferLLVM.h" #include "lldb/Utility/DataExtractor.h" using namespace lldb; @@ -125,7 +121,7 @@ static bool IsDirNumeric(const char *dname) { static ArchSpec GetELFProcessCPUType(llvm::StringRef exe_path) { Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST); - auto buffer_sp = DataBufferLLVM::CreateSliceFromPath(exe_path, 0x20, 0); + auto buffer_sp = FileSystem::Instance().CreateDataBuffer(exe_path, 0x20, 0); if (!buffer_sp) return ArchSpec(); @@ -190,8 +186,7 @@ static bool GetProcessAndStatInfo(::pid_t pid, return false; process_info.SetProcessID(pid); - process_info.GetExecutableFile().SetFile(PathRef, false, - FileSpec::Style::native); + process_info.GetExecutableFile().SetFile(PathRef, FileSpec::Style::native); llvm::StringRef Rest = Environ->getBuffer(); while (!Rest.empty()) { diff --git a/source/Host/linux/HostInfoLinux.cpp b/source/Host/linux/HostInfoLinux.cpp index 1d95010e2f73..f5a6b2c97a0d 100644 --- a/source/Host/linux/HostInfoLinux.cpp +++ b/source/Host/linux/HostInfoLinux.cpp @@ -7,8 +7,9 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Host/Config.h" #include "lldb/Host/linux/HostInfoLinux.h" +#include "lldb/Host/Config.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Utility/Log.h" #include "llvm/Support/Threading.h" @@ -20,7 +21,7 @@ #include <unistd.h> #include <algorithm> -#include <mutex> // std::once +#include <mutex> using namespace lldb_private; @@ -170,7 +171,7 @@ FileSpec HostInfoLinux::GetProgramFileSpec() { ssize_t len = readlink("/proc/self/exe", exe_path, sizeof(exe_path) - 1); if (len > 0) { exe_path[len] = 0; - g_program_filespec.SetFile(exe_path, false, FileSpec::Style::native); + g_program_filespec.SetFile(exe_path, FileSpec::Style::native); } } @@ -179,14 +180,15 @@ FileSpec HostInfoLinux::GetProgramFileSpec() { bool HostInfoLinux::ComputeSupportExeDirectory(FileSpec &file_spec) { if (HostInfoPosix::ComputeSupportExeDirectory(file_spec) && - file_spec.IsAbsolute() && file_spec.Exists()) + file_spec.IsAbsolute() && FileSystem::Instance().Exists(file_spec)) return true; file_spec.GetDirectory() = GetProgramFileSpec().GetDirectory(); return !file_spec.GetDirectory().IsEmpty(); } bool HostInfoLinux::ComputeSystemPluginsDirectory(FileSpec &file_spec) { - FileSpec temp_file("/usr/lib" LLDB_LIBDIR_SUFFIX "/lldb/plugins", true); + FileSpec temp_file("/usr/lib" LLDB_LIBDIR_SUFFIX "/lldb/plugins"); + FileSystem::Instance().Resolve(temp_file); file_spec.GetDirectory().SetCString(temp_file.GetPath().c_str()); return true; } |
