Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
72 ~
CPoolRecord(
void) {
if (byteData != (uint1 *)0)
delete [] byteData; }
73 uint4 getTag(
void)
const {
return tag; }
74 const string &getToken(
void)
const {
return token; }
75 const uint1 *getByteData(
void)
const {
return byteData; }
76 int4 getByteDataLength(
void)
const {
return byteDataLen; }
77 Datatype *getType(
void)
const {
return type; }
78 uintb getValue(
void)
const {
return value; }
79 bool isConstructor(
void)
const {
return ((flags &
is_constructor)!=0); }
80 bool isDestructor(
void)
const {
return ((flags &
is_destructor)!=0); }
99 virtual CPoolRecord *createRecord(
const vector<uintb> &refs)=0;
117 void putRecord(
const vector<uintb> &refs,uint4 tag,
const string &tok,
Datatype *ct);
129 virtual bool empty(
void)
const=0;
130 virtual void clear(
void)=0;
137 virtual void saveXml(ostream &s)
const=0;
167 CheapSorter(
void) { a = 0; b = 0; }
168 CheapSorter(
const CheapSorter &op2) { a = op2.a; b = op2.b; }
169 CheapSorter(
const vector<uintb> &refs) { a = refs[0]; b = (refs.size() > 1) ? refs[1] : 0; }
175 bool operator<(
const CheapSorter &op2)
const {
176 if (a != op2.a)
return (a<op2.a);
183 void apply(vector<uintb> &refs)
const { refs.push_back(a); refs.push_back(b); }
185 void saveXml(ostream &s)
const;
188 map<CheapSorter,CPoolRecord> cpoolMap;
189 virtual CPoolRecord *createRecord(
const vector<uintb> &refs);
192 virtual bool empty(
void)
const {
return cpoolMap.empty(); }
193 virtual void clear(
void) { cpoolMap.clear(); }
194 virtual void saveXml(ostream &s)
const;
virtual const CPoolRecord * getRecord(const vector< uintb > &refs) const
Retrieve a constant pool record (CPoolRecord) given a reference to it.
Definition: cpool.cc:202
const CPoolRecord * restoreXmlRecord(const vector< uintb > &refs, const Element *el, TypeFactory &typegrp)
Restore a CPoolRecord given a reference and an XML stream.
Definition: cpool.cc:159
void restoreXml(const Element *el, TypeFactory &typegrp)
Restore object from XML stream.
Definition: cpool.cc:75
@ string_literal
Constant reference to string (passed back as byteData)
Definition: cpool.hh:49
@ pointer_field
Pointer to a field, name in token, data-type in type.
Definition: cpool.hh:52
A description of a byte-code object referenced by a constant.
Definition: cpool.hh:44
void saveXml(ostream &s) const
Save object to an XML stream.
Definition: cpool.cc:20
@ class_reference
Reference to (system level) class object, token holds class name.
Definition: cpool.hh:50
An interface to the pool of constant objects for byte-code languages.
Definition: cpool.hh:92
@ check_cast
Pointer to object, new name in token, new data-type in type.
Definition: cpool.hh:55
void putRecord(const vector< uintb > &refs, uint4 tag, const string &tok, Datatype *ct)
A a new constant pool record to this database.
Definition: cpool.cc:150
An XML element. A node in the DOM tree.
Definition: xml.hh:150
@ is_destructor
Referenced method is a destructor.
Definition: cpool.hh:59
virtual const CPoolRecord * getRecord(const vector< uintb > &refs) const =0
Retrieve a constant pool record (CPoolRecord) given a reference to it.
virtual void saveXml(ostream &s) const
Save all records in this container to an XML stream.
Definition: cpool.cc:213
virtual void clear(void)
Release any (local) resources.
Definition: cpool.hh:193
@ pointer_method
Pointer to a method, name in token, signature in type.
Definition: cpool.hh:51
virtual void clear(void)=0
Release any (local) resources.
virtual bool empty(void) const
Is the container empty of records.
Definition: cpool.hh:192
The base datatype class for the decompiler.
Definition: type.hh:62
Container class for all Datatype objects in an Architecture.
Definition: type.hh:396
virtual void saveXml(ostream &s) const =0
Save all records in this container to an XML stream.
@ primitive
Constant value of data-type type, cpool operator can be eliminated.
Definition: cpool.hh:48
Classes for describing and printing data-types.
@ is_constructor
Referenced method is a constructor.
Definition: cpool.hh:58
virtual void restoreXml(const Element *el, TypeFactory &typegrp)
Restore constant pool records from an XML stream.
Definition: cpool.cc:225
@ instance_of
Boolean value, token is language specific indicator, type is boolean data-type.
Definition: cpool.hh:54
virtual void restoreXml(const Element *el, TypeFactory &typegrp)=0
Restore constant pool records from an XML stream.
An implementation of the ConstantPool interface storing records internally in RAM.
Definition: cpool.hh:153
virtual bool empty(void) const =0
Is the container empty of records.
@ array_length
Integer length, token is language specific indicator, type is integral data-type.
Definition: cpool.hh:53