decompiler  1.0.0
Public Member Functions | Protected Attributes | List of all members
ghidra::Decoder Class Referenceabstract

A class for reading structured data from a stream. More...

#include <marshal.hh>

Inheritance diagram for ghidra::Decoder:
ghidra::PackedDecode ghidra::XmlDecode

Public Member Functions

 Decoder (const AddrSpaceManager *spc)
 Base constructor.
 
const AddrSpaceManagergetAddrSpaceManager (void) const
 Get the manager used for address space decoding.
 
virtual ~Decoder (void)
 Destructor.
 
virtual void ingestStream (istream &s)=0
 Prepare to decode a given stream. More...
 
virtual uint4 peekElement (void)=0
 Peek at the next child element of the current parent, without traversing in (opening) it. More...
 
virtual uint4 openElement (void)=0
 Open (traverse into) the next child element of the current parent. More...
 
virtual uint4 openElement (const ElementId &elemId)=0
 Open (traverse into) the next child element, which must be of a specific type. More...
 
virtual void closeElement (uint4 id)=0
 Close the current element. More...
 
virtual void closeElementSkipping (uint4 id)=0
 Close the current element, skipping any child elements that have not yet been parsed. More...
 
virtual uint4 getNextAttributeId (void)=0
 Get the next attribute id for the current element. More...
 
virtual uint4 getIndexedAttributeId (const AttributeId &attribId)=0
 Get the id for the (current) attribute, assuming it is indexed. More...
 
virtual void rewindAttributes (void)=0
 Reset attribute traversal for the current element. More...
 
virtual bool readBool (void)=0
 Parse the current attribute as a boolean value. More...
 
virtual bool readBool (const AttributeId &attribId)=0
 Find and parse a specific attribute in the current element as a boolean value. More...
 
virtual intb readSignedInteger (void)=0
 Parse the current attribute as a signed integer value. More...
 
virtual intb readSignedInteger (const AttributeId &attribId)=0
 Find and parse a specific attribute in the current element as a signed integer. More...
 
virtual intb readSignedIntegerExpectString (const string &expect, intb expectval)=0
 Parse the current attribute as either a signed integer value or a string. More...
 
virtual intb readSignedIntegerExpectString (const AttributeId &attribId, const string &expect, intb expectval)=0
 Find and parse a specific attribute in the current element as either a signed integer or a string. More...
 
virtual uintb readUnsignedInteger (void)=0
 Parse the current attribute as an unsigned integer value. More...
 
virtual uintb readUnsignedInteger (const AttributeId &attribId)=0
 Find and parse a specific attribute in the current element as an unsigned integer. More...
 
virtual string readString (void)=0
 Parse the current attribute as a string. More...
 
virtual string readString (const AttributeId &attribId)=0
 Find the specific attribute in the current element and return it as a string. More...
 
virtual AddrSpacereadSpace (void)=0
 Parse the current attribute as an address space. More...
 
virtual AddrSpacereadSpace (const AttributeId &attribId)=0
 Find the specific attribute in the current element and return it as an address space. More...
 
void skipElement (void)
 Skip parsing of the next element. More...
 

Protected Attributes

const AddrSpaceManagerspcManager
 Manager for decoding address space attributes.
 

Detailed Description

A class for reading structured data from a stream.

All data is loosely structured as with an XML document. A document contains a nested set of elements, with labels corresponding to the ElementId class. A single element can hold zero or more attributes and zero or more child elements. An attribute holds a primitive data element (bool, integer, string) and is labeled by an AttributeId. The document is traversed using a sequence of openElement() and closeElement() calls, intermixed with read*() calls to extract the data. The elements are traversed in a depth first order. Attributes within an element can be traversed in order using repeated calls to the getNextAttributeId() method, followed by a calls to one of the read*(void) methods to extract the data. Alternately a read*(AttributeId) call can be used to extract data for an attribute known to be in the element. There is a special content attribute whose data can be extracted using a read*(AttributeId) call that is passed the special ATTRIB_CONTENT id. This attribute will not be traversed by getNextAttribute().

