Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
60 vector<PcodeData> issued;
61 list<RelativeRecord> label_refs;
74 if (newptr <= endpool) {
79 return expandPool(size);
86 issued.emplace_back();
113 void initialize(int4 min,int4 hashsize);
129 virtual void dump(
OpTpl *op );
139 void setUniqueOffset(
const Address &addr);
142 virtual void appendBuild(
OpTpl *bld,int4 secnum);
143 virtual void delaySlot(
OpTpl *op);
144 virtual void setLabel(
OpTpl *op);
145 virtual void appendCrossBuild(
OpTpl *bld,int4 secnum);
164 void clearForDelete(
void);
Abstract class for emitting pcode to an application.
Definition: translate.hh:76
PcodeCacher(void)
Constructor.
Definition: sleigh.cc:19
Definition: slghsymbol.hh:466
A region where processor data is stored.
Definition: space.hh:73
SleighBuilder(ParserWalker *w, DisassemblyCache *dcache, PcodeCacher *pc, AddrSpace *cspc, AddrSpace *uspc, uint4 umask)
Constructor.
Definition: sleigh.cc:294
void resolveHandles(ParserContext &pos) const
Prepare the parse tree for p-code generation.
Definition: sleigh.cc:620
VarnodeData * dataptr
Varnode indicating relative offset.
Definition: sleigh.hh:35
VarnodeData * invar
Array of input Varnode data.
Definition: sleigh.hh:45
Abstract class for emitting disassembly to an application.
Definition: translate.hh:118
OpCode opc
The op code.
Definition: sleigh.hh:43
Definition: semantics.hh:77
int4 isize
Number of input Varnodes.
Definition: sleigh.hh:46
ParserContext * obtainContext(const Address &addr, int4 state) const
Obtain a parse tree for the instruction at the given address.
Definition: sleigh.cc:546
Definition: context.hh:68
Build p-code from a pre-parsed instruction.
Definition: sleigh.hh:128
Sleigh(LoadImage *ld, ContextDatabase *c_db)
Constructor.
Definition: sleigh.cc:476
void reset(LoadImage *ld, ContextDatabase *c_db)
Reset the engine for a new program.
Definition: sleigh.cc:504
Definition: semantics.hh:137
An interface into a particular binary executable image.
Definition: loadimage.hh:71
virtual int4 oneInstruction(PcodeEmit &emit, const Address &baseaddr) const
Transform a single machine instruction into pcode.
Definition: sleigh.cc:697
~PcodeCacher(void)
Destructor.
Definition: sleigh.cc:29
A full SLEIGH engine.
Definition: sleigh.hh:158
VarnodeData * allocateVarnodes(uint4 size)
Allocate data objects for a new set of Varnodes.
Definition: sleigh.hh:72
void resolveRelatives(void)
Rewrite branch target Varnodes as relative offsets.
Definition: sleigh.cc:118
Base class for applications that process SLEIGH format specifications.
void emit(const Address &addr, PcodeEmit *emt) const
Pass the cached p-code data to the emitter.
Definition: sleigh.cc:137
A helper class for caching the active context blob to minimize database lookups.
Definition: globalcontext.hh:309
virtual void allowContextSet(bool val) const
Toggle whether disassembly is allowed to affect context.
Definition: sleigh.cc:763
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
Class for caching a chunk of p-code, prior to emitting.
Definition: sleigh.hh:56
virtual ~Sleigh(void)
Destructor.
Definition: sleigh.cc:494
void addLabel(uint4 id)
Attach a label to the next p-code instruction.
Definition: sleigh.cc:98
virtual void setContextDefault(const string &nm, uintm val)
Set the default value for a particular context variable.
Definition: sleigh.cc:757
An interface to a database of disassembly/decompiler context information.
Definition: globalcontext.hh:108
virtual int4 instructionLength(const Address &baseaddr) const
Get the length of a machine instruction.
Definition: sleigh.cc:671
DisassemblyCache(ContextCache *ccache, AddrSpace *cspace, int4 cachesize, int4 windowsize)
Constructor.
Definition: sleigh.cc:441
void resolve(ParserContext &pos) const
Generate a parse tree suitable for disassembly.
Definition: sleigh.cc:565
OpCode
The op-code defining a specific p-code operation (PcodeOp)
Definition: opcodes.hh:35
PcodeData * allocateInstruction(void)
Allocate a data object for a new p-code operation.
Definition: sleigh.hh:85
ParserContext * getParserContext(const Address &addr)
Get the parser for a particular Address.
Definition: sleigh.cc:457
virtual void initialize(DocumentStorage &store)
Definition: sleigh.cc:517
A container for disassembly context used by the SLEIGH engine.
Definition: sleigh.hh:105
Common core of classes that read or write SLEIGH specification files natively.
Definition: sleighbase.hh:57
virtual void registerContext(const string &name, int4 sbit, int4 ebit)
Add a new context variable to the model for this processor.
Definition: sleigh.cc:751
virtual int4 printAssembly(AssemblyEmit &emit, const Address &baseaddr) const
Disassemble a single machine instruction.
Definition: sleigh.cc:678
Data defining a specific memory location.
Definition: pcoderaw.hh:33
A container for parsed XML documents.
Definition: xml.hh:249
void clear(void)
Reset the cache so that all objects are unallocated.
Definition: sleigh.cc:106
VarnodeData * outvar
Output Varnode data (or null)
Definition: sleigh.hh:44
Definition: semantics.hh:192
Definition: context.hh:124
Data for building one p-code instruction.
Definition: sleigh.hh:42
Class for describing a relative p-code branch destination.
Definition: sleigh.hh:34
uintb calling_index
Index of instruction containing relative offset.
Definition: sleigh.hh:36
void addLabelRef(VarnodeData *ptr)
Denote a Varnode holding a relative branch offset.
Definition: sleigh.cc:84