diff options
author | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2019-10-10 12:21:04 +0000 |
---|---|---|
committer | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2019-10-10 12:21:04 +0000 |
commit | 6d5c10e7c611d62b74ffb83dbd7c2b2420cfe886 (patch) | |
tree | d8d1cafe7caf4b6f09f294a51dc803f8ea43ba72 /source | |
parent | 279e6d9b52cc928e604995ca5294a3512eee4f49 (diff) | |
download | lldb-6d5c10e7c611d62b74ffb83dbd7c2b2420cfe886.tar.gz |
[Windows] Introduce a switch for the `lldb-server` mode on Windows
Summary:
This patch introduces a switch, based on the environment variable
`LLDB_USE_LLDB_SERVER`, to determine whether to use the `ProcessWindows` plugin
(the old way) or the `lldb-server` way for debugging on Windows.
Reviewers: labath, amccarth, asmith, stella.stamenova
Reviewed By: labath, amccarth
Subscribers: mstorsjo, abidh, JDevlieghere, lldb-commits, leonid.mashinskiy
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68258
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@374325 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source')
-rw-r--r-- | source/Plugins/Process/Windows/Common/ProcessWindows.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/source/Plugins/Process/Windows/Common/ProcessWindows.cpp index 8a06fb7ed..c4b7a6d1a 100644 --- a/source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ b/source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -81,13 +81,24 @@ ProcessSP ProcessWindows::CreateInstance(lldb::TargetSP target_sp, 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() {} |