mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
GP-3590 Send void as normal core type
This commit is contained in:
parent
a961b069a4
commit
b69840c347
3 changed files with 28 additions and 2 deletions
|
@ -754,6 +754,23 @@ void TypeUnicode::encode(Encoder &encoder) const
|
|||
encoder.closeElement(ELEM_TYPE);
|
||||
}
|
||||
|
||||
/// Parse a \<type> element for the \b id attributes of the \b void data-type.
|
||||
/// The \b void data-type is usually marshaled with the \<void> element, but this is an alternate
|
||||
/// encoding that allows a specific id to be associated with the data-type when core data-types are specified.
|
||||
/// \param decoder is the stream decoder
|
||||
/// \param typegrp is the factory owning \b this data-type
|
||||
void TypeVoid::decode(Decoder &decoder,TypeFactory &typegrp)
|
||||
|
||||
{
|
||||
for(;;) {
|
||||
uint4 attrib = decoder.getNextAttributeId();
|
||||
if (attrib == 0) break;
|
||||
if (attrib == ATTRIB_ID) {
|
||||
id = decoder.readUnsignedInteger();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TypeVoid::encode(Encoder &encoder) const
|
||||
|
||||
{
|
||||
|
@ -4070,6 +4087,13 @@ Datatype *TypeFactory::decodeTypeNoRef(Decoder &decoder,bool forcecore)
|
|||
case TYPE_CODE:
|
||||
ct = decodeCode(decoder,false, false, forcecore);
|
||||
break;
|
||||
case TYPE_VOID:
|
||||
{
|
||||
TypeVoid voidType;
|
||||
voidType.decode(decoder,*this);
|
||||
ct = findAdd(voidType);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
for(;;) {
|
||||
uint4 attribId = decoder.getNextAttributeId();
|
||||
|
|
|
@ -326,6 +326,7 @@ public:
|
|||
class TypeVoid : public Datatype {
|
||||
protected:
|
||||
friend class TypeFactory;
|
||||
void decode(Decoder &decoder,TypeFactory &typegrp); ///< Restore \b void data-type, with an id
|
||||
public:
|
||||
/// Construct from another TypeVoid
|
||||
TypeVoid(const TypeVoid &op) : Datatype(op) { flags |= Datatype::coretype; }
|
||||
|
|
|
@ -1137,6 +1137,9 @@ public class PcodeDataTypeManager {
|
|||
TypeMap type = new TypeMap(DataType.DEFAULT, "undefined", "unknown", false, false,
|
||||
DEFAULT_DECOMPILER_ID);
|
||||
coreBuiltin.put(type.id, type);
|
||||
type = new TypeMap(displayLanguage, VoidDataType.dataType, "void", false, false,
|
||||
builtInDataTypes);
|
||||
coreBuiltin.put(type.id, type);
|
||||
|
||||
for (BuiltIn dt : Undefined.getUndefinedDataTypes()) {
|
||||
type = new TypeMap(displayLanguage, dt, "unknown", false, false, builtInDataTypes);
|
||||
|
@ -1218,8 +1221,6 @@ public class PcodeDataTypeManager {
|
|||
*/
|
||||
public void encodeCoreTypes(Encoder encoder) throws IOException {
|
||||
encoder.openElement(ELEM_CORETYPES);
|
||||
encoder.openElement(ELEM_VOID);
|
||||
encoder.closeElement(ELEM_VOID);
|
||||
|
||||
for (TypeMap typeMap : coreBuiltin.values()) {
|
||||
encoder.openElement(ELEM_TYPE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue