Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
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;
int4 getPageSize(void) const
Get the number of bytes in a page for this memory bank.
Definition: memstate.hh:74
void setValue(AddrSpace *spc, uintb off, int4 size, uintb cval)
Set a value on the memory state.
Definition: memstate.cc:650
virtual void getPage(uintb addr, uint1 *res, int4 skip, int4 size) const
Retrieve data from a memory page.
Definition: memstate.cc:91
A region where processor data is stored.
Definition: space.hh:73
AddrSpace * space
The address space.
Definition: pcoderaw.hh:34
Memory storage/state for a single AddressSpace.
Definition: memstate.hh:36
The lowest level error generated by the decompiler.
Definition: error.hh:44
MemoryBank * getMemoryBank(AddrSpace *spc) const
Get a memory bank associated with a particular space.
Definition: memstate.cc:634
Classes and API for accessing a binary load image.
virtual void setPage(uintb addr, const uint1 *val, int4 skip, int4 size)
Overridden setPage.
Definition: memstate.cc:500
void getChunk(uint1 *res, AddrSpace *spc, uintb off, int4 size) const
Get a chunk of data from memory state.
Definition: memstate.cc:710
MemoryState(Translate *t)
A constructor for MemoryState.
Definition: memstate.hh:171
void setChunk(const uint1 *val, AddrSpace *spc, uintb off, int4 size)
Set a chunk of data from memory state.
Definition: memstate.cc:727
virtual void setPage(uintb addr, const uint1 *val, int4 skip, int4 size)
Write data into a memory page.
Definition: memstate.cc:134
Translate * trans
Architecture information about memory spaces.
Definition: memstate.hh:150
An interface into a particular binary executable image.
Definition: loadimage.hh:71
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
Translate * getTranslate(void) const
Get the Translate object.
Definition: memstate.hh:179
uintb offset
The offset within the space.
Definition: pcoderaw.hh:35
uint4 size
The number of bytes in the location.
Definition: pcoderaw.hh:36
AddrSpace * getSpace(void) const
Get the address space associated with this memory bank.
Definition: memstate.hh:82
All storage/state for a pcode machine.
Definition: memstate.hh:148
void setValue(uintb offset, int4 size, uintb val)
Set the value of a (small) range of bytes.
Definition: memstate.cc:180
virtual uintb find(uintb addr) const
Overridden aligned word find.
Definition: memstate.cc:573
A kind of MemoryBank which retrieves its data from an underlying LoadImage.
Definition: memstate.hh:93
int4 getWordSize(void) const
Get the number of bytes in a word for this memory bank.
Definition: memstate.hh:65
MemoryBank(AddrSpace *spc, int4 ws, int4 ps)
Generic constructor for a memory bank.
Definition: memstate.cc:73
vector< MemoryBank * > memspace
Memory banks associated with each address space.
Definition: memstate.hh:151
virtual uintb find(uintb addr) const =0
Retrieve a word from memory bank at an aligned location.
virtual void insert(uintb addr, uintb val)
Overridden aligned word insert.
Definition: memstate.cc:549
virtual void insert(uintb addr, uintb val)
Overridden aligned word insert.
Definition: memstate.cc:417
The interface to a translation engine for a processor.
Definition: translate.hh:294
static uintb constructValue(const uint1 *ptr, int4 size, bool bigendian)
Decode bytes to value.
Definition: memstate.cc:25
A memory bank that implements reads and writes using a hash table.
Definition: memstate.hh:128
virtual uintb find(uintb addr) const
Overridden aligned word find.
Definition: memstate.cc:448
uintb getValue(uintb offset, int4 size) const
Retrieve the value encoded in a (small) range of bytes.
Definition: memstate.cc:250
virtual void getPage(uintb addr, uint1 *res, int4 skip, int4 size) const
Overridden getPage.
Definition: memstate.cc:474
Memory bank that overlays some other memory bank, using a "copy on write" behavior.
Definition: memstate.hh:110
uintb getValue(AddrSpace *spc, uintb off, int4 size) const
Retrieve a memory value from the memory state.
Definition: memstate.cc:666
virtual void getPage(uintb addr, uint1 *res, int4 skip, int4 size) const
Overridded getPage method.
Definition: memstate.cc:384
void setMemoryBank(MemoryBank *bank)
Map a memory bank into the state.
Definition: memstate.cc:618
MemoryImage(AddrSpace *spc, int4 ws, int4 ps, LoadImage *ld)
Constructor for a loadimage memorybank.
Definition: memstate.cc:405
Data defining a specific memory location.
Definition: pcoderaw.hh:33
Raw descriptions of varnodes and p-code ops.
void getChunk(uintb offset, int4 size, uint1 *res) const
Retrieve an arbitrary sequence of bytes.
Definition: memstate.cc:333
virtual uintb find(uintb addr) const
Overridden find method.
Definition: memstate.cc:363
static void deconstructValue(uint1 *ptr, uintb val, int4 size, bool bigendian)
Encode value to bytes.
Definition: memstate.cc:51