19 #ifndef __CPUI_SPACE__ 20 #define __CPUI_SPACE__ 100 uintb pointerLowerBound;
119 const string &
getName(
void)
const;
153 virtual void printRaw(ostream &s,uintb offset)
const;
154 virtual uintb
read(
const string &s,int4 &size)
const;
155 virtual void saveXml(ostream &s)
const;
180 virtual void printRaw(ostream &s,uintb offset)
const;
181 virtual void saveXml(ostream &s)
const;
190 virtual void printRaw(ostream &s, uintb offset)
const;
191 virtual void saveXml(ostream &s)
const;
207 virtual void saveXml(ostream &s)
const;
224 virtual void printRaw(ostream &s,uintb offset)
const;
225 virtual uintb
read(
const string &s,int4 &size)
const;
226 virtual void saveXml(ostream &s)
const;
243 virtual void saveXml(ostream &s)
const;
347 return pointerLowerBound;
364 intb mod = (intb)(highest+1);
365 intb res = (intb)off % mod;
456 throw LowlevelError(
name+
" space is not virtual and has no associated base register");
Space is truncated from its original size, expect pointers larger than this size. ...
Definition: space.hh:84
void setFlags(uint4 fl)
Set a cached attribute.
Definition: space.hh:249
A region where processor data is stored.
Definition: space.hh:73
virtual void saveXml(ostream &s) const
Write the details of this space as XML.
Definition: space.cc:285
const Translate * getTrans(void) const
Get the processor translator.
Definition: space.hh:277
static uintb addressToByte(uintb val, uint4 ws)
Scale from addressable units to byte units.
Definition: space.hh:487
bool isHeritaged(void) const
Return true if dataflow has been traced.
Definition: space.hh:385
virtual uintb read(const string &s, int4 &size) const
Read in an address (and possible size) from a string.
Definition: space.cc:237
Reserved index for the other space.
Definition: space.hh:91
A manager for different address spaces.
Definition: translate.hh:218
Justification within aligned word is opposite of endianness.
Definition: space.hh:81
static int4 addressToByteInt(int4 val, uint4 ws)
Scale int4 from addressable units to byte units.
Definition: space.hh:505
The pool of logically joined variables.
Definition: space.hh:218
uint4 addressSize
Size of an address into this space in bytes.
Definition: space.hh:104
bool isOverlay(void) const
Return true if this is an overlay space.
Definition: space.hh:421
Has physical memory associated with it.
Definition: space.hh:85
spacetype
Fundemental address space types.
Definition: space.hh:28
Does there exist near pointers into this space.
Definition: space.hh:87
const string & getName(void) const
Get the name.
Definition: space.hh:262
virtual bool stackGrowsNegative(void) const
Return true if a stack in this space grows negative.
Definition: space.hh:470
Special space to represent constants.
Definition: space.hh:29
This is the base space for overlay space(s)
Definition: space.hh:83
static uintb byteToAddress(uintb val, uint4 ws)
Scale from byte units to addressable units.
Definition: space.hh:496
bool hasPhysical(void) const
Return true if data is physically stored in this.
Definition: space.hh:401
Quick check for the OtherSpace derived class.
Definition: space.hh:86
static int4 byteToAddressInt(int4 val, uint4 ws)
Scale int4 from byte units to addressable units.
Definition: space.hh:514
AddrSpace(AddrSpaceManager *m, const Translate *t, spacetype tp, const string &nm, uint4 size, uint4 ws, int4 ind, uint4 fl, int4 dl)
Definition: space.cc:39
addresses = offsets off of base register
Definition: space.hh:31
void clearFlags(uint4 fl)
Clear a cached attribute.
Definition: space.hh:255
Dead-code analysis is done on this space.
Definition: space.hh:79
virtual void printRaw(ostream &s, uintb offset) const
Write an address in this space to a stream.
Definition: space.cc:188
bool isTruncated(void) const
Return true if this space is truncated from its original size.
Definition: space.hh:435
This space is an overlay of another space.
Definition: space.hh:82
virtual int4 numSpacebase(void) const
Number of base registers associated with this space.
Definition: space.hh:447
int4 delay
Delay in heritaging this space.
Definition: space.hh:108
virtual const VarnodeData & getSpacebase(int4 i) const
Get a base register that creates this virtual space.
Definition: space.hh:455
Lightweight (and incomplete) XML parser for marshaling data to and from the decompiler.
spacetype getType(void) const
Get the type of space.
Definition: space.hh:289
Special internal PcodeOp reference.
Definition: space.hh:34
bool isOtherSpace(void) const
Return true if this is the other address space.
Definition: space.hh:429
bool hasNearPointers(void) const
Return true if near (truncated) pointers into this space are possible.
Definition: space.hh:439
Special internal FuncCallSpecs reference.
Definition: space.hh:33
Normal spaces modelled by processor.
Definition: space.hh:30
bool doesDeadcode(void) const
Return true if dead code analysis should be done on this space.
Definition: space.hh:393
Special AddrSpace for representing constants during analysis.
Definition: space.hh:177
uint4 wordsize
Size of unit being addressed (1=byte)
Definition: space.hh:105
The interface to a translation engine for a processor.
Definition: translate.hh:293
string name
Name of this space.
Definition: space.hh:103
An overlay space.
Definition: space.hh:238
uintb wrapOffset(uintb off) const
Wrap -off- to the offset that fits into this space.
Definition: space.hh:361
bool isReverseJustified(void) const
Return true if alignment justification does not match endianness.
Definition: space.hh:417
virtual ~AddrSpace(void)
The address space destructor.
Definition: space.hh:118
void truncateSpace(uint4 newsize)
Definition: space.cc:104
Special AddrSpace for special/user-defined address spaces.
Definition: space.hh:186
void calcScaleMask(void)
Calculate scale and mask.
Definition: space.cc:21
The lowest level error generated by the decompiler.
Definition: error.hh:44
Space is big endian if set, little endian otherwise.
Definition: space.hh:77
int4 getDelay(void) const
Get number of heritage passes being delayed.
Definition: space.hh:300
An XML element. A node in the DOM tree.
Definition: xml.hh:150
Space is specific to a particular loadimage.
Definition: space.hh:80
void printOffset(ostream &s, uintb offset) const
Write an address offset to a stream.
Definition: space.cc:176
Base class for error handling facilities.
uint4 getAddrSize(void) const
Get the size of the space.
Definition: space.hh:333
virtual AddrSpace * getContain(void) const
Return this space's containing space (if any)
Definition: space.hh:478
Internally managed temporary space.
Definition: space.hh:32
bool isOverlayBase(void) const
Return true if other spaces overlay this space.
Definition: space.hh:425
uintb getPointerLowerBound(void) const
Get lower bound for assuming an offset is a pointer.
Definition: space.hh:346
int4 getMinimumPtrSize(void) const
Get the minimum pointer size for this space.
Definition: space.hh:352
int4 index
An integer identifier for the space.
Definition: space.hh:107
int4 getDeadcodeDelay(void) const
Get number of passes before deadcode removal is allowed.
Definition: space.hh:310
virtual uintb restoreXmlAttributes(const Element *el, uint4 &size) const
Recover an offset and size.
Definition: space.cc:148
uintb getHighest(void) const
Get the highest byte-scaled address.
Definition: space.hh:339
The pool of temporary storage registers.
Definition: space.hh:203
uint4 getWordSize(void) const
Get the addressable unit size.
Definition: space.hh:325
virtual void saveXmlAttributes(ostream &s, uintb offset) const
Save an address as XML.
Definition: space.cc:118
virtual const VarnodeData & getSpacebaseFull(int4 i) const
Return original spacebase register before truncation.
Definition: space.hh:463
Reserved index for the constant space.
Definition: space.hh:90
virtual void restoreXml(const Element *el)
Recover the details of this space from XML.
Definition: space.cc:297
char getShortcut(void) const
Get the shortcut character.
Definition: space.hh:375
int4 getIndex(void) const
Get the integer identifier.
Definition: space.hh:317
bool isBigEndian(void) const
Return true if values in this space are big endian.
Definition: space.hh:408
AddrSpaceManager * getManager(void) const
Get the space manager.
Definition: space.hh:269
static bool compareByIndex(const AddrSpace *a, const AddrSpace *b)
Compare two spaces by their index.
Definition: space.hh:522
void saveBasicAttributes(ostream &s) const
Write the XML attributes of this space.
Definition: space.cc:87
int4 deadcodedelay
Delay before deadcode removal is allowed on this space.
Definition: space.hh:109
Special virtual space to represent split variables.
Definition: space.hh:35
This space is heritaged.
Definition: space.hh:78
int4 minimumPointerSize
Smallest size of a pointer into this space (in bytes)
Definition: space.hh:106
Data defining a specific memory location.
Definition: pcoderaw.hh:33