ROSE 0.11.145.247
SgAsmDOSExtendedHeader.h
1
2#ifndef ROSE_SgAsmDOSExtendedHeader_H
3#define ROSE_SgAsmDOSExtendedHeader_H
4#include <RoseFirst.h>
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmGenericSection.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 SgAsmDOSExtendedHeader
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmDOSExtendedHeader.h" */
25/* #line 29380 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
26
27#include <Rose/BinaryAnalysis/Address.h>
28
29
30/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
31
32/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
33
34#if !defined(DOCUMENTATION)
35// Class Definition for SgAsmDOSExtendedHeader
36class ROSE_DLL_API SgAsmDOSExtendedHeader : public SgAsmGenericSection
37 {
38 public:
39
40
41/* #line 42 "../../../src/frontend/SageIII//SgAsmDOSExtendedHeader.h" */
42
43 virtual SgNode* copy ( SgCopyHelp& help) const override;
44// Start of memberFunctionString
45/* #line 29446 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
46
47
48 //----------------------- Boost serialization for SgAsmDOSExtendedHeader -----------------------
49#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
50private:
51 friend class boost::serialization::access;
52
53 template<class S>
54 void serialize(S &s, const unsigned /*version*/) {
55 debugSerializationBegin("SgAsmDOSExtendedHeader");
56 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
57 s & BOOST_SERIALIZATION_NVP(p_e_res1);
58 s & BOOST_SERIALIZATION_NVP(p_e_oemid);
59 s & BOOST_SERIALIZATION_NVP(p_e_oeminfo);
60 s & BOOST_SERIALIZATION_NVP(p_e_res2);
61 s & BOOST_SERIALIZATION_NVP(p_e_res3);
62 s & BOOST_SERIALIZATION_NVP(p_e_res4);
63 s & BOOST_SERIALIZATION_NVP(p_e_res5);
64 s & BOOST_SERIALIZATION_NVP(p_e_res6);
65 s & BOOST_SERIALIZATION_NVP(p_e_lfanew);
66 debugSerializationEnd("SgAsmDOSExtendedHeader");
67 }
68#endif // ROSE_ENABLE_BOOST_SERIALIZATION
70 // Local types
72public:
73#ifdef _MSC_VER
74# pragma pack (1)
75#endif
76 struct DOSExtendedHeader_disk {
77 uint32_t e_res1; /* 0x00 reserved */
78 uint16_t e_oemid; /* 0x04 OEM Identifier */
79 uint16_t e_oeminfo; /* 0x06 other OEM information; oemid specific */
80 uint32_t e_res2; /* 0x08 reserved */
81 uint32_t e_res3; /* 0x0c reserved */
82 uint32_t e_res4; /* 0x10 reserved */
83 uint32_t e_res5; /* 0x14 reserved */
84 uint32_t e_res6; /* 0x18 reserved */
85 uint32_t e_lfanew; /* 0x1c file offset of new exe (PE) header */
86 } /* 0x20 */
87#if !defined(SWIG) && !defined(_MSC_VER)
88 __attribute__((packed))
89#endif
90 ;
91#ifdef _MSC_VER
92# pragma pack ()
93#endif
94
96 // Properties
98public:
99public:
105 unsigned const& get_e_res1() const;
106 void set_e_res1(unsigned const&);
109public:
115 unsigned const& get_e_oemid() const;
116 void set_e_oemid(unsigned const&);
119public:
125 unsigned const& get_e_oeminfo() const;
126 void set_e_oeminfo(unsigned const&);
129public:
135 unsigned const& get_e_res2() const;
136 void set_e_res2(unsigned const&);
139public:
145 unsigned const& get_e_res3() const;
146 void set_e_res3(unsigned const&);
149public:
155 unsigned const& get_e_res4() const;
156 void set_e_res4(unsigned const&);
159public:
165 unsigned const& get_e_res5() const;
166 void set_e_res5(unsigned const&);
169public:
175 unsigned const& get_e_res6() const;
176 void set_e_res6(unsigned const&);
179public:
185 Rose::BinaryAnalysis::Address const& get_e_lfanew() const;
186 void set_e_lfanew(Rose::BinaryAnalysis::Address const&);
189 // Functions
191public:
193 virtual SgAsmDOSExtendedHeader *parse() override;
195 virtual void unparse(std::ostream&) const override;
196 virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
197public:
199 virtual ~SgAsmDOSExtendedHeader();
200
201public:
204
205protected:
213
214
215// End of memberFunctionString
216// Start of memberFunctionString
217/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
218
219// *** COMMON CODE SECTION BEGINS HERE ***
220
221 public:
222
223 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
224 // and not required which is required to match the other aspects of the copy mechanism code generation.
225 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
226 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
227 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
228 // virtual SgNode* copy ( const SgCopyHelp & help) const;
229
231 virtual std::string class_name() const override;
232
234 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
235
237 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
238 // static const VariantT static_variant = V_SgAsmDOSExtendedHeader;
239 enum { static_variant = V_SgAsmDOSExtendedHeader };
240
241 /* the generated cast function */
243 ROSE_DLL_API friend SgAsmDOSExtendedHeader* isSgAsmDOSExtendedHeader( SgNode * s );
244
246 ROSE_DLL_API friend const SgAsmDOSExtendedHeader* isSgAsmDOSExtendedHeader( const SgNode * s );
247
248 // ******************************************
249 // * Memory Pool / New / Delete
250 // ******************************************
251
252 public:
254 static const unsigned pool_size; //
256 static std::vector<unsigned char *> pools; //
258 static SgAsmDOSExtendedHeader * next_node; //
259
261 static unsigned long initializeStorageClassArray(SgAsmDOSExtendedHeaderStorageClass *); //
262
264 static void clearMemoryPool(); //
265 static void deleteMemoryPool(); //
266
268 static void extendMemoryPoolForFileIO(); //
269
271 static SgAsmDOSExtendedHeader * getPointerFromGlobalIndex(unsigned long); //
273 static SgAsmDOSExtendedHeader * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
274
276 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
278 static void resetValidFreepointers(); //
280 static unsigned long getNumberOfLastValidPointer(); //
281
282
283#if defined(INLINE_FUNCTIONS)
285 inline void *operator new (size_t size);
286#else
288 void *operator new (size_t size);
289#endif
291 void operator delete (void* pointer, size_t size);
292
293 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
294 void operator delete (void* pointer)
295 {
296 // This is the generated delete operator...
297 SgAsmDOSExtendedHeader::operator delete (pointer,sizeof(SgAsmDOSExtendedHeader));
298 }
299
301 static size_t numberOfNodes();
302
304 static size_t memoryUsage();
305
306 // End of scope which started in IR nodes specific code
307 /* */
308
309 /* name Internal Functions
310 \brief Internal functions ... incomplete-documentation
311
312 These functions have been made public as part of the design, but they are suggested for internal use
313 or by particularly knowledgeable users for specialized tools or applications.
314
315 \internal We could not make these private because they are required by user for special purposes. And
316 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
317
318 */
319
320 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
321 // overridden in every class by *generated* implementation
323 virtual std::vector<SgNode*> get_traversalSuccessorContainer() const override;
324 // MS: 06/28/02 container of names of variables or container indices
325 // used used in the traversal to access AST successor nodes
326 // overridden in every class by *generated* implementation
329 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() const override;
330
331 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
332 // than all the vector copies. The implementation for these functions is generated for each class.
334 virtual size_t get_numberOfTraversalSuccessors() const override;
336 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) const override;
338 virtual size_t get_childIndex(SgNode *child) const override;
339
340#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
341 // MS: 08/16/2002 method for generating RTI information
343 virtual RTIReturnType roseRTI() override;
344#endif
345 /* */
346
347
348
349 /* name Deprecated Functions
350 \brief Deprecated functions ... incomplete-documentation
351
352 These functions have been deprecated from use.
353 */
354 /* */
355
357 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
358
359 // JJW (10/16/2008): Changed to a single function in Node.code, and put
360 // getVariant() in #if 0 block to prevent confusing Doxygen
361#if 0
363 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
365 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
366#endif
367 /* */
368
369
370
371
372 public:
373 /* name Traversal Support Functions
374 \brief Traversal support functions ... incomplete-documentation
375
376 These functions have been made public as part of the design, but they are suggested for internal use
377 or by particularly knowledgable users for specialized tools or applications.
378 */
379 /* */
380
381 // DQ (11/26/2005): Support for visitor pattern mechanims
382 // (inferior to ROSE traversal mechanism, experimental).
386
387 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
389 virtual void accept (ROSE_VisitorPattern & visitor) override;
390
391 // DQ (12/26/2005): Support for traversal based on the memory pool
394 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
395
399
400 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
401 // This traversal helps support internal tools that call static member functions.
402 // note: this function operates on the memory pools.
405 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
406 /* */
407
408 public:
409 /* NodeId support functions */
411 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
414 static SgAsmDOSExtendedHeader* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
417 static std::string getNodeIdString(SgAsmDOSExtendedHeader* sgnode);
418 static std::string getNodeIdStringInternal(SgAsmDOSExtendedHeader* sgnode);
419
420 public:
421 /* name Memory Allocation Functions
422 \brief Memory allocations functions ... incomplete-documentation
423
424 These functions have been made public as part of the design, but they are suggested for internal use
425 or by particularly knowledgable users for specialized tools or applications.
426 */
427 /* */
428
439 virtual bool isInMemoryPool() override;
440
451 virtual void checkDataMemberPointersIfInMemoryPool() override;
452
453 // DQ (4/30/2006): Modified to be a const function.
468 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
469
480
492 virtual long getChildIndex( SgNode* childNode ) const override;
493
494 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
495 // comment here (changed to be a C style comment and not be a doxygen comment).
496 /* \brief Constructor for use by AST File I/O Mechanism
497
498 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
499 which obtained via fast binary file I/O from disk.
500 */
501 // SgAsmDOSExtendedHeader( SgAsmDOSExtendedHeaderStorageClass& source );
502
503
504
505
506
507 // JH (10/24/2005): methods added to support the ast file IO
508 private:
509
510 /* name AST Memory Allocation Support Functions
511 \brief Memory allocations support....
512
513 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
514 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
515 and support the AST File I/O Mechanism.
516 */
517 /* */
518
519 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
520 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
521 that I use the same type everywhere, if any changes are made. THe second one declares the type
522 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
523 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
524 a correspinding one in the AST_FILE_IO class!
525 */
526 // DQ (9/2/2015): This typedef is no longer used, we can't define the
527 // comment here (changed to be a C style comment and not be a doxygen comment).
528 /* \brief Typedef used for low level memory access.
529 */
530 // typedef unsigned char* TestType;
531
532 // DQ (9/2/2015): This typedef is no longer used, we can't define the
533 // comment here (changed to be a C style comment and not be a doxygen comment).
534 /* \brief Typedef used to hold memory addresses as values.
535 */
536 // typedef unsigned long AddressType;
537
538
539
540 // necessary, to have direct access to the p_freepointer and the private methods !
542 friend class AST_FILE_IO;
543
545 friend class SgAsmDOSExtendedHeaderStorageClass;
546
548 friend class AstSpecificDataManagingClass;
549
551 friend class AstSpecificDataManagingClassStorageClass;
552 public:
554 SgAsmDOSExtendedHeader( const SgAsmDOSExtendedHeaderStorageClass& source );
555
556 // private: // JJW hack
557 /*
558 name AST Memory Allocation Support Variables
559 Memory allocations support variables
560
561 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
562 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
563 and support the AST File I/O Mechanism.
564 */
565 /* */
566
567 public:
568
569 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
570 // to current node (so that it will work cleanly with build functions to specify patterns).
571 // virtual SgNode* addRegExpAttribute();
578
579#ifndef _MSC_VER
580// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
581// and likely never fully implemented nor tested. Files remain in the src tree but are no
582// longer built.
583#define BUILD_ATERM_SUPPORT 0
584 #if BUILD_ATERM_SUPPORT
585 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
586 // DQ (10/4/2014): Adding ATerm support to ROSE.
596 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
597 virtual ATerm generate_ATerm() override;
598
600 virtual void generate_ATerm_Annotation(ATerm & term) override;
601 #endif
602 #endif // BUILD_ATERM_SUPPORT
603#endif
604 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
605 // virtual generate_AST(ATerm & term);
606 // virtual void read_ATerm_Annotation(ATerm & term);
607
608// *** COMMON CODE SECTION ENDS HERE ***
609
610
611// End of memberFunctionString
612// Start of memberFunctionString
613/* #line 710 "/workspace/src/ROSETTA/Grammar/Node.code" */
614
615 // the generated cast function
616 // friend ROSE_DLL_API SgAsmDOSExtendedHeader* isSgAsmDOSExtendedHeader ( SgNode* s );
617
618 typedef SgAsmGenericSection base_node_type;
619
620
621// End of memberFunctionString
622
623
624
625
626
627
628
629
630
631
632 protected:
633// Start of memberFunctionString
634unsigned p_e_res1;
635
636// End of memberFunctionString
637// Start of memberFunctionString
638unsigned p_e_oemid;
639
640// End of memberFunctionString
641// Start of memberFunctionString
642unsigned p_e_oeminfo;
643
644// End of memberFunctionString
645// Start of memberFunctionString
646unsigned p_e_res2;
647
648// End of memberFunctionString
649// Start of memberFunctionString
650unsigned p_e_res3;
651
652// End of memberFunctionString
653// Start of memberFunctionString
654unsigned p_e_res4;
655
656// End of memberFunctionString
657// Start of memberFunctionString
658unsigned p_e_res5;
659
660// End of memberFunctionString
661// Start of memberFunctionString
662unsigned p_e_res6;
663
664// End of memberFunctionString
665// Start of memberFunctionString
667
668// End of memberFunctionString
669
671 friend struct Rose::Traits::generated::describe_field_t<SgAsmDOSExtendedHeader, unsigned,&SgAsmDOSExtendedHeader::p_e_res1>;
672 friend struct Rose::Traits::generated::describe_field_t<SgAsmDOSExtendedHeader, unsigned,&SgAsmDOSExtendedHeader::p_e_oemid>;
673 friend struct Rose::Traits::generated::describe_field_t<SgAsmDOSExtendedHeader, unsigned,&SgAsmDOSExtendedHeader::p_e_oeminfo>;
674 friend struct Rose::Traits::generated::describe_field_t<SgAsmDOSExtendedHeader, unsigned,&SgAsmDOSExtendedHeader::p_e_res2>;
675 friend struct Rose::Traits::generated::describe_field_t<SgAsmDOSExtendedHeader, unsigned,&SgAsmDOSExtendedHeader::p_e_res3>;
676 friend struct Rose::Traits::generated::describe_field_t<SgAsmDOSExtendedHeader, unsigned,&SgAsmDOSExtendedHeader::p_e_res4>;
677 friend struct Rose::Traits::generated::describe_field_t<SgAsmDOSExtendedHeader, unsigned,&SgAsmDOSExtendedHeader::p_e_res5>;
678 friend struct Rose::Traits::generated::describe_field_t<SgAsmDOSExtendedHeader, unsigned,&SgAsmDOSExtendedHeader::p_e_res6>;
679 friend struct Rose::Traits::generated::describe_field_t<SgAsmDOSExtendedHeader, Rose::BinaryAnalysis::Address,&SgAsmDOSExtendedHeader::p_e_lfanew>;
680
681/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
682
683
684 };
685#endif
686
687// postdeclarations for SgAsmDOSExtendedHeader
688
689/* #line 690 "../../../src/frontend/SageIII//SgAsmDOSExtendedHeader.h" */
690
691/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
692
693/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
694
695
696/* #line 697 "../../../src/frontend/SageIII//SgAsmDOSExtendedHeader.h" */
697
698#endif // ROSE_SgAsmDOSExtendedHeader_H
699
Class holding static data and functions supporting File I/O.
Definition AST_FILE_IO.h:19
Attribute containing a regex expression as a string.
Represents the file header for DOS executables.
Contiguous region of a file.
virtual SgAsmGenericSection * parse()
Parse contents of the section.
virtual void dump(FILE *, const char *prefix, ssize_t idx) const
Print some debugging info.
void initializeProperties()
Initialize all properties that have explicit initial values.
virtual void unparse(std::ostream &) const
Write a section back to the file.
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 RTIReturnType roseRTI()
return C++ Runtime-Time-Information
virtual size_t get_numberOfTraversalSuccessors() const
return number of children in the traversal successor list
virtual std::vector< std::string > get_traversalSuccessorNamesContainer() const
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 size_t get_childIndex(SgNode *child) const
index-based access to traversal successors by child node
virtual std::vector< SgNode * > get_traversalSuccessorContainer() const
container of pointers to AST successor nodes used in the traversal overridden in every class by gener...
virtual VariantT variantT() const
returns new style SageIII enum values
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 void debugSerializationBegin(const char *className)
Called by generated serializers.
virtual SgNode * get_traversalSuccessorByIndex(size_t idx) const
index-based access to traversal successors by index number
virtual std::string class_name() const
returns a string representing the class name
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
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.
std::uint64_t Address
Address.
Definition Address.h:11
void serialize(std::ostream &output, Graph &graph)
Serialize a graph into a stream of bytes.
The ROSE library.
void copy(const Word *src, const BitRange &srcRange, Word *dst, const BitRange &dstRange)
Copy some bits.