diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -2536,7 +2536,9 @@ (1024.0 * 1024.0); float packets_per_second = ((float)packet_count) / duration(total_time).count(); - const auto average_per_packet = total_time / packet_count; + const auto average_per_packet = packet_count > 0 + ? total_time / packet_count + : duration::zero(); if (json) { strm.Format("{0}\n {{\"send_size\" : {1,6}, \"recv_size\" : "