Skip to content

lldb-dap output events are by chunk size not lines #105444

@ashgti

Description

@ashgti

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 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions