Debugger: Add basic handling of SIMD to RegistersView.
- If an SIMD register is detected, retrieve its value and format it as an array of 16-bit hex values. This will be extended to allow other format choices in a future commit.
This commit is contained in:
@@ -133,12 +133,34 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
if (!fCpuState->GetRegisterValue(reg, value))
|
if (!fCpuState->GetRegisterValue(reg, value))
|
||||||
value.SetTo("?", B_VARIANT_DONT_COPY_DATA);
|
value.SetTo("?", B_VARIANT_DONT_COPY_DATA);
|
||||||
|
else if (reg->Format() == REGISTER_FORMAT_SIMD)
|
||||||
|
_FormatSIMDValue(reg, value);
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void _FormatSIMDValue(const Register* reg, BVariant& _value)
|
||||||
|
{
|
||||||
|
// for now, format SIMD registers as groups of 16-bit integer values.
|
||||||
|
// TODO: support multiple formats.
|
||||||
|
BString temp("{");
|
||||||
|
uint16* data = (uint16*)_value.ToPointer();
|
||||||
|
uint32 count = reg->BitSize() / (sizeof(uint16) * 8);
|
||||||
|
for (uint32 i = 0; i < count; i++) {
|
||||||
|
BString intFormat;
|
||||||
|
intFormat.SetToFormat("%#" B_PRIx16, data[i]);
|
||||||
|
temp += intFormat;
|
||||||
|
if (i < count - 1)
|
||||||
|
temp += ", ";
|
||||||
|
}
|
||||||
|
temp += "}";
|
||||||
|
|
||||||
|
_value.SetTo(temp);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Architecture* fArchitecture;
|
Architecture* fArchitecture;
|
||||||
CpuState* fCpuState;
|
CpuState* fCpuState;
|
||||||
|
|||||||
Reference in New Issue
Block a user