[lldb-vscode] Implement stderr/stdout on win32 and redirect lldb log to VSCode
authorWalter Erquinigo <wallace@fb.com>
Tue, 5 Apr 2022 18:21:22 +0000 (11:21 -0700)
committerWalter Erquinigo <wallace@fb.com>
Tue, 5 Apr 2022 18:54:03 +0000 (11:54 -0700)
commit9bcaf6ddfe34943e6ae6a319097524c117908913
tree2ace73759fd9f057b5d9c1ab58ce708ceeb9add6
parent5561ab3495a42fddbc251bec6bef46a1cae9c559
[lldb-vscode] Implement stderr/stdout on win32 and redirect lldb log to VSCode

This patch implements stderr/stdout forwarding on windows.
This was previously not implemented in D99974.
I added separate callbacks so the output can be sent to the different channels VSCode provides (OutputType::Stdout, OutputType::Stderr, OutputType::Console).

This patch also passes a log callback handler to SBDebugger::Create to be able to see logging output when it is enabled.

Since the output is now redirect on early startup I removed the calls to SetOutputFileHandle/SetErrorFileHandle, which set them to /dev/null.

I send the output of stderr/stdout/lldb log to OutputType::Console

Reviewed By: wallace

Differential Revision: https://reviews.llvm.org/D123025
lldb/tools/lldb-vscode/OutputRedirector.cpp
lldb/tools/lldb-vscode/lldb-vscode.cpp