name to address space map

shortcut to address space map
more adjustments to shortcuts
allow null AddrSpace pointer in raw baselist
holes in the space indices
almost working
GT-2873 decompiler, other, and overlays
GT-2873 added OTHER space to java sleigh compiler, fixed decompiler
exception
isOtherSpace method
isOtherSpace java, addressing code review comments
GT-2873 added null check in decompiler reset
GT-2873 code review changes
Read and write space_other tag in SLA files
Version number for .sla file
GT-2873 fixups after merge
GT-2873 renamed Sparc registers: OTHER->OTHERWIN, WINWSTATE->WSTATE
GT-2873 added option in AddressInput to control OTHER space visibility
GT-2873 OTHER space now global
GT-2873 fixing comments refering to decompiler code in BasicCompilerSpec
This commit is contained in:
caheckman 2019-05-24 17:47:04 -04:00 committed by James
parent cf47a2ee57
commit 612c0d6f3e
40 changed files with 545 additions and 213 deletions

View file

@ -82,7 +82,12 @@ public:
overlay = 32, ///< This space is an overlay of another space
overlaybase = 64, ///< This is the base space for overlay space(s)
truncated = 128, ///< Space is truncated from its original size, expect pointers larger than this size
hasphysical = 256 ///< Has physical memory associated with it
hasphysical = 256, ///< Has physical memory associated with it
is_otherspace = 512 ///< Quick check for the OtherSpace derived class
};
enum {
constant_space_index = 0, ///< Reserved index for the constant space
other_space_index = 1 ///< Reserved index for the other space
};
private:
spacetype type; ///< Type of space (PROCESSOR, CONSTANT, INTERNAL, ...)
@ -100,7 +105,6 @@ protected:
int4 delay; ///< Delay in heritaging this space
int4 deadcodedelay; ///< Delay before deadcode removal is allowed on this space
void calcScaleMask(void); ///< Calculate scale and mask
void assignShortcut(void); ///< Assign a shortcut character to the space
void setFlags(uint4 fl); ///< Set a cached attribute
void clearFlags(uint4 fl); ///< Clear a cached attribute
void saveBasicAttributes(ostream &s) const; ///< Write the XML attributes of this space
@ -128,6 +132,7 @@ public:
bool isReverseJustified(void) const; ///< Return \b true if alignment justification does not match endianness
bool isOverlay(void) const; ///< Return \b true if this is an overlay space
bool isOverlayBase(void) const; ///< Return \b true if other spaces overlay this space
bool isOtherSpace(void) const; ///< Return \b true if \b this is the \e other address space
bool isTruncated(void) const; ///< Return \b true if this space is truncated from its original size
void printOffset(ostream &s,uintb offset) const; ///< Write an address offset to a stream
@ -170,6 +175,15 @@ public:
virtual void restoreXml(const Element *el);
};
/// \brief Special AddrSpace for special/user-defined address spaces
class OtherSpace : public AddrSpace {
public:
OtherSpace(AddrSpaceManager *m, const Translate *t, const string &nm, int4 ind); ///< Constructor
OtherSpace(AddrSpaceManager *m, const Translate *t); ///< For use with restoreXml
virtual void printRaw(ostream &s, uintb offset) const;
virtual void saveXml(ostream &s) const;
};
/// \brief The pool of temporary storage registers
///
/// It is convenient both for modelling processor instructions
@ -181,7 +195,7 @@ public:
/// \b unique.
class UniqueSpace : public AddrSpace {
public:
UniqueSpace(AddrSpaceManager *m,const Translate *t,const string &nm,int4 ind,uint4 fl);
UniqueSpace(AddrSpaceManager *m,const Translate *t,const string &nm,int4 ind,uint4 fl); ///< Constructor
UniqueSpace(AddrSpaceManager *m,const Translate *t); ///< For use with restoreXml
virtual void saveXml(ostream &s) const;
};
@ -392,6 +406,10 @@ inline bool AddrSpace::isOverlayBase(void) const {
return ((flags&overlaybase)!=0);
}
inline bool AddrSpace::isOtherSpace(void) const {
return ((flags&is_otherspace)!=0);
}
/// If this method returns \b true, the logical form of this space is truncated from its actual size
/// Pointers may refer to this original size put the most significant bytes are ignored
inline bool AddrSpace::isTruncated(void) const {