diff options
author | Pavel Labath <labath@google.com> | 2018-05-10 10:46:03 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-05-10 10:46:03 +0000 |
commit | 19dd1a0ea6fed11b40cb9f83adbce17c04d569f3 (patch) | |
tree | 9684b6fe9398b094dbc917e225c1f4f887d58db9 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
parent | ce6ada41513eeff22e04b52d7965cdf02d8fe6fe (diff) | |
download | bcm5719-llvm-19dd1a0ea6fed11b40cb9f83adbce17c04d569f3.tar.gz bcm5719-llvm-19dd1a0ea6fed11b40cb9f83adbce17c04d569f3.zip |
Convert all RunShellCommand functions to use the Timeout class
this completes the Timeout migration started in r331880 with the
Predicate class.
llvm-svn: 331970
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 231fa9043c4..844e248dd0a 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -2796,13 +2796,16 @@ lldb_private::Status GDBRemoteCommunicationClient::RunShellCommand( // process to exit std::string *command_output, // Pass NULL if you don't want the command output - uint32_t - timeout_sec) // Timeout in seconds to wait for shell program to finish -{ + const Timeout<std::micro> &timeout) { lldb_private::StreamString stream; stream.PutCString("qPlatform_shell:"); stream.PutBytesAsRawHex8(command, strlen(command)); stream.PutChar(','); + uint32_t timeout_sec = UINT32_MAX; + if (timeout) { + // TODO: Use chrono version of std::ceil once c++17 is available. + timeout_sec = std::ceil(std::chrono::duration<double>(*timeout).count()); + } stream.PutHex32(timeout_sec); if (working_dir) { std::string path{working_dir.GetPath(false)}; |