ROSE 0.11.145.147
SgAsmGenericSection.h
1
2#ifndef ROSE_SgAsmGenericSection_H
3#define ROSE_SgAsmGenericSection_H
4#include <RoseFirst.h>
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmExecutableFileFormat.h>
7
8
9
10/* #line 1 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
11
12// WARNING -- GENERATED CODE -- DO NOT MODIFY THIS CODE -- WARNING!
13// This code is automatically generated for each
14// terminal and non-terminal within the defined
15// grammar. There is a simple way to change the
16// code to fix bugs etc. See the ROSE README file
17// for directions.
18
19// tps: (02/22/2010): Adding DLL export requirements
20#include "rosedll.h"
21
22// predeclarations for SgAsmGenericSection
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmGenericSection.h" */
25/* #line 30935 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
26
27#include <Rose/BinaryAnalysis/AddressIntervalSet.h>
28#include <Rose/BinaryAnalysis/MemoryMap.h>
29#include <Rose/BinaryAnalysis/RelativeVirtualAddress.h>
30#include <sageContainer.h>
31
32#ifdef ROSE_SgAsmGenericSection_IMPL
33#include <SgAsmBasicString.h>
34#endif
35
36
37/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
38
39/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
40
41#if !defined(DOCUMENTATION)
42// Class Definition for SgAsmGenericSection
43class ROSE_DLL_API SgAsmGenericSection : public SgAsmExecutableFileFormat
44 {
45 public:
46
47
48/* #line 49 "../../../src/frontend/SageIII//SgAsmGenericSection.h" */
49
50 virtual SgNode* copy ( SgCopyHelp& help) const override;
51// Start of memberFunctionString
52/* #line 31069 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
53
54
55 //----------------------- Boost serialization for SgAsmGenericSection -----------------------
56#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
57private:
58 friend class boost::serialization::access;
59
60 template<class S>
61 void serialize(S &s, const unsigned /*version*/) {
62 debugSerializationBegin("SgAsmGenericSection");
63 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
64 s & BOOST_SERIALIZATION_NVP(p_file);
65 s & BOOST_SERIALIZATION_NVP(p_header);
66 s & BOOST_SERIALIZATION_NVP(p_size);
67 s & BOOST_SERIALIZATION_NVP(p_offset);
68 s & BOOST_SERIALIZATION_NVP(p_fileAlignment);
69 s & BOOST_SERIALIZATION_NVP(p_data);
70 s & BOOST_SERIALIZATION_NVP(p_purpose);
71 s & BOOST_SERIALIZATION_NVP(p_synthesized);
72 s & BOOST_SERIALIZATION_NVP(p_id);
73 s & BOOST_SERIALIZATION_NVP(p_name);
74 s & BOOST_SERIALIZATION_NVP(p_shortName);
75 s & BOOST_SERIALIZATION_NVP(p_mappedPreferredRva);
76 s & BOOST_SERIALIZATION_NVP(p_mappedSize);
77 s & BOOST_SERIALIZATION_NVP(p_mappedAlignment);
78 s & BOOST_SERIALIZATION_NVP(p_mappedReadPermission);
79 s & BOOST_SERIALIZATION_NVP(p_mappedWritePermission);
80 s & BOOST_SERIALIZATION_NVP(p_mappedExecutePermission);
81 s & BOOST_SERIALIZATION_NVP(p_containsCode);
82 s & BOOST_SERIALIZATION_NVP(p_mappedActualVa);
83 debugSerializationEnd("SgAsmGenericSection");
84 }
85#endif // ROSE_HAVE_BOOST_SERIALIZATION_LIB
87 // Local types
89public:
94 enum SectionPurpose {
95 SP_UNSPECIFIED,
96 SP_PROGRAM,
97 SP_HEADER,
98 SP_SYMTAB,
99 SP_OTHER
100 };
101
103 // Properties
105public:
106public:
110 SgAsmGenericFile* const& get_file() const;
111 void set_file(SgAsmGenericFile* const&);
114public:
118 SgAsmGenericHeader* const& get_header() const;
119 void set_header(SgAsmGenericHeader* const&);
122public:
133 rose_addr_t get_size() const;
134 virtual void set_size(rose_addr_t);
136public:
144 // Starting file offset of the section
145
146 rose_addr_t get_offset() const;
147 virtual void set_offset(rose_addr_t);
149public:
155 rose_addr_t const& get_fileAlignment() const;
156 void set_fileAlignment(rose_addr_t const&);
159public:
165 SgFileContentList const& get_data() const;
166 void set_data(SgFileContentList const&);
169public:
173 SgAsmGenericSection::SectionPurpose const& get_purpose() const;
174 void set_purpose(SgAsmGenericSection::SectionPurpose const&);
177public:
183 bool const& get_synthesized() const;
184 void set_synthesized(bool const&);
187public:
193 int const& get_id() const;
194 void set_id(int const&);
197public:
205 SgAsmGenericString* const& get_name() const;
208public:
216 void set_shortName(std::string const&);
217 std::string get_shortName() const;
219public:
229 rose_addr_t const& get_mappedPreferredRva() const;
230 virtual void set_mappedPreferredRva(rose_addr_t);
232public:
238 rose_addr_t const& get_mappedSize() const;
239 virtual void set_mappedSize(rose_addr_t);
241public:
245 rose_addr_t const& get_mappedAlignment() const;
246 void set_mappedAlignment(rose_addr_t const&);
249public:
253 bool const& get_mappedReadPermission() const;
254 void set_mappedReadPermission(bool const&);
257public:
261 bool const& get_mappedWritePermission() const;
262 void set_mappedWritePermission(bool const&);
265public:
269 bool const& get_mappedExecutePermission() const;
270 void set_mappedExecutePermission(bool const&);
273public:
283 bool const& get_containsCode() const;
284 void set_containsCode(bool const&);
287public:
301 rose_addr_t const& get_mappedActualVa() const;
302 void set_mappedActualVa(rose_addr_t const&);
305 // Non-property data members
307private:
308protected: // Allows local_data_pool to be initialized by subclasses. Note, destruction is problematic, freeing non-allocated ptr.
309 // Set breakpoint in malloc_error_break to debug [Rasmussen, 2024.03.02]
310 /* This is an optional local, writable pool for the p_data member. Normally a section will point into the pool
311 * for its SgAsmGenericFile which is memory-mapped (read-only) from the actual file being parsed. The default
312 * unparsing action is to write the original data back to the file. By allowing a section to allocate its own
313 * pool for `data` we create a very easy way to get data into the unparsed file (the alternative is to derive
314 * a new class and override the unparse() method). */
315 unsigned char *local_data_pool;
316
318 // Functions
320public:
328
330 static void dumpContainingSections(FILE*, const std::string &prefix, Rose::BinaryAnalysis::RelativeVirtualAddress,
331 const SgAsmGenericSectionPtrList&);
332
337 void grabContent();
338
342 virtual SgAsmGenericSection* parse();
343
345 virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
346
348 virtual bool reallocate() { return false; }
349
353 virtual void unparse(std::ostream&) const;
354
356 void unparse(std::ostream&, const ExtentMap&) const;
357
359 void unparseHoles(std::ostream&) const;
360
365 SgAsmGenericHeader *isFileHeader();
366
368 rose_addr_t get_endOffset() const;
369
376 void extend(rose_addr_t nbytes);
377
391 rose_addr_t write(std::ostream &f, rose_addr_t offset, size_t bufsize, const void *buf) const;
392 rose_addr_t write(std::ostream &f, rose_addr_t offset, const std::string &str) const;
393 rose_addr_t write(std::ostream &f, rose_addr_t offset, char c) const;
394 rose_addr_t write(std::ostream &f, rose_addr_t offset, const SgFileContentList &buf) const;
395 rose_addr_t write(std::ostream &f, rose_addr_t offset, const SgUnsignedCharList &buf) const;
401 rose_addr_t writeUleb128(unsigned char*, rose_addr_t offset, uint64_t) const;
402
406 rose_addr_t writeSleb128(unsigned char*, rose_addr_t offset, int64_t) const;
407
415 size_t readContent(rose_addr_t abs_offset, void *dst_buf, rose_addr_t size, bool strict=true);
416
428 size_t readContent(const Rose::BinaryAnalysis::MemoryMap::Ptr&, rose_addr_t start, void *dst_buf,
429 rose_addr_t size, bool strict=true);
431 void *dst_buf, rose_addr_t size, bool strict=true);
440 size_t readContentLocal(rose_addr_t rel_offset, void *dst_buf, rose_addr_t size, bool strict=true);
441
448 std::string readContentString(const Rose::BinaryAnalysis::MemoryMap::Ptr&, rose_addr_t va, bool strict=true);
449
457 std::string readContentString(rose_addr_t abs_offset, bool strict=true);
459 bool strict=true);
467 std::string readContentLocalString(rose_addr_t rel_offset, bool strict=true);
468
473 SgUnsignedCharList readContentLocalUcl(rose_addr_t rel_offset, rose_addr_t size);
474
480 int64_t readContentLocalSleb128(rose_addr_t *rel_offset, bool strict=true);
481
487 uint64_t readContentLocalUleb128(rose_addr_t *rel_offset, bool strict=true);
488
496 unsigned char *writableContent(size_t nbytes);
497
503 Rose::BinaryAnalysis::AddressIntervalSet get_referencedExtents() const;
504
510 Rose::BinaryAnalysis::AddressIntervalSet get_unreferencedExtents() const;
511
515 bool isMapped() const;
516
520 void clearMapped();
521
526 rose_addr_t get_baseVa() const;
527
531 rose_addr_t get_mappedPreferredVa() const;
532
537 rose_addr_t get_vaOffset(rose_addr_t va) const;
538
543 rose_addr_t get_rvaOffset(rose_addr_t rva) const;
544
548 Extent get_fileExtent() const;
549
554 Extent get_mappedPreferredExtent() const;
555
569 bool align();
570
571protected:
572 virtual void destructorHelper() override;
573
575 // Deprecated 2023-11
577public:
578 rose_addr_t get_file_alignment() const ROSE_DEPRECATED("use get_fileAlignment");
579 void set_file_alignment(rose_addr_t) ROSE_DEPRECATED("use set_fileAlignment");
580 std::string get_short_name() const ROSE_DEPRECATED("use get_shortName");
581 void set_short_name(const std::string&) ROSE_DEPRECATED("use set_shortName");
582 rose_addr_t get_mapped_preferred_rva() const ROSE_DEPRECATED("use get_mappedPreferredRva");
583 void set_mapped_preferred_rva(rose_addr_t) ROSE_DEPRECATED("use set_mappedPreferredRva");
584 rose_addr_t get_mapped_size() const ROSE_DEPRECATED("use get_mappedSize");
585 void set_mapped_size(rose_addr_t) ROSE_DEPRECATED("use set_mappedSize");
586 rose_addr_t get_mapped_alignment() const ROSE_DEPRECATED("use get_mappedAlignment");
587 void set_mapped_alignment(rose_addr_t) ROSE_DEPRECATED("use set_mappedAlignment");
588 bool get_mapped_rperm() const ROSE_DEPRECATED("use get_mappedReadPermission");
589 void set_mapped_rperm(bool) ROSE_DEPRECATED("use set_mappedReadPermission");
590 bool get_mapped_wperm() const ROSE_DEPRECATED("use get_mappedWritePermission");
591 void set_mapped_wperm(bool) ROSE_DEPRECATED("use set_mappedWritePermission");
592 bool get_mapped_xperm() const ROSE_DEPRECATED("use get_mappedExecutePermission");
593 void set_mapped_xperm(bool) ROSE_DEPRECATED("use set_mappedExecutePermission");
594 bool get_contains_code() const ROSE_DEPRECATED("use get_containsCode");
595 void set_contains_code(bool) ROSE_DEPRECATED("use set_containsCode");
596 rose_addr_t get_mapped_actual_va() const ROSE_DEPRECATED("use get_mappedActualVa");
597 void set_mapped_actual_va(rose_addr_t) ROSE_DEPRECATED("use set_mappedActualVa");
598 static void dump_containing_sections(FILE*, const std::string&, Rose::BinaryAnalysis::RelativeVirtualAddress,
599 const SgAsmGenericSectionPtrList&)
600 ROSE_DEPRECATED("use dumpContainingSections");
601 void grab_content() ROSE_DEPRECATED("use grabContent");
602 void unparse_holes(std::ostream&) const ROSE_DEPRECATED("use unparseHoles");
603 SgAsmGenericHeader *is_file_header() ROSE_DEPRECATED("use isFileHeader");
604 rose_addr_t get_end_offset() const ROSE_DEPRECATED("use get_endOffset");
605 rose_addr_t write_uleb128(unsigned char*, rose_addr_t, uint64_t) const ROSE_DEPRECATED("use writeUleb128");
606 rose_addr_t write_sleb128(unsigned char*, rose_addr_t, int64_t) const ROSE_DEPRECATED("use writeSleb128");
607 size_t read_content(rose_addr_t, void*, rose_addr_t, bool=true) ROSE_DEPRECATED("use readContent");
608 size_t read_content(const Rose::BinaryAnalysis::MemoryMap::Ptr&, rose_addr_t, void*, rose_addr_t, bool=true)
609 ROSE_DEPRECATED("use readContent");
610 size_t read_content(const Rose::BinaryAnalysis::MemoryMap::Ptr&, const Rose::BinaryAnalysis::RelativeVirtualAddress&, void*,
611 rose_addr_t, bool=true)
612 ROSE_DEPRECATED("use readContent");
613 size_t read_content_local(rose_addr_t, void*, rose_addr_t, bool=true) ROSE_DEPRECATED("use readContentLocal");
614 std::string read_content_str(const Rose::BinaryAnalysis::MemoryMap::Ptr&, rose_addr_t, bool=true)
615 ROSE_DEPRECATED("use readContentString");
616 std::string read_content_str(rose_addr_t, bool=true) ROSE_DEPRECATED("use readContentString");
617 std::string read_content_str(const Rose::BinaryAnalysis::MemoryMap::Ptr&, Rose::BinaryAnalysis::RelativeVirtualAddress,
618 bool=true)
619 ROSE_DEPRECATED("use readContentString");
620 std::string read_content_local_str(rose_addr_t, bool=true) ROSE_DEPRECATED("use readContentLocalString");
621 SgUnsignedCharList read_content_local_ucl(rose_addr_t, rose_addr_t) ROSE_DEPRECATED("use readContentLocalUcl");
622 int64_t read_content_local_sleb128(rose_addr_t*, bool=true) ROSE_DEPRECATED("use readContentLocalSleb128");
623 uint64_t read_content_local_uleb128(rose_addr_t*, bool=true) ROSE_DEPRECATED("use readContentLocalUleb128");
624 unsigned char *writable_content(size_t) ROSE_DEPRECATED("use writableContent");
625 Rose::BinaryAnalysis::AddressIntervalSet get_referenced_extents() const ROSE_DEPRECATED("use get_referencedExtents");
626 Rose::BinaryAnalysis::AddressIntervalSet get_unreferenced_extents() const ROSE_DEPRECATED("use get_unreferencedExtents");
627 bool is_mapped() const ROSE_DEPRECATED("use isMapped");
628 void clear_mapped() ROSE_DEPRECATED("use clearMapped");
629 rose_addr_t get_base_va() const ROSE_DEPRECATED("use get_baseVa");
630 rose_addr_t get_mapped_preferred_va() const ROSE_DEPRECATED("use get_mappedPreferredVa");
631 rose_addr_t get_va_offset(rose_addr_t) const ROSE_DEPRECATED("use get_vaOffset");
632 rose_addr_t get_rva_offset(rose_addr_t) const ROSE_DEPRECATED("use get_rvaOffset");
633 Extent get_file_extent() const ROSE_DEPRECATED("use get_fileExtent");
634 Extent get_mapped_preferred_extent() const ROSE_DEPRECATED("use get_mappedPreferredExtent");
635public:
637 virtual ~SgAsmGenericSection();
638
639public:
642
643protected:
650 void initializeProperties();
651
652
653// End of memberFunctionString
654// Start of memberFunctionString
655/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
656
657// *** COMMON CODE SECTION BEGINS HERE ***
658
659 public:
660
661 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
662 // and not required which is required to match the other aspects of the copy mechanism code generation.
663 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
664 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
665 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
666 // virtual SgNode* copy ( const SgCopyHelp & help) const;
667
669 virtual std::string class_name() const override;
670
672 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
673
675 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
676 // static const VariantT static_variant = V_SgAsmGenericSection;
677 enum { static_variant = V_SgAsmGenericSection };
678
679 /* the generated cast function */
681 ROSE_DLL_API friend SgAsmGenericSection* isSgAsmGenericSection( SgNode * s );
682
684 ROSE_DLL_API friend const SgAsmGenericSection* isSgAsmGenericSection( const SgNode * s );
685
686 // ******************************************
687 // * Memory Pool / New / Delete
688 // ******************************************
689
690 public:
692 static const unsigned pool_size; //
694 static std::vector<unsigned char *> pools; //
696 static SgAsmGenericSection * next_node; //
697
699 static unsigned long initializeStorageClassArray(SgAsmGenericSectionStorageClass *); //
700
702 static void clearMemoryPool(); //
703 static void deleteMemoryPool(); //
704
706 static void extendMemoryPoolForFileIO(); //
707
709 static SgAsmGenericSection * getPointerFromGlobalIndex(unsigned long); //
711 static SgAsmGenericSection * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
712
714 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
716 static void resetValidFreepointers(); //
718 static unsigned long getNumberOfLastValidPointer(); //
719
720
721#if defined(INLINE_FUNCTIONS)
723 inline void *operator new (size_t size);
724#else
726 void *operator new (size_t size);
727#endif
729 void operator delete (void* pointer, size_t size);
730
731 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
732 void operator delete (void* pointer)
733 {
734 // This is the generated delete operator...
735 SgAsmGenericSection::operator delete (pointer,sizeof(SgAsmGenericSection));
736 }
737
739 static size_t numberOfNodes();
740
742 static size_t memoryUsage();
743
744 // End of scope which started in IR nodes specific code
745 /* */
746
747 /* name Internal Functions
748 \brief Internal functions ... incomplete-documentation
749
750 These functions have been made public as part of the design, but they are suggested for internal use
751 or by particularly knowledgeable users for specialized tools or applications.
752
753 \internal We could not make these private because they are required by user for special purposes. And
754 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
755
756 */
757
758 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
759 // overridden in every class by *generated* implementation
761 virtual std::vector<SgNode*> get_traversalSuccessorContainer() override;
762 // MS: 06/28/02 container of names of variables or container indices
763 // used used in the traversal to access AST successor nodes
764 // overridden in every class by *generated* implementation
767 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() override;
768
769 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
770 // than all the vector copies. The implementation for these functions is generated for each class.
772 virtual size_t get_numberOfTraversalSuccessors() override;
774 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) override;
776 virtual size_t get_childIndex(SgNode *child) override;
777
778#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
779 // MS: 08/16/2002 method for generating RTI information
781 virtual RTIReturnType roseRTI() override;
782#endif
783 /* */
784
785
786
787 /* name Deprecated Functions
788 \brief Deprecated functions ... incomplete-documentation
789
790 These functions have been deprecated from use.
791 */
792 /* */
793
795 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
796
797 // JJW (10/16/2008): Changed to a single function in Node.code, and put
798 // getVariant() in #if 0 block to prevent confusing Doxygen
799#if 0
801 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
803 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
804#endif
805 /* */
806
807
808
809
810 public:
811 /* name Traversal Support Functions
812 \brief Traversal support functions ... incomplete-documentation
813
814 These functions have been made public as part of the design, but they are suggested for internal use
815 or by particularly knowledgable users for specialized tools or applications.
816 */
817 /* */
818
819 // DQ (11/26/2005): Support for visitor pattern mechanims
820 // (inferior to ROSE traversal mechanism, experimental).
824
825 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
827 virtual void accept (ROSE_VisitorPattern & visitor) override;
828
829 // DQ (12/26/2005): Support for traversal based on the memory pool
832 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
833
837
838 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
839 // This traversal helps support internal tools that call static member functions.
840 // note: this function operates on the memory pools.
843 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
844 /* */
845
846 public:
847 /* NodeId support functions */
849 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
852 static SgAsmGenericSection* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
855 static std::string getNodeIdString(SgAsmGenericSection* sgnode);
856 static std::string getNodeIdStringInternal(SgAsmGenericSection* sgnode);
857
858 public:
859 /* name Memory Allocation Functions
860 \brief Memory allocations functions ... incomplete-documentation
861
862 These functions have been made public as part of the design, but they are suggested for internal use
863 or by particularly knowledgable users for specialized tools or applications.
864 */
865 /* */
866
877 virtual bool isInMemoryPool() override;
878
889 virtual void checkDataMemberPointersIfInMemoryPool() override;
890
891 // DQ (4/30/2006): Modified to be a const function.
906 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
907
918
930 virtual long getChildIndex( SgNode* childNode ) const override;
931
932 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
933 // comment here (changed to be a C style comment and not be a doxygen comment).
934 /* \brief Constructor for use by AST File I/O Mechanism
935
936 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
937 which obtained via fast binary file I/O from disk.
938 */
939 // SgAsmGenericSection( SgAsmGenericSectionStorageClass& source );
940
941
942
943
944
945 // JH (10/24/2005): methods added to support the ast file IO
946 private:
947
948 /* name AST Memory Allocation Support Functions
949 \brief Memory allocations support....
950
951 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
952 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
953 and support the AST File I/O Mechanism.
954 */
955 /* */
956
957 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
958 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
959 that I use the same type everywhere, if any changes are made. THe second one declares the type
960 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
961 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
962 a correspinding one in the AST_FILE_IO class!
963 */
964 // DQ (9/2/2015): This typedef is no longer used, we can't define the
965 // comment here (changed to be a C style comment and not be a doxygen comment).
966 /* \brief Typedef used for low level memory access.
967 */
968 // typedef unsigned char* TestType;
969
970 // DQ (9/2/2015): This typedef is no longer used, we can't define the
971 // comment here (changed to be a C style comment and not be a doxygen comment).
972 /* \brief Typedef used to hold memory addresses as values.
973 */
974 // typedef unsigned long AddressType;
975
976
977
978 // necessary, to have direct access to the p_freepointer and the private methods !
980 friend class AST_FILE_IO;
981
983 friend class SgAsmGenericSectionStorageClass;
984
986 friend class AstSpecificDataManagingClass;
987
989 friend class AstSpecificDataManagingClassStorageClass;
990 public:
992 SgAsmGenericSection( const SgAsmGenericSectionStorageClass& source );
993
994 // private: // JJW hack
995 /*
996 name AST Memory Allocation Support Variables
997 Memory allocations support variables
998
999 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
1000 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
1001 and support the AST File I/O Mechanism.
1002 */
1003 /* */
1004
1005 public:
1006
1007 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
1008 // to current node (so that it will work cleanly with build functions to specify patterns).
1009 // virtual SgNode* addRegExpAttribute();
1016
1017#ifndef _MSC_VER
1018// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
1019// and likely never fully implemented nor tested. Files remain in the src tree but are no
1020// longer built.
1021#define BUILD_ATERM_SUPPORT 0
1022 #if BUILD_ATERM_SUPPORT
1023 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
1024 // DQ (10/4/2014): Adding ATerm support to ROSE.
1034 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
1035 virtual ATerm generate_ATerm() override;
1036
1038 virtual void generate_ATerm_Annotation(ATerm & term) override;
1039 #endif
1040 #endif // BUILD_ATERM_SUPPORT
1041#endif
1042 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
1043 // virtual generate_AST(ATerm & term);
1044 // virtual void read_ATerm_Annotation(ATerm & term);
1045
1046// *** COMMON CODE SECTION ENDS HERE ***
1047
1048
1049// End of memberFunctionString
1050// Start of memberFunctionString
1051/* #line 706 "/workspace/src/ROSETTA/Grammar/Node.code" */
1052
1053 // the generated cast function
1054 // friend ROSE_DLL_API SgAsmGenericSection* isSgAsmGenericSection ( SgNode* s );
1055
1056 typedef SgAsmExecutableFileFormat base_node_type;
1057
1058
1059// End of memberFunctionString
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080 protected:
1081// Start of memberFunctionString
1082SgAsmGenericFile* p_file;
1083
1084// End of memberFunctionString
1085// Start of memberFunctionString
1086SgAsmGenericHeader* p_header;
1087
1088// End of memberFunctionString
1089// Start of memberFunctionString
1090rose_addr_t p_size;
1091
1092// End of memberFunctionString
1093// Start of memberFunctionString
1094rose_addr_t p_offset;
1095
1096// End of memberFunctionString
1097// Start of memberFunctionString
1098rose_addr_t p_fileAlignment;
1099
1100// End of memberFunctionString
1101// Start of memberFunctionString
1102SgFileContentList p_data;
1103
1104// End of memberFunctionString
1105// Start of memberFunctionString
1107
1108// End of memberFunctionString
1109// Start of memberFunctionString
1110bool p_synthesized;
1111
1112// End of memberFunctionString
1113// Start of memberFunctionString
1114int p_id;
1115
1116// End of memberFunctionString
1117// Start of memberFunctionString
1118SgAsmGenericString* p_name;
1119
1120// End of memberFunctionString
1121// Start of memberFunctionString
1122std::string p_shortName;
1123
1124// End of memberFunctionString
1125// Start of memberFunctionString
1126rose_addr_t p_mappedPreferredRva;
1127
1128// End of memberFunctionString
1129// Start of memberFunctionString
1130rose_addr_t p_mappedSize;
1131
1132// End of memberFunctionString
1133// Start of memberFunctionString
1134rose_addr_t p_mappedAlignment;
1135
1136// End of memberFunctionString
1137// Start of memberFunctionString
1138bool p_mappedReadPermission;
1139
1140// End of memberFunctionString
1141// Start of memberFunctionString
1142bool p_mappedWritePermission;
1143
1144// End of memberFunctionString
1145// Start of memberFunctionString
1146bool p_mappedExecutePermission;
1147
1148// End of memberFunctionString
1149// Start of memberFunctionString
1150bool p_containsCode;
1151
1152// End of memberFunctionString
1153// Start of memberFunctionString
1154rose_addr_t p_mappedActualVa;
1155
1156// End of memberFunctionString
1157
1159 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, SgAsmGenericFile*,&SgAsmGenericSection::p_file>;
1160 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, SgAsmGenericHeader*,&SgAsmGenericSection::p_header>;
1161 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, rose_addr_t,&SgAsmGenericSection::p_size>;
1162 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, rose_addr_t,&SgAsmGenericSection::p_offset>;
1163 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, rose_addr_t,&SgAsmGenericSection::p_fileAlignment>;
1164 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, SgFileContentList,&SgAsmGenericSection::p_data>;
1166 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, bool,&SgAsmGenericSection::p_synthesized>;
1167 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, int,&SgAsmGenericSection::p_id>;
1168 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, SgAsmGenericString*,&SgAsmGenericSection::p_name>;
1169 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, std::string,&SgAsmGenericSection::p_shortName>;
1170 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, rose_addr_t,&SgAsmGenericSection::p_mappedPreferredRva>;
1171 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, rose_addr_t,&SgAsmGenericSection::p_mappedSize>;
1172 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, rose_addr_t,&SgAsmGenericSection::p_mappedAlignment>;
1173 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, bool,&SgAsmGenericSection::p_mappedReadPermission>;
1174 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, bool,&SgAsmGenericSection::p_mappedWritePermission>;
1175 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, bool,&SgAsmGenericSection::p_mappedExecutePermission>;
1176 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, bool,&SgAsmGenericSection::p_containsCode>;
1177 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericSection, rose_addr_t,&SgAsmGenericSection::p_mappedActualVa>;
1178
1179/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
1180
1181
1182 };
1183#endif
1184
1185// postdeclarations for SgAsmGenericSection
1186
1187/* #line 1188 "../../../src/frontend/SageIII//SgAsmGenericSection.h" */
1188
1189/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
1190
1191/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
1192
1193
1194/* #line 1195 "../../../src/frontend/SageIII//SgAsmGenericSection.h" */
1195
1196#endif // ROSE_SgAsmGenericSection_H
1197
Class holding static data and functions supporting File I/O.
Definition AST_FILE_IO.h:19
Attribute containing a regex expression as a string.
A contiguous range of values.
Definition rangemap.h:50
Optionally bound relative virtual address.
Base class for many binary analysis nodes.
Base class for binary files.
Base class for container file headers.
Contiguous region of a file.
SectionPurpose
Reason for section's existence.
Base class for strings related to binary specimens.
Supporting class from copy mechanism within ROSE.
Definition sageCopy.h:26
This class represents the base class for all IR nodes within Sage III.
virtual size_t get_numberOfTraversalSuccessors()
return number of children in the traversal successor list
virtual RTIReturnType roseRTI()
return C++ Runtime-Time-Information
virtual std::vector< std::string > get_traversalSuccessorNamesContainer()
container of names of variables or container indices used used in the traversal to access AST success...
virtual void debugSerializationEnd(const char *className)
Called by generated serializers.
static std::string getNodeIdString(SgNode *sgnode)
compute the NodeId for a particular SgNode*.
virtual bool isInMemoryPool()
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the he...
int variant() const
Older version function returns enum value "NODE".
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 no...
virtual size_t get_childIndex(SgNode *child)
index-based access to traversal successors by child node
virtual void debugSerializationBegin(const char *className)
Called by generated serializers.
virtual std::vector< SgNode * > get_traversalSuccessorContainer()
container of pointers to AST successor nodes used in the traversal overridden in every class by gener...
static void visitRepresentativeNode(ROSE_VisitTraversal &visit)
FOR INTERNAL USE Support for type-based traversal.
virtual void checkDataMemberPointersIfInMemoryPool()
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the he...
static size_t numberOfNodes()
Returns the total number of IR nodes of this type.
virtual void accept(ROSE_VisitorPattern &visitor)
support for the classic visitor pattern done in GoF
virtual SgNode * get_traversalSuccessorByIndex(size_t idx)
index-based access to traversal successors by index number
static void traverseMemoryPoolVisitorPattern(ROSE_VisitorPattern &visitor)
FOR INTERNAL USE Support for visitor pattern.
void executeVisitorMemberFunction(ROSE_VisitorPattern &visitor)
FOR INTERNAL USE Support for visitor pattern.
static SgNode * getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx)
Find a node by its variant type, pool index, and item index.
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 over all IR nodes by type of IR node.
virtual const char * sage_class_name() const
generates string representing the class name: (e.g. for SgNode returns "SgNode").
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
static SgNode * getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx)
FOR INTERNAL USE Find an SgNode from its memory pool and location therin.
SgNode * addRegExpAttribute(std::string s, AstRegExAttribute *a)
Support for AST matching using regular expression.
virtual void destructorHelper()
This gets called by all Rosebud-generated destructors.
void parse(SgAsmGenericFile *)
Main function to parse DWARF information.
void serialize(std::ostream &output, Graph &graph)
Serialize a graph into a stream of bytes.
The ROSE library.
ROSE_DLL_API int set_name(SgInitializedName *initializedNameNode, SgName new_name)
set_name of symbol in symbol table.
std::string get_name(const SgNode *node)
Generate a useful name to describe the SgNode.
void copy(const Word *src, const BitRange &srcRange, Word *dst, const BitRange &dstRange)
Copy some bits.
const char * SectionPurpose(int64_t)
Convert SgAsmGenericSection::SectionPurpose enum constant to a string.