When the VS Debug Engine extension (this repository) figures out that a child process has been launched it needs to inform the VS Code GUI part that it should attach to the newly created process.
Currently, this is implemented by abusing the DkmUserMessage interface. To the best of my knowledge, these user messages are indented to be used for debug messages that are to be displayed to the user. We currently intercept those user messages in the VS Code extension (the childdebugger-vscode repository) and parse all information about the child process back from the text messages, so that we can then make the VS Code GUI attach to the new process.
This is less then ideal:
it is hard to guarantee that the to text formatting and parsing back will always work as expected.
although these messages should be internal, they will always be displayed to the user.
Other solutions tried so far, but that didn't work:
Using DkmDebugProcessRequest to make VS Code attach to the child process. Although this looks like the perfect tool for the job, it does not seem to be implemented in the VS Code incarnation of the debug engine (but only in Visual Studio's). My guess is that the reason is that VS Code starts a separate vsdbg.exe instance for every process it wants to debug. So anything that is internal to the current instance of the debug engine (which I assume DkmDebugProcessRequest is), would not work in this case.
Similarly, DkmCustomMessage does not seem to be implemented for VS Code, too. It is unclear where this messages could be received.
When the VS Debug Engine extension (this repository) figures out that a child process has been launched it needs to inform the VS Code GUI part that it should attach to the newly created process.
Currently, this is implemented by abusing the
DkmUserMessage
interface. To the best of my knowledge, these user messages are indented to be used for debug messages that are to be displayed to the user. We currently intercept those user messages in the VS Code extension (thechilddebugger-vscode
repository) and parse all information about the child process back from the text messages, so that we can then make the VS Code GUI attach to the new process.This is less then ideal:
Other solutions tried so far, but that didn't work:
DkmDebugProcessRequest
to make VS Code attach to the child process. Although this looks like the perfect tool for the job, it does not seem to be implemented in the VS Code incarnation of the debug engine (but only in Visual Studio's). My guess is that the reason is that VS Code starts a separatevsdbg.exe
instance for every process it wants to debug. So anything that is internal to the current instance of the debug engine (which I assumeDkmDebugProcessRequest
is), would not work in this case.DkmCustomMessage
does not seem to be implemented for VS Code, too. It is unclear where this messages could be received.