summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-11-04 11:49:06 +0000
committerPavel Labath <labath@google.com>2016-11-04 11:49:06 +0000
commit2fd9a1e0d9ee0a2a4458d7b6d55494a2a9c60038 (patch)
tree1b30124545a3bfed5400aa7f074316de17c721be /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parentbaeb40201476656d2478ae1af284cb8b17d1296c (diff)
downloadbcm5719-llvm-2fd9a1e0d9ee0a2a4458d7b6d55494a2a9c60038.tar.gz
bcm5719-llvm-2fd9a1e0d9ee0a2a4458d7b6d55494a2a9c60038.zip
Fix GDBRemoteCommunicationClientTest.TestPacketSpeedJSON
The mock server was listening for only one packet (I forgot to put a loop around it), which caused the client to stall in debug builds, as the timeout there is 1000 seconds. In case of a release builds the test would just silently succeed as the tested function does not check or report errors (which should be fixed). This fixes the test by adding the server loop. Since the test was taking quite a long time now (8s), I have added a parameter to control the amount of data sent (default 4MB), and call it with a smaller value in the test, to make the test run faster. llvm-svn: 285992
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 4a3cc7f7a34..c0fbccb3e4f 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4905,13 +4905,11 @@ public:
const uint64_t max_send = m_max_send.GetOptionValue().GetCurrentValue();
const uint64_t max_recv = m_max_recv.GetOptionValue().GetCurrentValue();
const bool json = m_json.GetOptionValue().GetCurrentValue();
- if (output_stream_sp)
- process->GetGDBRemote().TestPacketSpeed(
- num_packets, max_send, max_recv, json, *output_stream_sp);
- else {
- process->GetGDBRemote().TestPacketSpeed(
- num_packets, max_send, max_recv, json, result.GetOutputStream());
- }
+ const uint64_t k_recv_amount =
+ 4 * 1024 * 1024; // Receive amount in bytes
+ process->GetGDBRemote().TestPacketSpeed(
+ num_packets, max_send, max_recv, k_recv_amount, json,
+ output_stream_sp ? *output_stream_sp : result.GetOutputStream());
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
}
OpenPOWER on IntegriCloud