summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-10-31 17:19:42 +0000
committerPavel Labath <labath@google.com>2016-10-31 17:19:42 +0000
commit3aa049102fd0e80600622b29fde5c973b6138cf4 (patch)
tree79e72fbdb30dbc35a2b0539ead1d366bb923517d /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parentd1b54492cdef8bbaf84097d44901ba5a123e9947 (diff)
downloadbcm5719-llvm-3aa049102fd0e80600622b29fde5c973b6138cf4.tar.gz
bcm5719-llvm-3aa049102fd0e80600622b29fde5c973b6138cf4.zip
Remove usages of TimeValue from gdb-remote process plugin
Summary: Most of the changes are very straight-forward, the only tricky part was the "packet speed-test" function, which is very time-heavy. As the function was completely untested, I added a quick unit smoke test for it. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D25391 llvm-svn: 285602
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index c9d5b1156ba..f96bfe7baeb 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -46,7 +46,6 @@
#include "lldb/Host/StringConvert.h"
#include "lldb/Host/Symbols.h"
#include "lldb/Host/ThreadLauncher.h"
-#include "lldb/Host/TimeValue.h"
#include "lldb/Host/XML.h"
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
@@ -289,7 +288,7 @@ ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp,
const uint64_t timeout_seconds =
GetGlobalPluginProperties()->GetPacketTimeout();
if (timeout_seconds > 0)
- m_gdb_comm.SetPacketTimeout(timeout_seconds);
+ m_gdb_comm.SetPacketTimeout(std::chrono::seconds(timeout_seconds));
}
//----------------------------------------------------------------------
@@ -424,9 +423,9 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
// Check if qHostInfo specified a specific packet timeout for this connection.
// If so then lets update our setting so the user knows what the timeout is
// and can see it.
- const uint32_t host_packet_timeout = m_gdb_comm.GetHostDefaultPacketTimeout();
- if (host_packet_timeout) {
- GetGlobalPluginProperties()->SetPacketTimeout(host_packet_timeout);
+ const auto host_packet_timeout = m_gdb_comm.GetHostDefaultPacketTimeout();
+ if (host_packet_timeout > std::chrono::seconds(0)) {
+ GetGlobalPluginProperties()->SetPacketTimeout(host_packet_timeout.count());
}
// Register info search order:
@@ -899,7 +898,8 @@ Error ProcessGDBRemote::DoLaunch(Module *exe_module,
{
// Scope for the scoped timeout object
- GDBRemoteCommunication::ScopedTimeout timeout(m_gdb_comm, 10);
+ GDBRemoteCommunication::ScopedTimeout timeout(m_gdb_comm,
+ std::chrono::seconds(10));
int arg_packet_err = m_gdb_comm.SendArgumentsPacket(launch_info);
if (arg_packet_err == 0) {
@@ -2573,7 +2573,8 @@ Error ProcessGDBRemote::DoDestroy() {
if (m_public_state.GetValue() != eStateAttaching) {
StringExtractorGDBRemote response;
bool send_async = true;
- GDBRemoteCommunication::ScopedTimeout(m_gdb_comm, 3);
+ GDBRemoteCommunication::ScopedTimeout(m_gdb_comm,
+ std::chrono::seconds(3));
if (m_gdb_comm.SendPacketAndWaitForResponse("k", response, send_async) ==
GDBRemoteCommunication::PacketResult::Success) {
@@ -3894,7 +3895,8 @@ ProcessGDBRemote::GetLoadedDynamicLibrariesInfos_sender(
if (m_gdb_comm.GetLoadedDynamicLibrariesInfosSupported()) {
// Scope for the scoped timeout object
- GDBRemoteCommunication::ScopedTimeout timeout(m_gdb_comm, 10);
+ GDBRemoteCommunication::ScopedTimeout timeout(m_gdb_comm,
+ std::chrono::seconds(10));
StreamString packet;
packet << "jGetLoadedDynamicLibrariesInfos:";
OpenPOWER on IntegriCloud