aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-08-09 12:04:46 +0000
committerPavel Labath <labath@google.com>2016-08-09 12:04:46 +0000
commit8c1b6bd7d2ac9c4a1a017405959185978204c5d5 (patch)
treeec8abb4d98f22b4248087064de8b6532305a7b7b /lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
parent0e0e07f436f939b844ada9671f7ce38e62ecb69b (diff)
downloadllvm-8c1b6bd7d2ac9c4a1a017405959185978204c5d5.zip
llvm-8c1b6bd7d2ac9c4a1a017405959185978204c5d5.tar.gz
llvm-8c1b6bd7d2ac9c4a1a017405959185978204c5d5.tar.bz2
Reapply "Rewrite gdb-remote's SendContinuePacketAndWaitForResponse"
Resumbitting the commit after fixing the following problems: - broken unit tests on windows: incorrect gtest usage on my part (TEST vs. TEST_F) - the new code did not correctly handle the case where we went to interrupt the process, but it stopped due to a different reason - the interrupt request would remain queued and would interfere with the following "continue". I also added a unit test for this case. This reapplies r277156 and r277139. llvm-svn: 278118
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
index 06adeb4..3e24934 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -380,12 +380,6 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const RegisterInfo *reg_info, Data
return false;
GDBRemoteCommunicationClient &gdb_comm (((ProcessGDBRemote *)process)->GetGDBRemote());
-// FIXME: This check isn't right because IsRunning checks the Public state, but this
-// is work you need to do - for instance in ShouldStop & friends - before the public
-// state has been changed.
-// if (gdb_comm.IsRunning())
-// return false;
-
#if defined (LLDB_CONFIGURATION_DEBUG)
assert (m_reg_data.GetByteSize() >= reg_info->byte_offset + reg_info->byte_size);
@@ -409,8 +403,8 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const RegisterInfo *reg_info, Data
reg_info->byte_size, // dst length
m_reg_data.GetByteOrder())) // dst byte order
{
- std::unique_lock<std::recursive_mutex> lock;
- if (gdb_comm.GetSequenceMutex(lock, "Didn't get sequence mutex for write register."))
+ GDBRemoteClientBase::Lock lock(gdb_comm, false);
+ if (lock)
{
const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
ProcessSP process_sp (m_thread.GetProcess());
@@ -578,8 +572,8 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
const bool use_g_packet = gdb_comm.AvoidGPackets ((ProcessGDBRemote *)process) == false;
- std::unique_lock<std::recursive_mutex> lock;
- if (gdb_comm.GetSequenceMutex(lock, "Didn't get sequence mutex for read all registers."))
+ GDBRemoteClientBase::Lock lock(gdb_comm, false);
+ if (lock)
{
SyncThreadState(process);
@@ -687,8 +681,8 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data
const bool use_g_packet = gdb_comm.AvoidGPackets ((ProcessGDBRemote *)process) == false;
StringExtractorGDBRemote response;
- std::unique_lock<std::recursive_mutex> lock;
- if (gdb_comm.GetSequenceMutex(lock, "Didn't get sequence mutex for write all registers."))
+ GDBRemoteClientBase::Lock lock(gdb_comm, false);
+ if (lock)
{
const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
ProcessSP process_sp (m_thread.GetProcess());