Member Function Documentation

◆ closeElement()

virtual void ghidra::Decoder::closeElement ( uint4  id)
pure virtual

Close the current element.

The data for the current element is considered fully processed. If the element has additional children, an exception is thrown. The stream must indicate the end of the element in some way.

Parameters
idis the id of the element to close (which must be the current element)

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

Referenced by ghidra::Scope::addMapSym(), ghidra::GhidraTranslate::decode(), ghidra::VarnodeData::decode(), ghidra::CompilerTag::decode(), ghidra::InjectCallotherGhidra::decode(), ghidra::BlockEdge::decode(), ghidra::LoadTable::decode(), ghidra::StringManager::decode(), ghidra::Comment::decode(), ghidra::LanguageDescription::decode(), ghidra::TrackedContext::decode(), ghidra::TruncationTag::decode(), ghidra::Override::decode(), ghidra::CPoolRecord::decode(), ghidra::OptionDatabase::decode(), ghidra::LanedRegister::decode(), ghidra::PcodeOpRaw::decode(), ghidra::ParamEntry::decode(), ghidra::SymbolEntry::decode(), ghidra::SeqNum::decode(), ghidra::AddrSpace::decode(), ghidra::CommentDatabaseInternal::decode(), ghidra::SpacebaseSpace::decode(), ghidra::ConstantPoolInternal::CheapSorter::decode(), ghidra::FlowBlock::decode(), ghidra::Funcdata::decode(), ghidra::ConstantPoolInternal::decode(), ghidra::Range::decode(), ghidra::RangeProperties::decode(), ghidra::SegmentOp::decode(), ghidra::RangeList::decode(), ghidra::Symbol::decode(), ghidra::JumpAssistOp::decode(), ghidra::OverlaySpace::decode(), ghidra::FunctionSymbol::decode(), ghidra::ContextInternal::decode(), ghidra::EquateSymbol::decode(), ghidra::UnionFacetSymbol::decode(), ghidra::LabSymbol::decode(), ghidra::ExternRefSymbol::decode(), ghidra::TypeEnum::decode(), ghidra::JumpBasicOverride::decode(), ghidra::TypePointerRel::decode(), ghidra::JumpTable::decode(), ghidra::ParamListStandard::decode(), ghidra::TypeFactory::decode(), ghidra::ScopeInternal::decode(), ghidra::Database::decode(), ghidra::ProtoModel::decode(), ghidra::ProtoModelMerged::decode(), ghidra::ProtoStoreInternal::decode(), ghidra::Architecture::decodeAggressiveTrim(), ghidra::BlockGraph::decodeBody(), ghidra::ScopeInternal::decodeCollision(), ghidra::ContextInternal::decodeContext(), ghidra::TypeFactory::decodeCoreTypes(), ghidra::TypeFactory::decodeDataOrganization(), ghidra::Architecture::decodeDeadcodeDelay(), ghidra::Architecture::decodeDefaultProto(), ghidra::Architecture::decodeDynamicRule(), ghidra::Architecture::decodeFlowOverride(), ghidra::ContextInternal::decodeFromSpec(), ghidra::Architecture::decodeFuncPtrAlign(), ghidra::Architecture::decodeGlobal(), ghidra::ScopeGhidra::decodeHole(), ghidra::ScopeInternal::decodeHole(), ghidra::Architecture::decodeIncidentalCopy(), ghidra::Architecture::decodeInferPtrBounds(), ghidra::Funcdata::decodeJumpTable(), ghidra::Architecture::decodeLaneSizes(), ghidra::Architecture::decodeNoHighPtr(), ghidra::OptionDatabase::decodeOne(), ghidra::PcodeEmit::decodeOp(), ghidra::InjectPayload::decodeParameter(), ghidra::Architecture::decodePreferSplit(), ghidra::Architecture::decodeProtoEval(), ghidra::Architecture::decodeReadOnly(), ghidra::Architecture::decodeReturnAddress(), ghidra::Database::decodeScope(), ghidra::Database::decodeScopePath(), ghidra::Architecture::decodeSpacebase(), ghidra::AddrSpaceManager::decodeSpaces(), ghidra::Architecture::decodeStackPointer(), ghidra::TypeFactory::decodeType(), ghidra::TypeFactory::decodeTypeNoRef(), ghidra::TypeFactory::decodeTypeWithCodeFlags(), ghidra::Architecture::decodeVolatile(), ghidra::ScopeGhidra::dump2Cache(), ghidra::TypeFactory::parseEnumConfig(), ghidra::ParamListStandard::parseGroup(), ghidra::Database::parseParentTag(), and ghidra::TypeField::TypeField().

