#include <Cxx_Grammar.h>
Inheritance diagram for SgAsmGenericSection:


Not only are ELF and PE Sections represented by SgAsmGenericSection, but also such things as file headers, segment/section tables, etc.
Public Types | |
| typedef SgAsmExecutableFileFormat | base_node_type |
| SP_UNSPECIFIED | |
| SP_PROGRAM | |
| SP_HEADER | |
| SP_SYMTAB | |
| SP_OTHER | |
| static_variant = V_SgAsmGenericSection | |
| enum | SectionPurpose { SP_UNSPECIFIED, SP_PROGRAM, SP_HEADER, SP_SYMTAB, SP_OTHER } |
| enum | { static_variant = V_SgAsmGenericSection } |
| static variant value More... | |
Public Member Functions | |
| virtual SgNode * | copy (SgCopyHelp &help) const |
| unsigned long | get_starting_memory_address () |
| unsigned long | get_starting_file_offset () |
| unsigned long | get_flags () |
| unsigned long | get_type () |
| SgAsmGenericSection (SgAsmGenericFile *f, SgAsmGenericHeader *fhdr) | |
| virtual | ~SgAsmGenericSection () |
| void | grab_content () |
| Saves a reference to the original file data for a section based on the sections current offset and size. | |
| virtual SgAsmGenericSection * | parse () |
| virtual void | dump (FILE *, const char *prefix, ssize_t idx) const |
| virtual bool | reallocate () |
| virtual void | unparse (std::ostream &) const |
| Write a section back to the file. | |
| void | unparse (std::ostream &, const ExtentMap &) const |
| Write just the specified regions back to the file. | |
| void | unparse_holes (std::ostream &) const |
| Write holes (unreferenced areas) back to the file. | |
| SgAsmGenericHeader * | is_file_header () |
| True (the SgAsmGenericHeader pointer) if this section is also a top-level file header, false (NULL) otherwise. | |
| rose_addr_t | get_size () const |
| true if section represents a top level file header | |
| virtual void | set_size (rose_addr_t) |
| Adjust the current size of a section. | |
| rose_addr_t | get_offset () const |
| Returns current file offset of section in bytes. | |
| virtual void | set_offset (rose_addr_t) |
| Adjust the current offset of a section. | |
| rose_addr_t | get_end_offset () const |
| Move a section w/o regard to other sections or mapping. | |
| void | extend (rose_addr_t nbytes) |
| file offset for end of section | |
| rose_addr_t | write (std::ostream &, rose_addr_t offset, size_t bufsize, const void *buf) const |
| make section larger by extending the end | |
| rose_addr_t | write (std::ostream &, rose_addr_t offset, const std::string &str) const |
| rose_addr_t | write (std::ostream &, rose_addr_t offset, char c) const |
| rose_addr_t | write (std::ostream &, rose_addr_t offset, const SgFileContentList &buf) const |
| rose_addr_t | write (std::ostream &, rose_addr_t offset, const SgUnsignedCharList &buf) const |
| rose_addr_t | write_uleb128 (unsigned char *, rose_addr_t offset, uint64_t) const |
| Encode an unsigned value as LEB128 and return the next offset. | |
| rose_addr_t | write_sleb128 (unsigned char *, rose_addr_t offset, int64_t) const |
| Encode a signed value as LEB128 and return the next offset. | |
| size_t | read_content (rose_addr_t abs_offset, void *dst_buf, rose_addr_t size, bool strict=true) |
| Reads data from a file. | |
| size_t | read_content (const MemoryMap *, rose_addr_t rva, void *dst_buf, rose_addr_t size, bool strict=true) |
| Reads data from a file. | |
| size_t | read_content (const MemoryMap *map, rose_rva_t rva, void *dst_buf, rose_addr_t size, bool strict=true) |
| size_t | read_content_local (rose_addr_t rel_offset, void *dst_buf, rose_addr_t size, bool strict=true) |
| Reads data from a file. | |
| std::string | read_content_str (const MemoryMap *, rose_addr_t rva, bool strict=true) |
| Reads a string from the file. | |
| std::string | read_content_str (const MemoryMap *map, rose_rva_t rva, bool strict=true) |
| std::string | read_content_str (rose_addr_t abs_offset, bool strict=true) |
| Reads a string from the file. | |
| std::string | read_content_local_str (rose_addr_t rel_offset, bool strict=true) |
| Reads a string from the file. | |
| SgUnsignedCharList | read_content_local_ucl (rose_addr_t rel_offset, rose_addr_t size) |
| Reads content of a section and returns it as a container. | |
| int64_t | read_content_local_sleb128 (rose_addr_t *rel_offset, bool strict=true) |
Extract a signed LEB128 value and adjust rel_offset according to how many bytes it occupied. | |
| uint64_t | read_content_local_uleb128 (rose_addr_t *rel_offset, bool strict=true) |
Extract an unsigned LEB128 value and adjust rel_offset according to how many bytes it occupied. | |
| unsigned char * | writable_content (size_t nbytes) |
| Sections typically point into the memory mapped, read-only file stored in the SgAsmGenericFile parent initialized by calling grab_content() (or indirectly by calling parse()). | |
| ExtentMap | get_referenced_extents () const |
| Returns a list of parts of a single section that have been referenced. | |
| ExtentMap | get_unreferenced_extents () const |
| bool | is_mapped () const |
| Returns whether section desires to be mapped to memory. | |
| void | clear_mapped () |
| True iff non-zero mapped address and size. | |
| rose_addr_t | get_mapped_size () const |
| Set mapped address and size to zero (unmapped). | |
| virtual void | set_mapped_size (rose_addr_t) |
| Resizes a mapped section without consideration of other sections that might be mapped. | |
| rose_addr_t | get_mapped_preferred_rva () const |
| Returns relative virtual address w.r.t., base address of header. | |
| virtual void | set_mapped_preferred_rva (rose_addr_t) |
| Moves a mapped section without consideration of other sections that might be mapped. | |
| rose_addr_t | get_base_va () const |
| Returns base virtual address for a section, or zero if the section is not associated with a header. | |
| rose_addr_t | get_mapped_preferred_va () const |
| Returns (non-relative) virtual address if mapped, zero otherwise. | |
| rose_addr_t | get_va_offset (rose_addr_t va) const |
| Returns the file offset associated with the virtual address of a mapped section. | |
| rose_addr_t | get_rva_offset (rose_addr_t rva) const |
| Returns the file offset associated with the relative virtual address of a mapped section. | |
| SgAsmGenericString * | get_name () const |
| Accessors for section name. | |
| void | set_name (SgAsmGenericString *s) |
| Same as standard ROSETTA accessor. | |
| Extent | get_file_extent () const |
| Like std accessor but sets parent of 's'. | |
| Extent | get_mapped_preferred_extent () const |
| Returns the memory extent for a mapped section. | |
| bool | align () |
| Increase file offset and mapping address to satisfy alignment constraints. | |
| virtual std::string | class_name () const |
| Copies AST (whole subtree, depending on the SgCopyHelp class returns a string representing the class name. | |
| virtual VariantT | variantT () const |
| returns new style SageIII enum values | |
| void * | operator new (size_t size) |
| returns pointer to newly allocated IR node | |
| void | operator delete (void *pointer, size_t size) |
| deallocated memory for IR node (returns memory to memory pool for reuse) | |
| void | operator delete (void *pointer) |
| virtual std::vector< SgNode * > | get_traversalSuccessorContainer () |
| FOR INTERNAL USE within ROSE traverals mechanism only. | |
| virtual std::vector< std::string > | get_traversalSuccessorNamesContainer () |
| FOR INTERNAL USE within ROSE traverals mechanism only. | |
| virtual size_t | get_numberOfTraversalSuccessors () |
| virtual SgNode * | get_traversalSuccessorByIndex (size_t idx) |
| virtual size_t | get_childIndex (SgNode *child) |
| virtual RTIReturnType | roseRTI () |
| FOR INTERNAL USE Access to Runtime Type Information (RTI) for this IR nodes. | |
| virtual const char * | sage_class_name () const ROSE_DEPRECATED_FUNCTION |
| void | executeVisitorMemberFunction (ROSE_VisitorPattern &visitor) |
| FOR INTERNAL USE Support for visitor pattern. | |
| virtual void | accept (ROSE_VisitorPattern &visitor) |
| DXN (08/09/2010): support for the classic visitor pattern done in GoF. | |
| virtual bool | isInMemoryPool () |
| FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the heap. | |
| virtual void | checkDataMemberPointersIfInMemoryPool () |
| FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the heap. | |
| virtual std::vector< std::pair< SgNode *, std::string > > | returnDataMemberPointers () const |
| FOR INTERNAL USE Returns STL vector of pairs of SgNode* and strings for use in AST tools | |
| virtual void | processDataMemberReferenceToPointers (ReferenceToPointerHandler *) |
| FOR INTERNAL USE Processes pairs of references to SgNode* and strings for use in AST tools | |
| virtual long | getChildIndex (SgNode *childNode) const |
| FOR INTERNAL USE Returns a unique index value for the childNode in the list of children at this IR node. | |
| SgAsmGenericSection (const SgAsmGenericSectionStorageClass &source) | |
| SgAsmGenericSection * | addRegExpAttribute (std::string s, AstRegExAttribute *a) |
| Support for AST matching using regular expression. | |
| SgAsmGenericFile * | get_file () const |
| void | set_file (SgAsmGenericFile *file) |
| SgAsmGenericHeader * | get_header () const |
| void | set_header (SgAsmGenericHeader *header) |
| rose_addr_t | get_file_alignment () const |
| void | set_file_alignment (rose_addr_t file_alignment) |
| SgFileContentList | get_data () const |
| void | set_data (SgFileContentList data) |
| SgAsmGenericSection::SectionPurpose | get_purpose () const |
| void | set_purpose (SgAsmGenericSection::SectionPurpose purpose) |
| bool | get_synthesized () const |
| void | set_synthesized (bool synthesized) |
| int | get_id () const |
| void | set_id (int id) |
| rose_addr_t | get_mapped_alignment () const |
| void | set_mapped_alignment (rose_addr_t mapped_alignment) |
| bool | get_mapped_rperm () const |
| void | set_mapped_rperm (bool mapped_rperm) |
| bool | get_mapped_wperm () const |
| void | set_mapped_wperm (bool mapped_wperm) |
| bool | get_mapped_xperm () const |
| void | set_mapped_xperm (bool mapped_xperm) |
| bool | get_contains_code () const |
| void | set_contains_code (bool contains_code) |
| rose_addr_t | get_mapped_actual_va () const |
| void | set_mapped_actual_va (rose_addr_t mapped_actual_va) |
| SgAsmGenericSection () | |
Static Public Member Functions | |
| static void | dump_containing_sections (FILE *f, const std::string &prefix, rose_rva_t rva, const SgAsmGenericSectionPtrList &) |
| Class method that prints info about offsets into known sections. | |
| static size_t | numberOfNodes () |
| Returns the total number of IR nodes of this type. | |
| static size_t | memoryUsage () |
| Returns the size in bytes of the total memory allocated for all IR nodes of this type. | |
| static void | traverseMemoryPoolNodes (ROSE_VisitTraversal &visit) |
| FOR INTERNAL USE Support for visitor pattern. | |
| static void | traverseMemoryPoolVisitorPattern (ROSE_VisitorPattern &visitor) |
| FOR INTERNAL USE Support for visitor pattern. | |
| static void | visitRepresentativeNode (ROSE_VisitTraversal &visit) |
| FOR INTERNAL USE Support for type-based traversal. | |
Protected Member Functions | |
| void | ctor (SgAsmGenericFile *, SgAsmGenericHeader *) |
| Section constructors set the optional section header relationship--a bidirectional link between this new section and its optional, single header. | |
Protected Attributes | |
| SgAsmGenericFile * | p_file |
| SgAsmGenericHeader * | p_header |
| rose_addr_t | p_size |
| rose_addr_t | p_offset |
| rose_addr_t | p_file_alignment |
| SgFileContentList | p_data |
| SgAsmGenericSection::SectionPurpose | p_purpose |
| bool | p_synthesized |
| int | p_id |
| SgAsmGenericString * | p_name |
| rose_addr_t | p_mapped_preferred_rva |
| This is the relative virtual address where the section prefers to be mapped. | |
| rose_addr_t | p_mapped_size |
| rose_addr_t | p_mapped_alignment |
| bool | p_mapped_rperm |
| bool | p_mapped_wperm |
| bool | p_mapped_xperm |
| bool | p_contains_code |
| If a section is known to contain code then this data member is set. | |
| rose_addr_t | p_mapped_actual_va |
| This is the virtual address where ROSE simulates a loader mapping the section. | |
Private Attributes | |
| unsigned char * | local_data_pool |
| This is an optional local, writable pool for the p_data member. | |
Friends | |
| class | AST_FILE_IO |
| class | SgAsmGenericSectionStorageClass |
| class | AstSpecificDataManagingClass |
| class | AstSpecificDataManagingClassStorageClass |
| SgAsmGenericSection * | isSgAsmGenericSection (SgNode *s) |
| Casts pointer from base class to derived class. | |
| const SgAsmGenericSection * | isSgAsmGenericSection (const SgNode *s) |
| Casts pointer from base class to derived class (for const pointers). | |
| SgAsmGenericSection * | SgAsmGenericSection_getPointerFromGlobalIndex (unsigned long globalIndex) |
| Constructor for use by AST File I/O MechanismTypedef used for low level memory access. Typedef used to hold memory addresses as values. Methods to find the pointer to a global and local index. | |
| unsigned long | SgAsmGenericSection_getNumberOfValidNodesAndSetGlobalIndexInFreepointer (unsigned long) |
| Get the size of the memory pool. | |
| void | SgAsmGenericSection_clearMemoryPool () |
| void | SgAsmGenericSection_extendMemoryPoolForFileIO (unsigned long) |
| void | SgAsmGenericSection_getNextValidPointer (std::pair< SgAsmGenericSection *, std::vector< unsigned char * >::const_iterator > &) |
| void | SgAsmGenericSection_resetValidFreepointers () |
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| SgAsmGenericSection::SgAsmGenericSection | ( | SgAsmGenericFile * | f, | |
| SgAsmGenericHeader * | fhdr | |||
| ) |
| SgAsmGenericSection::~SgAsmGenericSection | ( | ) | [virtual] |
| SgAsmGenericSection::SgAsmGenericSection | ( | const SgAsmGenericSectionStorageClass & | source | ) |
| SgAsmGenericSection::SgAsmGenericSection | ( | ) |
| virtual SgNode* SgAsmGenericSection::copy | ( | SgCopyHelp & | help | ) | const [virtual] |
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| unsigned long SgAsmGenericSection::get_starting_memory_address | ( | ) | [inline] |
| unsigned long SgAsmGenericSection::get_starting_file_offset | ( | ) | [inline] |
| unsigned long SgAsmGenericSection::get_flags | ( | ) | [inline] |
| unsigned long SgAsmGenericSection::get_type | ( | ) | [inline] |
| void SgAsmGenericSection::dump_containing_sections | ( | FILE * | f, | |
| const std::string & | prefix, | |||
| rose_rva_t | rva, | |||
| const SgAsmGenericSectionPtrList & | ||||
| ) | [static] |
Class method that prints info about offsets into known sections.
| void SgAsmGenericSection::grab_content | ( | ) |
Saves a reference to the original file data for a section based on the sections current offset and size.
Once we do this, changing the offset or size of the file will not affect the original data. The original data can be extended, however, by calling SgAsmGenericSection::extend(), which is typically done during parsing.
| virtual SgAsmGenericSection* SgAsmGenericSection::parse | ( | ) | [virtual] |
Reimplemented in SgAsmPEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, and SgAsmCoffSymbolTable.
| void SgAsmGenericSection::dump | ( | FILE * | , | |
| const char * | prefix, | |||
| ssize_t | idx | |||
| ) | const [virtual] |
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual bool SgAsmGenericSection::reallocate | ( | ) | [inline, virtual] |
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEStringSection, and SgAsmPESectionTable.
| void SgAsmGenericSection::unparse | ( | std::ostream & | f | ) | const [virtual] |
Write a section back to the file.
This is the generic version that simply writes the content. Subclasses should override this.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPEImportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, and SgAsmLEEntryTable.
| void SgAsmGenericSection::unparse | ( | std::ostream & | , | |
| const ExtentMap & | ||||
| ) | const |
Write just the specified regions back to the file.
| void SgAsmGenericSection::unparse_holes | ( | std::ostream & | ) | const |
Write holes (unreferenced areas) back to the file.
| SgAsmGenericHeader * SgAsmGenericSection::is_file_header | ( | ) |
True (the SgAsmGenericHeader pointer) if this section is also a top-level file header, false (NULL) otherwise.
| rose_addr_t SgAsmGenericSection::get_size | ( | ) | const |
true if section represents a top level file header
The original size of the section (available when parse() is called for the function, but possibly updated while parsing) is available through the size of the original data: p_data.size()
| void SgAsmGenericSection::set_size | ( | rose_addr_t | size | ) | [virtual] |
Adjust the current size of a section.
This is virtual because some sections may need to do something special. This function should not adjust the size of other sections, or the mapping of any section (see SgAsmGenericFile::resize() for that).
Reimplemented in SgAsmElfStringSection, and SgAsmPEStringSection.
| rose_addr_t SgAsmGenericSection::get_offset | ( | ) | const |
Returns current file offset of section in bytes.
| void SgAsmGenericSection::set_offset | ( | rose_addr_t | offset | ) | [virtual] |
Adjust the current offset of a section.
This is virtual because some sections may need to do something special. This function should not adjust the offset of other sections, or the mapping of any section.
| rose_addr_t SgAsmGenericSection::get_end_offset | ( | ) | const |
Move a section w/o regard to other sections or mapping.
| void SgAsmGenericSection::extend | ( | rose_addr_t | size | ) |
file offset for end of section
This is function is considered to be part of the parsing and construction of a section--it changes the part of the file that's considered the "original size" of the section. To adjust the size of a section after the executable file is parsed, see SgAsmGenericFile::resize(). Sections are allowed to extend beyond the end of the file and the original data (p_data) is extended only up to the end of the file.
| rose_addr_t SgAsmGenericSection::write | ( | std::ostream & | f, | |
| rose_addr_t | offset, | |||
| size_t | bufsize, | |||
| const void * | buf | |||
| ) | const |
make section larger by extending the end
| f | Output steam to which to write | |
| offset | Byte offset relative to start of this section | |
| bufsize | Size of buf in bytes | |
| buf | Buffer of bytes to be written |
| rose_addr_t SgAsmGenericSection::write | ( | std::ostream & | , | |
| rose_addr_t | offset, | |||
| const std::string & | str | |||
| ) | const |
| rose_addr_t SgAsmGenericSection::write | ( | std::ostream & | , | |
| rose_addr_t | offset, | |||
| char | c | |||
| ) | const |
| rose_addr_t SgAsmGenericSection::write | ( | std::ostream & | , | |
| rose_addr_t | offset, | |||
| const SgFileContentList & | buf | |||
| ) | const |
| rose_addr_t SgAsmGenericSection::write | ( | std::ostream & | , | |
| rose_addr_t | offset, | |||
| const SgUnsignedCharList & | buf | |||
| ) | const |
| rose_addr_t SgAsmGenericSection::write_uleb128 | ( | unsigned char * | , | |
| rose_addr_t | offset, | |||
| uint64_t | ||||
| ) | const |
Encode an unsigned value as LEB128 and return the next offset.
| rose_addr_t SgAsmGenericSection::write_sleb128 | ( | unsigned char * | , | |
| rose_addr_t | offset, | |||
| int64_t | ||||
| ) | const |
Encode a signed value as LEB128 and return the next offset.
| size_t SgAsmGenericSection::read_content | ( | rose_addr_t | start_offset, | |
| void * | dst_buf, | |||
| rose_addr_t | size, | |||
| bool | strict = true | |||
| ) |
Reads data from a file.
Reads up to size bytes of data beginning at byte start_offset from the beginning of the file, placing the results in dst_buf and returning the number of bytes read. The return value could be smaller than size if the end-of-file is reached. If the return value is smaller than size then one of two things happen: if strict is set (the default) then an SgAsmExecutableFileFormat::ShortRead exception is thrown; otherwise the dst_buf will be padded with zero bytes so that exactly size bytes of dst_buf are always initialized.
| size_t SgAsmGenericSection::read_content | ( | const MemoryMap * | map, | |
| rose_addr_t | start_rva, | |||
| void * | dst_buf, | |||
| rose_addr_t | size, | |||
| bool | strict = true | |||
| ) |
Reads data from a file.
Reads up to size bytes of data beginning at byte start_rva in the mapped address space and placing the results in dst_buf and returning the number of bytes read. The return value could be smaller than size if the reading encounters virtual addresses that are not mapped. When an unmapped virtual address is encountered the reading stops (even if subsequent virtual addresses are defined) and one of two things happen: if strict is set (the default) then an MemoryMap::NotMapped exception is thrown, otherwise the dst_buf is padded with zeros so that all size bytes are initialized. The map is used to map virtual addresses to file offsets; if map is NULL then the map defined in the underlying file is used.
| size_t SgAsmGenericSection::read_content | ( | const MemoryMap * | map, | |
| rose_rva_t | rva, | |||
| void * | dst_buf, | |||
| rose_addr_t | size, | |||
| bool | strict = true | |||
| ) | [inline] |
| size_t SgAsmGenericSection::read_content_local | ( | rose_addr_t | start_offset, | |
| void * | dst_buf, | |||
| rose_addr_t | size, | |||
| bool | strict = true | |||
| ) |
Reads data from a file.
This behaves the same as read_content() except the start_offset is relative to the beginning of this section. Reading past the end of the section is not allowed and treated as a short read, and one of two things happen: if strict is set (the default) then an SgAsmExecutableFileFormat::ShortRead exception is thrown, otherwise the result is zero padded so as to contain exactly size bytes.
| std::string SgAsmGenericSection::read_content_str | ( | const MemoryMap * | map, | |
| rose_addr_t | start_rva, | |||
| bool | strict = true | |||
| ) |
Reads a string from the file.
The string begins at the specified virtual address and continues until the first NUL byte or until we reach an address that is not mapped. However, if strict is set (the default) and we reach an unmapped address then an MemoryMap::NotMapped exception is thrown. The map defines the mapping from virtual addresses to file offsets; if map is NULL then the map defined in the underlying file is used.
| std::string SgAsmGenericSection::read_content_str | ( | const MemoryMap * | map, | |
| rose_rva_t | rva, | |||
| bool | strict = true | |||
| ) | [inline] |
| std::string SgAsmGenericSection::read_content_str | ( | rose_addr_t | abs_offset, | |
| bool | strict = true | |||
| ) |
Reads a string from the file.
The string begins at the specified absolute file offset and continues until the first NUL byte or end of file is reached. However, if strict is set (the default) and we reach the end-of-file then an SgAsmExecutableFileFormat::ShortRead exception is thrown.
| std::string SgAsmGenericSection::read_content_local_str | ( | rose_addr_t | rel_offset, | |
| bool | strict = true | |||
| ) |
Reads a string from the file.
The string begins at the specified file offset relative to the start of this section and continues until the first NUL byte or the end of section is reached. However, if strict is set (the default) and we reach the end-of-section then an SgAsmExecutableFileFormat::ShortRead exception is thrown.
| SgUnsignedCharList SgAsmGenericSection::read_content_local_ucl | ( | rose_addr_t | rel_offset, | |
| rose_addr_t | size | |||
| ) |
Reads content of a section and returns it as a container.
The returned container will always have exactly size byte. If size bytes are not available in this section at the specified offset then the container will be zero padded.
| int64_t SgAsmGenericSection::read_content_local_sleb128 | ( | rose_addr_t * | rel_offset, | |
| bool | strict = true | |||
| ) |
Extract a signed LEB128 value and adjust rel_offset according to how many bytes it occupied.
If strict is set (the default) and the end of the section is reached then throw an SgAsmExecutableFileFormat::ShortRead exception. Upon return, the rel_offset will be adjusted to point to the first byte after the LEB128 value.
| uint64_t SgAsmGenericSection::read_content_local_uleb128 | ( | rose_addr_t * | rel_offset, | |
| bool | strict = true | |||
| ) |
Extract an unsigned LEB128 value and adjust rel_offset according to how many bytes it occupied.
If strict is set (the default) and the end of the section is reached then throw an SgAsmExecutableFileFormat::ShortRead exception. Upon return, the rel_offset will be adjusted to point to the first byte after the LEB128 value.
| unsigned char * SgAsmGenericSection::writable_content | ( | size_t | nbytes | ) |
Sections typically point into the memory mapped, read-only file stored in the SgAsmGenericFile parent initialized by calling grab_content() (or indirectly by calling parse()).
This is also the same data which is, by default, written back out to the new file during unparse(). Programs modify section content by either overriding the unparse() method or by modifying the p_data values. But in order to modify p_data we have to make sure that it's pointing to a read/write memory pool. This function replaces the read-only memory pool with a new one containing nbytes bytes of zeros.
| ExtentMap SgAsmGenericSection::get_referenced_extents | ( | ) | const |
Returns a list of parts of a single section that have been referenced.
The offsets are relative to the start of the section.
| ExtentMap SgAsmGenericSection::get_unreferenced_extents | ( | ) | const |
| bool SgAsmGenericSection::is_mapped | ( | ) | const |
Returns whether section desires to be mapped to memory.
| void SgAsmGenericSection::clear_mapped | ( | ) |
True iff non-zero mapped address and size.
| rose_addr_t SgAsmGenericSection::get_mapped_size | ( | ) | const |
Set mapped address and size to zero (unmapped).
| void SgAsmGenericSection::set_mapped_size | ( | rose_addr_t | size | ) | [virtual] |
Resizes a mapped section without consideration of other sections that might be mapped.
See also SgAsmGenericFile::mapped_resize().
| rose_addr_t SgAsmGenericSection::get_mapped_preferred_rva | ( | ) | const |
Returns relative virtual address w.r.t., base address of header.
| void SgAsmGenericSection::set_mapped_preferred_rva | ( | rose_addr_t | ) | [virtual] |
Moves a mapped section without consideration of other sections that might be mapped.
| rose_addr_t SgAsmGenericSection::get_base_va | ( | ) | const |
Returns base virtual address for a section, or zero if the section is not associated with a header.
Reimplemented in SgAsmGenericHeader.
| rose_addr_t SgAsmGenericSection::get_mapped_preferred_va | ( | ) | const |
Returns (non-relative) virtual address if mapped, zero otherwise.
| rose_addr_t SgAsmGenericSection::get_va_offset | ( | rose_addr_t | va | ) | const |
Returns the file offset associated with the virtual address of a mapped section.
NOTE: The MemoryMap class is a better interface to this same information. [RPM 2009-09-09]
| rose_addr_t SgAsmGenericSection::get_rva_offset | ( | rose_addr_t | rva | ) | const |
Returns the file offset associated with the relative virtual address of a mapped section.
NOTE: The MemoryMap class is a better interface to this same information. [RPM 2009-09-09]
| SgAsmGenericString * SgAsmGenericSection::get_name | ( | ) | const |
Accessors for section name.
Setting the section name makes the SgAsmGenericString node a child of the section.
| void SgAsmGenericSection::set_name | ( | SgAsmGenericString * | s | ) |
Same as standard ROSETTA accessor.
| Extent SgAsmGenericSection::get_file_extent | ( | ) | const |
Like std accessor but sets parent of 's'.
| Extent SgAsmGenericSection::get_mapped_preferred_extent | ( | ) | const |
Returns the memory extent for a mapped section.
If the section is not mapped then offset and size will be zero
| bool SgAsmGenericSection::align | ( | ) |
Increase file offset and mapping address to satisfy alignment constraints.
This is typically done when initializing a new section. The constructor places the new section at the end of the file before it knows what the alignment constraints will be. The user should then set the alignment constraints (see set_file_alignment() and set_mapped_alignment()) and call this method. This method must be called before any additional sections are appended to the file.
The file offset and memory mapping address are adjusted independently.
On the other hand, if additional sections are in the way, they must first be moved out of the way with the SgAsmGenericFile::shift_extend() method.
Returns true if the file offset and/or mapping address changed as a result of this call.
| void SgAsmGenericSection::ctor | ( | SgAsmGenericFile * | ef, | |
| SgAsmGenericHeader * | hdr | |||
| ) | [protected] |
Section constructors set the optional section header relationship--a bidirectional link between this new section and its optional, single header.
This new section points to its header and the header contains a list that points to this new section. The section-to-header part of the link is deleted by the default destructor by virtue of being a simple pointer, but we also need to delete the other half of the link in the destructors.
| virtual std::string SgAsmGenericSection::class_name | ( | ) | const [virtual] |
Copies AST (whole subtree, depending on the SgCopyHelp class returns a string representing the class name.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual VariantT SgAsmGenericSection::variantT | ( | ) | const [virtual] |
returns new style SageIII enum values
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| void* SgAsmGenericSection::operator new | ( | size_t | size | ) |
returns pointer to newly allocated IR node
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| void SgAsmGenericSection::operator delete | ( | void * | pointer, | |
| size_t | size | |||
| ) |
deallocated memory for IR node (returns memory to memory pool for reuse)
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| void SgAsmGenericSection::operator delete | ( | void * | pointer | ) |
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| static size_t SgAsmGenericSection::numberOfNodes | ( | ) | [static] |
Returns the total number of IR nodes of this type.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| static size_t SgAsmGenericSection::memoryUsage | ( | ) | [static] |
Returns the size in bytes of the total memory allocated for all IR nodes of this type.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual std::vector<SgNode*> SgAsmGenericSection::get_traversalSuccessorContainer | ( | ) | [virtual] |
FOR INTERNAL USE within ROSE traverals mechanism only.
This function builds and returns a copy of ordered container holding pointers to children of this node in a traversal. It is associated with the definition of a tree that is travered by the AST traversal mechanism; a tree that is embeded in the AST (which is a more general graph). This function is used within the implementation of the AST traversal and has a semantics may change in subtle ways that makes it difficult to use in user code. It can return unexpected data members and thus the order and the number of elements is unpredicable and subject to change.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual std::vector<std::string> SgAsmGenericSection::get_traversalSuccessorNamesContainer | ( | ) | [virtual] |
FOR INTERNAL USE within ROSE traverals mechanism only.
This function builds and returns a copy of ordered container holding strings used to name data members that are traversed in the IR node. It is associated with the definition of a tree that is travered by the AST traversal mechanism; a tree that is embeded in the AST (which is a more general graph). This function is used within the implementation of the AST traversal and has a semantics may change in subtle ways that makes it difficult to use in user code. It can return unexpected data members and thus the order and the number of elements is unpredicable and subject to change.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual size_t SgAsmGenericSection::get_numberOfTraversalSuccessors | ( | ) | [virtual] |
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual SgNode* SgAsmGenericSection::get_traversalSuccessorByIndex | ( | size_t | idx | ) | [virtual] |
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual size_t SgAsmGenericSection::get_childIndex | ( | SgNode * | child | ) | [virtual] |
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual RTIReturnType SgAsmGenericSection::roseRTI | ( | ) | [virtual] |
FOR INTERNAL USE Access to Runtime Type Information (RTI) for this IR nodes.
This function provides runtime type information for accessing the structure of the current node. It is useful for generating code which would dump out or rebuild IR nodes.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual const char* SgAsmGenericSection::sage_class_name | ( | ) | const [virtual] |
returns a C style string (char*) representing the class name
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| void SgAsmGenericSection::executeVisitorMemberFunction | ( | ROSE_VisitorPattern & | visitor | ) |
FOR INTERNAL USE Support for visitor pattern.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual void SgAsmGenericSection::accept | ( | ROSE_VisitorPattern & | visitor | ) | [virtual] |
DXN (08/09/2010): support for the classic visitor pattern done in GoF.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| static void SgAsmGenericSection::traverseMemoryPoolNodes | ( | ROSE_VisitTraversal & | visit | ) | [static] |
FOR INTERNAL USE Support for visitor pattern.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| static void SgAsmGenericSection::traverseMemoryPoolVisitorPattern | ( | ROSE_VisitorPattern & | visitor | ) | [static] |
FOR INTERNAL USE Support for visitor pattern.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| static void SgAsmGenericSection::visitRepresentativeNode | ( | ROSE_VisitTraversal & | visit | ) | [static] |
FOR INTERNAL USE Support for type-based traversal.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual bool SgAsmGenericSection::isInMemoryPool | ( | ) | [virtual] |
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the heap.
The AST File I/O depends upon the allocation of IR nodes being from the heap, stack based or global IR nodes should not appear in the AST if it will be written out to a file and read back in. To enforce this concept, this function implements a test to verify that the IR node can be found on the heap and is part of a larger test of the whole AST. This test must pass before the AST can be written out to a file. This is part of a compromise in the design of the AST File I/O to support binary streaming of data to files; for performance. It is also rather difficult, but possible, to build a useful AST with IR nodes allocated on the stack or frm global scope, this test filters out such cased from being used with the AST File I/O mechanism.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual void SgAsmGenericSection::checkDataMemberPointersIfInMemoryPool | ( | ) | [virtual] |
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the heap.
The AST File I/O depends upon the allocation of IR nodes being from the heap, stack based or global IR nodes should not appear in the AST if it will be written out to a file and read back in. To enforce this concept, this function implements a test to verify that the IR node can be found on the heap and is part of a larger test of the whole AST. This test must pass before the AST can be written out to a file. This is part of a compromise in the design of the AST File I/O to support binary streaming of data to files; for performance. It is also rather difficult, but possible, to build a useful AST with IR nodes allocated on the stack or frm global scope, this test filters out such cased from being used with the AST File I/O mechanism.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual std::vector<std::pair<SgNode*,std::string> > SgAsmGenericSection::returnDataMemberPointers | ( | ) | const [virtual] |
FOR INTERNAL USE Returns STL vector of pairs of SgNode* and strings for use in AST tools
This functions is part of general support for many possible tools to operate on the AST. The forms a list of ALL IR node pointers used by each IR node, and is a supperset of the get_traversalSuccessorContainer(). It is (I think) less than the set of pointers used by the AST file I/O. This is part of work implemented by Andreas, and support tools such as the AST graph generation.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual void SgAsmGenericSection::processDataMemberReferenceToPointers | ( | ReferenceToPointerHandler * | ) | [virtual] |
FOR INTERNAL USE Processes pairs of references to SgNode* and strings for use in AST tools
This functions similar to returnDataMemberPointers() except that it passes references to a handler object. As a result there is FAR more damage that can be done by using this function, but it is type-safe. This is provided for support of internal tools that operate on the AST, e.g the AST Merge mechanism.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| virtual long SgAsmGenericSection::getChildIndex | ( | SgNode * | childNode | ) | const [virtual] |
FOR INTERNAL USE Returns a unique index value for the childNode in the list of children at this IR node.
This function returns a unique value for the input childNode in set of children at this IR node. Note that a negative value indicates that the input node is not a child. This is the basis for the implementation of the isChild(SgNode*) member function. Data members that are NULL in the IR node are counted internally (so that this function returns value that could be statically defined, and so are not dynamically determined).
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| SgAsmGenericSection* SgAsmGenericSection::addRegExpAttribute | ( | std::string | s, | |
| AstRegExAttribute * | a | |||
| ) |
Support for AST matching using regular expression.
This support is incomplete and the subject of current research to define RegEx trees to support inexact matching.
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| SgAsmGenericFile* SgAsmGenericSection::get_file | ( | ) | const |
| void SgAsmGenericSection::set_file | ( | SgAsmGenericFile * | file | ) |
| SgAsmGenericHeader* SgAsmGenericSection::get_header | ( | ) | const |
| void SgAsmGenericSection::set_header | ( | SgAsmGenericHeader * | header | ) |
| rose_addr_t SgAsmGenericSection::get_file_alignment | ( | ) | const |
| void SgAsmGenericSection::set_file_alignment | ( | rose_addr_t | file_alignment | ) |
| SgFileContentList SgAsmGenericSection::get_data | ( | ) | const |
| void SgAsmGenericSection::set_data | ( | SgFileContentList | data | ) |
| SgAsmGenericSection::SectionPurpose SgAsmGenericSection::get_purpose | ( | ) | const |
| void SgAsmGenericSection::set_purpose | ( | SgAsmGenericSection::SectionPurpose | purpose | ) |
| bool SgAsmGenericSection::get_synthesized | ( | ) | const |
| void SgAsmGenericSection::set_synthesized | ( | bool | synthesized | ) |
| int SgAsmGenericSection::get_id | ( | ) | const |
| void SgAsmGenericSection::set_id | ( | int | id | ) |
| rose_addr_t SgAsmGenericSection::get_mapped_alignment | ( | ) | const |
| void SgAsmGenericSection::set_mapped_alignment | ( | rose_addr_t | mapped_alignment | ) |
| bool SgAsmGenericSection::get_mapped_rperm | ( | ) | const |
| void SgAsmGenericSection::set_mapped_rperm | ( | bool | mapped_rperm | ) |
| bool SgAsmGenericSection::get_mapped_wperm | ( | ) | const |
| void SgAsmGenericSection::set_mapped_wperm | ( | bool | mapped_wperm | ) |
| bool SgAsmGenericSection::get_mapped_xperm | ( | ) | const |
| void SgAsmGenericSection::set_mapped_xperm | ( | bool | mapped_xperm | ) |
| bool SgAsmGenericSection::get_contains_code | ( | ) | const |
| void SgAsmGenericSection::set_contains_code | ( | bool | contains_code | ) |
| rose_addr_t SgAsmGenericSection::get_mapped_actual_va | ( | ) | const |
| void SgAsmGenericSection::set_mapped_actual_va | ( | rose_addr_t | mapped_actual_va | ) |
friend class AST_FILE_IO [friend] |
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
friend class SgAsmGenericSectionStorageClass [friend] |
friend class AstSpecificDataManagingClass [friend] |
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
friend class AstSpecificDataManagingClassStorageClass [friend] |
Reimplemented from SgAsmExecutableFileFormat.
Reimplemented in SgAsmGenericHeader, SgAsmPEFileHeader, SgAsmLEFileHeader, SgAsmNEFileHeader, SgAsmDOSFileHeader, SgAsmElfFileHeader, SgAsmElfSection, SgAsmElfSymbolSection, SgAsmElfRelocSection, SgAsmElfDynamicSection, SgAsmElfStringSection, SgAsmElfNoteSection, SgAsmElfEHFrameSection, SgAsmElfSymverSection, SgAsmElfSymverDefinedSection, SgAsmElfSymverNeededSection, SgAsmElfSectionTable, SgAsmElfSegmentTable, SgAsmPESection, SgAsmPEImportSection, SgAsmPEExportSection, SgAsmPEStringSection, SgAsmPESectionTable, SgAsmDOSExtendedHeader, SgAsmCoffSymbolTable, SgAsmNESection, SgAsmNESectionTable, SgAsmNENameTable, SgAsmNEModuleTable, SgAsmNEStringTable, SgAsmNEEntryTable, SgAsmNERelocTable, SgAsmLESection, SgAsmLESectionTable, SgAsmLENameTable, SgAsmLEPageTable, SgAsmLEEntryTable, and SgAsmLERelocTable.
| SgAsmGenericSection* isSgAsmGenericSection | ( | SgNode * | s | ) | [friend] |
Casts pointer from base class to derived class.
| const SgAsmGenericSection* isSgAsmGenericSection | ( | const SgNode * | s | ) | [friend] |
Casts pointer from base class to derived class (for const pointers).
| SgAsmGenericSection* SgAsmGenericSection_getPointerFromGlobalIndex | ( | unsigned long | globalIndex | ) | [friend] |
Constructor for use by AST File I/O MechanismTypedef used for low level memory access. Typedef used to hold memory addresses as values. Methods to find the pointer to a global and local index.
| unsigned long SgAsmGenericSection_getNumberOfValidNodesAndSetGlobalIndexInFreepointer | ( | unsigned | long | ) | [friend] |
Get the size of the memory pool.
It actually returns the size of the whole blocks allocated, no matter they contain valid pointers or not.
| void SgAsmGenericSection_clearMemoryPool | ( | ) | [friend] |
| void SgAsmGenericSection_extendMemoryPoolForFileIO | ( | unsigned | long | ) | [friend] |
| void SgAsmGenericSection_getNextValidPointer | ( | std::pair< SgAsmGenericSection *, std::vector< unsigned char * >::const_iterator > & | ) | [friend] |
| void SgAsmGenericSection_resetValidFreepointers | ( | ) | [friend] |
unsigned char* SgAsmGenericSection::local_data_pool [private] |
This is an optional local, writable pool for the p_data member.
Normally a section will point into the pool for its SgAsmGenericFile which is memory-mapped (read-only) from the actual file being parsed. The default unparsing action is to write the original data back to the file. By allowing a section to allocate its own pool for p_data we create a very easy way to get data into the unparsed file (the alternative is to derive a new class and override the unparse() method).
SgAsmGenericFile* SgAsmGenericSection::p_file [protected] |
SgAsmGenericHeader* SgAsmGenericSection::p_header [protected] |
rose_addr_t SgAsmGenericSection::p_size [protected] |
rose_addr_t SgAsmGenericSection::p_offset [protected] |
rose_addr_t SgAsmGenericSection::p_file_alignment [protected] |
SgFileContentList SgAsmGenericSection::p_data [protected] |
bool SgAsmGenericSection::p_synthesized [protected] |
int SgAsmGenericSection::p_id [protected] |
SgAsmGenericString* SgAsmGenericSection::p_name [protected] |
This is the relative virtual address where the section prefers to be mapped.
The RVA where the section will ultimately be mapped by the loader might be different due to file and/or memory alignment constraints and conflicts with other sections.
rose_addr_t SgAsmGenericSection::p_mapped_size [protected] |
rose_addr_t SgAsmGenericSection::p_mapped_alignment [protected] |
bool SgAsmGenericSection::p_mapped_rperm [protected] |
bool SgAsmGenericSection::p_mapped_wperm [protected] |
bool SgAsmGenericSection::p_mapped_xperm [protected] |
bool SgAsmGenericSection::p_contains_code [protected] |
If a section is known to contain code then this data member is set.
Part of the process of parsing a binary file is to look at the symbol tables and if any function symbol points into a section then the entire section is marked as containing code. This is necessary because ELF Object Files (*.o files) contain one ELF Section per function, none of which have a memory mapping specification. By marking those sections as containing code, the LoaderELFObj class, knows that the section should be mapped to virtual memory for disassembly.
rose_addr_t SgAsmGenericSection::p_mapped_actual_va [protected] |
This is the virtual address where ROSE simulates a loader mapping the section.
The actual mapping is sometimes different than the preferred mapping indicated in the section table due to file and/or memory alignment constraints or conflicts with other sections. The only place values are assigned to this data member is in the BinaryLoader class and subclasses thereof.
The address corresponds to the latest call into the Loader classes. Depending on the loader employed, it's possible for a section to be mapped, the p_mapped_actual_va value to be set, and then some other section to be mapped over the top of all or part of the first section. In that case, the p_mapped_actual_va of the first section is not reset to zero. The return value is not conditional upon is_mapped() since that predicate applies only to preferred mapping attributes.
1.4.7