forked from OSchip/llvm-project
Make sure to lock down the sequence mutex and select the thread we want when read or write all registers.
llvm-svn: 115992
This commit is contained in:
parent
139edad73a
commit
68f4b4f2a2
|
@ -373,6 +373,12 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
|
||||||
{
|
{
|
||||||
GDBRemoteCommunication &gdb_comm = GetGDBProcess().GetGDBRemote();
|
GDBRemoteCommunication &gdb_comm = GetGDBProcess().GetGDBRemote();
|
||||||
StringExtractorGDBRemote response;
|
StringExtractorGDBRemote response;
|
||||||
|
|
||||||
|
Mutex::Locker locker;
|
||||||
|
if (gdb_comm.GetSequenceMutex (locker))
|
||||||
|
{
|
||||||
|
if (GetGDBProcess().SetCurrentGDBRemoteThread(m_thread.GetID()))
|
||||||
|
{
|
||||||
if (gdb_comm.SendPacketAndWaitForResponse("g", response, 1, false))
|
if (gdb_comm.SendPacketAndWaitForResponse("g", response, 1, false))
|
||||||
{
|
{
|
||||||
if (response.IsErrorPacket())
|
if (response.IsErrorPacket())
|
||||||
|
@ -383,6 +389,8 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
|
||||||
response.GetStringRef().size()));
|
response.GetStringRef().size()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,6 +399,11 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data
|
||||||
{
|
{
|
||||||
GDBRemoteCommunication &gdb_comm = GetGDBProcess().GetGDBRemote();
|
GDBRemoteCommunication &gdb_comm = GetGDBProcess().GetGDBRemote();
|
||||||
StringExtractorGDBRemote response;
|
StringExtractorGDBRemote response;
|
||||||
|
Mutex::Locker locker;
|
||||||
|
if (gdb_comm.GetSequenceMutex (locker))
|
||||||
|
{
|
||||||
|
if (GetGDBProcess().SetCurrentGDBRemoteThread(m_thread.GetID()))
|
||||||
|
{
|
||||||
if (gdb_comm.SendPacketAndWaitForResponse((const char *)data_sp->GetBytes(),
|
if (gdb_comm.SendPacketAndWaitForResponse((const char *)data_sp->GetBytes(),
|
||||||
data_sp->GetByteSize(),
|
data_sp->GetByteSize(),
|
||||||
response,
|
response,
|
||||||
|
@ -400,6 +413,8 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data
|
||||||
if (response.IsOKPacket())
|
if (response.IsOKPacket())
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue