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

    <tr>
        <th>Summary</th>
        <td>
            [LLDB] Hangs when connecting to lldb-server via script file on Windows
        </td>
    </tr>

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

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

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

<pre>
    On Windows, LLDB hangs when using a script file, and that script file instructs LLDB to connect to a lldb-server process.

To reproduce:

In one terminal:
```
> lldb-server.exe g localhost:9090
```

In a second terminal:
```
> lldb.exe -b -s script.txt
```
where `script.txt` contains the following:
```
process connect --plugin gdb-remote connect://localhost:9090
attach error
```
The second line, `attach error`, is just to make it clear whether execution continued to the second statement, or hung on the first one.

If these two commands are executed in an interactive `lldb.exe` invocation, they work just as expected. But when executed via a script file, LLDB hangs on the first command and doesn't end up executing the second one.

This was reported downstream in https://github.com/mstorsjo/llvm-mingw/issues/401, but the same issue can be reproduced with LLDB built with MSVC as well.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE1v6zYQ_DX0ZWGDohXJOuiQPNfoA17RwwvaM0WuJSYUKZArK_n3BSU5dtq0KGAYkvgxOzM7K2M0rUOs2cMTE-IoL0b_HIx6RSImBHs4buRInQ91H8mH-OI3jdfv9e8O_jRO-yky8Q1-_Dg-QSddG2Hq0MEYjWtBQlTBDARnYzFtk04DdZLuv4NxkcKoKC63kAflnUNF6VGCtbrZRgwXDDAErzDGHeNHxh-X_2cPAYfg9aiQ7R_vl7478A6BMPTGSXtbLfj6W173v9yj7PANoQXrlbSdj8T2jxWv-NdHrzgSIiqf6P1PsBll28A2rmLs6I2-PDF1GBBYwe_2FTyJRNK4CNQhnL21fjKu_TfYVbkPabfbwY6tcdDqZhuw94TXtXSFODFx-loBSSRVBxiCD19CPXd4FcMaN_vOCv7pWMHTVxPhZYyzzb18RTAEyqIMqYWowwD4hmok491M1rgRddpMN4BIkrBHR-k-H6AbXQveLZqYECk1wKd2-X5OixGBptRofS-djiADrmiowTiQDowjDFKRucziXz1L0ht38UqmwhIsdfgOkw-vCxsZAd8GVIR6B08jLYH4uPxi5D9zcRefT8Wv9c250R6jY6IkQKdhHK7quPZekL_Tfe5MhEnGlBEfUgHaTylwKPtEtCMa4ofjraFubHbK90ycrnlPnWAv_bY3rp2YOJkYR4xMnHKepeKbkZYKZI8wL4KSDhq85VLDZKhbaDajsbS8__bzj29Jrwmt3W10vdfVvpIbrLNS5GWVibLcdDXnWcYPBT80h0qV5yqXVZPxal9VZXnIi_PG1IKLnB9EKXieZeUOq_KsG6Flrou9LEuWc-ylsbvEY-dDu5nLrDNeiIPYWNmgjesATD6vcy_UM-9mbCPLuTWR4u0GMmTnoZlIsYcj_HqbfmuQZmv8pwGW3L-fff5jim7GYOv_cCMBX50Ygn9JQb3zYqVyqcVfAQAA___a7eFj">