This is an archive of the discontinued LLVM Phabricator instance.

Improve error messaging on process connect errors
ClosedPublic

Authored by jasonmolenda on Aug 29 2021, 1:41 AM.

Details

Summary

process connect (aka gdb-remote) isn't the clearest in its error messaging. We have everything we need to distinguish between three common failure modes: Nothing is listening to the port (or we could not reach the port), the remote side did not respond to the initial handshake packet quickly enough, or the remote connection accepts the connection and then drops it immediately (e.g. a debugserver might reject the connection because it is only accepting connections from certain hosts).

With this patch, we get

(lldb) gdb-remote 7000
error: Failed to connect port

(lldb) gdb-remote 4000
error: failed to get reply to handshake packet within timeout of 6.0 seconds

(lldb) gdb-remote work-imacpro:4000
error: Connection shut down by remote side while waiting for reply to initial handshake packet

and I think it's a little easier to understand the nature of the problem. Just fixing a little thing that's bugged me for a while.

Diff Detail

Event Timeline

jasonmolenda created this revision.Aug 29 2021, 1:41 AM
jasonmolenda requested review of this revision.Aug 29 2021, 1:41 AM
This revision was not accepted when it landed; it landed in state Needs Review.Sep 9 2021, 5:04 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.