diff --git a/radare2 b/radare2 index b84e57ec..b1bf3fea 160000 --- a/radare2 +++ b/radare2 @@ -1 +1 @@ -Subproject commit b84e57ec4c509afeaf856471d70e9dd9d9fd0013 +Subproject commit b1bf3fea9edf231ba99c27b147ec83664ac06638 diff --git a/src/Cutter.cpp b/src/Cutter.cpp index 05aa9ea2..5d565ef3 100644 --- a/src/Cutter.cpp +++ b/src/Cutter.cpp @@ -2204,10 +2204,13 @@ QList CutterCore::getAllUnions() QList 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 CutterCore::getAllStructs() QList 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) { @@ -2631,4 +2637,4 @@ QString CutterCore::ansiEscapeToHtml(const QString &text) QString r = QString::fromUtf8(html, len); free(html); return r; -} \ No newline at end of file +} diff --git a/src/widgets/TypesWidget.cpp b/src/widgets/TypesWidget.cpp index 7005c0ad..2dd054d6 100644 --- a/src/widgets/TypesWidget.cpp +++ b/src/widgets/TypesWidget.cpp @@ -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: