This is an archive of the discontinued LLVM Phabricator instance.

Ensure lldb-server waits for child debug servers to start up when passing them a port number to listen on.
ClosedPublic

Authored by hhellyer on Feb 22 2017, 7:18 AM.

Details

Summary

When lldb-server is started with the -P <port> or -m/-M <min/max port> options to specify which ports are available for remote connections the child debug server is told what port it should listen on. In those cases lldb-server needs to wait for the child to report it’s port number as otherwise it can tell the lldb client that the child is up and listening before it is actually listening on that port. lldb-server already waits in the cases where a port wasn’t specified by waiting until the child reports the port it is using. It was skipping this synchronisation step when passed a port numbers as it knew what the port would be however it does need to ensure the child process has had time to open that port and waiting until the child reports the port number makes sure this has happened.

This patch just removes the one case where a child was spawned and lldb-server did not wait for it to report it’s port number before telling the client lldb process the child is ready to connect to.

This issue was discussed on lldb-dev in a thread here:
http://lists.llvm.org/pipermail/lldb-dev/2017-February/012002.html

Event Timeline

hhellyer created this revision.Feb 22 2017, 7:18 AM
hhellyer added a subscriber: lldb-commits.
clayborg accepted this revision.Feb 22 2017, 11:15 AM

Looks good.

This revision is now accepted and ready to land.Feb 22 2017, 11:15 AM
hhellyer closed this revision.Feb 23 2017, 1:01 AM