[Lldb-commits] [PATCH] D96623: [lldb-vscode] Fix lldb init file stdout issue
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Feb 16 16:09:58 PST 2021
clayborg added a comment.
I added Jim and Pavel to get some more feedback.
The main issue is the Visual Studio Code debug adaptors like lldb-vscode receive and send packets on STDIN and STDOUT. The debugger is created during the "initialize" request which expects a response. If the debugger tries to run the init files when the debugger is created, it risks outputting some info to STDOUT and causing the entire debug session to fail the stdout is the default output file handle for debuggers. If you don't run the init files, they are marked as skipped in the command interpreter and calling SBCommandInterpreter::SourceInitFileInHomeDirectory(...) will do nothing if you call it later.
A further complication of this patch is that we intend to support different LLDB.framework binaries in order to support Swift debugging in the future by setting a DYLD_FRAMEWORK_PATH in the environment of lldb-vscode when it is launched so we can use the LLDB.framework (or liblldb.so for linux) that matches the swift we need. This means that if we change the API by adding the new lldb::SBDebugger::Create() method that takes the SBFile handles for in/out/error, then we can't use these older LLDB versions since it will crash when it doesn't find this new create method. The current version of this patch does actually allow us to use these older LLDB.framework binaries, though it does duplicate the running of the init files manually. So maybe this is the best option for now, but I wanted to include a few other people to get their input.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96623/new/
https://reviews.llvm.org/D96623
More information about the lldb-commits
mailing list