debugger: make handling of cpu type result failure more robust

This commit is contained in:
hjk
2011-02-14 17:46:45 +01:00
parent b3d3ec731f
commit 793cadfe7f

View File

@@ -1131,6 +1131,11 @@ void TrkGdbAdapter::handleCpuType(const TrkResult &result)
// Command: 0x80 Acknowledge
// Error: 0x00
// [80 03 00 04 00 00 04 00 00 00]
if (result.data.size() < 7) {
logMessage("ERROR: CPUTYPE RESULT " + result.errorString()
+ " NOT PARSABLE", LogError);
return;
}
m_session.cpuMajor = result.data[1];
m_session.cpuMinor = result.data[2];
m_session.bigEndian = result.data[3];