◆ closeElementSkipping()

virtual void ghidra::Decoder::closeElementSkipping ( uint4  id)
pure virtual

Close the current element, skipping any child elements that have not yet been parsed.

This closes the given element, which must be current. If there are child elements that have not been parsed, this is not considered an error, and they are skipped over in the parse.

Parameters
idis the id of the element to close (which must be the current element)

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

Referenced by ghidra::InjectPayloadGhidra::decode(), ghidra::InjectCallfixupGhidra::decode(), ghidra::InjectCallotherGhidra::decode(), ghidra::ExecutablePcodeGhidra::decode(), ghidra::LanguageDescription::decode(), ghidra::TypeFactory::decodeDataOrganization(), and ghidra::Database::decodeScopePath().

◆ getIndexedAttributeId()

virtual uint4 ghidra::Decoder::getIndexedAttributeId ( const AttributeId attribId)
pure virtual

Get the id for the (current) attribute, assuming it is indexed.

Assuming the previous call to getNextAttributeId() returned the id of ATTRIB_UNKNOWN, reinterpret the attribute as being an indexed form of the given attribute. If the attribute matches, return this indexed id, otherwise return ATTRIB_UNKNOWN.

Parameters
attribIdis the attribute being indexed
Returns
the indexed id or ATTRIB_UNKNOWN

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

Referenced by ghidra::JoinSpace::decodeAttributes().

◆ getNextAttributeId()

virtual uint4 ghidra::Decoder::getNextAttributeId ( void  )
pure virtual

Get the next attribute id for the current element.

Attributes are automatically set up for traversal using this method, when the element is opened. If all attributes have been traversed (or there are no attributes), 0 is returned.

Returns
the id of the next attribute or 0

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

Referenced by ghidra::LanguageDescription::decode(), ghidra::CPoolRecord::decode(), ghidra::LanedRegister::decode(), ghidra::ParamEntry::decode(), ghidra::SeqNum::decode(), ghidra::Funcdata::decode(), ghidra::RangeProperties::decode(), ghidra::SegmentOp::decode(), ghidra::FunctionSymbol::decode(), ghidra::ContextInternal::decode(), ghidra::TypePointer::decode(), ghidra::ExternRefSymbol::decode(), ghidra::TypeArray::decode(), ghidra::TypeEnum::decode(), ghidra::TypePointerRel::decode(), ghidra::JumpTable::decode(), ghidra::ParamListStandard::decode(), ghidra::Database::decode(), ghidra::ProtoModel::decode(), ghidra::ProtoStoreInternal::decode(), ghidra::FuncProto::decode(), ghidra::Architecture::decodeAggressiveTrim(), ghidra::AddrSpace::decodeAttributes(), ghidra::JoinSpace::decodeAttributes(), ghidra::Datatype::decodeBasic(), ghidra::AddrSpace::decodeBasicAttributes(), ghidra::Architecture::decodeDynamicRule(), ghidra::VarnodeData::decodeFromAttributes(), ghidra::Range::decodeFromAttributes(), ghidra::Symbol::decodeHeader(), ghidra::ScopeGhidra::decodeHole(), ghidra::ScopeInternal::decodeHole(), ghidra::InjectPayload::decodeParameter(), ghidra::InjectPayload::decodePayloadAttributes(), ghidra::Database::decodeScopePath(), ghidra::Architecture::decodeStackPointer(), ghidra::TypeFactory::decodeType(), ghidra::TypeFactory::decodeTypedef(), ghidra::TypeFactory::decodeTypeNoRef(), ghidra::TypeFactory::decodeTypeWithCodeFlags(), ghidra::UserOpManage::decodeVolatile(), and ghidra::TypeField::TypeField().

