diff options
-rw-r--r-- | lldb/include/lldb/Host/HostInfoBase.h | 3 | ||||
-rw-r--r-- | lldb/include/lldb/Host/posix/HostInfoPosix.h | 2 | ||||
-rw-r--r-- | lldb/include/lldb/Host/windows/HostInfoWindows.h | 2 | ||||
-rw-r--r-- | lldb/source/Host/windows/HostInfoWindows.cpp | 20 |
4 files changed, 24 insertions, 3 deletions
diff --git a/lldb/include/lldb/Host/HostInfoBase.h b/lldb/include/lldb/Host/HostInfoBase.h index f2370f1d00a..a6fc2038ba4 100644 --- a/lldb/include/lldb/Host/HostInfoBase.h +++ b/lldb/include/lldb/Host/HostInfoBase.h @@ -11,7 +11,6 @@ #include "lldb/Utility/ArchSpec.h" #include "lldb/Utility/FileSpec.h" -#include "lldb/Utility/UserIDResolver.h" #include "lldb/lldb-enumerations.h" #include "llvm/ADT/StringRef.h" @@ -99,8 +98,6 @@ public: //--------------------------------------------------------------------------- static ArchSpec GetAugmentedArchSpec(llvm::StringRef triple); - static UserIDResolver &GetUserIDResolver(); - protected: static bool ComputeSharedLibraryDirectory(FileSpec &file_spec); static bool ComputeSupportExeDirectory(FileSpec &file_spec); diff --git a/lldb/include/lldb/Host/posix/HostInfoPosix.h b/lldb/include/lldb/Host/posix/HostInfoPosix.h index 2ae1415e030..c6f012bca72 100644 --- a/lldb/include/lldb/Host/posix/HostInfoPosix.h +++ b/lldb/include/lldb/Host/posix/HostInfoPosix.h @@ -14,6 +14,8 @@ namespace lldb_private { +class UserIDResolver; + class HostInfoPosix : public HostInfoBase { friend class HostInfoBase; diff --git a/lldb/include/lldb/Host/windows/HostInfoWindows.h b/lldb/include/lldb/Host/windows/HostInfoWindows.h index 3f0810527dc..209d9da0821 100644 --- a/lldb/include/lldb/Host/windows/HostInfoWindows.h +++ b/lldb/include/lldb/Host/windows/HostInfoWindows.h @@ -14,6 +14,7 @@ #include "llvm/Support/VersionTuple.h" namespace lldb_private { +class UserIDResolver; class HostInfoWindows : public HostInfoBase { friend class HostInfoBase; @@ -28,6 +29,7 @@ public: static void Terminate(); static size_t GetPageSize(); + static UserIDResolver &GetUserIDResolver(); static llvm::VersionTuple GetOSVersion(); static bool GetOSBuildString(std::string &s); diff --git a/lldb/source/Host/windows/HostInfoWindows.cpp b/lldb/source/Host/windows/HostInfoWindows.cpp index 033d6d844b4..8cd8f2d2fc5 100644 --- a/lldb/source/Host/windows/HostInfoWindows.cpp +++ b/lldb/source/Host/windows/HostInfoWindows.cpp @@ -14,15 +14,29 @@ #include "lldb/Host/windows/HostInfoWindows.h" #include "lldb/Host/windows/PosixApi.h" +#include "lldb/Utility/UserIDResolver.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/ConvertUTF.h" #include "llvm/Support/FileSystem.h" +#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Path.h" #include "llvm/Support/Threading.h" #include "llvm/Support/raw_ostream.h" using namespace lldb_private; +namespace { +class WindowsUserIDResolver : public UserIDResolver { +protected: + llvm::Optional<std::string> DoGetUserName(id_t uid) override { + return llvm::None; + } + llvm::Optional<std::string> DoGetGroupName(id_t gid) override { + return llvm::None; + } +}; +} // namespace + FileSpec HostInfoWindows::m_program_filespec; void HostInfoWindows::Initialize() { @@ -117,3 +131,9 @@ bool HostInfoWindows::GetEnvironmentVar(const std::string &var_name, return llvm::convertWideToUTF8(wvar, var); return false; } + +static llvm::ManagedStatic<WindowsUserIDResolver> g_user_id_resolver; + +UserIDResolver &HostInfoWindows::GetUserIDResolver() { + return *g_user_id_resolver; +} |