This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf3472ad5c5f8: Add specific error messages around gdb RSP handshake failures (authored by jasonmolenda).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108888/new/ https://reviews.llvm.org/D108888 Files: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -82,6 +82,8 @@ // Start the read thread after we send the handshake ack since if we fail to // send the handshake ack, there is no reason to continue... + std::chrono::steady_clock::time_point start_of_handshake = + std::chrono::steady_clock::now(); if (SendAck()) { // Wait for any responses that might have been queued up in the remote // GDB server and flush them all @@ -97,8 +99,24 @@ if (QueryNoAckModeSupported()) { return true; } else { - if (error_ptr) - error_ptr->SetErrorString("failed to get reply to handshake packet"); + std::chrono::steady_clock::time_point end_of_handshake = + std::chrono::steady_clock::now(); + auto handshake_timeout = + std::chrono::duration<double>(end_of_handshake - start_of_handshake) + .count(); + if (error_ptr) { + if (packet_result == PacketResult::ErrorDisconnected) + error_ptr->SetErrorString("Connection shut down by remote side " + "while waiting for reply to initial " + "handshake packet"); + else if (packet_result == PacketResult::ErrorReplyTimeout) + error_ptr->SetErrorStringWithFormat( + "failed to get reply to handshake packet within timeout of " + "%.1f seconds", + handshake_timeout); + else + error_ptr->SetErrorString("failed to get reply to handshake packet"); + } } } else { if (error_ptr)
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -82,6 +82,8 @@ // Start the read thread after we send the handshake ack since if we fail to // send the handshake ack, there is no reason to continue... + std::chrono::steady_clock::time_point start_of_handshake = + std::chrono::steady_clock::now(); if (SendAck()) { // Wait for any responses that might have been queued up in the remote // GDB server and flush them all @@ -97,8 +99,24 @@ if (QueryNoAckModeSupported()) { return true; } else { - if (error_ptr) - error_ptr->SetErrorString("failed to get reply to handshake packet"); + std::chrono::steady_clock::time_point end_of_handshake = + std::chrono::steady_clock::now(); + auto handshake_timeout = + std::chrono::duration<double>(end_of_handshake - start_of_handshake) + .count(); + if (error_ptr) { + if (packet_result == PacketResult::ErrorDisconnected) + error_ptr->SetErrorString("Connection shut down by remote side " + "while waiting for reply to initial " + "handshake packet"); + else if (packet_result == PacketResult::ErrorReplyTimeout) + error_ptr->SetErrorStringWithFormat( + "failed to get reply to handshake packet within timeout of " + "%.1f seconds", + handshake_timeout); + else + error_ptr->SetErrorString("failed to get reply to handshake packet"); + } } } else { if (error_ptr)
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits