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



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to