[Lldb-commits] [PATCH] D70883: [vscode.py] Make read_packet only return None when EOF

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 6 00:23:21 PST 2019


labath added a comment.

In D70883#1771686 <https://reviews.llvm.org/D70883#1771686>, @aadsm wrote:

> Fair enough, I haven't seen evidence of this (haven't searched for it) but I imagine IDEs need to ignore this as well otherwise they just barf if they're expecting `Content-Length` and a wild print appears. The notion of stdout of SBDebugger is the SBCommandReturnObject which doesn't print right away (only when the command finishes executing) and from my previous tests .flush() doesn't help with this. I believe this is the reason why people opt to use print instead in their custom commands. But I don't think it's a reasonable assumption (or api contract) to tell people they can't use print or it breaks lldb-vscode.
>
> I'm going to fix this in lldb-vscode itself to wrap all stdout in a proper DAP console response.


Interesting.. I was expecting this was already handled somehow within lldb -- we have a fair amount of code <https://github.com/llvm/llvm-project/blob/1cc0ba4cbdc54200e1b3c65e83e51a5368a819ea/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp#L770> which tries to install fake stdin/out handles when running a python script. I'd start with checking out why that piece of code isn't kicking in...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70883





More information about the lldb-commits mailing list