16 #ifndef __GLOBALCONTEXT__ 17 #define __GLOBALCONTEXT__ 40 uintm
getMask(
void)
const {
return mask; }
48 uintm newval = vec[word];
49 newval &= ~(mask<<shift);
50 newval |= ((val & mask)<<shift);
59 return ((vec[word]>>shift)&mask);
72 void saveXml(ostream &s)
const;
139 virtual void getRegionForSet(vector<uintm *> &res,
const Address &addr1,
140 const Address &addr2,int4 num,uintm mask)=0;
151 virtual void getRegionToChangePoint(vector<uintm *> &res,
const Address &addr,int4 num,uintm mask)=0;
158 virtual uintm *getDefaultValue(
void)=0;
165 virtual const uintm *getDefaultValue(
void)
const=0;
172 virtual int4 getContextSize(
void)
const=0;
183 virtual void registerVariable(
const string &nm,int4 sbit,int4 ebit)=0;
189 virtual const uintm *getContext(
const Address &addr)
const=0;
199 virtual const uintm *getContext(
const Address &addr,uintb &first,uintb &last)
const=0;
204 virtual TrackedSet &getTrackedDefault(
void)=0;
224 virtual void saveXml(ostream &s)
const=0;
240 void setVariableDefault(
const string &nm,uintm val);
241 uintm getDefaultValue(
const string &nm)
const;
242 void setVariable(
const string &nm,
const Address &addr,uintm value);
243 uintm getVariable(
const string &nm,
const Address &addr)
const;
244 void setContextChangePoint(
const Address &addr,int4 num,uintm mask,uintm value);
245 void setContextRegion(
const Address &addr1,
const Address &addr2,int4 num,uintm mask,uintm value);
246 void setVariableRegion(
const string &nm,
const Address &begad,
247 const Address &endad,uintm value);
267 FreeArray(
void) { size=0; array = (uintm *)0; mask = (uintm *)0; }
268 ~FreeArray(
void) {
if (size!=0) {
delete [] array;
delete [] mask; } }
270 FreeArray &operator=(
const FreeArray &op2);
274 map<string,ContextBitRange> variables;
277 void saveContext(ostream &s,
const Address &addr,
const uintm *vec)
const;
281 virtual void getRegionForSet(vector<uintm *> &res,
const Address &addr1,
282 const Address &addr2,int4 num,uintm mask);
283 virtual void getRegionToChangePoint(vector<uintm *> &res,
const Address &addr,int4 num,uintm mask);
284 virtual uintm *getDefaultValue(
void) {
return database.
defaultValue().array; }
285 virtual const uintm *getDefaultValue(
void)
const {
return database.
defaultValue().array; }
290 virtual void registerVariable(
const string &nm,int4 sbit,int4 ebit);
293 virtual const uintm *getContext(
const Address &addr,uintb &first,uintb &last)
const;
299 virtual void saveXml(ostream &s)
const;
315 mutable const uintm *context;
320 void getContext(
const Address &addr,uintm *buf)
const;
321 void setContext(
const Address &addr,int4 num,uintm mask,uintm value);
322 void setContext(
const Address &addr1,
const Address &addr2,int4 num,uintm mask,uintm value);
vector< TrackedContext > TrackedSet
A set of tracked registers and their values (at one code point)
Definition: globalcontext.hh:74
A region where processor data is stored.
Definition: space.hh:73
const _valuetype & defaultValue(void) const
Get the default value object.
Definition: partmap.hh:61
A manager for different address spaces.
Definition: translate.hh:218
void allowSet(bool val)
Toggle whether setContext() calls are ignored.
Definition: globalcontext.hh:319
Raw descriptions of varnodes and p-code ops.
VarnodeData loc
Storage details of the register being tracked.
Definition: globalcontext.hh:69
uintm getMask(void) const
Return the mask for this value.
Definition: globalcontext.hh:40
uintb val
The value of the register.
Definition: globalcontext.hh:70
ContextBitRange(void)
Constructor for use with restoreXml()
Definition: globalcontext.hh:37
ContextDatabase * getDatabase(void) const
Retrieve the encapsulated database object.
Definition: globalcontext.hh:318
_valuetype & getValue(const _linetype &pnt)
Get the value object at a point.
Definition: partmap.hh:81
An interface to a database of disassembly/decompiler context information.
Definition: globalcontext.hh:108
virtual const TrackedSet & getTrackedSet(const Address &addr) const
Get the set of tracked register values associated with the given address.
Definition: globalcontext.hh:296
virtual const uintm * getContext(const Address &addr) const
Get the context blob of values associated with a given address.
Definition: globalcontext.hh:292
virtual int4 getContextSize(void) const
Retrieve the number of words (uintm) in a context blob.
Definition: globalcontext.hh:289
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
void setValue(uintm *vec, uintm val) const
Set this value within a given context blob.
Definition: globalcontext.hh:47
uintm getValue(const uintm *vec) const
Retrieve this value from a given context blob.
Definition: globalcontext.hh:58
The partmap<> template mapping a linear space to value objects.
A tracked register (Varnode) and the value it contains.
Definition: globalcontext.hh:68
Description of a context variable within the disassembly context blob.
Definition: globalcontext.hh:30
An in-memory implementation of the ContextDatabase interface.
Definition: globalcontext.hh:256
An XML element. A node in the DOM tree.
Definition: xml.hh:150
virtual ~ContextDatabase()
Destructor.
Definition: globalcontext.hh:167
virtual TrackedSet & getTrackedDefault(void)
Get the set of default values for all tracked registers.
Definition: globalcontext.hh:295
A helper class for caching the active context blob to minimize database lookups.
Definition: globalcontext.hh:309
int4 getWord(void) const
Return the word index for this value.
Definition: globalcontext.hh:41
int4 getShift(void) const
Return the shift-amount for this value.
Definition: globalcontext.hh:39
Data defining a specific memory location.
Definition: pcoderaw.hh:33