This is an archive of the discontinued LLVM Phabricator instance.

[lldb-vscode] stop read loop after termination
ClosedPublic

Authored by wallace on Mar 17 2020, 1:01 PM.

Details

Summary

On Linux, when executing lldb-vscode on a remote machine, lldb-vscode doesn't die after the debug session ends. It keeps trying to read JSON input to no avail.
This diff indicates lldb-vscode to stop reading after a termination event has been processed.

Diff Detail

Event Timeline

wallace created this revision.Mar 17 2020, 1:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2020, 1:01 PM
kusmour accepted this revision.Mar 17 2020, 1:03 PM
This revision is now accepted and ready to land.Mar 17 2020, 1:03 PM

Does this have something to do with a multiplexor that funnels traffic through one tunnel? I am curious as to why the ReadJSON() doesn't exit after the other side closes down?

LGTM, but needs a test.

As we discussed privately, some remote connections use a mutiplexor socket that doesn't die when the debug session ends.

wallace updated this revision to Diff 251149.Mar 18 2020, 12:44 PM

add a test

clayborg added inline comments.Mar 18 2020, 2:40 PM
lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py
46–48

I don't think we need to run a program. Just send the initialize packet and then the terminate packet, then sleep?

wallace updated this revision to Diff 251204.Mar 18 2020, 4:15 PM

address comments

Just watch the build bots carefully when you check this in!

labath added a subscriber: labath.Mar 19 2020, 12:54 AM
labath added inline comments.
lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py
50–53

1 second is pretty short, and I wouldn't be surprised if it causes spurious failures.

Using popen.wait() would be _much_ better -- you can use a much larger timeout, while still having the test terminate quickly in the common case.

wallace updated this revision to Diff 251425.Mar 19 2020, 11:31 AM

address comments

wallace updated this revision to Diff 251428.Mar 19 2020, 11:39 AM

support python2.7

wallace marked 2 inline comments as done.Mar 19 2020, 11:42 AM
labath accepted this revision.Mar 20 2020, 12:31 AM
labath marked an inline comment as done.
labath added inline comments.
lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py
55–56

I'll add this to my list of reasons for dropping python2 support. :)

This revision was automatically updated to reflect the committed changes.