Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
19 #ifndef __CPUI_TYPEVAR__
20 #define __CPUI_TYPEVAR__
59 vector<Varnode *> inst;
61 mutable uint4 highflags;
64 mutable Varnode *nameRepresentative;
65 mutable Cover wholecover;
67 mutable int4 symboloffset;
68 int4 instanceIndex(
const Varnode *vn)
const;
69 void updateFlags(
void)
const;
70 void updateCover(
void)
const;
71 void updateType(
void)
const;
72 void updateSymbol(
void)
const;
73 void setCopyIn1(
void)
const { highflags |=
copy_in1; }
74 void setCopyIn2(
void)
const { highflags |=
copy_in2; }
76 bool hasCopyIn1(
void)
const {
return ((highflags&
copy_in1)!=0); }
77 bool hasCopyIn2(
void)
const {
return ((highflags&
copy_in2)!=0); }
80 void setSymbol(
Varnode *vn)
const;
81 void setSymbolReference(
Symbol *sym,int4 off);
83 void coverDirty(
void)
const { highflags |=
coverdirty; }
84 void typeDirty(
void)
const { highflags |=
typedirty; }
85 void setUnmerged(
void)
const { highflags |=
unmerged; }
88 Datatype *getType(
void)
const { updateType();
return type; }
89 Symbol *getSymbol(
void)
const { updateSymbol();
return symbol; }
91 int4 getSymbolOffset(
void)
const {
return symboloffset; }
92 int4 numInstances(
void)
const {
return inst.size(); }
93 Varnode *getInstance(int4 i)
const {
return inst[i]; }
107 int4 getNumMergeClasses(
void)
const {
return numMergeClasses; }
108 bool isMapped(
void)
const { updateFlags();
return ((flags&
Varnode::mapped)!=0); }
109 bool isPersist(
void)
const { updateFlags();
return ((flags&
Varnode::persist)!=0); }
110 bool isAddrTied(
void)
const { updateFlags();
return ((flags&
Varnode::addrtied)!=0); }
111 bool isInput(
void)
const { updateFlags();
return ((flags&
Varnode::input)!=0); }
112 bool isImplied(
void)
const { updateFlags();
return ((flags&
Varnode::implied)!=0); }
113 bool isSpacebase(
void)
const { updateFlags();
return ((flags&
Varnode::spacebase)!=0); }
114 bool isConstant(
void)
const { updateFlags();
return ((flags&
Varnode::constant)!=0); }
118 void clearMark(
void)
const { flags &= ~
Varnode::mark; }
119 bool isMark(
void)
const {
return ((flags&
Varnode::mark)!=0); }
120 bool isUnmerged(
void)
const {
return ((highflags&
unmerged)!=0); }
130 bool isUnattached(
void)
const {
return inst.empty(); }
131 bool isTypeLock(
void)
const { updateType();
return ((flags &
Varnode::typelock)!=0); }
132 bool isNameLock(
void)
const { updateFlags();
return ((flags &
Varnode::namelock)!=0); }
133 void saveXml(ostream &s)
const;
134 #ifdef MERGEMULTI_DEBUG
135 void verifyCover(
void)
const;
void printCover(ostream &s) const
Print details of the cover for this (for debug purposes)
Definition: variable.hh:99
@ namelock
The Name of the Varnode is locked.
Definition: varnode.hh:83
static bool compareJustLoc(const Varnode *a, const Varnode *b)
Compare based on storage location.
Definition: variable.cc:184
@ persist
Persists after (and before) function.
Definition: varnode.hh:89
@ coverdirty
The cover for the HighVariable is dirty.
Definition: variable.hh:49
@ insert
Definition: varnode.hh:76
void printInfo(ostream &s) const
Print information about this HighVariable to stream.
Definition: variable.cc:410
@ mark
Prevents infinite loops.
Definition: varnode.hh:71
@ copy_in1
There exists at least 1 COPY into this HighVariable from other HighVariables.
Definition: variable.hh:51
SymbolEntry * getSymbolEntry(void) const
Definition: variable.cc:278
@ implied
This varnode is a temporary variable.
Definition: varnode.hh:79
Class for merging low-level Varnodes into high-level HighVariables.
Definition: merge.hh:80
void saveXml(ostream &s) const
Save the variable to stream as an XML <high> tag.
Definition: variable.cc:452
@ copy_in2
There exists at least 2 COPYs into this HighVariable from other HighVariables.
Definition: variable.hh:52
@ typelock
The Dataype of the Varnode is locked.
Definition: varnode.hh:82
@ unaffected
Input which is unaffected by the function.
Definition: varnode.hh:91
A storage location for a particular Symbol.
Definition: database.hh:51
void print(ostream &s) const
Dump a description of this cover to stream.
Definition: cover.cc:554
@ spacebase
This is a base register for an address space.
Definition: varnode.hh:92
bool hasCover(void) const
Determine if this HighVariable has an associated cover.
Definition: variable.hh:126
@ flagsdirty
Boolean properties for the HighVariable are dirty.
Definition: variable.hh:46
bool hasName(void) const
Check if this HighVariable can be named.
Definition: variable.cc:350
@ unmerged
Set if part of a multi-entry Symbol but did not get merged with other SymbolEntrys.
Definition: variable.hh:54
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
@ mapped
Varnode has a database entry associated with it.
Definition: varnode.hh:97
@ namerepdirty
The name representative for the HighVariable is dirty.
Definition: variable.hh:47
@ annotation
This varnode is an annotation and has no dataflow.
Definition: varnode.hh:73
A description of the topological scope of a single variable object.
Definition: cover.hh:68
The base datatype class for the decompiler.
Definition: type.hh:62
@ input
This varnode has no ancestor.
Definition: varnode.hh:74
Varnode * getTiedVarnode(void) const
Find the first address tied member Varnode.
Definition: variable.cc:384
@ type_finalized
Set if a final data-type is locked in and dirtying is disabled.
Definition: variable.hh:53
Varnode * getInputVarnode(void) const
Find (the) input member Varnode.
Definition: variable.cc:399
@ constant
The varnode is constant.
Definition: varnode.hh:72
@ typedirty
The data-type for the HighVariable is dirty.
Definition: variable.hh:48
A high-level variable modeled as a list of low-level variables, each written once.
Definition: variable.hh:38
void finalizeDatatype(Datatype *tp)
Set a final datatype for this variable.
Definition: variable.cc:292
HighVariable(Varnode *vn)
Construct a HighVariable with a single member Varnode.
Definition: variable.cc:22
@ symboldirty
The symbol attachment is dirty.
Definition: variable.hh:50
static bool compareName(Varnode *vn1, Varnode *vn2)
Determine which given Varnode is most nameable.
Definition: variable.cc:201
Varnode * getTypeRepresentative(void) const
Get a member Varnode with the strongest data-type.
Definition: variable.cc:122
static int4 markExpression(Varnode *vn, vector< HighVariable * > &highList)
Mark and collect variables in expression.
Definition: variable.cc:504
The base class for a symbol in a symbol table or scope.
Definition: database.hh:152
The Varnode and VarnodeBank classes.
@ indirect_creation
The value in this Varnode is created indirectly.
Definition: varnode.hh:98
@ addrtied
High-level variable is tied to address.
Definition: varnode.hh:90
Varnode * getNameRepresentative(void) const
Get a member Varnode that dictates the naming of this HighVariable.
Definition: variable.cc:235