◆ ingestStream()

virtual void ghidra::Decoder::ingestStream ( istream &  s)
pure virtual

Prepare to decode a given stream.

Called once before any decoding. Currently this is assumed to make an internal copy of the stream data, i.e. the input stream is cleared before any decoding takes place.

Parameters
sis the given input stream to be decode
Returns
true if the stream was fully ingested

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

Referenced by ghidra::ArchitectureGhidra::readStringStream().

◆ openElement() [1/2]

virtual uint4 ghidra::Decoder::openElement ( void  )
pure virtual

Open (traverse into) the next child element of the current parent.

The child becomes the current parent. The list of attributes is initialized for use with getNextAttributeId.

Returns
the id of the child element

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

Referenced by ghidra::Scope::addMapSym(), ghidra::GhidraTranslate::decode(), ghidra::InjectPayloadGhidra::decode(), ghidra::VarnodeData::decode(), ghidra::CompilerTag::decode(), ghidra::InjectCallfixupGhidra::decode(), ghidra::InjectCallotherGhidra::decode(), ghidra::BlockEdge::decode(), ghidra::LoadTable::decode(), ghidra::StringManager::decode(), ghidra::Comment::decode(), ghidra::ExecutablePcodeGhidra::decode(), ghidra::LanguageDescription::decode(), ghidra::TrackedContext::decode(), ghidra::TruncationTag::decode(), ghidra::Override::decode(), ghidra::CPoolRecord::decode(), ghidra::OptionDatabase::decode(), ghidra::LanedRegister::decode(), ghidra::PcodeOpRaw::decode(), ghidra::ParamEntry::decode(), ghidra::SymbolEntry::decode(), ghidra::SeqNum::decode(), ghidra::AddrSpace::decode(), ghidra::CommentDatabaseInternal::decode(), ghidra::SpacebaseSpace::decode(), ghidra::ConstantPoolInternal::CheapSorter::decode(), ghidra::FlowBlock::decode(), ghidra::Funcdata::decode(), ghidra::ConstantPoolInternal::decode(), ghidra::Range::decode(), ghidra::RangeProperties::decode(), ghidra::SegmentOp::decode(), ghidra::RangeList::decode(), ghidra::Symbol::decode(), ghidra::JumpAssistOp::decode(), ghidra::OverlaySpace::decode(), ghidra::FunctionSymbol::decode(), ghidra::ContextInternal::decode(), ghidra::EquateSymbol::decode(), ghidra::UnionFacetSymbol::decode(), ghidra::LabSymbol::decode(), ghidra::ExternRefSymbol::decode(), ghidra::TypeEnum::decode(), ghidra::JumpBasicOverride::decode(), ghidra::TypePointerRel::decode(), ghidra::JumpTable::decode(), ghidra::ParamListStandard::decode(), ghidra::TypeFactory::decode(), ghidra::ScopeInternal::decode(), ghidra::Database::decode(), ghidra::ProtoModel::decode(), ghidra::ProtoModelMerged::decode(), ghidra::ProtoStoreInternal::decode(), ghidra::FuncProto::decode(), ghidra::Architecture::decodeAggressiveTrim(), ghidra::BlockGraph::decodeBody(), ghidra::ScopeInternal::decodeCollision(), ghidra::ContextInternal::decodeContext(), ghidra::TypeFactory::decodeCoreTypes(), ghidra::TypeFactory::decodeDataOrganization(), ghidra::Architecture::decodeDeadcodeDelay(), ghidra::Architecture::decodeDefaultProto(), ghidra::Architecture::decodeDynamicRule(), ghidra::Architecture::decodeFlowOverride(), ghidra::ContextInternal::decodeFromSpec(), ghidra::Architecture::decodeFuncPtrAlign(), ghidra::Architecture::decodeGlobal(), ghidra::ScopeGhidra::decodeHole(), ghidra::ScopeInternal::decodeHole(), ghidra::Architecture::decodeIncidentalCopy(), ghidra::Architecture::decodeInferPtrBounds(), ghidra::Funcdata::decodeJumpTable(), ghidra::Architecture::decodeLaneSizes(), ghidra::Architecture::decodeNoHighPtr(), ghidra::OptionDatabase::decodeOne(), ghidra::PcodeEmit::decodeOp(), ghidra::InjectPayload::decodeParameter(), ghidra::Architecture::decodePreferSplit(), ghidra::Architecture::decodeProtoEval(), ghidra::Architecture::decodeReadOnly(), ghidra::Architecture::decodeReturnAddress(), ghidra::Database::decodeScope(), ghidra::Database::decodeScopePath(), ghidra::Architecture::decodeSpacebase(), ghidra::AddrSpaceManager::decodeSpaces(), ghidra::Architecture::decodeStackPointer(), ghidra::TypeFactory::decodeType(), ghidra::TypeFactory::decodeTypeNoRef(), ghidra::TypeFactory::decodeTypeWithCodeFlags(), ghidra::Architecture::decodeVolatile(), ghidra::ScopeGhidra::dump2Cache(), ghidra::TypeFactory::parseEnumConfig(), ghidra::ParamListStandard::parseGroup(), ghidra::Database::parseParentTag(), and ghidra::TypeField::TypeField().

