decompiler
1.0.0
|
An implementation of ConstantPool using a Ghidra client as the backing storage. More...
#include <cpool_ghidra.hh>
Public Member Functions | |
ConstantPoolGhidra (ArchitectureGhidra *g) | |
Constructor. | |
virtual const CPoolRecord * | getRecord (const vector< uintb > &refs) const |
Retrieve a constant pool record (CPoolRecord) given a reference to it. More... | |
virtual bool | empty (void) const |
Is the container empty of records. | |
virtual void | clear (void) |
Release any (local) resources. | |
virtual void | encode (Encoder &encoder) const |
Encode all records in this container to a stream. More... | |
virtual void | decode (Decoder &decoder, TypeFactory &typegrp) |
Restore constant pool records from the given stream decoder. More... | |
Public Member Functions inherited from ghidra::ConstantPool | |
virtual | ~ConstantPool () |
Destructor. | |
void | putRecord (const vector< uintb > &refs, uint4 tag, const string &tok, Datatype *ct) |
A a new constant pool record to this database. More... | |
const CPoolRecord * | decodeRecord (const vector< uintb > &refs, Decoder &decoder, TypeFactory &typegrp) |
Restore a CPoolRecord given a reference and a stream decoder. More... | |
Private Member Functions | |
virtual CPoolRecord * | createRecord (const vector< uintb > &refs) |
Allocate a new CPoolRecord object, given a reference to it. More... | |
Private Attributes | |
ArchitectureGhidra * | ghidra |
The connection with the Ghidra client. | |
ConstantPoolInternal | cache |
The local cache of previouly queried CPoolRecord objects. | |
An implementation of ConstantPool using a Ghidra client as the backing storage.
The actual CPoolRecord objects are cached locally, but new queries are placed with the Ghidra client hosting the program currently being decompiled. The queries and response records are sent via XML. The encode() and decode() methods are disabled. The clear() method only releases the local cache, no records on the Ghidra client are affected.
|
privatevirtual |
Allocate a new CPoolRecord object, given a reference to it.
The object will still need to be initialized but is already associated with the reference. Any issue with allocation (like a dupicate reference) causes an exception.
refs | is the reference of 1 or more identifying integers |
Implements ghidra::ConstantPool.
|
virtual |
Restore constant pool records from the given stream decoder.
(If supported) The container is populated with CPoolRecords initialized from a <constantpool> element.
decoder | is the given stream decoder |
typegrp | is the TypeFactory used to resolve data-type references in the XML |
Implements ghidra::ConstantPool.
Referenced by clear().
|
virtual |
Encode all records in this container to a stream.
(If supported) A <constantpool> element is written containing <cpoolrec> child elements for each CPoolRecord in the container.
encoder | is the stream encoder |
Implements ghidra::ConstantPool.
Referenced by clear().
|
virtual |
Retrieve a constant pool record (CPoolRecord) given a reference to it.
refs | is the reference (made up of 1 or more identifying integers) |
Implements ghidra::ConstantPool.
References cache, ghidra::ConstantPool::decodeRecord(), ghidra::LowlevelError::explain, ghidra::DecoderError::explain, and ghidra::ConstantPoolInternal::getRecord().