decompiler
1.0.0
|
A manager for different address spaces. More...
#include <translate.hh>
Public Member Functions | |
AddrSpaceManager (void) | |
Construct an empty address space manager. More... | |
virtual | ~AddrSpaceManager (void) |
Destroy the manager. More... | |
int4 | getDefaultSize (void) const |
Get size of addresses for the default space. More... | |
AddrSpace * | getSpaceByName (const string &nm) const |
Get address space by name. More... | |
AddrSpace * | getSpaceByShortcut (char sc) const |
Get address space from its shortcut. More... | |
AddrSpace * | getIopSpace (void) const |
Get the internal pcode op space. More... | |
AddrSpace * | getFspecSpace (void) const |
Get the internal callspec space. More... | |
AddrSpace * | getJoinSpace (void) const |
Get the joining space. More... | |
AddrSpace * | getStackSpace (void) const |
Get the stack space for this processor. More... | |
AddrSpace * | getUniqueSpace (void) const |
Get the temporary register space for this processor. More... | |
AddrSpace * | getDefaultCodeSpace (void) const |
Get the default address space of this processor. More... | |
AddrSpace * | getDefaultDataSpace (void) const |
Get the default address space where data is stored. More... | |
AddrSpace * | getConstantSpace (void) const |
Get the constant space. More... | |
Address | getConstant (uintb val) const |
Get a constant encoded as an Address. More... | |
Address | createConstFromSpace (AddrSpace *spc) const |
Create a constant address encoding an address space. More... | |
Address | resolveConstant (AddrSpace *spc, uintb val, int4 sz, const Address &point, uintb &fullEncoding) const |
Resolve a native constant into an Address. More... | |
int4 | numSpaces (void) const |
Get the number of address spaces for this processor. More... | |
AddrSpace * | getSpace (int4 i) const |
Get an address space via its index. More... | |
AddrSpace * | getNextSpaceInOrder (AddrSpace *spc) const |
Get the next contiguous address space. More... | |
JoinRecord * | findAddJoin (const vector< VarnodeData > &pieces, uint4 logicalsize) |
Get (or create) JoinRecord for pieces. More... | |
JoinRecord * | findJoin (uintb offset) const |
Find JoinRecord for offset in the join space. More... | |
void | setDeadcodeDelay (AddrSpace *spc, int4 delaydelta) |
Set the deadcodedelay for a specific space. More... | |
void | truncateSpace (const TruncationTag &tag) |
Mark a space as truncated from its original size. More... | |
Address | constructFloatExtensionAddress (const Address &realaddr, int4 realsize, int4 logicalsize) |
Build a logically lower precision storage location for a bigger floating point register. More... | |
Address | constructJoinAddress (const Translate *translate, const Address &hiaddr, int4 hisz, const Address &loaddr, int4 losz) |
Build a logical whole from register pairs. More... | |
void | renormalizeJoinAddress (Address &addr, int4 size) |
Make sure a possibly offset join address has a proper JoinRecord. More... | |
Address | parseAddressSimple (const string &val) |
Parse a string with just an address space name and a hex offset. More... | |
Protected Member Functions | |
AddrSpace * | decodeSpace (Decoder &decoder, const Translate *trans) |
Add a space to the model based an on XML tag. More... | |
void | decodeSpaces (Decoder &decoder, const Translate *trans) |
Restore address spaces in the model from an XML tag. More... | |
void | setDefaultCodeSpace (int4 index) |
Set the default address space (for code) More... | |
void | setDefaultDataSpace (int4 index) |
Set the default address space for data. More... | |
void | setReverseJustified (AddrSpace *spc) |
Set reverse justified property on this space. More... | |
void | assignShortcut (AddrSpace *spc) |
Select a shortcut character for a new space. More... | |
void | markNearPointers (AddrSpace *spc, int4 size) |
Mark that given space can be accessed with near pointers. More... | |
void | insertSpace (AddrSpace *spc) |
Add a new address space to the model. More... | |
void | copySpaces (const AddrSpaceManager *op2) |
Copy spaces from another manager. More... | |
void | addSpacebasePointer (SpacebaseSpace *basespace, const VarnodeData &ptrdata, int4 truncSize, bool stackGrowth) |
Set the base register of a spacebase space. More... | |
void | insertResolver (AddrSpace *spc, AddressResolver *rsolv) |
Override the base resolver for a space. More... | |
void | setInferPtrBounds (const Range &range) |
Set the range of addresses that can be inferred as pointers. More... | |
JoinRecord * | findJoinInternal (uintb offset) const |
Find JoinRecord for offset in the join space. More... | |
Private Attributes | |
vector< AddrSpace * > | baselist |
Every space we know about for this architecture. | |
vector< AddressResolver * > | resolvelist |
Special constant resolvers. | |
map< string, AddrSpace * > | name2Space |
Map from name -> space. | |
map< int4, AddrSpace * > | shortcut2Space |
Map from shortcut -> space. | |
AddrSpace * | constantspace |
Quick reference to constant space. | |
AddrSpace * | defaultcodespace |
Default space where code lives, generally main RAM. | |
AddrSpace * | defaultdataspace |
Default space where data lives. | |
AddrSpace * | iopspace |
Space for internal pcode op pointers. | |
AddrSpace * | fspecspace |
Space for internal callspec pointers. | |
AddrSpace * | joinspace |
Space for unifying split variables. | |
AddrSpace * | stackspace |
Stack space associated with processor. | |
AddrSpace * | uniqspace |
Temporary space associated with processor. | |
uintb | joinallocate |
Next offset to be allocated in join space. | |
set< JoinRecord *, JoinRecordCompare > | splitset |
Different splits that have been defined in join space. | |
vector< JoinRecord * > | splitlist |
JoinRecords indexed by join address. | |
A manager for different address spaces.
Allow creation, lookup by name, lookup by shortcut, lookup by name, and iteration over address spaces
ghidra::AddrSpaceManager::AddrSpaceManager | ( | void | ) |
Construct an empty address space manager.
Initialize manager containing no address spaces. All the cached space slots are set to null.
|
virtual |
Destroy the manager.
Base destructor class, cleans up AddrSpace pointers which must be explicited created via new
References ghidra::AddrSpace::refcount.
|
protected |
Set the base register of a spacebase space.
Perform the privileged act of associating a base register with an existing virtual space
basespace | is the virtual space |
ptrdata | is the location data for the base register |
truncSize | is the size of the space covered by the base register |
stackGrowth | is true if the stack grows "normally" towards address 0 |
References ghidra::SpacebaseSpace::setBaseRegister().
|
protected |
Select a shortcut character for a new space.
Assign a shortcut character to the given address space. This routine makes use of the desired type of the new space and info about shortcuts for spaces that already exist to pick a unique and consistent character. This method also builds up a map from short to AddrSpace object.
spc | is the given AddrSpace |
References ghidra::AddrSpace::getName(), ghidra::AddrSpace::getType(), ghidra::IPTR_CONSTANT, ghidra::IPTR_FSPEC, ghidra::IPTR_INTERNAL, ghidra::IPTR_IOP, ghidra::IPTR_JOIN, ghidra::IPTR_PROCESSOR, ghidra::IPTR_SPACEBASE, and ghidra::AddrSpace::shortcut.
Address ghidra::AddrSpaceManager::constructFloatExtensionAddress | ( | const Address & | realaddr, |
int4 | realsize, | ||
int4 | logicalsize | ||
) |
Build a logically lower precision storage location for a bigger floating point register.
This handles the situation where we need to find a logical address to hold the lower precision floating-point value that is stored in a bigger register If the logicalsize (precision) requested matches the -realsize- of the register just return the real address. Otherwise construct a join address to hold the logical value
realaddr | is the address of the real floating-point register |
realsize | is the size of the real floating-point register |
logicalsize | is the size (lower precision) size of the logical value |
References ghidra::VarnodeData::getAddr(), ghidra::Address::getOffset(), ghidra::Address::getSpace(), and ghidra::JoinRecord::getUnified().
Referenced by ghidra::ParamEntry::getAddrBySlot().
Address ghidra::AddrSpaceManager::constructJoinAddress | ( | const Translate * | translate, |
const Address & | hiaddr, | ||
int4 | hisz, | ||
const Address & | loaddr, | ||
int4 | losz | ||
) |
Build a logical whole from register pairs.
This handles the common case, of trying to find a join address given a high location and a low location. This may not return an address in the join address space. It checks for the case where the two pieces are contiguous locations in a mappable space, in which case it just returns the containing address
translate | is the Translate object used to find registers |
hiaddr | is the address of the most significant piece to be joined |
hisz | is the size of the most significant piece |
loaddr | is the address of the least significant piece |
losz | is the size of the least significant piece |
References ghidra::VarnodeData::getAddr(), ghidra::Address::getOffset(), ghidra::Translate::getRegisterName(), ghidra::Address::getSpace(), ghidra::AddrSpace::getType(), ghidra::JoinRecord::getUnified(), ghidra::IPTR_PROCESSOR, ghidra::IPTR_SPACEBASE, ghidra::Address::isBigEndian(), and ghidra::Address::isContiguous().
Referenced by ghidra::FuncCallSpecs::buildOutputFromTrials(), and ghidra::ActionReturnRecovery::buildReturnOutput().
|
protected |
Copy spaces from another manager.
Different managers may need to share the same spaces. I.e. if different programs being analyzed share the same processor. This routine pulls in a reference of every space in -op2- in order to manage it from within -this-
op2 | is a pointer to space manager being copied |
References baselist, getDefaultCodeSpace(), getDefaultDataSpace(), and ghidra::AddrSpace::getIndex().
Create a constant address encoding an address space.
This routine is used to encode a pointer to an address space as a constant Address, for use in LOAD and STORE operations. This is used internally and is slightly more efficient than storing the formal index of the space param spc is the space pointer to be encoded
Referenced by ghidra::Funcdata::newVarnodeSpace().
|
protected |
Add a space to the model based an on XML tag.
The initialization of address spaces is the same across all variants of the Translate object. This routine initializes a single address space from a decoder element. It knows which class derived from AddrSpace to instantiate based on the ElementId.
decoder | is the stream decoder |
trans | is the translator object to be associated with the new space |
References ghidra::AddrSpace::AddrSpace(), ghidra::AddrSpace::decode(), ghidra::IPTR_PROCESSOR, ghidra::Decoder::peekElement(), and ghidra::SpacebaseSpace::SpacebaseSpace().
|
protected |
Restore address spaces in the model from an XML tag.
This routine initializes (almost) all the address spaces used for a particular processor by using a <spaces> element, which contains child elements for the specific address spaces. This also instantiates the builtin constant space. It should probably also instantiate the iop, fspec, and join spaces, but this is currently done by the Architecture class.
decoder | is the stream decoder |
trans | is the processor translator to be associated with the spaces |
References ghidra::Decoder::closeElement(), ghidra::AddrSpace::getIndex(), ghidra::Decoder::openElement(), ghidra::Decoder::peekElement(), and ghidra::Decoder::readString().
Referenced by ghidra::GhidraTranslate::decode().
JoinRecord * ghidra::AddrSpaceManager::findAddJoin | ( | const vector< VarnodeData > & | pieces, |
uint4 | logicalsize | ||
) |
Get (or create) JoinRecord for pieces.
Given a list of memory locations, the pieces, either find a pre-existing JoinRecord or create a JoinRecord that represents the logical joining of the pieces.
pieces | if the list memory locations to be joined |
logicalsize | of a single piece join, or zero |
References ghidra::VarnodeData::offset, ghidra::JoinRecord::pieces, ghidra::VarnodeData::size, ghidra::VarnodeData::space, and ghidra::JoinRecord::unified.
Referenced by ghidra::JoinSpace::decodeAttributes(), and ghidra::JoinSpace::read().
JoinRecord * ghidra::AddrSpaceManager::findJoin | ( | uintb | offset | ) | const |
Find JoinRecord for offset in the join space.
Given a specific offset into the join address space, recover the JoinRecord that lists the pieces corresponding to that offset. The offset must originally have come from a JoinRecord returned by findAddJoin, otherwise this method throws an exception.
offset | is an offset into the join space |
References ghidra::VarnodeData::offset, and ghidra::JoinRecord::unified.
Referenced by ghidra::RulePullsubMulti::buildSubpiece(), ghidra::JoinSpace::encodeAttributes(), ghidra::JoinSpace::overlapJoin(), ghidra::JoinSpace::printRaw(), and ghidra::ParamEntry::resolveJoin().
|
protected |
Find JoinRecord for offset in the join space.
Given a specific offset into the join address space, recover the JoinRecord that contains the offset, as a range in the join address space. If there is no existing record, null is returned.
offset | is an offset into the join space |
References ghidra::VarnodeData::offset, ghidra::VarnodeData::size, and ghidra::JoinRecord::unified.
|
inline |
Get a constant encoded as an Address.
This routine encodes a specific value as a constant address. I.e. the address space of the resulting Address will be the constant space, and the offset will be the value.
val | is the constant value to encode |
Referenced by ghidra::RuleCollapseConstants::applyOp(), and ghidra::Funcdata::newConstant().
|
inline |
Get the constant space.
Pcode represents constant values within an operation as offsets within a special constant address space. (See ConstantSpace)
Referenced by ghidra::ActionConstantPtr::apply(), ghidra::SleighCompile::createCrossBuild(), ghidra::SleighCompile::createMacroUse(), ghidra::PcodeOpRaw::decode(), ghidra::SleighCompile::finalizeSections(), ghidra::Sleigh::initialize(), ghidra::ActionNameVars::linkSymbols(), ghidra::Sleigh::oneInstruction(), and ghidra::SleighCompile::predefinedSymbols().
|
inline |
Get the default address space of this processor.
Most processors have a main address bus, on which the bulk of the processor's RAM is mapped. This matches SLEIGH's notion of the default space. For Harvard architectures, this is the space where code exists (as opposed to data).
Referenced by ghidra::ActionPrototypeTypes::apply(), ghidra::RulePtrFlow::applyOp(), ghidra::ExecutablePcode::build(), copySpaces(), ghidra::VarnodeData::decodeFromAttributes(), ghidra::Range::decodeFromAttributes(), ghidra::SleighCompile::newSpace(), ghidra::SleighCompile::process(), ghidra::PrintC::pushPtrCodeConstant(), and ghidra::Range::Range().
|
inline |
Get the default address space where data is stored.
Return the default address space for holding data. For most processors, this is just the main RAM space and is the same as the default code space. For Harvard architectures, this is the space where data is stored (as opposed to code).
Referenced by ghidra::ParamListStandard::assignMap(), ghidra::ParamListStandardOut::assignMap(), ghidra::TypePointer::calcTruncate(), copySpaces(), ghidra::Funcdata::prepareThisPointer(), ghidra::TypeOpEqual::propagateAcrossCompare(), ghidra::TypeOpCopy::propagateType(), ghidra::TypeOpIntXor::propagateType(), ghidra::TypeOpIntAnd::propagateType(), ghidra::TypeOpIntOr::propagateType(), ghidra::TypeOpMulti::propagateType(), ghidra::TypeOpIndirect::propagateType(), ghidra::PrintC::pushPtrCharConstant(), and ghidra::RulePtrFlow::RulePtrFlow().
|
inline |
Get size of addresses for the default space.
Return the size of addresses for the processor's official default space. This space is usually the main RAM databus.
Referenced by ghidra::ActionParamDouble::apply(), ghidra::Varnode::printRawNoMarkup(), and ghidra::AddrSpace::read().
|
inline |
Get the internal callspec space.
There is a special address space reserved for encoding pointers to the FuncCallSpecs object as addresses. This allows direct pointers to be hidden within an operation, when manipulating pcode internally. (See FspecSpace)
Referenced by ghidra::Funcdata::newVarnodeCallSpecs().
|
inline |
Get the internal pcode op space.
There is a special address space reserved for encoding pointers to pcode operations as addresses. This allows a direct pointer to be hidden within an operation, when manipulating pcode internally. (See IopSpace)
Referenced by ghidra::TransformVar::createReplacement(), and ghidra::Funcdata::newVarnodeIop().
|
inline |
Get the joining space.
There is a special address space reserved for providing a logical contiguous memory location for variables that are really split between two physical locations. This allows the the decompiler to work with the logical value. (See JoinSpace)
Get the next contiguous address space.
Get the next space in the absolute order of addresses. This ordering is determined by the AddrSpace index.
spc | is the pointer to the space being queried |
References ghidra::AddrSpace::getIndex(), and ghidra::AddrSpace::index.
Referenced by ghidra::VarnodeBank::endLoc(), and ghidra::Range::getLastAddrOpen().
|
inline |
Get an address space via its index.
This retrieves a specific address space via its formal index. All spaces have an index, and in conjunction with the numSpaces method, this method can be used to iterate over all spaces.
i | is the index of the address space |
Referenced by ghidra::ActionDeadCode::apply(), ghidra::Override::applyDeadCodeDelay(), ghidra::ConditionalExecution::buildHeritageArray(), ghidra::Heritage::buildInfoList(), ghidra::Override::encode(), ghidra::Funcdata::encodeTree(), ghidra::IfcPrintSpaces::execute(), ghidra::Override::generateDeadcodeDelayMessage(), ghidra::ActionNameVars::linkSymbols(), ghidra::Override::printRaw(), and ghidra::Funcdata::spacebase().
AddrSpace * ghidra::AddrSpaceManager::getSpaceByName | ( | const string & | nm | ) | const |
Get address space by name.
All address spaces have a unique name associated with them. This routine retrieves the AddrSpace object based on the desired name.
nm | is the name of the address space |
Referenced by ghidra::JoinSpace::decodeAttributes(), and ghidra::Range::Range().
AddrSpace * ghidra::AddrSpaceManager::getSpaceByShortcut | ( | char | sc | ) | const |
Get address space from its shortcut.
All address spaces have a unique shortcut (ASCII) character assigned to them. This routine retrieves an AddrSpace object given a specific shortcut.
sc | is the shortcut character |
Referenced by ghidra::JoinSpace::read().
|
inline |
Get the stack space for this processor.
Most processors have registers and instructions that are reserved for implementing a stack. In the pcode translation, these are translated into locations and operations on a dedicated stack address space. (See SpacebaseSpace)
Referenced by ghidra::ActionConditionalConst::apply(), ghidra::ActionPrototypeTypes::apply(), ghidra::ActionActiveParam::apply(), ghidra::Funcdata::decode(), ghidra::Funcdata::Funcdata(), and ghidra::ActionDatabase::universalAction().
|
inline |
Get the temporary register space for this processor.
Both the pcode translation process and the simplification process need access to a pool of temporary registers that can be used for moving data around without affecting the address spaces used to formally model the processor's RAM and registers. These temporary locations are all allocated from a dedicated address space, referred to as the unique space. (See UniqueSpace)
Referenced by ghidra::ExecutablePcode::build(), ghidra::Sleigh::oneInstruction(), ghidra::SleighCompile::predefinedSymbols(), ghidra::SleighCompile::setResultStarVarnode(), and ghidra::VarnodeBank::VarnodeBank().
|
protected |
Override the base resolver for a space.
Provide a new specialized resolver for a specific AddrSpace. The manager takes ownership of resolver.
spc | is the space to which the resolver is associated |
rsolv | is the new resolver object |
References ghidra::AddrSpace::getIndex().
|
protected |
Add a new address space to the model.
This adds a previously instantiated address space (AddrSpace) to the model for this processor. It checks a set of indexing and naming conventions for the space and throws an exception if the conventions are violated. Should only be called during initialization.
spc | the address space to insert |
References ghidra::AddrSpace::getContain(), ghidra::AddrSpace::getName(), ghidra::AddrSpace::getType(), ghidra::AddrSpace::index, ghidra::ConstantSpace::INDEX, ghidra::OtherSpace::INDEX, ghidra::IPTR_CONSTANT, ghidra::IPTR_FSPEC, ghidra::IPTR_INTERNAL, ghidra::IPTR_IOP, ghidra::IPTR_JOIN, ghidra::IPTR_PROCESSOR, ghidra::IPTR_SPACEBASE, ghidra::AddrSpace::isOtherSpace(), ghidra::AddrSpace::isOverlay(), ghidra::ConstantSpace::NAME, ghidra::UniqueSpace::NAME, ghidra::JoinSpace::NAME, ghidra::AddrSpace::overlaybase, ghidra::AddrSpace::refcount, and ghidra::AddrSpace::setFlags().
Referenced by ghidra::SleighCompile::newSpace(), and ghidra::SleighCompile::predefinedSymbols().
|
protected |
Mark that given space can be accessed with near pointers.
spc | is the AddrSpace to mark |
size | is the (minimum) size of a near pointer in bytes |
References ghidra::AddrSpace::addressSize, ghidra::AddrSpace::has_nearpointers, ghidra::AddrSpace::minimumPointerSize, and ghidra::AddrSpace::setFlags().
|
inline |
Get the number of address spaces for this processor.
This returns the total number of address spaces used by the processor, including all special spaces, like the constant space and the iop space.
Referenced by ghidra::ScopeInternal::adjustCaches(), ghidra::ActionDeadCode::apply(), ghidra::ConditionalExecution::buildHeritageArray(), ghidra::Heritage::buildInfoList(), ghidra::Funcdata::encodeTree(), ghidra::IfcPrintSpaces::execute(), ghidra::ActionNameVars::linkSymbols(), ghidra::SleighCompile::newSpace(), ghidra::SleighCompile::predefinedSymbols(), ghidra::ScopeInternal::ScopeInternal(), and ghidra::Funcdata::spacebase().
Address ghidra::AddrSpaceManager::parseAddressSimple | ( | const string & | val | ) |
Parse a string with just an address space name and a hex offset.
The string must contain a hexadecimal offset. The offset may be optionally prepended with "0x". The string may optionally start with the name of the address space to associate with the offset, followed by ':' to separate it from the offset. If the name is not present, the default data space is assumed.
val | is the string to parse |
References ghidra::AddrSpace::addressToByte(), and ghidra::AddrSpace::getWordSize().
Referenced by ghidra::ArchitectureGhidra::buildSymbols().
void ghidra::AddrSpaceManager::renormalizeJoinAddress | ( | Address & | addr, |
int4 | size | ||
) |
Make sure a possibly offset join address has a proper JoinRecord.
If an Address in the join AddressSpace is shifted from its original offset, it may no longer have a valid JoinRecord. The shift or size change may even make the address of one of the pieces a more natural representation. Given a new Address and size, this method decides if there is a matching JoinRecord. If not it either constructs a new JoinRecord or computes the address within the containing piece. The given Address is changed if necessary either to the offset corresponding to the new JoinRecord or to a normal non-join Address.
addr | is the given Address |
size | is the size of the range in bytes |
References ghidra::JoinRecord::getEquivalentAddress(), ghidra::Address::getOffset(), ghidra::Address::isInvalid(), ghidra::VarnodeData::offset, ghidra::JoinRecord::pieces, ghidra::VarnodeData::size, ghidra::VarnodeData::space, and ghidra::JoinRecord::unified.
Address ghidra::AddrSpaceManager::resolveConstant | ( | AddrSpace * | spc, |
uintb | val, | ||
int4 | sz, | ||
const Address & | point, | ||
uintb & | fullEncoding | ||
) | const |
Resolve a native constant into an Address.
If there is a special resolver for the AddrSpace, this is invoked, otherwise basic wordsize conversion and wrapping is performed. If the address encoding is partial (as in a near pointer) and the full encoding can be recovered, it is passed back. The sz parameter indicates the number of bytes in constant and is used to determine if the constant is a partial or full pointer encoding. A value of -1 indicates the value is known to be a full encoding.
spc | is the space to generate the address from |
val | is the constant encoding of the address |
sz | is the size of the constant encoding (or -1) |
point | is the context address (for recovering full encoding info if necessary) |
fullEncoding | is used to pass back the recovered full encoding of the pointer |
References ghidra::AddrSpace::addressToByte(), ghidra::AddrSpace::getIndex(), ghidra::AddrSpace::getWordSize(), ghidra::AddressResolver::resolve(), and ghidra::AddrSpace::wrapOffset().
Referenced by ghidra::ActionConstantPtr::isPointer(), and ghidra::PrintC::pushPtrCharConstant().
void ghidra::AddrSpaceManager::setDeadcodeDelay | ( | AddrSpace * | spc, |
int4 | delaydelta | ||
) |
Set the deadcodedelay for a specific space.
Set the number of passes for a specific AddrSpace before deadcode removal is allowed for that space.
spc | is the AddrSpace to change |
delaydelta | is the number of rounds to the delay should be set to |
References ghidra::AddrSpace::deadcodedelay.
|
protected |
Set the default address space (for code)
Once all the address spaces have been initialized, this routine should be called once to establish the official default space for the processor, via its index. Should only be called during initialization.
index | is the index of the desired default space |
References ghidra::AddrSpace::index.
Referenced by ghidra::SleighCompile::newSpace().
|
protected |
Set the default address space for data.
If the architecture has different code and data spaces, this routine can be called to set the data space after the code space has been set.
index | is the index of the desired default space |
References ghidra::AddrSpace::index.
|
protected |
Set the range of addresses that can be inferred as pointers.
This method establishes for a single address space, what range of constants are checked as possible symbol starts, when it is not known apriori that a constant is a pointer.
range | is the range of values for a single address space |
References ghidra::Range::getFirst(), ghidra::Range::getLast(), ghidra::Range::getSpace(), ghidra::AddrSpace::pointerLowerBound, and ghidra::AddrSpace::pointerUpperBound.
|
protected |
Set reverse justified property on this space.
For spaces with alignment restrictions, the address of a small variable must be justified within a larger aligned memory word, usually either to the left boundary for little endian encoding or to the right boundary for big endian encoding. Some compilers justify small variables to the opposite side of the one indicated by the endianness. Setting this property on a space causes the decompiler to use this justification
References ghidra::AddrSpace::reverse_justification, and ghidra::AddrSpace::setFlags().
void ghidra::AddrSpaceManager::truncateSpace | ( | const TruncationTag & | tag | ) |
Mark a space as truncated from its original size.
Mark the named space as truncated from its original size
tag | is a description of the space and how it should be truncated |
References ghidra::TruncationTag::getName(), ghidra::TruncationTag::getSize(), and ghidra::AddrSpace::truncateSpace().
Referenced by ghidra::GhidraTranslate::decode(), and ghidra::SleighArchitecture::modifySpaces().