|
OpenASIP 2.2
|
#include <StringSection.hh>


Public Member Functions | |
| virtual | ~StringSection () |
| virtual SectionType | type () const |
| std::string | chunk2String (const Chunk *chunk) const |
| Chunk * | string2Chunk (const std::string &str) |
Public Member Functions inherited from TPEF::DataSection | |
| virtual | ~DataSection () |
| virtual Byte | byte (const Chunk *chunk) const |
| virtual Byte | byte (Word offset) const |
| virtual void | addByte (Byte aByte) |
| virtual MinimumAddressableUnit | MAU (Word index) const |
| virtual void | addMAU (MinimumAddressableUnit aMAU) |
| virtual void | writeValue (Word index, Word numOfMAUs, unsigned long value) |
| virtual void | writeValue (Word index, Word numOfMAUs, signed long value) |
| virtual Word | length () const |
| virtual void | setDataLength (Word length) |
| virtual bool | isDataSection () const override |
Public Member Functions inherited from TPEF::UDataSection | |
| virtual | ~UDataSection () |
Public Member Functions inherited from TPEF::RawSection | |
| virtual bool | isChunkable () const |
| virtual Chunk * | chunk (SectionOffset offset) const |
| virtual void | assureInSection (SectionOffset offset) const |
| virtual | ~RawSection () |
| bool | empty () const |
| virtual void | setLengthInMAUs (Word length) |
| virtual Word | lengthInMAUs () const |
| virtual Word | bytesToMAUs (Word byteCount) const |
| virtual Word | MAUsToBytes (Word mauCount) const |
| virtual Word | chunkToMAUIndex (const Chunk *chunk) const |
| Word | referredChunkCount () const |
| Chunk * | referredChunk (Word index) const |
| bool | belongsToSection (const Chunk *chunk) const |
Public Member Functions inherited from TPEF::Section | |
| virtual | ~Section () |
| bool | isProgramSection () const |
| bool | isAuxSection () const |
| virtual void | addElement (SectionElement *element) |
| virtual void | setElement (Word index, SectionElement *element) |
| SectionElement * | element (Word index) const |
| Word | elementCount () const |
| void | setFlagNoBits () |
| void | unsetFlagNoBits () |
| bool | noBits () const |
| bool | vLen () const |
| Byte | flags () const |
| void | setFlags (Byte flagByte) |
| void | setStartingAddress (AddressImage address) |
| AddressImage | startingAddress () const |
| void | setLink (const ReferenceManager::SafePointer *aLink) |
| void | setLink (Section *aLink) |
| Section * | link () const |
| void | setASpace (const ReferenceManager::SafePointer *addrSpace) |
| void | setASpace (ASpaceElement *addrSpace) |
| ASpaceElement * | aSpace () const |
| void | setName (const ReferenceManager::SafePointer *sectionName) |
| void | setName (Chunk *sectionName) |
| Chunk * | name () const |
| virtual bool | isCodeSection () const |
Public Member Functions inherited from TPEF::SafePointable | |
| virtual | ~SafePointable () |
Protected Member Functions | |
| StringSection (bool init) | |
| virtual Section * | clone () const |
Protected Member Functions inherited from TPEF::DataSection | |
| DataSection (bool init) | |
| virtual void | setByte (Word offset, Byte aByte) |
Protected Member Functions inherited from TPEF::UDataSection | |
| UDataSection (bool init) | |
Protected Member Functions inherited from TPEF::RawSection | |
| RawSection () | |
Protected Member Functions inherited from TPEF::Section | |
| Section () | |
| void | setFlagVLen () |
| void | unsetFlagVLen () |
Protected Member Functions inherited from TPEF::SafePointable | |
| SafePointable () | |
Static Private Attributes | |
| static StringSection | proto_ |
| Prototype of the section. | |
Additional Inherited Members | |
Public Types inherited from TPEF::Section | |
| enum | SectionType { ST_NULL = 0x00 , ST_STRTAB = 0x01 , ST_SYMTAB = 0x02 , ST_DEBUG = 0x03 , ST_RELOC = 0x04 , ST_LINENO = 0x05 , ST_NOTE = 0x06 , ST_ADDRSP = 0x07 , ST_MR = 0x0A , ST_CODE = 0x81 , ST_DATA = 0x82 , ST_UDATA = 0x83 , ST_LEDATA = 0x84 , ST_DUMMY = 0xff } |
| enum | SectionFlag { SF_VLEN = 0x40 , SF_NOBITS = 0x80 } |
Static Public Member Functions inherited from TPEF::Section | |
| static Section * | createSection (SectionType type) |
| static bool | isProgramSection (SectionType type) |
Static Protected Member Functions inherited from TPEF::Section | |
| static void | registerSection (const Section *section) |
Represents a string table section.
Definition at line 48 of file StringSection.hh.
|
virtual |
|
protected |
Constructor.
| init | True if registeration is wanted. |
Definition at line 50 of file StringSection.cc.
References TPEF::Section::registerSection(), TPEF::Section::unsetFlagNoBits(), and TPEF::Section::unsetFlagVLen().

