On 28 November 2017 at 20:54, Christopher Book <cb...@google.com> wrote: > Hi Pavel, I think you are on the right track in that it already does seem to > wait for the gdbserver to be up using a pipe. > > In StartDebugserverProcess it seems like there is a pipe created to tell > when the server is running. Here is a comment: > > // socket_pipe is used by debug server to communicate back either > // TCP port or domain socket name which it listens on. > // The second purpose of the pipe to serve as a synchronization point - > // once data is written to the pipe, debug server is up and running. > > However, it looks like specifying --min-gdbserver-port and > --max-gdbserver-port cause the pipe to not be used for some reason. > > Here is the gdbserver invocation when I don't specify the gdb min and max > port: >> lldb-server gdbserver tcp://<myip>:0 --native-regs --pipe 6 > > And here is the gdbserver invocation when I do specify the gdb port: >> lldb-server gdbserver tcp://<myip>:<mygdbport> --native-regs > > Its not obvious to me from looking at the code why this is being skipped. > But I will debug further why this argument is not used in this case. >
Aha, interesting. That would explain why there is a race. We should add the pipe synchronization even in case we know what is the port going to be (though I still like the "exec" idea). _______________________________________________ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev