diff options
author | Pavel Labath <labath@google.com> | 2016-08-17 09:12:21 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-08-17 09:12:21 +0000 |
commit | d43ae376d4aae65e83ec161ad51488874e3f534a (patch) | |
tree | 2db9c9b0dcdc9437ef81bd8204163fd7f85d885f /lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp | |
parent | 56d7262b698024ba95afe5df5355e7cc23933049 (diff) | |
download | bcm5719-llvm-d43ae376d4aae65e83ec161ad51488874e3f534a.tar.gz bcm5719-llvm-d43ae376d4aae65e83ec161ad51488874e3f534a.zip |
Remove manual packet construction from GDBRemoteRegisterContext::SetPrimordialRegister
llvm-svn: 278916
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index 05b2a324568..dbdb3a81aa1 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -325,26 +325,13 @@ GDBRemoteRegisterContext::SetPrimordialRegister(const RegisterInfo *reg_info, StreamString packet; StringExtractorGDBRemote response; const uint32_t reg = reg_info->kinds[eRegisterKindLLDB]; - packet.Printf ("P%x=", reg_info->kinds[eRegisterKindProcessPlugin]); - packet.PutBytesAsRawHex8 (m_reg_data.PeekData(reg_info->byte_offset, reg_info->byte_size), - reg_info->byte_size, - endian::InlHostByteOrder(), - endian::InlHostByteOrder()); - - if (gdb_comm.GetThreadSuffixSupported()) - packet.Printf (";thread:%4.4" PRIx64 ";", m_thread.GetProtocolID()); - // Invalidate just this register SetRegisterIsValid(reg, false); - if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(), - packet.GetString().size(), - response, - false) == GDBRemoteCommunication::PacketResult::Success) - { - if (response.IsOKResponse()) - return true; - } - return false; + + return gdb_comm.WriteRegister( + m_thread.GetProtocolID(), reg_info->kinds[eRegisterKindProcessPlugin], + llvm::StringRef(reinterpret_cast<const char *>(m_reg_data.PeekData(reg_info->byte_offset, reg_info->byte_size)), + reg_info->byte_size)); } void |