<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/119058>119058</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Remote debug lost debug server connection
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          haozia816
      </td>
    </tr>
</table>

<pre>
    Host OS: Ubuntu20.04-x86_64
Host LLDB: 18.1.8
Remote OS: OpenWRT armv7-unknown-linux-musleabi
Remote LLDB-SERVER: 18.1.8

Remote commands:
```
./lldb-server platform --listen "*:10000" --server
```

Host commands:
```
root@vc:~# /usr/local/bin/lldb
(lldb) log enable lldb platform
(lldb) platform select remote-linux
lldb force = true, arch=(<null>, <null>)
lldb             create = true
 Platform: remote-linux
 Connected: no
(lldb) platform connect connect://192.168.123.179:10000
lldb PlatformRemoteGDBServer::GetRemoteWorkingDirectory() -> '/root'
  Platform: remote-linux
    Triple: armv7-unknown-linux-musleabi
OS Version: 5.4.238 (5.4.238)
  Hostname: OpenWrt
 Connected: yes
WorkingDir: /root
 Kernel: #0 SMP Mon Apr 17 13:15:36 2023
(lldb) file "/root/untitled/build/untitled"
lldb             force = false, arch=(arm, arm---eabi)
lldb             create = true
Current executable set to '/root/untitled/build/untitled' (arm).
(lldb) run
error: Lost debug server connection
```
But with the same remote machine, the same program file, the same operation method, and the same LLVM version, switching the host to Windows can work normally:
```
C:\Users\vc>D:\z\dev\cpp\clang+llvm-18.1.8-x86_64-pc-windows-msvc\bin\lldb.exe
(lldb) log enable lldb platform
(lldb) platform select remote-linux
 force = true, arch=(<null>, <null>)
 create = true
  Platform: remote-linux
 Connected: no
(lldb) platform connect connect://192.168.123.179:10000
 PlatformRemoteGDBServer::GetRemoteWorkingDirectory() -> '/root'
  Platform: remote-linux
    Triple: armv7-unknown-linux-musleabi
OS Version: 5.4.238 (5.4.238)
  Hostname: OpenWrt
 Connected: yes
WorkingDir: /root
 Kernel: #0 SMP Mon Apr 17 13:15:36 2023
(lldb) file C:\Users\vc\Desktop\untitled
 force = false, arch=(arm, arm---eabi)
 create = false
 PlatformAndroid::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformAndroid::CreateInstance() aborting creation of remote-android platform
 force = false, arch=(arm, arm---eabi)
 create = false
 PlatformRemoteiOS::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformRemoteiOS::CreateInstance() aborting creation of platform
 PlatformRemoteMacOSX::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformRemoteMacOSX::CreateInstance() aborting creation of platform
 force = false, arch=(arm, arm---eabi)
 create = false
 force = false, arch=(arm, arm---eabi)
 create = false
 force = false, arch=(arm, arm---eabi)
 create = false
 PlatformAndroid::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformAndroid::CreateInstance() aborting creation of remote-android platform
 force = false, arch=(arm, arm---eabi)
 create = false
 PlatformRemoteiOS::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformRemoteiOS::CreateInstance() aborting creation of platform
 PlatformRemoteMacOSX::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformRemoteMacOSX::CreateInstance() aborting creation of platform
 force = false, arch=(arm, arm---eabi)
 create = false
 force = false, arch=(arm, arm---eabi)
 create = false
 force = false, arch=(arm, arm---eabi)
 create = false
 PlatformAndroid::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformAndroid::CreateInstance() aborting creation of remote-android platform
 force = false, arch=(arm, arm---eabi)
 create = false
 PlatformRemoteiOS::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformRemoteiOS::CreateInstance() aborting creation of platform
 PlatformRemoteMacOSX::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformRemoteMacOSX::CreateInstance() aborting creation of platform
 force = false, arch=(arm, arm---eabi)
 create = false
 force = false, arch=(arm, arm---eabi)
 create = false
 force = false, arch=(arm, arm---eabi)
 create = false
 PlatformAndroid::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformAndroid::CreateInstance() aborting creation of remote-android platform
 force = false, arch=(arm, arm---eabi)
 create = false
 PlatformRemoteiOS::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformRemoteiOS::CreateInstance() aborting creation of platform
 PlatformRemoteMacOSX::CreateInstance(force=false, arch={arm,arm---eabi})
 PlatformRemoteMacOSX::CreateInstance() aborting creation of platform
 force = false, arch=(arm, arm---eabi)
 create = false
 force = false, arch=(arm, arm---eabi)
 create = false
 PlatformRemoteGDBServer::GetModuleSpec - failed to get module info for C:/Users/vc/Desktop/untitled:arm---eabi
Current executable set to 'C:\Users\vc\Desktop\untitled' (arm).
(lldb) run
 target 0x000001B107A07B50
 PlatformRemoteGDBServer::GetRemoteWorkingDirectory() -> '/root'
 Platform::Install (src='C:\Users\vc\Desktop\untitled', dst='/root/untitled')
 Platform::Install (src='C:\Users\vc\Desktop\untitled', dst='/root/untitled') fixed_dst='/root/untitled'
 [PutFile] Using block by block transfer....

 dest_file = 4

 PlatformRemoteGDBServer::SetFilePermissions(path='/root/untitled', file_permissions=700) error = 0 ((null))
Hello World!1 launched: 'C:\Users\vc\Desktop\untitled' (arm)
(ldb) Process 23301 exited with status = 0 (0x00000000)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWUFv4zoO_jXKhbAhS3EcH3Jwkua9xbaYYvJmurdCsZnEW1kKJDlt32F_-0Ky0ybtTFvsdnbfIUXRuJREfiQ_EhEtrK03CnFC0ilJ5wPRuq02k63Qf9ZinIwGK109Tn7X1sGXJeEFfFu1yrWMxnQYPYxHt6MhoUVYv7ycT_2OZBwn8ZjQ4is22mF_7ssO1c3XP0CYZp9FrbpT-l5FslbtQ9S0VqJY1c9nvK5oefH1-8XXE5XPO0rdNEJVlnAvJCPa_9IiJmwhZbWKLJo9GthJ4dbaNBBFsrYOFRDGCCsILxJKKSWMQdRvfqHq4NrPjRmtHRnSfUl48S_CO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