[lldb-vscode] Add logic to handle EOF when reading from lldb-vscode stdout.
authorJorge Gorbe Moya <jgorbe@google.com>
Mon, 1 Apr 2019 20:37:22 +0000 (20:37 +0000)
committerJorge Gorbe Moya <jgorbe@google.com>
Mon, 1 Apr 2019 20:37:22 +0000 (20:37 +0000)
commit4665aca8ca769f1389d83f59e8774c749b2f9d88
tree97f31e3387e0a794b47b8bd5d2996beccd51a4dc
parent66d7eb97045e0fda283ff336297e1a46869152f6
[lldb-vscode] Add logic to handle EOF when reading from lldb-vscode stdout.

Summary:
This change prevents the lldb-vscode test harness from hanging up waiting for
new messages when the lldb-vscode subprocess crashes.

Now, when an EOF from the subprocess pipe is detected we enqueue a `None` packet
in the received packets list. Then, during the message processing loop, we can
use this `None` packet to tell apart the case where lldb-vscode has terminated
unexpectedly from the normal situation where no pending messages means blocking
and waiting for more data.

I believe this should be enough to fix the issues with these tests hanging on
multiple platforms. Once this lands, I'll prepare and test a separate change
removing the @skipIfLinux annotations.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D59849

llvm-svn: 357426
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py