diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h @@ -83,7 +83,7 @@ protected: friend class ThreadGDBRemote; - bool ReadRegisterBytes(const RegisterInfo *reg_info, DataExtractor &data); + bool ReadRegisterBytes(const RegisterInfo *reg_info); bool WriteRegisterBytes(const RegisterInfo *reg_info, DataExtractor &data, uint32_t data_offset); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -90,7 +90,7 @@ bool GDBRemoteRegisterContext::ReadRegister(const RegisterInfo *reg_info, RegisterValue &value) { // Read the register - if (ReadRegisterBytes(reg_info, m_reg_data)) { + if (ReadRegisterBytes(reg_info)) { const uint32_t reg = reg_info->kinds[eRegisterKindLLDB]; if (m_reg_valid[reg] == false) return false; @@ -184,8 +184,7 @@ return false; } -bool GDBRemoteRegisterContext::ReadRegisterBytes(const RegisterInfo *reg_info, - DataExtractor &data) { +bool GDBRemoteRegisterContext::ReadRegisterBytes(const RegisterInfo *reg_info) { ExecutionContext exe_ctx(CalculateThread()); Process *process = exe_ctx.GetProcessPtr(); @@ -279,22 +278,6 @@ return false; } - if (&data != &m_reg_data) { - assert(m_reg_data.GetByteSize() >= - reg_info->byte_offset + reg_info->byte_size); - // If our register context and our register info disagree, which should - // never happen, don't read past the end of the buffer. - if (m_reg_data.GetByteSize() < reg_info->byte_offset + reg_info->byte_size) - return false; - - // If we aren't extracting into our own buffer (which only happens when - // this function is called from ReadRegisterValue(uint32_t, Scalar&)) then - // we transfer bytes from our buffer into the data buffer that was passed - // in - - data.SetByteOrder(m_reg_data.GetByteOrder()); - data.SetData(m_reg_data, reg_info->byte_offset, reg_info->byte_size); - } return true; } @@ -526,7 +509,7 @@ if (reg_info ->value_regs) // skip registers that are slices of real registers continue; - ReadRegisterBytes(reg_info, m_reg_data); + ReadRegisterBytes(reg_info); // ReadRegisterBytes saves the contents of the register in to the // m_reg_data buffer }