diff options
author | Tamas Berghammer <tberghammer@google.com> | 2015-02-24 10:23:39 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2015-02-24 10:23:39 +0000 |
commit | 912800c4006eb0caa6407fd8278f7292f617d378 (patch) | |
tree | ce1985ec30c7cd0b293102d2f58f4c56d2ce0a29 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | |
parent | 987bf0400d27d4ef51f9f4abe3842b1cf758a623 (diff) | |
download | bcm5719-llvm-912800c4006eb0caa6407fd8278f7292f617d378.tar.gz bcm5719-llvm-912800c4006eb0caa6407fd8278f7292f617d378.zip |
Create ScopedTimeout class for GDBRemoteCommunication
This new class makes it easier to change the timeout of a
GDBRemoteCommunication instance for a short time and then restore it to
its original value.
Differential revision: http://reviews.llvm.org/D7826
llvm-svn: 230319
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index ecf581b2fab..62bc3627f69 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -926,3 +926,15 @@ GDBRemoteCommunication::DumpHistory(Stream &strm) { m_history.Dump (strm); } + +GDBRemoteCommunication::ScopedTimeout::ScopedTimeout (GDBRemoteCommunication& gdb_comm, + uint32_t timeout) : + m_gdb_comm (gdb_comm) +{ + m_saved_timeout = m_gdb_comm.SetPacketTimeout (timeout); +} + +GDBRemoteCommunication::ScopedTimeout::~ScopedTimeout () +{ + m_gdb_comm.SetPacketTimeout (m_saved_timeout); +} |