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/posix | |
parent | 39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff) | |
download | src-94994d372d014ce4c8758b9605d63fae651bd8aa.tar.gz src-94994d372d014ce4c8758b9605d63fae651bd8aa.zip |
Vendor import of lldb trunk r351319 (just before the release_80 branchvendor/lldb/lldb-trunk-r351319
Notes
Notes:
svn path=/vendor/lldb/dist/; revision=343181
svn path=/vendor/lldb/lldb-trunk-r351319/; revision=343182; tag=vendor/lldb/lldb-trunk-r351319
Diffstat (limited to 'source/Host/posix')
-rw-r--r-- | source/Host/posix/ConnectionFileDescriptorPosix.cpp | 4 | ||||
-rw-r--r-- | source/Host/posix/FileSystem.cpp | 9 | ||||
-rw-r--r-- | source/Host/posix/HostInfoPosix.cpp | 4 | ||||
-rw-r--r-- | source/Host/posix/HostProcessPosix.cpp | 2 | ||||
-rw-r--r-- | source/Host/posix/PipePosix.cpp | 9 | ||||
-rw-r--r-- | source/Host/posix/ProcessLauncherPosixFork.cpp | 2 |
6 files changed, 16 insertions, 14 deletions
diff --git a/source/Host/posix/ConnectionFileDescriptorPosix.cpp b/source/Host/posix/ConnectionFileDescriptorPosix.cpp index c21bb786a896..deac3844d4a2 100644 --- a/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ b/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -21,7 +21,6 @@ #include "lldb/Utility/SelectHelper.h" #include "lldb/Utility/Timeout.h" -// C Includes #include <errno.h> #include <fcntl.h> #include <stdlib.h> @@ -33,16 +32,13 @@ #include <unistd.h> #endif -// C++ Includes #include <sstream> -// Other libraries and framework includes #include "llvm/Support/Errno.h" #include "llvm/Support/ErrorHandling.h" #if defined(__APPLE__) #include "llvm/ADT/SmallVector.h" #endif -// Project includes #include "lldb/Host/Host.h" #include "lldb/Host/Socket.h" #include "lldb/Host/common/TCPSocket.h" diff --git a/source/Host/posix/FileSystem.cpp b/source/Host/posix/FileSystem.cpp index 60be642df608..d7045ff99919 100644 --- a/source/Host/posix/FileSystem.cpp +++ b/source/Host/posix/FileSystem.cpp @@ -11,6 +11,7 @@ // C includes #include <dirent.h> +#include <fcntl.h> #include <sys/mount.h> #include <sys/param.h> #include <sys/stat.h> @@ -47,7 +48,7 @@ Status FileSystem::Readlink(const FileSpec &src, FileSpec &dst) { error.SetErrorToErrno(); else { buf[count] = '\0'; // Success - dst.SetFile(buf, false, FileSpec::Style::native); + dst.SetFile(buf, FileSpec::Style::native); } return error; } @@ -65,7 +66,7 @@ Status FileSystem::ResolveSymbolicLink(const FileSpec &src, FileSpec &dst) { return err; } - dst = FileSpec(real_path, false); + dst = FileSpec(real_path); return Status(); } @@ -73,3 +74,7 @@ Status FileSystem::ResolveSymbolicLink(const FileSpec &src, FileSpec &dst) { FILE *FileSystem::Fopen(const char *path, const char *mode) { return ::fopen(path, mode); } + +int FileSystem::Open(const char *path, int flags, int mode) { + return ::open(path, flags, mode); +} diff --git a/source/Host/posix/HostInfoPosix.cpp b/source/Host/posix/HostInfoPosix.cpp index 62c70fa3edc1..4763ebc9b9d4 100644 --- a/source/Host/posix/HostInfoPosix.cpp +++ b/source/Host/posix/HostInfoPosix.cpp @@ -119,7 +119,7 @@ uint32_t HostInfoPosix::GetEffectiveUserID() { return geteuid(); } uint32_t HostInfoPosix::GetEffectiveGroupID() { return getegid(); } -FileSpec HostInfoPosix::GetDefaultShell() { return FileSpec("/bin/sh", false); } +FileSpec HostInfoPosix::GetDefaultShell() { return FileSpec("/bin/sh"); } bool HostInfoPosix::ComputePathRelativeToLibrary(FileSpec &file_spec, llvm::StringRef dir) { @@ -163,7 +163,7 @@ bool HostInfoPosix::ComputeSupportExeDirectory(FileSpec &file_spec) { } bool HostInfoPosix::ComputeHeaderDirectory(FileSpec &file_spec) { - FileSpec temp_file("/opt/local/include/lldb", false); + FileSpec temp_file("/opt/local/include/lldb"); file_spec.GetDirectory().SetCString(temp_file.GetPath().c_str()); return true; } diff --git a/source/Host/posix/HostProcessPosix.cpp b/source/Host/posix/HostProcessPosix.cpp index 3c5273f4bd3f..f431e0c72de1 100644 --- a/source/Host/posix/HostProcessPosix.cpp +++ b/source/Host/posix/HostProcessPosix.cpp @@ -62,7 +62,7 @@ Status HostProcessPosix::GetMainModule(FileSpec &file_spec) const { return error; } - error = FileSystem::Readlink(FileSpec{link_path, false}, file_spec); + error = FileSystem::Instance().Readlink(FileSpec(link_path), file_spec); if (!error.Success()) return error; diff --git a/source/Host/posix/PipePosix.cpp b/source/Host/posix/PipePosix.cpp index b321cad64275..866a9897ee43 100644 --- a/source/Host/posix/PipePosix.cpp +++ b/source/Host/posix/PipePosix.cpp @@ -61,12 +61,13 @@ bool SetCloexecFlag(int fd) { std::chrono::time_point<std::chrono::steady_clock> Now() { return std::chrono::steady_clock::now(); } -} +} // namespace PipePosix::PipePosix() : m_fds{PipePosix::kInvalidDescriptor, PipePosix::kInvalidDescriptor} {} -PipePosix::PipePosix(int read_fd, int write_fd) : m_fds{read_fd, write_fd} {} +PipePosix::PipePosix(lldb::pipe_t read, lldb::pipe_t write) + : m_fds{read, write} {} PipePosix::PipePosix(PipePosix &&pipe_posix) : PipeBase{std::move(pipe_posix)}, @@ -125,8 +126,8 @@ Status PipePosix::CreateNew(llvm::StringRef name, bool child_process_inherit) { Status PipePosix::CreateWithUniqueName(llvm::StringRef prefix, bool child_process_inherit, llvm::SmallVectorImpl<char> &name) { - llvm::SmallString<PATH_MAX> named_pipe_path; - llvm::SmallString<PATH_MAX> pipe_spec((prefix + ".%%%%%%").str()); + llvm::SmallString<128> named_pipe_path; + llvm::SmallString<128> pipe_spec((prefix + ".%%%%%%").str()); FileSpec tmpdir_file_spec = HostInfo::GetProcessTempDir(); if (!tmpdir_file_spec) tmpdir_file_spec.AppendPathComponent("/tmp"); diff --git a/source/Host/posix/ProcessLauncherPosixFork.cpp b/source/Host/posix/ProcessLauncherPosixFork.cpp index 46ce3e3d224f..6bf78463d060 100644 --- a/source/Host/posix/ProcessLauncherPosixFork.cpp +++ b/source/Host/posix/ProcessLauncherPosixFork.cpp @@ -157,7 +157,7 @@ static void LLVM_ATTRIBUTE_NORETURN ChildFunc(int error_fd, #if defined(__linux__) if (errno == ETXTBSY) { - // On android M and earlier we can get this error because the adb deamon + // On android M and earlier we can get this error because the adb daemon // can hold a write handle on the executable even after it has finished // uploading it. This state lasts only a short time and happens only when // there are many concurrent adb commands being issued, such as when |