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

    <tr>
        <th>Summary</th>
        <td>
            LLDB remote debugging fails with invalid host:port specification
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    I want to use lldb for remote debugging between two macs (13.3). I followed the [lldb instructions][1] and tried it with Xcode's `debugserver` as well as `lldb-server` and `lldb` 16 from brew. I want to upload and debug a locally built C++ executable called `utmpx`. Tested it between Apple Silicon & VM, and Apple Silicon & Intel, always the same error.

On the remote:
* I start the lldb server via: `/opt/homebrew/opt/llvm/bin/lldb-server platform --listen '*:1234' --server`

On the local machine:
```
(lldb) platform select remote-macosx
  Platform: remote-macosx
 Connected: no
  SDK Path: "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.3 (22E252) x86_64"
 SDK Roots: [ 0] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.2 (22D49) x86_64"
 SDK Roots: [ 1] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.3 (22E252) x86_64"
 SDK Roots: [ 2] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/12.5.1 (21G83) x86_64"
 SDK Roots: [ 3] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/10.16"
 SDK Roots: [ 4] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/12.6 (21G115) x86_64"
 SDK Roots: [ 5] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.0 (22A380) x86_64"
 SDK Roots: [ 6] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.1 (22C65) x86_64"
 SDK Roots: [ 7] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/12.4 (21F79) x86_64"
 SDK Roots: [ 8] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.2.1 (22D68) x86_64"
 SDK Roots: [ 9] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/12.5 (21G72) x86_64"
 SDK Roots: [10] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.0.1 (22A400) x86_64"
(lldb) platform connect connect://192.168.64.2:1234
 Platform: remote-macosx
    Triple: arm64-apple-macosx
OS Version: 13.3 (22E252)
  Hostname: 127.0.0.1
 Connected: yes
WorkingDir: /Users/venturo
    Kernel: Darwin Kernel Version 22.4.0: Mon Mar  6 20:55:35 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_VMAPPLE
  SDK Path: "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.3 (22E252) x86_64"
 SDK Roots: [ 0] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.2 (22D49) x86_64"
 SDK Roots: [ 1] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.3 (22E252) x86_64"
 SDK Roots: [ 2] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/12.5.1 (21G83) x86_64"
 SDK Roots: [ 3] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/10.16"
 SDK Roots: [ 4] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/12.6 (21G115) x86_64"
 SDK Roots: [ 5] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.0 (22A380) x86_64"
 SDK Roots: [ 6] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.1 (22C65) x86_64"
 SDK Roots: [ 7] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/12.4 (21F79) x86_64"
 SDK Roots: [ 8] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.2.1 (22D68) x86_64"
 SDK Roots: [ 9] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/12.5 (21G72) x86_64"
 SDK Roots: [10] "/Users/picard/Library/Developer/Xcode/macOS DeviceSupport/13.0.1 (22A400) x86_64"
(lldb) file utmpx
Current executable set to '/Users/picard/Developer/C++ Snippets/build/utmpx' (arm64).
(lldb) run
error: invalid host:port specification: '[192.168.64.2]'

```
After the `platform connect` command the connection is established according to the server's output. 

What could cause the error? Am I doing something wrong or is this a bug? I'm also a bit confused why the logged SDK are all referring to `x86_64`, when I'm on ARM.


  [1]: https://lldb.llvm.org/use/remote.html
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWE1v2zwS_jX0ZWCBor7sgw9yHO8GTdAg7rZ7K2hpbHGXIgWSspPL_vYFKTkfTfDWL-DeAhR1PBxznnk40sMZbq3YK8QFyZYkW0147xptFseyV2gmW10_LW7gyJUDp6G3CFLWW9hpAwZb7RBq3Pb7vVB72KI7IipwRw0trywQNouTKCFsHsEN7LSU-og1uAaBZMuwkVDWmb5yQitLshXJljHJVsBVDc4IrEE4OArXwL8rXSNhhQWS0xDTojmgITkFbuGIUvpPklO_7_TVoqpPVv81zmFndAtbg0eP6jm1TmpeB--wO3CQuuJSPsG2F9LBFWFLwpaAj1j1jm8lgl_GsHvv2u6R5DSCb2jdAPtER9l1EmEjpKi0AsJy-H5H2FUI9X7tRjmUYVke-ZMNZFneIqAx2kSErggth_-_qrA6nANJRithJdyAddy4sBxoHuiAg-AkKT1gwta6c4StG92i5-LZIOWhJWy9FSp8eeYSOsndTpsWplMprEOPtyCsJEkZsyQlrIDpC-8fAA18-spohHqFN6fjvxH-LBwVm78EtCixcmOi05ZX2j4O3gD3o5PP6yOHK60UVg5r76D06Web1Re4564JdDBG2PpfFo0lbN2JipuasPWt2Bpunghbr_CAUndoCFuPdbhuefV1Ays8iAo3fddp48nz5e7LnrFrljGfxOMs_5mnPsQQ2Qd-0NrZEDlbAvX1flkIbICwSudnIYgvj-DvksAuDYFFWRQHEPE_ZslZGJJLY6BRnP9FvPTyOedjxnGcnZVydvmTp8PJl8mMngUhvzyE4dzZVX4eCcXlzyEdzmFdnPcAzv7AK-DE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