Go to the documentation of this file.
52 using ReferenceManager::SafePointer;
54 using ReferenceManager::FileOffsetKey;
55 using ReferenceManager::SectionOffsetKey;
56 using ReferenceManager::SectionKey;
57 using ReferenceManager::SectionIndexKey;
136 Word stringTableFileOffset = stream.
readWord();
138 if (stringTableFileOffset != 0) {
146 if (stringTableFileOffset != 0) {
156 bool programSectionWasFound =
false;
157 for (Word i = offsetToHeader;
158 i < offsetToHeader + (sectionHeaderCount*sectionHeaderSize);
159 i += sectionHeaderSize) {
169 bool brokenBinaryMoreThanOneASpaceSection =
170 (aSpaceSectionId == 0);
171 assert(brokenBinaryMoreThanOneASpaceSection);
177 programSectionWasFound =
true;
182 assert(aSpaceSectionId != 0);
186 for (HalfWord i = 0; i < sectionHeaderCount; i++) {
201 offsetToHeader += sectionHeaderSize;
216 programSectionWasFound ==
false));
288 if (sect->
aSpace() == aSpace) {
293 lastSectionAddress +=
294 dynamic_cast<CodeSection*
>(sect)->instructionCount();
297 lastSectionAddress +=
298 dynamic_cast<RawSection*
>(sect)->lengthInMAUs();
302 if (address < lastSectionAddress &&
HalfWord SectionId
Type for storing binary file section ids.
static BinaryReader * instance()
ASpaceElement * aSpace() const
void addSectionSize(const Section *sect, Word length)
unsigned int readPosition()
void setTPEFVersion(TPEFHeaders::TPEFVersion version)
void setReadPosition(unsigned int position)
ASpaceSection * aSpaceSection() const
std::map< const Section *, Word > sectionSizes_
Cache of sizes in addresses of read sections.
static TPEFReader * proto_
Prototype instance registered into BinaryReader.
virtual SectionType type() const =0
Returns SectioType of actual section instance.
static const SafePointer null
The default SafePointer that is used in null references.
void addSection(Section *section)
void setType(FileType type)
Section * section(Word index) const
Word sectionCount() const
void setTPEFVersion(TPEFHeaders::TPEFVersion version)
static void addObjectReference(SectionIndexKey key, const SafePointable *obj)
#define assert(condition)
virtual bool isMyStreamType(BinaryStream &stream) const
Section * sectionOfAddress(const ASpaceElement *aSpaceId, AddressImage address) const
SectionId strTableId_
Identification code of string table containing section name strings.
static Section * createSection(SectionType type)
Word FileOffset
Type for storing absolute file offsets.
Binary * binary_
Last or currently read binary.
virtual Binary * readData(BinaryStream &stream) const
UInt32 AddressImage
Type for storing addresses to memory image.
bool isProgramSection() const
virtual bool isCodeSection() const
SectionId aSpaceId_
Identification code of address space section (there is only one at maximum).
@ ST_MR
Machine resources section.
void setStrings(StringSection *strTable)
AddressImage startingAddress() const
@ ST_ADDRSP
Address space section.
static void readSection(BinaryStream &stream, Section *section, BinaryReader *reader)
void setArch(FileArchitecture arch)
static void registerBinaryReader(BinaryReader *reader)