ROSE 0.11.145.247
SgAsmExecutableFileFormat.h
1
2#ifndef ROSE_SgAsmExecutableFileFormat_H
3#define ROSE_SgAsmExecutableFileFormat_H
4#include <RoseFirst.h>
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmNode.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 SgAsmExecutableFileFormat
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmExecutableFileFormat.h" */
25/* #line 42656 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
26
27#include <Rose/BinaryAnalysis/Address.h>
28#include <Rose/Exception.h>
29
30
31/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
32
33/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
34
35#if !defined(DOCUMENTATION)
36// Class Definition for SgAsmExecutableFileFormat
37class ROSE_DLL_API SgAsmExecutableFileFormat : public SgAsmNode
38 {
39 public:
40
41
42/* #line 43 "../../../src/frontend/SageIII//SgAsmExecutableFileFormat.h" */
43
44 virtual SgNode* copy ( SgCopyHelp& help) const override;
45// Start of memberFunctionString
46/* #line 42667 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
47
48
49 //----------------------- Boost serialization for SgAsmExecutableFileFormat -----------------------
50#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
51private:
52 friend class boost::serialization::access;
53
54 template<class S>
55 void serialize(S &s, const unsigned /*version*/) {
56 debugSerializationBegin("SgAsmExecutableFileFormat");
57 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
58 debugSerializationEnd("SgAsmExecutableFileFormat");
59 }
60#endif // ROSE_ENABLE_BOOST_SERIALIZATION
62 // Local types
64public:
68 class ShortRead: public Rose::Exception {
69 public:
70 const SgAsmGenericSection *section;
74 ShortRead(const class SgAsmGenericSection *section, size_t offset, size_t size)
75 : Rose::Exception("short read"), section(section), offset(offset), size(size) {}
76 ShortRead(const class SgAsmGenericSection *section, size_t offset, size_t size, const std::string &mesg)
77 : Rose::Exception(mesg), section(section), offset(offset), size(size) {}
78 ShortRead(const class SgAsmGenericSection *section, size_t offset, size_t size, const char *mesg)
79 : Rose::Exception(mesg), section(section), offset(offset), size(size) {}
80 ~ShortRead() throw () {}
81 };
82
86 class ShortWrite: public Rose::Exception {
87 public:
88 const SgAsmGenericSection *section;
92 ShortWrite(const class SgAsmGenericSection *section, size_t offset, size_t size)
93 : Rose::Exception(""), section(section), offset(offset), size(size) {}
94 ShortWrite(const class SgAsmGenericSection *section, size_t offset, size_t size, const std::string &mesg)
95 : Rose::Exception(mesg), section(section), offset(offset), size(size) {}
96 ShortWrite(const class SgAsmGenericSection *section, size_t offset, size_t size, const char *mesg)
97 : Rose::Exception(mesg), section(section), offset(offset), size(size) {}
98 };
99
103 class FormatError: public Rose::Exception {
104 public:
105 FormatError(const std::string &mesg)
106 : Rose::Exception(mesg) {}
107 FormatError(const char *mesg)
108 : Rose::Exception(mesg) {}
109 ~FormatError() throw () {}
110 };
111
113 typedef struct stat fileDetails;
114
116 enum ExecFamily {
117 FAMILY_UNSPECIFIED,
118 FAMILY_DOS,
119 FAMILY_ELF,
120 FAMILY_JVM,
121 FAMILY_LE,
122 FAMILY_LX,
123 FAMILY_NE,
124 FAMILY_PE
125 };
126
128 enum ExecABI {
129 ABI_UNSPECIFIED,
130 ABI_OTHER,
131 ABI_86OPEN,
132 ABI_AIX,
133 ABI_ARM,
134 ABI_FREEBSD,
135 ABI_HPUX,
136 ABI_IRIX,
137 ABI_HURD,
138 ABI_JVM,
139 ABI_LINUX,
140 ABI_MODESTO,
141 ABI_MONTEREY,
142 ABI_MSDOS,
143 ABI_NT,
144 ABI_NETBSD,
145 ABI_OS2,
146 ABI_SOLARIS,
147 ABI_SYSV,
148 ABI_TRU64,
149 ABI_WIN386
150 };
151
153 enum InsSetArchitecture {
154 ISA_UNSPECIFIED = 0x0000,
155 ISA_OTHER = 0xffff,
156 ISA_FAMILY_MASK = 0xff00,
158 ISA_IA32_Family = 0x0100,
159 ISA_IA32_286 = 0x0101,
160 ISA_IA32_386 = 0x0102,
161 ISA_IA32_486 = 0x0103,
162 ISA_IA32_Pentium = 0x0104,
163 ISA_IA32_Cyrix6x86 = 0x0105,
164 ISA_IA32_AMDK5 = 0x0106,
165 ISA_IA32_PentiumPro = 0x0107,
166 ISA_IA32_PentiumII = 0x0108,
167 ISA_IA32_Athlon = 0x0109,
168 ISA_IA32_Pentium4 = 0x010a,
169 ISA_IA32_PentiumM = 0x010b,
171 ISA_X8664_Family = 0x0200,
172 ISA_X8664_Athlon64 = 0x0201,
173 ISA_X8664_Prescott = 0x0202,
174 ISA_X8664_IntelCore = 0x0203,
175 ISA_X8664_AMDPhenom = 0x0204,
177 ISA_SPARC_Family = 0x0300,
178 ISA_SPARC_V7 = 0x0301,
179 ISA_SPARC_V8 = 0x0302,
180 ISA_SPARC_V8E = 0x0303,
181 ISA_SPARC_V9 = 0x0304,
182 ISA_SPARC_V9JPS1 = 0x0305,
183 ISA_SPARC_V9UA = 0x0306,
184 ISA_SPARC_V9JPS2 = 0x0307,
185
186 ISA_M68K_Family = 0x0400,
187 ISA_M68K_68000 = 0x0401,
188 ISA_M68K_68EC000 = 0x0402,
189 ISA_M68K_68HC000 = 0x0403,
190 ISA_M68K_68008 = 0x0404,
191 ISA_M68K_68010 = 0x0405,
192 ISA_M68K_68012 = 0x0406,
193 ISA_M68K_68020 = 0x0407,
194 ISA_M68K_68EC020 = 0x0408,
195 ISA_M68K_68030 = 0x0409,
196 ISA_M68K_68EC030 = 0x040a,
197 ISA_M68K_68040 = 0x040b,
198 ISA_M68K_68EC040 = 0x040c,
199 ISA_M68K_68LC040 = 0x040d,
200 ISA_M68K_68060 = 0x040e,
201 ISA_M68K_ColdFire = 0x040f,
202 ISA_M68K_DragonBall = 0x0410,
204 ISA_M88K_Family = 0x0500,
205 ISA_M88K_88100 = 0x0501,
206 ISA_M88K_88110 = 0x0502,
207 ISA_M88K_88110MP = 0x0503,
208 ISA_M88K_88120 = 0x0504,
210 ISA_MIPS_Family = 0x0600,
211 ISA_MIPS_MarkI = 0x0601,
212 ISA_MIPS_MarkII = 0x0602,
213 ISA_MIPS_MarkIII = 0x0603,
214 ISA_MIPS_R2000 = 0x0604,
215 ISA_MIPS_R3000 = 0x0605,
216 ISA_MIPS_R4000 = 0x0606,
217 ISA_MIPS_R4200 = 0x0607,
218 ISA_MIPS_R4300 = 0x0608,
219 ISA_MIPS_R4600 = 0x0609,
220 ISA_MIPS_R4650 = 0x060a,
221 ISA_MIPS_R4700 = 0x060b,
222 ISA_MIPS_R5000 = 0x060c,
223 ISA_MIPS_RM7000 = 0x060d,
224 ISA_MIPS_R8000 = 0x060e,
225 ISA_MIPS_R10000 = 0x060f,
226 ISA_MIPS_R12000 = 0x0610,
227 ISA_MIPS_R14000 = 0x0611,
228 ISA_MIPS_R16000 = 0x0612,
229 ISA_MIPS_R16000A = 0x0613,
230 ISA_MIPS_16 = 0x0614,
231 ISA_MIPS_FPU = 0x0615,
232 ISA_MIPS_16FPU = 0x0616,
234 ISA_I860_Family = 0x0700,
235 ISA_I860_860XR = 0x0701,
236 ISA_I860_860XP = 0x0702,
238 ISA_IA64_Family = 0x0800,
239 ISA_IA64_Itanium = 0x0801,
240 ISA_IA64_Itanium2 = 0x0802,
242 // See http://en.wikipedia.org/wiki/ARM_architecture
243 ISA_ARM_Family = 0x0900,
244 ISA_ARM_ARM1 = 0x0901,
245 ISA_ARM_ARM2 = 0x0902,
246 ISA_ARM_ARM3 = 0x0903,
247 ISA_ARM_ARM6 = 0x0904,
248 ISA_ARM_ARM7 = 0x0905,
249 ISA_ARM_ARM7TDMI = 0x0906,
250 ISA_ARM_StrongARM = 0x0907,
251 ISA_ARM_ARM8 = 0x0908,
252 ISA_ARM_ARM9TDMI = 0x0909,
253 ISA_ARM_ARM9E = 0x090a,
254 ISA_ARM_ARM10E = 0x090b,
255 ISA_ARM_XScale = 0x090c,
259 ISA_ARM_ARM11 = 0x090d,
260 ISA_ARM_Cortex = 0x090e,
261 ISA_ARM_A64 = 0x090f,
263 ISA_JVM = 0x0a00,
265 // Others, not yet incorporated into this enum
266 ISA_OTHER_Family = 0xf000,
267
268 ISA_ATT_WE_32100 = 0xf001,
269 ISA_IBM_System_370 = 0xf002,
270 ISA_HPPA = 0xf003,
271 ISA_Fujitsu_VPP500 = 0xf004,
272 ISA_Sun_v8plus = 0xf005,
273 ISA_PowerPC = 0xf006,
274 ISA_PowerPC_64bit = 0xf007,
275 ISA_IBM_S390 = 0xf008,
276 ISA_NEC_V800_series = 0xf009,
277 ISA_Fujitsu_FR20 = 0xf00a,
278 ISA_TRW_RH_32 = 0xf00b,
279 ISA_Motorola_RCE = 0xf00c,
280 ISA_Digital_Alpha_fake = 0xf00e,
281 ISA_Hitachi_SH = 0xf00f,
282 ISA_Siemens_Tricore = 0xf010,
283 ISA_Argonaut_RISC_Core = 0xf011,
284 ISA_Hitachi_H8_300 = 0xf012,
285 ISA_Hitachi_H8_300H = 0xf013,
286 ISA_Hitachi_H8S = 0xf014,
287 ISA_Hitachi_H8_500 = 0xf015,
288 ISA_Stanford_MIPS_X = 0xf016,
289 ISA_Motorola_M68HC12 = 0xf017,
290 ISA_Fujitsu_MMA_Multimedia_Accelerator=0xf018,
291 ISA_Siemens_PCP = 0xf019,
292 ISA_Sony_nCPU_embeeded_RISC = 0xf01a,
293 ISA_Denso_NDR1_microprocessor=0xf01b,
294 ISA_Motorola_Start_Core_processor=0xf01c,
295 ISA_Toyota_ME16_processor = 0xf01d,
296 ISA_STMicroelectronic_ST100_processor=0xf01e,
297 ISA_Advanced_Logic_Corp_Tinyj_emb_family=0xf01f,
298 ISA_AMD_x86_64_architecture = 0xf020,
299 ISA_Sony_DSP_Processor = 0xf021,
300 ISA_Siemens_FX66_microcontroller=0xf022,
301 ISA_STMicroelectronics_ST9_plus_8_16_microcontroller=0xf023,
302 ISA_STMicroelectronics_ST7_8bit_microcontroller=0xf024,
303 ISA_Motorola_MC68HC16_microcontroller=0xf025,
304 ISA_Motorola_MC68HC11_microcontroller=0xf026,
305 ISA_Motorola_MC68HC08_microcontroller=0xf027,
306 ISA_Motorola_MC68HC05_microcontroller=0xf028,
307 ISA_Silicon_Graphics_SVx = 0xf029,
308 ISA_STMicroelectronics_ST19_8bit_microcontroller=0xf02a,
309 ISA_Digital_VAX = 0xf02b,
310 ISA_Axis_Communications_32bit_embedded_processor=0xf02c,
311 ISA_Infineon_Technologies_32bit_embedded_processor=0xf02d,
312 ISA_Element_14_64bit_DSP_Processor=0xf02e,
313 ISA_LSI_Logic_16bit_DSP_Processor=0xf02f,
314 ISA_Donald_Knuths_educational_64bit_processor=0xf030,
315 ISA_Harvard_University_machine_independent_object_files=0xf031,
316 ISA_SiTera_Prism = 0xf032,
317 ISA_Atmel_AVR_8bit_microcontroller=0xf033,
318 ISA_Fujitsu_FR30 = 0xf034,
319 ISA_Mitsubishi_D10V = 0xf035,
320 ISA_Mitsubishi_D30V = 0xf036,
321 ISA_NEC_v850 = 0xf037,
322 ISA_Mitsubishi_M32R = 0xf038,
323 ISA_Matsushita_MN10300 = 0xf039,
324 ISA_Matsushita_MN10200 = 0xf03a,
325 ISA_picoJava = 0xf03b,
326 ISA_OpenRISC_32bit_embedded_processor=0xf03c,
327 ISA_ARC_Cores_Tangent_A5 = 0xf03d,
328 ISA_Tensilica_Xtensa_Architecture=0xf03e,
329 ISA_Digital_Alpha = 0xf03f,
330 ISA_Matsushita_AM33 = 0xf040,
331 ISA_EFI_ByteCode = 0xf041
332 };
333
335 enum ExecPurpose {
336 PURPOSE_UNSPECIFIED,
337 PURPOSE_OTHER,
338 PURPOSE_EXECUTABLE,
339 PURPOSE_LIBRARY,
340 PURPOSE_CORE_DUMP,
341 PURPOSE_OS_SPECIFIC,
342 PURPOSE_PROC_SPECIFIC
343 };
344
346 // Functions
348public:
350 static SgAsmGenericFile *parseBinaryFormat(const char *name);
351
356 static void unparseBinaryFormat(const std::string &name, SgAsmGenericFile*);
357
362 static void unparseBinaryFormat(std::ostream&, SgAsmGenericFile*);
363
366
370 static void initDiagnostics();
371
372 // These convert enums to strings. It is better to use the automatic enum stringification instead. They have names like
373 // Rose::stringifySgAsmExecutableFileFormatInsnSetArchitecture, etc. */
374 static std::string isaFamilyToString(SgAsmExecutableFileFormat::InsSetArchitecture);
375 static std::string isaToString(SgAsmExecutableFileFormat::InsSetArchitecture);
380
382 // Deprecated 2023-11
384public:
385 static std::string isa_family_to_string(SgAsmExecutableFileFormat::InsSetArchitecture) ROSE_DEPRECATED("use isaFamilyToString");
386 static std::string isa_to_string(SgAsmExecutableFileFormat::InsSetArchitecture) ROSE_DEPRECATED("use isaToString");
387 static std::string to_string(SgAsmExecutableFileFormat::InsSetArchitecture) ROSE_DEPRECATED("use toString");
388 static std::string to_string(SgAsmExecutableFileFormat::ExecFamily) ROSE_DEPRECATED("use toString");
389 static std::string to_string(SgAsmExecutableFileFormat::ExecABI) ROSE_DEPRECATED("use toString");
390 static std::string to_string(SgAsmExecutableFileFormat::ExecPurpose) ROSE_DEPRECATED("use toString");
391public:
394
395protected:
398
399protected:
407
408
409// End of memberFunctionString
410// Start of memberFunctionString
411/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
412
413// *** COMMON CODE SECTION BEGINS HERE ***
414
415 public:
416
417 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
418 // and not required which is required to match the other aspects of the copy mechanism code generation.
419 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
420 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
421 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
422 // virtual SgNode* copy ( const SgCopyHelp & help) const;
423
425 virtual std::string class_name() const override;
426
428 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
429
431 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
432 // static const VariantT static_variant = V_SgAsmExecutableFileFormat;
433 enum { static_variant = V_SgAsmExecutableFileFormat };
434
435 /* the generated cast function */
437 ROSE_DLL_API friend SgAsmExecutableFileFormat* isSgAsmExecutableFileFormat( SgNode * s );
438
440 ROSE_DLL_API friend const SgAsmExecutableFileFormat* isSgAsmExecutableFileFormat( const SgNode * s );
441
442 // ******************************************
443 // * Memory Pool / New / Delete
444 // ******************************************
445
446 public:
448 static const unsigned pool_size; //
450 static std::vector<unsigned char *> pools; //
452 static SgAsmExecutableFileFormat * next_node; //
453
455 static unsigned long initializeStorageClassArray(SgAsmExecutableFileFormatStorageClass *); //
456
458 static void clearMemoryPool(); //
459 static void deleteMemoryPool(); //
460
462 static void extendMemoryPoolForFileIO(); //
463
465 static SgAsmExecutableFileFormat * getPointerFromGlobalIndex(unsigned long); //
467 static SgAsmExecutableFileFormat * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
468
470 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
472 static void resetValidFreepointers(); //
474 static unsigned long getNumberOfLastValidPointer(); //
475
476
477#if defined(INLINE_FUNCTIONS)
479 inline void *operator new (size_t size);
480#else
482 void *operator new (size_t size);
483#endif
485 void operator delete (void* pointer, size_t size);
486
487 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
488 void operator delete (void* pointer)
489 {
490 // This is the generated delete operator...
491 SgAsmExecutableFileFormat::operator delete (pointer,sizeof(SgAsmExecutableFileFormat));
492 }
493
495 static size_t numberOfNodes();
496
498 static size_t memoryUsage();
499
500 // End of scope which started in IR nodes specific code
501 /* */
502
503 /* name Internal Functions
504 \brief Internal functions ... incomplete-documentation
505
506 These functions have been made public as part of the design, but they are suggested for internal use
507 or by particularly knowledgeable users for specialized tools or applications.
508
509 \internal We could not make these private because they are required by user for special purposes. And
510 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
511
512 */
513
514 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
515 // overridden in every class by *generated* implementation
517 virtual std::vector<SgNode*> get_traversalSuccessorContainer() const override;
518 // MS: 06/28/02 container of names of variables or container indices
519 // used used in the traversal to access AST successor nodes
520 // overridden in every class by *generated* implementation
523 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() const override;
524
525 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
526 // than all the vector copies. The implementation for these functions is generated for each class.
528 virtual size_t get_numberOfTraversalSuccessors() const override;
530 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) const override;
532 virtual size_t get_childIndex(SgNode *child) const override;
533
534#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
535 // MS: 08/16/2002 method for generating RTI information
537 virtual RTIReturnType roseRTI() override;
538#endif
539 /* */
540
541
542
543 /* name Deprecated Functions
544 \brief Deprecated functions ... incomplete-documentation
545
546 These functions have been deprecated from use.
547 */
548 /* */
549
551 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
552
553 // JJW (10/16/2008): Changed to a single function in Node.code, and put
554 // getVariant() in #if 0 block to prevent confusing Doxygen
555#if 0
557 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
559 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
560#endif
561 /* */
562
563
564
565
566 public:
567 /* name Traversal Support Functions
568 \brief Traversal support functions ... incomplete-documentation
569
570 These functions have been made public as part of the design, but they are suggested for internal use
571 or by particularly knowledgable users for specialized tools or applications.
572 */
573 /* */
574
575 // DQ (11/26/2005): Support for visitor pattern mechanims
576 // (inferior to ROSE traversal mechanism, experimental).
580
581 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
583 virtual void accept (ROSE_VisitorPattern & visitor) override;
584
585 // DQ (12/26/2005): Support for traversal based on the memory pool
588 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
589
593
594 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
595 // This traversal helps support internal tools that call static member functions.
596 // note: this function operates on the memory pools.
599 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
600 /* */
601
602 public:
603 /* NodeId support functions */
605 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
608 static SgAsmExecutableFileFormat* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
611 static std::string getNodeIdString(SgAsmExecutableFileFormat* sgnode);
612 static std::string getNodeIdStringInternal(SgAsmExecutableFileFormat* sgnode);
613
614 public:
615 /* name Memory Allocation Functions
616 \brief Memory allocations functions ... incomplete-documentation
617
618 These functions have been made public as part of the design, but they are suggested for internal use
619 or by particularly knowledgable users for specialized tools or applications.
620 */
621 /* */
622
633 virtual bool isInMemoryPool() override;
634
645 virtual void checkDataMemberPointersIfInMemoryPool() override;
646
647 // DQ (4/30/2006): Modified to be a const function.
662 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
663
674
686 virtual long getChildIndex( SgNode* childNode ) const override;
687
688 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
689 // comment here (changed to be a C style comment and not be a doxygen comment).
690 /* \brief Constructor for use by AST File I/O Mechanism
691
692 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
693 which obtained via fast binary file I/O from disk.
694 */
695 // SgAsmExecutableFileFormat( SgAsmExecutableFileFormatStorageClass& source );
696
697
698
699
700
701 // JH (10/24/2005): methods added to support the ast file IO
702 private:
703
704 /* name AST Memory Allocation Support Functions
705 \brief Memory allocations support....
706
707 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
708 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
709 and support the AST File I/O Mechanism.
710 */
711 /* */
712
713 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
714 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
715 that I use the same type everywhere, if any changes are made. THe second one declares the type
716 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
717 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
718 a correspinding one in the AST_FILE_IO class!
719 */
720 // DQ (9/2/2015): This typedef is no longer used, we can't define the
721 // comment here (changed to be a C style comment and not be a doxygen comment).
722 /* \brief Typedef used for low level memory access.
723 */
724 // typedef unsigned char* TestType;
725
726 // DQ (9/2/2015): This typedef is no longer used, we can't define the
727 // comment here (changed to be a C style comment and not be a doxygen comment).
728 /* \brief Typedef used to hold memory addresses as values.
729 */
730 // typedef unsigned long AddressType;
731
732
733
734 // necessary, to have direct access to the p_freepointer and the private methods !
736 friend class AST_FILE_IO;
737
739 friend class SgAsmExecutableFileFormatStorageClass;
740
742 friend class AstSpecificDataManagingClass;
743
745 friend class AstSpecificDataManagingClassStorageClass;
746 public:
748 SgAsmExecutableFileFormat( const SgAsmExecutableFileFormatStorageClass& source );
749
750 // private: // JJW hack
751 /*
752 name AST Memory Allocation Support Variables
753 Memory allocations support variables
754
755 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
756 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
757 and support the AST File I/O Mechanism.
758 */
759 /* */
760
761 public:
762
763 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
764 // to current node (so that it will work cleanly with build functions to specify patterns).
765 // virtual SgNode* addRegExpAttribute();
772
773#ifndef _MSC_VER
774// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
775// and likely never fully implemented nor tested. Files remain in the src tree but are no
776// longer built.
777#define BUILD_ATERM_SUPPORT 0
778 #if BUILD_ATERM_SUPPORT
779 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
780 // DQ (10/4/2014): Adding ATerm support to ROSE.
790 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
791 virtual ATerm generate_ATerm() override;
792
794 virtual void generate_ATerm_Annotation(ATerm & term) override;
795 #endif
796 #endif // BUILD_ATERM_SUPPORT
797#endif
798 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
799 // virtual generate_AST(ATerm & term);
800 // virtual void read_ATerm_Annotation(ATerm & term);
801
802// *** COMMON CODE SECTION ENDS HERE ***
803
804
805// End of memberFunctionString
806// Start of memberFunctionString
807/* #line 710 "/workspace/src/ROSETTA/Grammar/Node.code" */
808
809 // the generated cast function
810 // friend ROSE_DLL_API SgAsmExecutableFileFormat* isSgAsmExecutableFileFormat ( SgNode* s );
811
812 typedef SgAsmNode base_node_type;
813
814
815// End of memberFunctionString
816
817 protected:
818
820
821/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
822
823
824 };
825#endif
826
827// postdeclarations for SgAsmExecutableFileFormat
828
829/* #line 830 "../../../src/frontend/SageIII//SgAsmExecutableFileFormat.h" */
830
831/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
832
833/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
834
835
836/* #line 837 "../../../src/frontend/SageIII//SgAsmExecutableFileFormat.h" */
837
838#endif // ROSE_SgAsmExecutableFileFormat_H
839
Class holding static data and functions supporting File I/O.
Definition AST_FILE_IO.h:19
Attribute containing a regex expression as a string.
Base class for all ROSE exceptions.
Collection of streams.
Definition Message.h:1606
Base class for many binary analysis nodes.
ExecPurpose
General purpose of a binary executable file.
ExecABI
Application binary interface.
InsSetArchitecture
Instruction sets organized by families.
Base class for binary files.
Contiguous region of a file.
Base class for all binary analysis IR nodes.
void initializeProperties()
Initialize all properties that have explicit initial values.
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.
void initDiagnostics()
Initialize diagnostics.
std::uint64_t Address
Address.
Definition Address.h:11
ROSE_DLL_API Sawyer::Message::Facility mlog
Diagnostic facility for the ROSE library as a whole.
Definition sageBuilder.C:58
ROSE_UTIL_API std::string toString(const Path &)
Convert a path to a string.
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.
const char * ExecABI(int64_t)
Convert SgAsmExecutableFileFormat::ExecABI enum constant to a string.
const char * InsSetArchitecture(int64_t)
Convert SgAsmExecutableFileFormat::InsSetArchitecture enum constant to a string.
const char * ExecPurpose(int64_t)
Convert SgAsmExecutableFileFormat::ExecPurpose enum constant to a string.
const char * ExecFamily(int64_t)
Convert SgAsmExecutableFileFormat::ExecFamily enum constant to a string.