| string TPEF::StringSection::chunk2String | ( | const Chunk * | chunk | ) | const |
Returns the string of the given chunk.
| chunk | Chunk where string starts. |
| UnexpectedValue | If no terminating zero is found. |
Definition at line 72 of file StringSection.cc.
References __func__, assert, TPEF::RawSection::chunk(), TPEF::DataSection::length(), and TPEF::Chunk::offset().
Referenced by MachineResourceManager::addResourceElement(), TPEF::TPEFTools::addressSpaceName(), TTAProgram::TPEFResourceUpdater::bus(), TPEFDisassembler::createDisassemblyElement(), TTAProgram::TPEFProgramFactory::createLabels(), TPEF::AOutSymbolSectionReader::finalize(), TTAProgram::TPEFResourceUpdater::functionUnit(), TTAProgram::TPEFResourceUpdater::functionUnitPort(), TTAProgram::TPEFResourceUpdater::immediateUnit(), TTAProgram::TPEFResourceUpdater::initCache(), TPEF::AOutSymbolSectionReader::initializeSymbol(), TTAProgram::TPEFResourceUpdater::operand(), TTAProgram::TPEFResourceUpdater::registerFile(), TPEF::TPEFTools::resourceName(), TPEFDumper::section(), TPEFDumper::sectionHeader(), TTAProgram::TPEFProgramFactory::stringOfChunk(), TPEFDumper::symbolString(), and ProgramImageGenerator::writeDataSection().

|
protectedvirtual |
Creates an instance of the class.
Reimplemented from TPEF::DataSection.
Definition at line 158 of file StringSection.cc.
| Chunk * TPEF::StringSection::string2Chunk | ( | const std::string & | str | ) |
Checks if string is already found from section and returns chunk pointing to it.
If string is not already found from section, it is added to end, before returning chunk.
| str | String to find from section. |
Definition at line 103 of file StringSection.cc.
References TPEF::DataSection::addByte(), TPEF::RawSection::chunk(), and TPEF::DataSection::length().
Referenced by TTAProgram::TPEFResourceUpdater::bus(), TTAProgram::ProgramWriter::createASpaceElement(), TTAProgram::ProgramWriter::createBinary(), TTAProgram::ProgramWriter::createDataSections(), TTAProgram::ProgramWriter::createRelocSections(), LabelManager::finalize(), TTAProgram::TPEFResourceUpdater::functionUnit(), TTAProgram::TPEFResourceUpdater::functionUnitPort(), TTAProgram::TPEFResourceUpdater::immediateUnit(), TTAProgram::TPEFResourceUpdater::operand(), TPEF::AOutReader::readData(), TPEF::AOutSymbolSectionReader::readData(), TTAProgram::TPEFResourceUpdater::registerFile(), MachineResourceManager::stringToChunk(), and LabelManager::writeProcedureSymbols().

|
virtual |
Returns the type of section.
Reimplemented from TPEF::DataSection.
Definition at line 148 of file StringSection.cc.
References TPEF::Section::ST_STRTAB.
|
staticprivate |
Prototype of the section.
Definition at line 64 of file StringSection.hh.