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

    <tr>
        <th>Summary</th>
        <td>
            Re-attach debugger to parent process after child exits
        </td>
    </tr>

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

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

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

<pre>
    When debugging a complex multi-process code like Rust compiler unit tests, the current `settings set target.process.follow-fork-mode child|parent` is too limiting because a compiler test does a tree-like traversal - forking a subprocess which may spawn another subprocess, waiting for the child to finish, and forking another process and waiting for that, etc.  If the follow mode is `child`, it will stop debugging when the first child exits. If it is the `parent`, it will never go into any child processes.

Thus, it is currently impossible to add a breakpoint to the code and wait for it to be hit - because it might be in the second child process that runs.

Would it be possible for the debugger to re-attach to the parent process once the child exits?

See also
* https://github.com/vadimcn/codelldb/discussions/1231
* https://github.com/vadimcn/codelldb/issues/317

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyclEGv6jYQhX-N2YyIEgfCZZEFfRVSt6-V3tpOJsn0OjbyjOHx7ysnwON20UVXCOw558x3kA0zjR6xVfvf1P73jUkyhdj6e4r0ubGhv7c_JvTQo03jSH4EA12YLw5_wpyc0PYSQ4fM0IUewdEnwvfEslwihxGSJwFBFlb6G8iE0KUY0QuopmQUIT8yMAqIiSNK8RAshuBcuG2HED-3cxbvJnK9Ony7mDyumhKIQUIARzNlGbDYmcT4yLjYZ2foAzIYkIi4XSJKNFeMbBxsIRusi3Gyz21uE3UTzOYOfDE3D8YHmTC-Xcnb3MzqO4S4bpYTggQYyBNP-Yrx_S-Hh8jTJJ99lTCSZ1C6AuCPYdFcMcBCgDhDWzk0Zb5KAjdyDljC5a2kW-5smaaYy1hy4U8SLrIuyYJuwiz3wvmu5_GKEcYA5CWA8feHxiM6cqHKkypPf02JH3PEz2bdHWi-BGayDjMO0_dgwEY0n5dAXvJvC6-81JPCgoCWM4swkcD2VSgJzDROkk9o3YyxC77_GmshCDH5Z7wfIbk-T1uEV6BnWyuu_B8JEHFrREw3PaOtVF7CwXf4VvGCUtXn1eVPRDCOQ_6mTzCJXFjVJ6XPSp9HkinZoguz0uer6WnuvNLnvLpzvVX63BN3iZmCZ6XPla6r_ylEzAmzRl0dVHna9G3dH-uj2WBbHeqP5uNwbOrN1B53jdmVx2Y47svh2GBlsDnYqv4w_d6W1W5DrS71vtTlrmr2elcXxpRNae3O1HYo94da7UqcDbnCuetchDhuFu-20vtDddg4Y9Hx8qZo7fEGy6nSOj8xsc1DW5tGVrvSEQv_khESh-33VxvvHf2rEjMIxvc-Nim69j-YZZPHR361_sZO3qE9sl9b_U8AAAD__xRnvmQ">