Add a warning to GDBRemoteRegisterContext (if packet logging enabled)

if the size of the g packet response was smaller than expected and is
going to be ignored.

llvm-svn: 353269
This commit is contained in:
Jason Molenda 2019-02-06 04:08:09 +00:00
parent 23fdd5a37f
commit 8130bf67ba
1 changed files with 8 additions and 0 deletions

View File

@ -205,6 +205,14 @@ bool GDBRemoteRegisterContext::ReadRegisterBytes(const RegisterInfo *reg_info,
if (buffer_sp->GetByteSize() >= m_reg_data.GetByteSize()) {
SetAllRegisterValid(true);
return true;
} else {
Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_THREAD |
GDBR_LOG_PACKETS));
if (log)
log->Printf ("error: GDBRemoteRegisterContext::ReadRegisterBytes tried to read the "
"entire register context at once, expected at least %" PRId64 " bytes "
"but only got %" PRId64 " bytes.", m_reg_data.GetByteSize(),
buffer_sp->GetByteSize());
}
}
return false;