mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
Show sizes of structs and unions (#1203)
Show sizes of structs and unions and update radare2 submodule for r_core_save_parsed_type()
This commit is contained in:
parent
cd96856959
commit
a8fbe72bf7
2
radare2
2
radare2
@ -1 +1 @@
|
||||
Subproject commit b84e57ec4c509afeaf856471d70e9dd9d9fd0013
|
||||
Subproject commit b1bf3fea9edf231ba99c27b147ec83664ac06638
|
@ -2204,10 +2204,13 @@ QList<TypeDescription> CutterCore::getAllUnions()
|
||||
QList<TypeDescription> ret;
|
||||
|
||||
QJsonArray typesArray = cmdj("tuj").array();
|
||||
for (auto value: typesArray) {
|
||||
for (const QJsonValue value: typesArray) {
|
||||
QJsonObject typeObject = value.toObject();
|
||||
|
||||
TypeDescription exp;
|
||||
exp.type = value.toString();
|
||||
exp.size = 0;
|
||||
|
||||
exp.type = typeObject[RJsonKey::type].toString();
|
||||
exp.size = typeObject[RJsonKey::size].toVariant().toULongLong();
|
||||
exp.category = "Union";
|
||||
ret << exp;
|
||||
}
|
||||
@ -2221,10 +2224,13 @@ QList<TypeDescription> CutterCore::getAllStructs()
|
||||
QList<TypeDescription> ret;
|
||||
|
||||
QJsonArray typesArray = cmdj("tsj").array();
|
||||
for (auto value: typesArray) {
|
||||
for (const QJsonValue value: typesArray) {
|
||||
QJsonObject typeObject = value.toObject();
|
||||
|
||||
TypeDescription exp;
|
||||
exp.type = value.toString();
|
||||
exp.size = 0;
|
||||
|
||||
exp.type = typeObject[RJsonKey::type].toString();
|
||||
exp.size = typeObject[RJsonKey::size].toVariant().toULongLong();
|
||||
exp.category = "Struct";
|
||||
ret << exp;
|
||||
}
|
||||
@ -2280,7 +2286,7 @@ QString CutterCore::addTypes(const char *str)
|
||||
return ret;
|
||||
}
|
||||
|
||||
sdb_query_lines(core_->anal->sdb_types, parsed);
|
||||
r_core_save_parsed_type(core_, parsed);
|
||||
r_mem_free(parsed);
|
||||
|
||||
if (error_msg) {
|
||||
|
@ -37,7 +37,7 @@ QVariant TypesModel::data(const QModelIndex &index, int role) const
|
||||
case TYPE:
|
||||
return exp.type;
|
||||
case SIZE:
|
||||
return exp.category == tr("Primitive") ? exp.size : QVariant();
|
||||
return exp.size ? exp.size : QVariant();
|
||||
case FORMAT:
|
||||
return exp.format;
|
||||
case CATEGORY:
|
||||
|
Loading…
Reference in New Issue
Block a user