◆ openElement() [2/2]

virtual uint4 ghidra::Decoder::openElement ( const ElementId elemId)
pure virtual

Open (traverse into) the next child element, which must be of a specific type.

The child becomes the current parent, and its attributes are initialized for use with getNextAttributeId. The child must match the given element id or an exception is thrown.

Parameters
elemIdis the given element id to match
Returns
the id of the child element

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

◆ peekElement()

virtual uint4 ghidra::Decoder::peekElement ( void  )
pure virtual

Peek at the next child element of the current parent, without traversing in (opening) it.

The element id is returned, which can be compared to ElementId labels. If there are no remaining child elements to traverse, 0 is returned.

Returns
the element id or 0

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

Referenced by ghidra::Scope::addMapSym(), ghidra::GhidraTranslate::decode(), ghidra::Comment::decode(), ghidra::LanguageDescription::decode(), ghidra::OptionDatabase::decode(), ghidra::PcodeOpRaw::decode(), ghidra::SymbolEntry::decode(), ghidra::CommentDatabaseInternal::decode(), ghidra::Funcdata::decode(), ghidra::ConstantPoolInternal::decode(), ghidra::SegmentOp::decode(), ghidra::RangeList::decode(), ghidra::JumpAssistOp::decode(), ghidra::FunctionSymbol::decode(), ghidra::JumpTable::decode(), ghidra::ParamListStandard::decode(), ghidra::TypeFactory::decode(), ghidra::ScopeInternal::decode(), ghidra::Database::decode(), ghidra::ProtoModel::decode(), ghidra::BlockGraph::decodeBody(), ghidra::TypeFactory::decodeCoreTypes(), ghidra::Architecture::decodeDefaultProto(), ghidra::FlowBlock::decodeEdges(), ghidra::TypeStruct::decodeFields(), ghidra::TypeUnion::decodeFields(), ghidra::Architecture::decodeGlobal(), ghidra::Architecture::decodeIncidentalCopy(), ghidra::Architecture::decodeInferPtrBounds(), ghidra::Funcdata::decodeJumpTable(), ghidra::Architecture::decodeLaneSizes(), ghidra::Architecture::decodeNoHighPtr(), ghidra::InjectPayload::decodePayloadParams(), ghidra::Architecture::decodePreferSplit(), ghidra::Architecture::decodeProto(), ghidra::TypeCode::decodePrototype(), ghidra::Architecture::decodeReadOnly(), ghidra::Architecture::decodeReturnAddress(), ghidra::AddrSpaceManager::decodeSpace(), ghidra::AddrSpaceManager::decodeSpaces(), ghidra::TypeCode::decodeStub(), ghidra::ContextDatabase::decodeTracked(), ghidra::TypeFactory::decodeType(), ghidra::Architecture::decodeVolatile(), ghidra::ScopeGhidra::dump2Cache(), and ghidra::ParamListStandard::parseGroup().

