decompiler
1.0.0
|
A contiguous range of bytes in some address space. More...
#include <address.hh>
Public Member Functions | |
Range (AddrSpace *s, uintb f, uintb l) | |
Construct a Range from offsets. More... | |
Range (void) | |
Constructor for use with restoreXml. | |
AddrSpace * | getSpace (void) const |
Get the address space containing this Range. | |
uintb | getFirst (void) const |
Get the offset of the first byte in this Range. | |
uintb | getLast (void) const |
Get the offset of the last byte in this Range. | |
Address | getFirstAddr (void) const |
Get the address of the first byte. | |
Address | getLastAddr (void) const |
Get the address of the last byte. | |
Address | getLastAddrOpen (const AddrSpaceManager *manage) const |
Get address of first byte after this. More... | |
bool | contains (const Address &addr) const |
Determine if the address is in this Range. More... | |
bool | operator< (const Range &op2) const |
Sorting operator for Ranges. More... | |
void | printBounds (ostream &s) const |
Print this Range to a stream. More... | |
void | saveXml (ostream &s) const |
Save this Range to an XML stream. More... | |
void | restoreXml (const Element *el, const AddrSpaceManager *manage) |
Restore this from XML stream. More... | |
Private Attributes | |
AddrSpace * | spc |
Space containing range. | |
uintb | first |
Offset of first byte in this Range. | |
uintb | last |
Offset of last byte in this Range. | |
Friends | |
class | RangeList |
A contiguous range of bytes in some address space.
|
inline |
Construct a Range from offsets.
Offsets must expressed in bytes as opposed to addressable words
s | is the address space containing the range |
f | is the offset of the first byte in the range |
l | is the offset of the last byte in the range |
|
inline |
Determine if the address is in this Range.
addr | is the Address to test for containment |
References Address::getOffset(), and Address::getSpace().
Address Range::getLastAddrOpen | ( | const AddrSpaceManager * | manage | ) | const |
Get address of first byte after this.
Get the last address +1, updating the space, or returning the extremal address if necessary
manage | is used to fetch the next address space |
References AddrSpace::getHighest(), AddrSpaceManager::getNextSpaceInOrder(), and Address::m_maximal.
Referenced by ContextInternal::restoreFromSpec(), and Database::setPropertyRange().
|
inline |
Sorting operator for Ranges.
Compare based on address space, then the starting offset
op2 | is the Range to compare with this |
References first, AddrSpace::getIndex(), RangeList::printBounds(), Address::restoreXml(), Address::saveXml(), and spc.
void Range::printBounds | ( | ostream & | s | ) | const |
void Range::restoreXml | ( | const Element * | el, |
const AddrSpaceManager * | manage | ||
) |
Restore this from XML stream.
Reconstruct this object from an XML <range> element
el | is the XML element |
manage | is the space manage for recovering AddrSpace objects |
References Element::getAttributeName(), Element::getAttributeValue(), AddrSpaceManager::getDefaultCodeSpace(), Element::getNumAttributes(), Translate::getRegister(), AddrSpaceManager::getSpaceByName(), AddrSpace::getTrans(), VarnodeData::offset, VarnodeData::size, and VarnodeData::space.
Referenced by Architecture::parseGlobal(), Architecture::parseInferPtrBounds(), Architecture::parseNoHighPtr(), Architecture::parseReadOnly(), Architecture::parseVolatile(), ScopeGhidra::processHole(), ScopeInternal::processHole(), ContextInternal::restoreFromSpec(), RangeList::restoreXml(), and ProtoModel::restoreXml().
void Range::saveXml | ( | ostream & | s | ) | const |