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

    <tr>
        <th>Summary</th>
        <td>
            lldb-dap output events are by chunk size not lines
        </td>
    </tr>

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

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

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

<pre>
    Some background on the DAP Output Events:

When debugging in VS Code, DAP Output Events (https://microsoft.github.io/debug-adapter-protocol/specification#Events_Output) are shown in the Debug Console.

By default, the Debug Console shows each output event as a single "item" in the Debug Console UI and its up to the debug adapter to determine what each of these output events contain.

This means that if we fired an Output event and the output string was `line 1\nline2\n` the the Debug Console would show those two lines as being part of the same output message. Additionally, if the user was to use the Debug Console filter to look for `line 1` because the two lines are part of the same message the Debug Console will group both lines together.


As this pertains to lldb-dap, when debugging if a process produces output there are currently two distinct buffer sizes that cause output to be chunked in the VS Code debug console.

https://github.com/llvm/llvm-project/blob/main/lldb/tools/lldb-dap/OutputRedirector.cpp#L45

and

https://github.com/llvm/llvm-project/blob/main/lldb/tools/lldb-dap/lldb-dap.cpp#L402

Due to these two chunk sizes output events may contain multiple lines or split a message in the middle of a line.

I think it would be helpful to revisit this logic and break output up by lines.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VU9v47YT_TT0ZRBDpmTHPuiQTX4GFvgBLbr9cywociRNQ5ECOYrhfvqCEpW1N7n00otFJZyZ9-a9B6kYqXOItdh_EfuXjZq496FWse-YNo031_qbHxAapV-74CdnwDvgHuHl6Wf4aeJxYvjfGzqOonwSxYso8u8fPTow2ExdR64DcvD7N3j2BoV8_lgMQh575nHuIs9CngfSwUff8rYj7qdmS17I89zwQRk1MoaHMXj22lshz3FETS1pxeSdkOXS9s9liJAnUAEh9v7iEpSZQGoFz95Fb3F7C_3LFQy2ar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