[Lldb-commits] [PATCH] D117581: [lldb] Use lldb-server by default on Windows

Stella Stamenova via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 18 10:12:58 PST 2022


stella.stamenova created this revision.
stella.stamenova added reviewers: JDevlieghere, clayborg, labath.
stella.stamenova requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

The current default is to not use lldb-server on Windows, however, lldb-server is more stable than ProcessWindows, so default to using lldb-server.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117581

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
@@ -79,17 +79,16 @@
 
 ProcessSP ProcessWindows::CreateInstance(lldb::TargetSP target_sp,
                                          lldb::ListenerSP listener_sp,
-                                         const FileSpec *,
-                                         bool can_connect) {
+                                         const FileSpec *, bool can_connect) {
   return ProcessSP(new ProcessWindows(target_sp, listener_sp));
 }
 
 static bool ShouldUseLLDBServer() {
   llvm::StringRef use_lldb_server = ::getenv("LLDB_USE_LLDB_SERVER");
-  return use_lldb_server.equals_insensitive("on") ||
-         use_lldb_server.equals_insensitive("yes") ||
-         use_lldb_server.equals_insensitive("1") ||
-         use_lldb_server.equals_insensitive("true");
+  return !use_lldb_server.equals_insensitive("off") &&
+         !use_lldb_server.equals_insensitive("no") &&
+         !use_lldb_server.equals_insensitive("0") &&
+         !use_lldb_server.equals_insensitive("false");
 }
 
 void ProcessWindows::Initialize() {
@@ -97,9 +96,8 @@
     static llvm::once_flag g_once_flag;
 
     llvm::call_once(g_once_flag, []() {
-      PluginManager::RegisterPlugin(GetPluginNameStatic(),
-                                    GetPluginDescriptionStatic(),
-                                    CreateInstance);
+      PluginManager::RegisterPlugin(
+          GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance);
     });
   }
 }
@@ -115,9 +113,8 @@
 ProcessWindows::ProcessWindows(lldb::TargetSP target_sp,
                                lldb::ListenerSP listener_sp)
     : lldb_private::Process(target_sp, listener_sp),
-      m_watchpoint_ids(
-          RegisterContextWindows::GetNumHardwareBreakpointSlots(),
-          LLDB_INVALID_BREAK_ID) {}
+      m_watchpoint_ids(RegisterContextWindows::GetNumHardwareBreakpointSlots(),
+                       LLDB_INVALID_BREAK_ID) {}
 
 ProcessWindows::~ProcessWindows() {}
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117581.400900.patch
Type: text/x-patch
Size: 2206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220118/f7e8e106/attachment.bin>


More information about the lldb-commits mailing list