Commit bbe8195d authored by David Schulz's avatar David Schulz
Browse files

Cdb: Add register size and type to the gdmi structure.



Change-Id: I8c87a92e6a76165a99c3654b7b71bd539a51d67c
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 58e391fe
......@@ -347,7 +347,7 @@ const wchar_t *valueType(ULONG type)
case DEBUG_VALUE_INT32:
return L"I32";
case DEBUG_VALUE_INT64:
return L"I64";
return L"I64";
case DEBUG_VALUE_FLOAT32:
return L"F32";
case DEBUG_VALUE_FLOAT64:
......@@ -509,6 +509,8 @@ Registers getRegisters(CIDebugRegisters *regs,
reg.description = registerDescription(description);
reg.subRegister = isSubRegister;
reg.value = value;
reg.size = valueSize(description.Type);
reg.type = valueType(description.Type);
rc.push_back(reg);
}
}
......@@ -527,6 +529,7 @@ Registers getRegisters(CIDebugRegisters *regs,
reg.name = buf;
reg.description = valueType(type);
reg.size = valueSize(type);
reg.type = valueType(type);
reg.value = value;
rc.push_back(reg);
}
......@@ -557,7 +560,8 @@ std::string gdbmiRegisters(CIDebugRegisters *regs,
const Register &reg = registers.at(r);
if (r)
str << ',';
str << "{number=\"" << r << "\",name=\"" << gdbmiWStringFormat(reg.name) << '"';
str << "{number=\"" << r << "\",name=\"" << gdbmiWStringFormat(reg.name)
<< "\",size=\"" << reg.size << "\",type=\"" << gdbmiWStringFormat(reg.type) << '"';
if (!reg.description.empty())
str << ",description=\"" << gdbmiWStringFormat(reg.description) << '"';
if (reg.subRegister)
......
......@@ -129,6 +129,7 @@ struct Register
std::wstring name;
std::wstring description;
std::wstring type;
int size;
bool subRegister;
bool pseudoRegister;
......
......@@ -1669,6 +1669,14 @@ void CdbEngine::handleRegistersExt(const DebuggerResponse &response)
reg.name = item["name"].data();
reg.description = item["description"].data();
reg.reportedType = item["type"].data();
if (reg.reportedType.startsWith('I'))
reg.kind = IntegerRegister;
else if (reg.reportedType.startsWith('F'))
reg.kind = FloatRegister;
else if (reg.reportedType.startsWith('V'))
reg.kind = VectorRegister;
else
reg.kind = OtherRegister;
reg.value.fromByteArray(item["value"].data(), HexadecimalFormat);
reg.size = item["size"].data().toInt();
handler->updateRegister(reg);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment