This revision was automatically updated to reflect the committed changes. Closed by commit rG0891366571b2: [Windows] Introduce a switch for the `lldb-server` mode on Windows (authored by aleksandr.urakov).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68258/new/ https://reviews.llvm.org/D68258 Files: lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp Index: lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp =================================================================== --- lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -81,13 +81,24 @@ return ProcessSP(new ProcessWindows(target_sp, listener_sp)); } -void ProcessWindows::Initialize() { - static llvm::once_flag g_once_flag; +static bool ShouldUseLLDBServer() { + llvm::StringRef use_lldb_server = ::getenv("LLDB_USE_LLDB_SERVER"); + return use_lldb_server.equals_lower("on") || + use_lldb_server.equals_lower("yes") || + use_lldb_server.equals_lower("1") || + use_lldb_server.equals_lower("true"); +} - llvm::call_once(g_once_flag, []() { - PluginManager::RegisterPlugin(GetPluginNameStatic(), - GetPluginDescriptionStatic(), CreateInstance); - }); +void ProcessWindows::Initialize() { + if (!ShouldUseLLDBServer()) { + static llvm::once_flag g_once_flag; + + llvm::call_once(g_once_flag, []() { + PluginManager::RegisterPlugin(GetPluginNameStatic(), + GetPluginDescriptionStatic(), + CreateInstance); + }); + } } void ProcessWindows::Terminate() {}
Index: lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp =================================================================== --- lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -81,13 +81,24 @@ return ProcessSP(new ProcessWindows(target_sp, listener_sp)); } -void ProcessWindows::Initialize() { - static llvm::once_flag g_once_flag; +static bool ShouldUseLLDBServer() { + llvm::StringRef use_lldb_server = ::getenv("LLDB_USE_LLDB_SERVER"); + return use_lldb_server.equals_lower("on") || + use_lldb_server.equals_lower("yes") || + use_lldb_server.equals_lower("1") || + use_lldb_server.equals_lower("true"); +} - llvm::call_once(g_once_flag, []() { - PluginManager::RegisterPlugin(GetPluginNameStatic(), - GetPluginDescriptionStatic(), CreateInstance); - }); +void ProcessWindows::Initialize() { + if (!ShouldUseLLDBServer()) { + static llvm::once_flag g_once_flag; + + llvm::call_once(g_once_flag, []() { + PluginManager::RegisterPlugin(GetPluginNameStatic(), + GetPluginDescriptionStatic(), + CreateInstance); + }); + } } void ProcessWindows::Terminate() {}
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits