summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-08-18 12:32:41 +0000
committerPavel Labath <labath@google.com>2016-08-18 12:32:41 +0000
commit27402d2a12fad5e347879e23eb91ba63778b3360 (patch)
tree411a7a375b257968dcbadac3e0df0874a7e70e02 /lldb/source/Plugins
parent2fc1985db3ea6f60156d9fb4b969cc05636586c0 (diff)
downloadbcm5719-llvm-27402d2a12fad5e347879e23eb91ba63778b3360.tar.gz
bcm5719-llvm-27402d2a12fad5e347879e23eb91ba63778b3360.zip
Move QSyncThreadState packet generation to the gdb-remote client
llvm-svn: 279057
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp19
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h3
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp25
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h3
4 files changed, 21 insertions, 29 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 7600c139ace..fc0cf6e4f38 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -3582,9 +3582,22 @@ GDBRemoteCommunicationClient::RestoreRegisterState (lldb::tid_t tid, uint32_t sa
}
bool
-GDBRemoteCommunicationClient::GetModuleInfo (const FileSpec& module_file_spec,
- const lldb_private::ArchSpec& arch_spec,
- ModuleSpec &module_spec)
+GDBRemoteCommunicationClient::SyncThreadState(lldb::tid_t tid)
+{
+ if (!GetSyncThreadStateSupported())
+ return false;
+
+ StreamString packet;
+ StringExtractorGDBRemote response;
+ packet.Printf("QSyncThreadState:%4.4" PRIx64 ";", tid);
+ return SendPacketAndWaitForResponse(packet.GetString(), response, false) ==
+ GDBRemoteCommunication::PacketResult::Success &&
+ response.IsOKResponse();
+}
+
+bool
+GDBRemoteCommunicationClient::GetModuleInfo(const FileSpec &module_file_spec, const lldb_private::ArchSpec &arch_spec,
+ ModuleSpec &module_spec)
{
if (!m_supports_qModuleInfo)
return false;
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
index 7b6e5e6784d..b041ecbf3da 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -509,6 +509,9 @@ public:
bool
RestoreRegisterState (lldb::tid_t tid, uint32_t save_id);
+ bool
+ SyncThreadState(lldb::tid_t tid);
+
const char *
GetGDBServerProgramName();
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
index dbdb3a81aa1..dd8ac9e6f90 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -334,28 +334,6 @@ GDBRemoteRegisterContext::SetPrimordialRegister(const RegisterInfo *reg_info,
reg_info->byte_size));
}
-void
-GDBRemoteRegisterContext::SyncThreadState(Process *process)
-{
- // NB. We assume our caller has locked the sequence mutex.
-
- GDBRemoteCommunicationClient &gdb_comm (((ProcessGDBRemote *) process)->GetGDBRemote());
- if (!gdb_comm.GetSyncThreadStateSupported())
- return;
-
- StreamString packet;
- StringExtractorGDBRemote response;
- packet.Printf ("QSyncThreadState:%4.4" PRIx64 ";", m_thread.GetProtocolID());
- if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(),
- packet.GetString().size(),
- response,
- false) == GDBRemoteCommunication::PacketResult::Success)
- {
- if (response.IsOKResponse())
- InvalidateAllRegisters();
- }
-}
-
bool
GDBRemoteRegisterContext::WriteRegisterBytes (const RegisterInfo *reg_info, DataExtractor &data, uint32_t data_offset)
{
@@ -562,7 +540,8 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
GDBRemoteClientBase::Lock lock(gdb_comm, false);
if (lock)
{
- SyncThreadState(process);
+ if (gdb_comm.SyncThreadState(m_thread.GetProtocolID()))
+ InvalidateAllRegisters();
if (use_g_packet && gdb_comm.ReadAllRegisters(m_thread.GetProtocolID(), response))
{
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
index 0e26c69eb2a..0021b5eba8b 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
@@ -143,9 +143,6 @@ protected:
m_reg_valid[reg] = valid;
}
- void
- SyncThreadState(Process *process); // Assumes the sequence mutex has already been acquired.
-
GDBRemoteDynamicRegisterInfo &m_reg_info;
std::vector<bool> m_reg_valid;
DataExtractor m_reg_data;
OpenPOWER on IntegriCloud