forked from OSchip/llvm-project
[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
This commit is contained in:
parent
62808631ac
commit
0891366571
|
@ -81,13 +81,24 @@ ProcessSP ProcessWindows::CreateInstance(lldb::TargetSP target_sp,
|
||||||
return ProcessSP(new ProcessWindows(target_sp, listener_sp));
|
return ProcessSP(new ProcessWindows(target_sp, listener_sp));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessWindows::Initialize() {
|
static bool ShouldUseLLDBServer() {
|
||||||
static llvm::once_flag g_once_flag;
|
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, []() {
|
void ProcessWindows::Initialize() {
|
||||||
PluginManager::RegisterPlugin(GetPluginNameStatic(),
|
if (!ShouldUseLLDBServer()) {
|
||||||
GetPluginDescriptionStatic(), CreateInstance);
|
static llvm::once_flag g_once_flag;
|
||||||
});
|
|
||||||
|
llvm::call_once(g_once_flag, []() {
|
||||||
|
PluginManager::RegisterPlugin(GetPluginNameStatic(),
|
||||||
|
GetPluginDescriptionStatic(),
|
||||||
|
CreateInstance);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessWindows::Terminate() {}
|
void ProcessWindows::Terminate() {}
|
||||||
|
|
Loading…
Reference in New Issue