mirror of
https://github.com/intel/llvm.git
synced 2026-01-28 01:04:49 +08:00
[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:
@@ -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() {}
|
||||
|
||||
Reference in New Issue
Block a user