summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Urakov <aleksandr.urakov@jetbrains.com>2019-10-10 12:21:04 +0000
committerAleksandr Urakov <aleksandr.urakov@jetbrains.com>2019-10-10 12:21:04 +0000
commit0891366571b2cf3e4e27d40af228fe5bd9e4e755 (patch)
treeeeaaa12e2a04b4f0e2ee22df93ad6fd163b2afb5
parent62808631acceaa8b78f8ab9b407eb6b943ff5f77 (diff)
downloadbcm5719-llvm-0891366571b2cf3e4e27d40af228fe5bd9e4e755.tar.gz
bcm5719-llvm-0891366571b2cf3e4e27d40af228fe5bd9e4e755.zip
[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 llvm-svn: 374325
-rw-r--r--lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
index 8a06fb7ed37..c4b7a6d1a90 100644
--- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ b/lldb/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() {}
OpenPOWER on IntegriCloud