Ghidra Decompiler Analysis Engine
Public Member Functions | List of all members
ConstantPoolGhidra Class Reference

An implementation of ConstantPool using a Ghidra client as the backing storage. More...

#include <cpool_ghidra.hh>

Inheritance diagram for ConstantPoolGhidra:
Inheritance graph
[legend]
Collaboration diagram for ConstantPoolGhidra:
Collaboration graph
[legend]

Public Member Functions

 ConstantPoolGhidra (ArchitectureGhidra *g)
 Constructor.
 
virtual const CPoolRecordgetRecord (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 saveXml (ostream &s) const
 Save all records in this container to an XML stream. More...
 
virtual void restoreXml (const Element *el, TypeFactory &typegrp)
 Restore constant pool records from an XML stream. More...
 
- Public Member Functions inherited from ConstantPool
void putRecord (const vector< uintb > &refs, uint4 tag, const string &tok, Datatype *ct)
 A a new constant pool record to this database. More...
 
const CPoolRecordrestoreXmlRecord (const vector< uintb > &refs, const Element *el, TypeFactory &typegrp)
 Restore a CPoolRecord given a reference and an XML stream. More...
 

Detailed Description

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 saveXml() and restoreXml() methods are disabled. The clear() method only releases the local cache, no records on the Ghidra client are affected.

Member Function Documentation

◆ getRecord()

const CPoolRecord * ConstantPoolGhidra::getRecord ( const vector< uintb > &  refs) const
virtual

Retrieve a constant pool record (CPoolRecord) given a reference to it.

Parameters
refsis the reference (made up of 1 or more identifying integers)
Returns
the matching CPoolRecord or NULL if none matches the reference

Implements ConstantPool.

◆ restoreXml()

void ConstantPoolGhidra::restoreXml ( const Element el,
TypeFactory typegrp 
)
virtual

Restore constant pool records from an XML stream.

(If supported) The container is populated with CPooLRecords initialized from a <constantpool> XML tag.

Parameters
elis the XML element
typegrpis the TypeFactory used to resolve data-type references in the XML

Implements ConstantPool.

◆ saveXml()

void ConstantPoolGhidra::saveXml ( ostream &  s) const
virtual

Save all records in this container to an XML stream.

(If supported) An <constantpool> element is written containing <cpoolrec> child elements for each CPoolRecord in the container.

Parameters
sis the output stream

Implements ConstantPool.


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