diff options
Diffstat (limited to 'source/Host')
-rw-r--r-- | source/Host/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/Host/common/Host.cpp | 10 | ||||
-rw-r--r-- | source/Host/common/IOObject.cpp | 14 | ||||
-rw-r--r-- | source/Host/common/Symbols.cpp | 2 | ||||
-rw-r--r-- | source/Host/freebsd/Host.cpp | 9 | ||||
-rw-r--r-- | source/Host/linux/Support.cpp | 10 | ||||
-rw-r--r-- | source/Host/macosx/Host.mm | 3 | ||||
-rw-r--r-- | source/Host/macosx/Symbols.cpp | 2 | ||||
-rw-r--r-- | source/Host/netbsd/Host.cpp | 9 | ||||
-rw-r--r-- | source/Host/openbsd/Host.cpp | 9 | ||||
-rw-r--r-- | source/Host/posix/ConnectionFileDescriptorPosix.cpp | 5 | ||||
-rw-r--r-- | source/Host/windows/Host.cpp | 10 |
12 files changed, 38 insertions, 46 deletions
diff --git a/source/Host/CMakeLists.txt b/source/Host/CMakeLists.txt index b9079ce26a2c6..73d030e198af0 100644 --- a/source/Host/CMakeLists.txt +++ b/source/Host/CMakeLists.txt @@ -13,7 +13,6 @@ add_host_subdirectory(common common/HostNativeThreadBase.cpp common/HostProcess.cpp common/HostThread.cpp - common/IOObject.cpp common/LockFileBase.cpp common/MainLoop.cpp common/MonitoringProcessLauncher.cpp diff --git a/source/Host/common/Host.cpp b/source/Host/common/Host.cpp index af0b572489225..29e5991d31aa3 100644 --- a/source/Host/common/Host.cpp +++ b/source/Host/common/Host.cpp @@ -58,6 +58,7 @@ #include "lldb/Host/Predicate.h" #include "lldb/Host/ProcessLauncher.h" #include "lldb/Host/ThreadLauncher.h" +#include "lldb/Host/posix/ConnectionFileDescriptorPosix.h" #include "lldb/Target/FileAction.h" #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Target/UnixSignals.h" @@ -73,6 +74,7 @@ #include "llvm/Support/FileSystem.h" #if defined(_WIN32) +#include "lldb/Host/windows/ConnectionGenericFileWindows.h" #include "lldb/Host/windows/ProcessLauncherWindows.h" #else #include "lldb/Host/posix/ProcessLauncherPosixFork.h" @@ -624,6 +626,14 @@ const UnixSignalsSP &Host::GetUnixSignals() { return s_unix_signals_sp; } +std::unique_ptr<Connection> Host::CreateDefaultConnection(llvm::StringRef url) { +#if defined(_WIN32) + if (url.startswith("file://")) + return std::unique_ptr<Connection>(new ConnectionGenericFile()); +#endif + return std::unique_ptr<Connection>(new ConnectionFileDescriptor()); +} + #if defined(LLVM_ON_UNIX) WaitStatus WaitStatus::Decode(int wstatus) { if (WIFEXITED(wstatus)) diff --git a/source/Host/common/IOObject.cpp b/source/Host/common/IOObject.cpp deleted file mode 100644 index 6f7de442be1dd..0000000000000 --- a/source/Host/common/IOObject.cpp +++ /dev/null @@ -1,14 +0,0 @@ -//===-- IOObject.cpp --------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lldb/Host/IOObject.h" - -using namespace lldb_private; - -const IOObject::WaitableHandle IOObject::kInvalidHandleValue = -1; diff --git a/source/Host/common/Symbols.cpp b/source/Host/common/Symbols.cpp index fe29b9e789900..e7bdf084d385a 100644 --- a/source/Host/common/Symbols.cpp +++ b/source/Host/common/Symbols.cpp @@ -11,7 +11,6 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/Timer.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/Target.h" #include "lldb/Utility/DataBuffer.h" @@ -19,6 +18,7 @@ #include "lldb/Utility/Log.h" #include "lldb/Utility/SafeMachO.h" #include "lldb/Utility/StreamString.h" +#include "lldb/Utility/Timer.h" #include "lldb/Utility/UUID.h" #include "llvm/Support/FileSystem.h" diff --git a/source/Host/freebsd/Host.cpp b/source/Host/freebsd/Host.cpp index bd547bbeb9c53..037dfc7f5e033 100644 --- a/source/Host/freebsd/Host.cpp +++ b/source/Host/freebsd/Host.cpp @@ -27,22 +27,19 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Module.h" -#include "lldb/Core/StreamFile.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/CleanUp.h" +#include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Endian.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/NameMatches.h" #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" -#include "lldb/Utility/CleanUp.h" -#include "lldb/Utility/DataBufferHeap.h" -#include "lldb/Utility/DataExtractor.h" -#include "lldb/Utility/NameMatches.h" - #include "llvm/Support/Host.h" extern "C" { diff --git a/source/Host/linux/Support.cpp b/source/Host/linux/Support.cpp index 8fbb60052e3f6..31808401ea615 100644 --- a/source/Host/linux/Support.cpp +++ b/source/Host/linux/Support.cpp @@ -32,3 +32,13 @@ lldb_private::getProcFile(::pid_t pid, const llvm::Twine &file) { LLDB_LOG(log, "Failed to open {0}: {1}", File, Ret.getError().message()); return Ret; } + +llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> +lldb_private::getProcFile(const llvm::Twine &file) { + Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST); + std::string File = ("/proc/" + file).str(); + auto Ret = llvm::MemoryBuffer::getFileAsStream(File); + if (!Ret) + LLDB_LOG(log, "Failed to open {0}: {1}", File, Ret.getError().message()); + return Ret; +} diff --git a/source/Host/macosx/Host.mm b/source/Host/macosx/Host.mm index 919b35624e60b..bbf70cd4c4b3f 100644 --- a/source/Host/macosx/Host.mm +++ b/source/Host/macosx/Host.mm @@ -58,8 +58,6 @@ #include "lldb/Core/Communication.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/StreamFile.h" -#include "lldb/Core/StructuredData.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/HostInfo.h" #include "lldb/Host/ThreadLauncher.h" @@ -73,6 +71,7 @@ #include "lldb/Utility/Log.h" #include "lldb/Utility/NameMatches.h" #include "lldb/Utility/StreamString.h" +#include "lldb/Utility/StructuredData.h" #include "llvm/Support/FileSystem.h" diff --git a/source/Host/macosx/Symbols.cpp b/source/Host/macosx/Symbols.cpp index 20508a6585634..9d1e8fe96ae98 100644 --- a/source/Host/macosx/Symbols.cpp +++ b/source/Host/macosx/Symbols.cpp @@ -26,7 +26,6 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/Timer.h" #include "lldb/Host/Host.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/CleanUp.h" @@ -35,6 +34,7 @@ #include "lldb/Utility/Endian.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" +#include "lldb/Utility/Timer.h" #include "lldb/Utility/UUID.h" #include "mach/machine.h" diff --git a/source/Host/netbsd/Host.cpp b/source/Host/netbsd/Host.cpp index bbe34a83d9992..d927f95f06753 100644 --- a/source/Host/netbsd/Host.cpp +++ b/source/Host/netbsd/Host.cpp @@ -26,22 +26,19 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Module.h" -#include "lldb/Core/StreamFile.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/CleanUp.h" +#include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Endian.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/NameMatches.h" #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" -#include "lldb/Utility/CleanUp.h" -#include "lldb/Utility/DataBufferHeap.h" -#include "lldb/Utility/DataExtractor.h" -#include "lldb/Utility/NameMatches.h" - #include "llvm/Support/Host.h" extern "C" { diff --git a/source/Host/openbsd/Host.cpp b/source/Host/openbsd/Host.cpp index 7e4a64fbd9ae4..0535256b9aa1f 100644 --- a/source/Host/openbsd/Host.cpp +++ b/source/Host/openbsd/Host.cpp @@ -23,22 +23,19 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Module.h" -#include "lldb/Core/StreamFile.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/CleanUp.h" +#include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Endian.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/NameMatches.h" #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" -#include "lldb/Utility/CleanUp.h" -#include "lldb/Utility/DataBufferHeap.h" -#include "lldb/Utility/DataExtractor.h" -#include "lldb/Utility/NameMatches.h" - #include "llvm/Support/Host.h" extern "C" { diff --git a/source/Host/posix/ConnectionFileDescriptorPosix.cpp b/source/Host/posix/ConnectionFileDescriptorPosix.cpp index c3b237a873029..6b0f069c35a95 100644 --- a/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ b/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -16,10 +16,10 @@ #include "lldb/Host/posix/ConnectionFileDescriptorPosix.h" #include "lldb/Host/Config.h" -#include "lldb/Host/IOObject.h" #include "lldb/Host/Socket.h" #include "lldb/Host/SocketAddress.h" #include "lldb/Utility/SelectHelper.h" +#include "lldb/Utility/Timeout.h" // C Includes #include <errno.h> @@ -42,13 +42,12 @@ #include "llvm/ADT/SmallVector.h" #endif // Project includes -#include "lldb/Core/Communication.h" -#include "lldb/Core/Timer.h" #include "lldb/Host/Host.h" #include "lldb/Host/Socket.h" #include "lldb/Host/common/TCPSocket.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" +#include "lldb/Utility/Timer.h" using namespace lldb; using namespace lldb_private; diff --git a/source/Host/windows/Host.cpp b/source/Host/windows/Host.cpp index 69a7c2ef4f74c..4458ce25e6079 100644 --- a/source/Host/windows/Host.cpp +++ b/source/Host/windows/Host.cpp @@ -15,16 +15,14 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Target/Process.h" -#include "lldb/Utility/Log.h" -#include "lldb/Utility/Status.h" - -#include "lldb/Core/StreamFile.h" -#include "lldb/Core/StructuredData.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Target/Process.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/DataExtractor.h" +#include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" +#include "lldb/Utility/StructuredData.h" #include "llvm/Support/ConvertUTF.h" |