ROSE 0.11.145.247
SgAsmCoffSymbol.h
1
2#ifndef ROSE_SgAsmCoffSymbol_H
3#define ROSE_SgAsmCoffSymbol_H
4#include <RoseFirst.h>
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmGenericSymbol.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 SgAsmCoffSymbol
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmCoffSymbol.h" */
25/* #line 30196 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
26
27#include <Rose/BinaryAnalysis/Address.h>
28
29#include <sageContainer.h>
30
31
32/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
33
34/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
35
36#if !defined(DOCUMENTATION)
37// Class Definition for SgAsmCoffSymbol
38class ROSE_DLL_API SgAsmCoffSymbol : public SgAsmGenericSymbol
39 {
40 public:
41
42
43/* #line 44 "../../../src/frontend/SageIII//SgAsmCoffSymbol.h" */
44
45 virtual SgNode* copy ( SgCopyHelp& help) const override;
46// Start of memberFunctionString
47/* #line 30250 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
48
49
50 //----------------------- Boost serialization for SgAsmCoffSymbol -----------------------
51#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
52private:
53 friend class boost::serialization::access;
54
55 template<class S>
56 void serialize(S &s, const unsigned /*version*/) {
57 debugSerializationBegin("SgAsmCoffSymbol");
58 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
59 s & BOOST_SERIALIZATION_NVP(p_st_name);
60 s & BOOST_SERIALIZATION_NVP(p_st_name_offset);
61 s & BOOST_SERIALIZATION_NVP(p_st_section_num);
62 s & BOOST_SERIALIZATION_NVP(p_st_type);
63 s & BOOST_SERIALIZATION_NVP(p_st_storage_class);
64 s & BOOST_SERIALIZATION_NVP(p_st_num_aux_entries);
65 s & BOOST_SERIALIZATION_NVP(p_auxiliaryData);
66 debugSerializationEnd("SgAsmCoffSymbol");
67 }
68#endif // ROSE_ENABLE_BOOST_SERIALIZATION
70 // Local types
72public:
73#ifdef _MSC_VER
74# pragma pack (1)
75#endif
76 struct COFFSymbol_disk {
77 union {
78 char st_name[8];
79 struct {
80 uint32_t st_zero;
81 uint32_t st_offset;
82 };
83 };
84 uint32_t st_value;
85 int16_t st_section_num;
86 uint16_t st_type;
87 unsigned char st_storage_class;
88 unsigned char st_num_aux_entries;
89 }
90// DQ (3/7/2013): Adding support to restrict visability to SWIG.
91#if !defined(SWIG) && !defined(_MSC_VER)
92 __attribute__((packed))
93#endif
94 ;
95#ifdef _MSC_VER
96# pragma pack ()
97#endif
98
100 // Properties and data members
102public:
103public:
107 std::string const& get_st_name() const;
108 void set_st_name(std::string const&);
111public:
115 Rose::BinaryAnalysis::Address const& get_st_name_offset() const;
116 void set_st_name_offset(Rose::BinaryAnalysis::Address const&);
119public:
123 int const& get_st_section_num() const;
124 void set_st_section_num(int const&);
127public:
131 unsigned const& get_st_type() const;
132 void set_st_type(unsigned const&);
135public:
139 unsigned const& get_st_storage_class() const;
140 void set_st_storage_class(unsigned const&);
143public:
147 unsigned const& get_st_num_aux_entries() const;
148 void set_st_num_aux_entries(unsigned const&);
151public:
155 SgUnsignedCharList const& get_auxiliaryData() const;
156 SgUnsignedCharList& get_auxiliaryData();
157 void set_auxiliaryData(SgUnsignedCharList const&);
159public:
160 static const unsigned int COFFSymbol_disk_size = 18;
161
163 // Functions
165public:
167 void *encode(SgAsmCoffSymbol::COFFSymbol_disk*) const;
168 virtual void dump(FILE *f, const char *prefix, ssize_t idx) const override;
169
171 // Deprecated
173public:
174 const SgUnsignedCharList& get_aux_data() const ROSE_DEPRECATED("use get_auxiliaryData");
175 void set_aux_data(const SgUnsignedCharList&) ROSE_DEPRECATED("use set_auxiliaryData");
176public:
178 virtual ~SgAsmCoffSymbol();
179
180public:
183
184protected:
191 void initializeProperties();
192
193
194// End of memberFunctionString
195// Start of memberFunctionString
196/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
197
198// *** COMMON CODE SECTION BEGINS HERE ***
199
200 public:
201
202 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
203 // and not required which is required to match the other aspects of the copy mechanism code generation.
204 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
205 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
206 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
207 // virtual SgNode* copy ( const SgCopyHelp & help) const;
208
210 virtual std::string class_name() const override;
211
213 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
214
216 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
217 // static const VariantT static_variant = V_SgAsmCoffSymbol;
218 enum { static_variant = V_SgAsmCoffSymbol };
219
220 /* the generated cast function */
222 ROSE_DLL_API friend SgAsmCoffSymbol* isSgAsmCoffSymbol( SgNode * s );
223
225 ROSE_DLL_API friend const SgAsmCoffSymbol* isSgAsmCoffSymbol( const SgNode * s );
226
227 // ******************************************
228 // * Memory Pool / New / Delete
229 // ******************************************
230
231 public:
233 static const unsigned pool_size; //
235 static std::vector<unsigned char *> pools; //
237 static SgAsmCoffSymbol * next_node; //
238
240 static unsigned long initializeStorageClassArray(SgAsmCoffSymbolStorageClass *); //
241
243 static void clearMemoryPool(); //
244 static void deleteMemoryPool(); //
245
247 static void extendMemoryPoolForFileIO(); //
248
250 static SgAsmCoffSymbol * getPointerFromGlobalIndex(unsigned long); //
252 static SgAsmCoffSymbol * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
253
255 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
257 static void resetValidFreepointers(); //
259 static unsigned long getNumberOfLastValidPointer(); //
260
261
262#if defined(INLINE_FUNCTIONS)
264 inline void *operator new (size_t size);
265#else
267 void *operator new (size_t size);
268#endif
270 void operator delete (void* pointer, size_t size);
271
272 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
273 void operator delete (void* pointer)
274 {
275 // This is the generated delete operator...
276 SgAsmCoffSymbol::operator delete (pointer,sizeof(SgAsmCoffSymbol));
277 }
278
280 static size_t numberOfNodes();
281
283 static size_t memoryUsage();
284
285 // End of scope which started in IR nodes specific code
286 /* */
287
288 /* name Internal Functions
289 \brief Internal functions ... incomplete-documentation
290
291 These functions have been made public as part of the design, but they are suggested for internal use
292 or by particularly knowledgeable users for specialized tools or applications.
293
294 \internal We could not make these private because they are required by user for special purposes. And
295 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
296
297 */
298
299 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
300 // overridden in every class by *generated* implementation
302 virtual std::vector<SgNode*> get_traversalSuccessorContainer() const override;
303 // MS: 06/28/02 container of names of variables or container indices
304 // used used in the traversal to access AST successor nodes
305 // overridden in every class by *generated* implementation
308 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() const override;
309
310 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
311 // than all the vector copies. The implementation for these functions is generated for each class.
313 virtual size_t get_numberOfTraversalSuccessors() const override;
315 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) const override;
317 virtual size_t get_childIndex(SgNode *child) const override;
318
319#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
320 // MS: 08/16/2002 method for generating RTI information
322 virtual RTIReturnType roseRTI() override;
323#endif
324 /* */
325
326
327
328 /* name Deprecated Functions
329 \brief Deprecated functions ... incomplete-documentation
330
331 These functions have been deprecated from use.
332 */
333 /* */
334
336 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
337
338 // JJW (10/16/2008): Changed to a single function in Node.code, and put
339 // getVariant() in #if 0 block to prevent confusing Doxygen
340#if 0
342 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
344 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
345#endif
346 /* */
347
348
349
350
351 public:
352 /* name Traversal Support Functions
353 \brief Traversal support functions ... incomplete-documentation
354
355 These functions have been made public as part of the design, but they are suggested for internal use
356 or by particularly knowledgable users for specialized tools or applications.
357 */
358 /* */
359
360 // DQ (11/26/2005): Support for visitor pattern mechanims
361 // (inferior to ROSE traversal mechanism, experimental).
365
366 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
368 virtual void accept (ROSE_VisitorPattern & visitor) override;
369
370 // DQ (12/26/2005): Support for traversal based on the memory pool
373 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
374
378
379 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
380 // This traversal helps support internal tools that call static member functions.
381 // note: this function operates on the memory pools.
384 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
385 /* */
386
387 public:
388 /* NodeId support functions */
390 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
393 static SgAsmCoffSymbol* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
396 static std::string getNodeIdString(SgAsmCoffSymbol* sgnode);
397 static std::string getNodeIdStringInternal(SgAsmCoffSymbol* sgnode);
398
399 public:
400 /* name Memory Allocation Functions
401 \brief Memory allocations functions ... incomplete-documentation
402
403 These functions have been made public as part of the design, but they are suggested for internal use
404 or by particularly knowledgable users for specialized tools or applications.
405 */
406 /* */
407
418 virtual bool isInMemoryPool() override;
419
430 virtual void checkDataMemberPointersIfInMemoryPool() override;
431
432 // DQ (4/30/2006): Modified to be a const function.
447 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
448
459
471 virtual long getChildIndex( SgNode* childNode ) const override;
472
473 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
474 // comment here (changed to be a C style comment and not be a doxygen comment).
475 /* \brief Constructor for use by AST File I/O Mechanism
476
477 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
478 which obtained via fast binary file I/O from disk.
479 */
480 // SgAsmCoffSymbol( SgAsmCoffSymbolStorageClass& source );
481
482
483
484
485
486 // JH (10/24/2005): methods added to support the ast file IO
487 private:
488
489 /* name AST Memory Allocation Support Functions
490 \brief Memory allocations support....
491
492 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
493 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
494 and support the AST File I/O Mechanism.
495 */
496 /* */
497
498 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
499 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
500 that I use the same type everywhere, if any changes are made. THe second one declares the type
501 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
502 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
503 a correspinding one in the AST_FILE_IO class!
504 */
505 // DQ (9/2/2015): This typedef is no longer used, we can't define the
506 // comment here (changed to be a C style comment and not be a doxygen comment).
507 /* \brief Typedef used for low level memory access.
508 */
509 // typedef unsigned char* TestType;
510
511 // DQ (9/2/2015): This typedef is no longer used, we can't define the
512 // comment here (changed to be a C style comment and not be a doxygen comment).
513 /* \brief Typedef used to hold memory addresses as values.
514 */
515 // typedef unsigned long AddressType;
516
517
518
519 // necessary, to have direct access to the p_freepointer and the private methods !
521 friend class AST_FILE_IO;
522
524 friend class SgAsmCoffSymbolStorageClass;
525
527 friend class AstSpecificDataManagingClass;
528
530 friend class AstSpecificDataManagingClassStorageClass;
531 public:
533 SgAsmCoffSymbol( const SgAsmCoffSymbolStorageClass& source );
534
535 // private: // JJW hack
536 /*
537 name AST Memory Allocation Support Variables
538 Memory allocations support variables
539
540 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
541 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
542 and support the AST File I/O Mechanism.
543 */
544 /* */
545
546 public:
547
548 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
549 // to current node (so that it will work cleanly with build functions to specify patterns).
550 // virtual SgNode* addRegExpAttribute();
557
558#ifndef _MSC_VER
559// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
560// and likely never fully implemented nor tested. Files remain in the src tree but are no
561// longer built.
562#define BUILD_ATERM_SUPPORT 0
563 #if BUILD_ATERM_SUPPORT
564 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
565 // DQ (10/4/2014): Adding ATerm support to ROSE.
575 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
576 virtual ATerm generate_ATerm() override;
577
579 virtual void generate_ATerm_Annotation(ATerm & term) override;
580 #endif
581 #endif // BUILD_ATERM_SUPPORT
582#endif
583 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
584 // virtual generate_AST(ATerm & term);
585 // virtual void read_ATerm_Annotation(ATerm & term);
586
587// *** COMMON CODE SECTION ENDS HERE ***
588
589
590// End of memberFunctionString
591// Start of memberFunctionString
592/* #line 710 "/workspace/src/ROSETTA/Grammar/Node.code" */
593
594 // the generated cast function
595 // friend ROSE_DLL_API SgAsmCoffSymbol* isSgAsmCoffSymbol ( SgNode* s );
596
597 typedef SgAsmGenericSymbol base_node_type;
598
599
600// End of memberFunctionString
601
602
603
604
605
606
607
608
609 protected:
610// Start of memberFunctionString
611std::string p_st_name;
612
613// End of memberFunctionString
614// Start of memberFunctionString
615Rose::BinaryAnalysis::Address p_st_name_offset;
616
617// End of memberFunctionString
618// Start of memberFunctionString
619int p_st_section_num;
620
621// End of memberFunctionString
622// Start of memberFunctionString
623unsigned p_st_type;
624
625// End of memberFunctionString
626// Start of memberFunctionString
627unsigned p_st_storage_class;
628
629// End of memberFunctionString
630// Start of memberFunctionString
631unsigned p_st_num_aux_entries;
632
633// End of memberFunctionString
634// Start of memberFunctionString
635SgUnsignedCharList p_auxiliaryData;
636
637// End of memberFunctionString
638
640 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, std::string,&SgAsmCoffSymbol::p_st_name>;
641 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, Rose::BinaryAnalysis::Address,&SgAsmCoffSymbol::p_st_name_offset>;
642 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, int,&SgAsmCoffSymbol::p_st_section_num>;
643 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, unsigned,&SgAsmCoffSymbol::p_st_type>;
644 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, unsigned,&SgAsmCoffSymbol::p_st_storage_class>;
645 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, unsigned,&SgAsmCoffSymbol::p_st_num_aux_entries>;
646 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, SgUnsignedCharList,&SgAsmCoffSymbol::p_auxiliaryData>;
647
648/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
649
650
651 };
652#endif
653
654// postdeclarations for SgAsmCoffSymbol
655
656/* #line 657 "../../../src/frontend/SageIII//SgAsmCoffSymbol.h" */
657
658/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
659
660/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
661
662
663/* #line 664 "../../../src/frontend/SageIII//SgAsmCoffSymbol.h" */
664
665#endif // ROSE_SgAsmCoffSymbol_H
666
Class holding static data and functions supporting File I/O.
Definition AST_FILE_IO.h:19
Attribute containing a regex expression as a string.
Contiguous region of a file.
virtual void dump(FILE *, const char *prefix, ssize_t idx) const
Print some debugging info.
Windows PE file header.
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 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
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.
void copy(const Word *src, const BitRange &srcRange, Word *dst, const BitRange &dstRange)
Copy some bits.