[Lldb-commits] [lldb] [lldb] Removed gdbserver ports map from lldb-server (PR #104238)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 23 07:54:33 PDT 2024


================
@@ -150,12 +153,17 @@ static void client_handle(GDBRemoteCommunicationServerPlatform &platform,
   printf("Disconnected.\n");
 }
 
-static GDBRemoteCommunicationServerPlatform::PortMap gdbserver_portmap;
-static std::mutex gdbserver_portmap_mutex;
-
 static void spawn_process_reaped(lldb::pid_t pid, int signal, int status) {
-  std::lock_guard<std::mutex> guard(gdbserver_portmap_mutex);
-  gdbserver_portmap.FreePortForProcess(pid);
+  if (g_single_pid != LLDB_INVALID_PROCESS_ID && g_single_pid == pid) {
+    // If not running as a server and the platform connection is closed
+    if (!g_terminate) {
+      g_terminate = true;
----------------
labath wrote:

I'm only talking about the first case in here, and there I think it should be possible to come up with a completely safe shutdown procedure (and it's going to be hard to convince me otherwise).

As for the second case, I think that even what you have right now (change to a global) is out of scope of this patch, and we should continue discussing that separately (but note I'll still be against the global).

https://github.com/llvm/llvm-project/pull/104238


More information about the lldb-commits mailing list