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

    <tr>
        <th>Summary</th>
        <td>
            lldb-dap is sending "removed" module events for modules that we never told the client about
        </td>
    </tr>

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

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

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

<pre>
    `lldb-dap` is sending module events with reason "removed"  for modules that we never told the client about in the first place.

```
--> (stdin/stdout) {"command":"launch","arguments":{"type":"lldb-dap","request":"launch","name":"Launch LLDB","program":"/Users/jonas/llvm/build-ra/bin/lldb","args":[],"env":[],"cwd":"/Users/jonas/llvm/llvm-project","__configurationTarget":6,"__sessionId":"8a3c0be9-4a19-469e-930d-25143dbc62ff"},"type":"request","seq":2}
--> (stdin/stdout) {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":3}
[...]
--> (stdin/stdout) {"command":"configurationDone","type":"request","seq":7}
<-- (stdin/stdout) {"command":"configurationDone","request_seq":7,"seq":0,"success":true,"type":"response"}
--> (stdin/stdout) {"command":"threads","type":"request","seq":8}
<-- (stdin/stdout) {"body":{"module":{"addressRange":"4294967296","debugInfoSize":"","id":"F65578D0-ACAE-349B-82FC-553E776F4C39","name":"lldb","path":"/Users/jonas/llvm/build-ra/bin/lldb","symbolFilePath":"/Users/jonas/llvm/build-ra/bin/lldb","symbolStatus":"Symbols loaded."},"reason":"removed"},"event":"module","seq":0,"type":"event"}
<-- (stdin/stdout) {"command":"launch","request_seq":2,"seq":0,"success":true,"type":"response"}
<-- (stdin/stdout) {"body":{"module":{"addressRange":"18446744073709551615","id":"127B0D25-7228-3A62-B8F9-677ABAAE9903","name":"liblzma.5.dylib","path":"/usr/lib/liblzma.5.dylib","symbolStatus":"Symbols not found.","version":"6.3.0"},"reason":"removed"},"event":"module","seq":0,"type":"event"}
<-- (stdin/stdout) {"body":{"module":{"addressRange":"18446744073709551615","id":"84805E4D-4BD8-3799-9D82-B06EB243B431","name":"libedit.3.dylib","path":"/usr/lib/libedit.3.dylib","symbolStatus":"Symbols not found.","version":"3.0.0"},"reason":"removed"},"event":"module","seq":0,"type":"event"}
<-- (stdin/stdout) {"body":{"module":{"addressRange":"18446744073709551615","id":"EB5AE5B3-913D-310C-9197-A091D38AFD94","name":"libxml2.2.dylib","path":"/usr/lib/libxml2.2.dylib","symbolStatus":"Symbols not found.","version":"10.9.0"},"reason":"removed"},"event":"module","seq":0,"type":"event"}
<-- (stdin/stdout) {"body":{"module":{"addressRange":"18446744073709551615","id":"4EF5FA3A-5C8B-32D1-8F06-6D5B5AF41D41","name":"libobjc.A.dylib","path":"/usr/lib/libobjc.A.dylib","symbolStatus":"Symbols not found.","version":"228.0.0"},"reason":"removed"},"event":"module","seq":0,"type":"event"}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzkV12vozYQ_TXkBRmZMQb8kAcIQdpqH6pu-7wyMEm8BZy1TbZ3f30Fl3x1k-rm3l210kqRCPaM53jO8ZiR1qptj7j0eO7xYiEHt9Nm-UuBh1bhdocGF5VunpZeTNu2qUgj915MfWV9i32j-q3f6WZo0ccD9s76X5Tb-Qal1b3vARjs9AEbD8D3N9rMxtZ3O-n8L-j3eEDjO902vtuhX7cKe-fLSg_OV_00tlHGOn_fyhoDj2bjL6bzj2aEeGzte5Ba16jeg9K6Rg_OA-F7Se4B1LrrZD8i8FjmAbRy6Ovd-AorD0Ca7dCNyGeDycc97fHscNz20cXg5wGtu7diL7uz8_tpzn__vshPBnujt0Z2JxsPyj8sGutB-Un3cny27aHzoKwG1TbEyPHvtLkRyyX0I-qJvOdR7A_fDtZfmheEGx9kb_QnrN0pysePte43ajsY6ZTuf5dmi_Pe46OFRWuV7t-dg6SS1bRCQSIZChLFAolgtCHAw4g1VR3DZjMaJzPAq4xfJHiatPj5eW6yfwX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