Skip to content

Proposal to add debugConsoleMode to StartDebuggingRequestArguments #575

@JulianvDoorn

Description

@JulianvDoorn

In #574 I have added a proposal for the field "debugConsoleMode" inside StartDebuggingRequestArguments. This specifies if a new debug console window should be created or the output should be merged with the parent session's console.

In VSCode, there is already support for merging the console output with the parent debugging session. Only this functionality is not exposed via the DAP. microsoft/vscode#80673

The particular use case I am chasing is being able to start debug sessions for inferior/subprocesses for a gdb instance. In my DAP implementation I can open a new port for each newly spawned subprocess. Subsequently using StartDebuggingRequest I can make VSCode attach to it and the UI will nicely show that parent+child processes are being debugged.

Image

Gdb is capable of attaching to the new subprocess without starting a new gdb instance, however, the default behavior for VSCode is to open a new debug console which is left unused since no new debugger has been started.

Image

Being able to set debugConsoleMode to "mergeWithParent", it becomes possible to combine the consoles, such that only one console per gdb instance is shown in VSCode. Solving the issue of having unused consoles in the UI.

Future work could include improvements to the ability to disambiguate commands for specific inferior subprocesses. I think it would be nice to lift the requirement of opening a port for each subprocess in my implementation, for instance, by specifying an optional debug session ID in each RPC message.

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions