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

    <tr>
        <th>Summary</th>
        <td>
            Target process created with incorrect file descriptors when using script
        </td>
    </tr>

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

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

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

<pre>
    When selecting a target process and selecting a script to use with `lldb <executable> -s <script>`, lldb will create a target process with the file descriptors 0u, 1u, and 2u. This means that the input and output operations from the executable cannot be interacted with from the lldb debugging session (scanf will not work). This differs from `lldb <executable>` where the file descriptors created for the process are 0r, 1w, 2w, allowing functions like scanf to read input from the lldb session.

platform: macOS Sequoia 15.0.1 (24A348)
os: Darwin 24.0.0
kernel: xnu-11215.1.12~1/RELEASE_ARM64_T6020
architecture: arm64
lldb --version: lldb-1600.0.36.3, Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VMGO5CYQ_Rp8KTUC7KbHBx86O92nRJF2RspxhXHZJkODA3i8ueTbI7Czq9FmL9WtqveKV4_CKkYzOcSOnH8h5-dKrWn2oZv8MAaDQ6p6P_zd_TGjg4gWdTJuAgVJhQkTLMFrjBGUGz6Uow5mSZA8rBFhM2kGIpm1Qw-k_oRfUa9J9RZJfYNTzLmdQeobkYyIT1Cwm7EWdECV8MczS9c0I4zGIgy4d_AhAltzB15iViZWCq-zifBA5SKkWaVCNG5ZU0H4NeW_fsGgkvEuwhj8o4C-iwWtnPMJ-sxMGJROOOwyvqGL7AH7dZqyExFjNN4BEU9RKzfuE-Ummw9vRLSHsMGMI4bj1J85RSSDbcaA_z_17tMAow8F8O1uAgILxZEtR1GistZvWeK4Or2PbM0bwi4zeQiohsOhj9MdM1HCngm77nGxKo0-PEh9hYfSv7_AC_61eqOAnymjPBsgmmvdPBHR7hQfM_hZhc04EA1llO2FNwwObS5-deuJc8HPlFMu_uFE3D_ffr1dX25frp9_k82XV8nEwVJBzyahTmvAzFXhIZu9VFSfTu8Ysu5czJkTl4xRRmtJ62zIdVkswstmxgQHFCRl5epy0io3nWSWSVvKGeiSOJoISQURbTV09dDWraqw4xfRyvaJn5tq7mrZswtv9aUfpcTmPEol1FMr6lYMTX05V6YTTDSciZqfG1HXdHzqpWr4hSsp2mEcScPwoYyl1r4_qA9TZWJcseO8bi68sqpHG8sjFsLhBqVKhMhvOnSZdOrXKZKGWRNT_N4mmWSxe_34tv7bpbLcxmkfAur0485t-buwxrLqJVmtwXZzSku-XSLuRNwnk-a1p9o_iLjnY4-f0xL8n6gTEfciNhJxP6Z578S_AQAA__8ClH_6">