[Lldb-commits] [PATCH] D80659: [lldb-vscode] Redirect stderr and stdout to DAPs console message

António Afonso via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Sep 20 23:16:54 PDT 2020


aadsm added a comment.

> Why would we be doing something (particularly a thing which will be hard to do in a cross-platform manner, and will very likely border on, or downright cross into, undefined behavior territory), if we get that from vscode for free?

I'm not sure what you mean with get this for free on vscode... Right now lldb-vscode will just crash if there's any command in the lldbinit that outputs to stdout because it pollutes the protocol, I don't think think there's anything vscode can do about this. But even if it did vscode is not the only client of lldb-vscode, there are multiple others: https://microsoft.github.io/debug-adapter-protocol/implementors/tools/.

I haven't answered this yet because I was trying to figure out why this only happens when parsing the lldbinit. I was looking into the CommandInterpreter{Python} code but to be honest it's not easy to figure out because there are multiple levels of indirection when it comes to processing the IO of the python interpreter, but it seems that the stdout while executing the lldbinit script is being flushed right away to the ImmediateOutputStream but haven't figure out when this is set in the case of `CommandInterpreter::IOHandlerInputComplete`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80659/new/

https://reviews.llvm.org/D80659



More information about the lldb-commits mailing list