19 #ifndef __CPUI_MEMSTATE__ 20 #define __CPUI_MEMSTATE__ 43 virtual void insert(uintb addr,uintb val)=0;
44 virtual uintb
find(uintb addr)
const=0;
45 virtual void getPage(uintb addr,uint1 *res,int4 skip,int4 size)
const;
46 virtual void setPage(uintb addr,
const uint1 *val,int4 skip,int4 size);
54 void setValue(uintb offset,int4 size,uintb val);
55 uintb
getValue(uintb offset,int4 size)
const;
56 void setChunk(uintb offset,int4 size,
const uint1 *val);
57 void getChunk(uintb offset,int4 size,uint1 *res)
const;
58 static uintb
constructValue(
const uint1 *ptr,int4 size,
bool bigendian);
96 virtual void insert(uintb addr,uintb val) {
98 virtual uintb
find(uintb addr)
const;
99 virtual void getPage(uintb addr,uint1 *res,int4 skip,int4 size)
const;
112 map<uintb,uint1 *> page;
114 virtual void insert(uintb addr,uintb val);
115 virtual uintb
find(uintb addr)
const;
116 virtual void getPage(uintb addr,uint1 *res,int4 skip,int4 size)
const;
117 virtual void setPage(uintb addr,
const uint1 *val,int4 skip,int4 size);
132 vector<uintb> address;
135 virtual void insert(uintb addr,uintb val);
136 virtual uintb
find(uintb addr)
const;
160 void setValue(
const string &nm,uintb cval);
161 uintb
getValue(
const string &nm)
const;
A region where processor data is stored.
Definition: space.hh:73
virtual void setPage(uintb addr, const uint1 *val, int4 skip, int4 size)
Write data into a memory page.
Definition: memstate.cc:134
MemoryBank(AddrSpace *spc, int4 ws, int4 ps)
Generic constructor for a memory bank.
Definition: memstate.cc:73
MemoryState(Translate *t)
A constructor for MemoryState.
Definition: memstate.hh:171
An interface into a particular binary executable image.
Definition: loadimage.hh:71
Raw descriptions of varnodes and p-code ops.
Translate * getTranslate(void) const
Get the Translate object.
Definition: memstate.hh:179
Translate * trans
Architecture information about memory spaces.
Definition: memstate.hh:150
Memory storage/state for a single AddressSpace.
Definition: memstate.hh:36
void setValue(uintb offset, int4 size, uintb val)
Set the value of a (small) range of bytes.
Definition: memstate.cc:180
void setValue(AddrSpace *spc, uintb off, int4 size, uintb cval)
Set a value on the memory state.
Definition: memstate.cc:650
vector< MemoryBank * > memspace
Memory banks associated with each address space.
Definition: memstate.hh:151
AddrSpace * space
The address space.
Definition: pcoderaw.hh:34
virtual void getPage(uintb addr, uint1 *res, int4 skip, int4 size) const
Retrieve data from a memory page.
Definition: memstate.cc:91
A kind of MemoryBank which retrieves its data from an underlying LoadImage.
Definition: memstate.hh:93
virtual void insert(uintb addr, uintb val)=0
Insert a word in memory bank at an aligned location.
void setChunk(uintb offset, int4 size, const uint1 *val)
Set values of an arbitrary sequence of bytes.
Definition: memstate.cc:300
int4 getWordSize(void) const
Get the number of bytes in a word for this memory bank.
Definition: memstate.hh:65
uintb offset
The offset within the space.
Definition: pcoderaw.hh:35
The interface to a translation engine for a processor.
Definition: translate.hh:293
The lowest level error generated by the decompiler.
Definition: error.hh:44
A memory bank that implements reads and writes using a hash table.
Definition: memstate.hh:128
uintb getValue(AddrSpace *spc, uintb off, int4 size) const
Retrieve a memory value from the memory state.
Definition: memstate.cc:666
void getChunk(uintb offset, int4 size, uint1 *res) const
Retrieve an arbitrary sequence of bytes.
Definition: memstate.cc:333
uint4 size
The number of bytes in the location.
Definition: pcoderaw.hh:36
uintb getValue(uintb offset, int4 size) const
Retrieve the value encoded in a (small) range of bytes.
Definition: memstate.cc:250
AddrSpace * getSpace(void) const
Get the address space associated with this memory bank.
Definition: memstate.hh:82
static void deconstructValue(uint1 *ptr, uintb val, int4 size, bool bigendian)
Encode value to bytes.
Definition: memstate.cc:51
All storage/state for a pcode machine.
Definition: memstate.hh:148
virtual void insert(uintb addr, uintb val)
Exception is thrown for write attempts.
Definition: memstate.hh:96
Memory bank that overlays some other memory bank, using a "copy on write" behavior.
Definition: memstate.hh:110
virtual uintb find(uintb addr) const =0
Retrieve a word from memory bank at an aligned location.
static uintb constructValue(const uint1 *ptr, int4 size, bool bigendian)
Decode bytes to value.
Definition: memstate.cc:25
int4 getPageSize(void) const
Get the number of bytes in a page for this memory bank.
Definition: memstate.hh:74
Data defining a specific memory location.
Definition: pcoderaw.hh:33
Classes and API for accessing a binary load image.