OpenASIP
2.0
|
#include <TPEFSectionReader.hh>
Classes | |
struct | Header |
Public Member Functions | |
virtual | ~TPEFSectionReader () |
Public Member Functions inherited from TPEF::SectionReader | |
virtual | ~SectionReader () |
Protected Member Functions | |
TPEFSectionReader () | |
virtual void | readData (BinaryStream &stream, Section *section) const |
virtual BinaryReader * | parent () const |
virtual void | readInfo (BinaryStream &stream, Section *sect) const |
Protected Member Functions inherited from TPEF::SectionReader | |
SectionReader () | |
virtual Section::SectionType | type () const =0 |
Returns type (TPEF) section which actual section reader reads. More... | |
virtual void | finalize (Section *section) const |
Static Protected Member Functions | |
static const Header & | header () |
Static Protected Member Functions inherited from TPEF::SectionReader | |
static const SectionReader * | findSectionReader (const Section::SectionType type, const BinaryReader *bReader) |
static void | registerSectionReader (const SectionReader *sReader) |
Private Member Functions | |
TPEFSectionReader (const TPEFSectionReader &) | |
Static Private Attributes | |
static Header | header_ |
Stores values that are needed in actual SectionReader classes. More... | |
Additional Inherited Members | |
Public Types inherited from TPEF::SectionReader | |
typedef BinaryReader::Length | Length |
Static Public Member Functions inherited from TPEF::SectionReader | |
static void | readSection (BinaryStream &stream, Section *section, BinaryReader *reader) |
static void | finalizeBinary (Binary *binaryToFinalize, BinaryReader *reader) |
Abstract base class for all TPEFSectionReaders.
Class implements default definitions of virtual methods declared in SectionReader class and reading headers of TPEF sections.
Definition at line 48 of file TPEFSectionReader.hh.
|
virtual |
|
protected |
|
private |
|
staticprotected |
Returns headers of section that we are currently reading.
Definition at line 174 of file TPEFSectionReader.cc.
References header_.
Referenced by TPEF::TPEFASpaceSectionReader::readData(), TPEF::TPEFDebugSectionReader::readData(), TPEF::TPEFStringSectionReader::readData(), TPEF::TPEFUDataSectionReader::readData(), TPEF::TPEFDataSectionReader::readData(), TPEF::TPEFCodeSectionReader::readData(), TPEF::TPEFSymbolSectionReader::readData(), TPEF::TPEFLineNumSectionReader::readData(), TPEF::TPEFResourceSectionReader::readData(), and TPEF::TPEFRelocSectionReader::readData().
|
protectedvirtual |
Returns binary reader instance which uses TPEFSectionReader classes.
Implements TPEF::SectionReader.
Definition at line 65 of file TPEFSectionReader.cc.
References TPEF::TPEFReader::instance().
Referenced by TPEF::TPEFRelocSectionReader::finalize(), TPEF::TPEFUDataSectionReader::readData(), TPEF::TPEFASpaceSectionReader::readData(), TPEF::TPEFDataSectionReader::readData(), TPEF::TPEFCodeSectionReader::readData(), TPEF::TPEFRelocSectionReader::readData(), and readData().
|
protectedvirtual |
Reads section data from TPEF binary file.
Base implementation for all TPEF section readers. Reads and keeps section header data for later use by concrete section readers. Header data is accessed by readData methods of subclasses.
stream | Stream to be read from. |
section | Section where the information is to be stored. |
UnreachableStream | If reading of section fails. |
KeyAlreadyExists | Key was in use when trying to register object. |
EndOfFile | If end of file were reached while it shouldn't. |
OutOfRange | Some of read values were out of range. |
WrongSubclass | Some class couldn't do what it was asked for. |
UnexpectedValue | If there was unexpected value when reading. |
Implements TPEF::SectionReader.
Reimplemented in TPEF::TPEFRelocSectionReader, TPEF::TPEFCodeSectionReader, TPEF::TPEFLineNumSectionReader, TPEF::TPEFResourceSectionReader, TPEF::TPEFSymbolSectionReader, TPEF::TPEFASpaceSectionReader, TPEF::TPEFDataSectionReader, TPEF::TPEFDebugSectionReader, TPEF::TPEFStringSectionReader, and TPEF::TPEFUDataSectionReader.
Definition at line 86 of file TPEFSectionReader.cc.
References __func__, TPEF::ReferenceManager::SafePointer::addObjectReference(), TPEF::TPEFReader::aSpaceId(), TPEF::TPEFSectionReader::Header::bodyLength, TPEF::TPEFSectionReader::Header::bodyOffset, TPEF::TPEFSectionReader::Header::elementSize, header_, TPEF::TPEFSectionReader::Header::linkId, TPEF::ReferenceManager::SafePointer::null, parent(), TPEF::BinaryStream::readByte(), TPEF::BinaryStream::readHalfWord(), readInfo(), TPEF::BinaryStream::readPosition(), TPEF::BinaryStream::readWord(), TPEF::TPEFSectionReader::Header::sectionId, TPEF::Section::setASpace(), TPEF::Section::setFlags(), TPEF::Section::setLink(), TPEF::Section::setName(), TPEF::BinaryStream::setReadPosition(), TPEF::Section::setStartingAddress(), TPEF::Section::SF_VLEN, TPEF::TPEFHeaders::SH_ADDR, TPEF::TPEFHeaders::SH_ASPACE, TPEF::TPEFHeaders::SH_ENTSIZE, TPEF::TPEFHeaders::SH_FLAGS, TPEF::TPEFHeaders::SH_ID, TPEF::TPEFHeaders::SH_INFO, TPEF::TPEFHeaders::SH_LINK, TPEF::TPEFHeaders::SH_NAME, TPEF::TPEFHeaders::SH_OFFSET, TPEF::TPEFHeaders::SH_SIZE, TPEF::TPEFReader::strTableId(), and TPEF::Section::vLen().
Referenced by TPEF::TPEFASpaceSectionReader::readData(), TPEF::TPEFDebugSectionReader::readData(), TPEF::TPEFStringSectionReader::readData(), TPEF::TPEFUDataSectionReader::readData(), TPEF::TPEFDataSectionReader::readData(), TPEF::TPEFCodeSectionReader::readData(), TPEF::TPEFSymbolSectionReader::readData(), TPEF::TPEFLineNumSectionReader::readData(), TPEF::TPEFResourceSectionReader::readData(), and TPEF::TPEFRelocSectionReader::readData().
|
protectedvirtual |
Reads info field of section header.
Read position of stream will be moved 4 bytes forward.
stream | Stream where from info word is read. |
Reimplemented in TPEF::TPEFRelocSectionReader, TPEF::TPEFCodeSectionReader, and TPEF::TPEFLineNumSectionReader.
Definition at line 162 of file TPEFSectionReader.cc.
References TPEF::BinaryStream::readWord().
Referenced by readData().
|
staticprivate |
Stores values that are needed in actual SectionReader classes.
Definition at line 79 of file TPEFSectionReader.hh.
Referenced by header(), and readData().