◆ readBool() [1/2]

virtual bool ghidra::Decoder::readBool ( void  )
pure virtual

◆ readBool() [2/2]

virtual bool ghidra::Decoder::readBool ( const AttributeId attribId)
pure virtual

Find and parse a specific attribute in the current element as a boolean value.

The set of attributes for the current element is searched for a match to the given attribute id. This attribute is then parsed as a boolean and its value returned. If there is no attribute matching the id, an exception is thrown. Parsing via getNextAttributeId is reset.

Parameters
attribIdis the specific attribute id to match
Returns
the boolean value

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

◆ readSignedInteger() [1/2]

virtual intb ghidra::Decoder::readSignedInteger ( void  )
pure virtual

◆ readSignedInteger() [2/2]

virtual intb ghidra::Decoder::readSignedInteger ( const AttributeId attribId)
pure virtual

Find and parse a specific attribute in the current element as a signed integer.

The set of attributes for the current element is searched for a match to the given attribute id. This attribute is then parsed as a signed integer and its value returned. If there is no attribute matching the id, an exception is thrown. Parsing via getNextAttributeId is reset.

Parameters
attribIdis the specific attribute id to match
Returns
the signed integer value

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

◆ readSignedIntegerExpectString() [1/2]

virtual intb ghidra::Decoder::readSignedIntegerExpectString ( const string &  expect,
intb  expectval 
)
pure virtual

Parse the current attribute as either a signed integer value or a string.

If the attribute is an integer, its value is returned. If the attribute is a string, it must match an expected string passed to the method, and a predetermined integer value associated with the string is returned. If the attribute neither matches the expected string nor is an integer, the return value is undefined.

Parameters
expectis the string value to expect if the attribute is encoded as a string
expectvalis the integer value to return if the attribute matches the expected string
Returns
the encoded integer or the integer value associated with the expected string

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

Referenced by ghidra::ProtoModel::decode(), and ghidra::FuncProto::decode().

◆ readSignedIntegerExpectString() [2/2]

virtual intb ghidra::Decoder::readSignedIntegerExpectString ( const AttributeId attribId,
const string &  expect,
intb  expectval 
)
pure virtual

Find and parse a specific attribute in the current element as either a signed integer or a string.

If the attribute is an integer, its value is parsed and returned. If the attribute is encoded as a string, it must match an expected string passed to this method. In this case, a predetermined integer value is passed back, indicating a matching string was parsed. If the attribute neither matches the expected string nor is an integer, the return value is undefined. If there is no attribute matching the id, an exception is thrown.

Parameters
attribIdis the specific attribute id to match
expectis the string to expect, if the attribute is not encoded as an integer
expectvalis the integer value to return if the attribute matches the expected string
Returns
the encoded integer or the integer value associated with the expected string

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

◆ readSpace() [1/2]

virtual AddrSpace* ghidra::Decoder::readSpace ( void  )
pure virtual

◆ readSpace() [2/2]

virtual AddrSpace* ghidra::Decoder::readSpace ( const AttributeId attribId)
pure virtual

Find the specific attribute in the current element and return it as an address space.

Search attributes from the current element for a match to the given attribute id. Return this attribute as an address space. If there is no attribute matching the id, an exception is thrown. Parse via getNextAttributeId is reset.

Parameters
attribIdis the specific attribute id to match
Returns
the address space associated with the attribute

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

◆ readString() [1/2]

virtual string ghidra::Decoder::readString ( void  )
pure virtual

Parse the current attribute as a string.

The last attribute, as returned by getNextAttributeId, is returned as a string.

