Ghidra Decompiler Analysis Engine
cpool_ghidra.hh
Go to the documentation of this file.
1 /* ###
2  * IP: GHIDRA
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
18 
19 #ifndef __CPOOL_GHIDRA__
20 #define __CPOOL_GHIDRA__
21 
22 #include "ghidra_arch.hh"
23 
32  ArchitectureGhidra *ghidra;
33  mutable ConstantPoolInternal cache;
34  virtual CPoolRecord *createRecord(const vector<uintb> &refs);
35 public:
37  virtual const CPoolRecord *getRecord(const vector<uintb> &refs) const;
38  virtual bool empty(void) const { return false; }
39  virtual void clear(void) { cache.clear(); }
40  virtual void saveXml(ostream &s) const;
41  virtual void restoreXml(const Element *el,TypeFactory &typegrp);
42 };
43 
44 #endif
ghidra_arch.hh
Ghidra specific architecture information and connection to a Ghidra client.
ConstantPoolGhidra::empty
virtual bool empty(void) const
Is the container empty of records.
Definition: cpool_ghidra.hh:38
ConstantPoolGhidra
An implementation of ConstantPool using a Ghidra client as the backing storage.
Definition: cpool_ghidra.hh:31
CPoolRecord
A description of a byte-code object referenced by a constant.
Definition: cpool.hh:44
ConstantPoolGhidra::saveXml
virtual void saveXml(ostream &s) const
Save all records in this container to an XML stream.
Definition: cpool_ghidra.cc:56
ConstantPool
An interface to the pool of constant objects for byte-code languages.
Definition: cpool.hh:92
Element
An XML element. A node in the DOM tree.
Definition: xml.hh:150
ConstantPoolGhidra::restoreXml
virtual void restoreXml(const Element *el, TypeFactory &typegrp)
Restore constant pool records from an XML stream.
Definition: cpool_ghidra.cc:62
ConstantPoolInternal::clear
virtual void clear(void)
Release any (local) resources.
Definition: cpool.hh:193
ConstantPoolGhidra::clear
virtual void clear(void)
Release any (local) resources.
Definition: cpool_ghidra.hh:39
TypeFactory
Container class for all Datatype objects in an Architecture.
Definition: type.hh:396
ConstantPoolGhidra::ConstantPoolGhidra
ConstantPoolGhidra(ArchitectureGhidra *g)
Constructor.
Definition: cpool_ghidra.cc:18
ConstantPoolGhidra::getRecord
virtual const CPoolRecord * getRecord(const vector< uintb > &refs) const
Retrieve a constant pool record (CPoolRecord) given a reference to it.
Definition: cpool_ghidra.cc:30
ArchitectureGhidra
An implementation of the Architecture interface and connection to a Ghidra client.
Definition: ghidra_arch.hh:60
ConstantPoolInternal
An implementation of the ConstantPool interface storing records internally in RAM.
Definition: cpool.hh:153