Returns
the string associated with the current attribute.

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

Referenced by ghidra::CompilerTag::decode(), ghidra::InjectCallfixupGhidra::decode(), ghidra::InjectCallotherGhidra::decode(), ghidra::StringManager::decode(), ghidra::Comment::decode(), ghidra::LanguageDescription::decode(), ghidra::TruncationTag::decode(), ghidra::Override::decode(), ghidra::CPoolRecord::decode(), ghidra::LanedRegister::decode(), ghidra::ParamEntry::decode(), ghidra::Funcdata::decode(), ghidra::RangeProperties::decode(), ghidra::SegmentOp::decode(), ghidra::JumpAssistOp::decode(), ghidra::OverlaySpace::decode(), ghidra::FunctionSymbol::decode(), ghidra::ExternRefSymbol::decode(), ghidra::TypeEnum::decode(), ghidra::Database::decode(), ghidra::ProtoModel::decode(), ghidra::ProtoModelMerged::decode(), ghidra::ProtoStoreInternal::decode(), ghidra::FuncProto::decode(), ghidra::JoinSpace::decodeAttributes(), ghidra::Datatype::decodeBasic(), ghidra::AddrSpace::decodeBasicAttributes(), ghidra::BlockGraph::decodeBody(), ghidra::ScopeInternal::decodeCollision(), ghidra::ContextInternal::decodeContext(), ghidra::Architecture::decodeDynamicRule(), ghidra::Architecture::decodeFlowOverride(), ghidra::VarnodeData::decodeFromAttributes(), ghidra::Range::decodeFromAttributes(), ghidra::Symbol::decodeHeader(), ghidra::OptionDatabase::decodeOne(), ghidra::InjectPayload::decodeParameter(), ghidra::InjectPayload::decodePayloadAttributes(), ghidra::Architecture::decodePreferSplit(), ghidra::Architecture::decodeProtoEval(), ghidra::Database::decodeScopePath(), ghidra::Architecture::decodeSpacebase(), ghidra::AddrSpaceManager::decodeSpaces(), ghidra::Architecture::decodeStackPointer(), ghidra::TypeFactory::decodeType(), ghidra::TypeFactory::decodeTypedef(), ghidra::TypeFactory::decodeTypeNoRef(), ghidra::UserOpManage::decodeVolatile(), and ghidra::TypeField::TypeField().

◆ readString() [2/2]

virtual string ghidra::Decoder::readString ( const AttributeId attribId)
pure virtual

Find the specific attribute in the current element and return it as a string.

The set of attributes for the current element is searched for a match to the given attribute id. This attribute is then returned as a string. If there is no attribute matching the id, and exception is thrown. Parse via getNextAttributeId is reset.

Parameters
attribIdis the specific attribute id to match
Returns
the string associated with the attribute

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

◆ readUnsignedInteger() [1/2]

virtual uintb ghidra::Decoder::readUnsignedInteger ( void  )
pure virtual

◆ readUnsignedInteger() [2/2]

virtual uintb ghidra::Decoder::readUnsignedInteger ( const AttributeId attribId)
pure virtual

Find and parse a specific attribute in the current element as an unsigned integer.

The set of attributes for the current element is searched for a match to the given attribute id. This attribute is then parsed as an unsigned integer and its value returned. If there is no attribute matching the id, an exception is thrown. Parsing via getNextAttributeId is reset.

Parameters
attribIdis the specific attribute id to match
Returns
the unsigned integer value

Implemented in ghidra::PackedDecode, and ghidra::XmlDecode.

◆ rewindAttributes()

virtual void ghidra::Decoder::rewindAttributes ( void  )
pure virtual

◆ skipElement()

void ghidra::Decoder::skipElement ( void  )
inline

Skip parsing of the next element.

The element skipped is the one that would be opened by the next call to openElement.

Referenced by ghidra::ContextGhidra::decode(), ghidra::ScopeInternal::decode(), and ghidra::ContextGhidra::decodeFromSpec().


The documentation for this class was generated from the following file: