ROSE  0.11.22.0
binaryInstruction.C
1 #include <featureTests.h>
2 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
3 
4 /******************************************************************************************************************************
5  * NOTE: For any given IR class, please keep all its parts as close together as possible. Its bad enough that we're
6  * defining classes in a non-C-like language -- and it's painful when a definition is scattered all over this file. We
7  * already have four places to look to get the definition of an IR class:
8  * (1) here, in this source file, built with ROSETTA functions
9  * (2) additional declarations between HEADER_* markers in ../Grammar/BinaryInstruction.code (which we can't
10  * even parse as a C++ file, making IDEs useless there).
11  * (3) function definitions between SOURCE_* markers in ../Grammar/BinaryInstruction.code, which for some
12  * reason are not next to the corresponding HEADER_ markers. Please migrate these definitions to *.C files
13  * whenever you have an opportunity, so that IDEs can see the definitions.
14  * (4) Doxygen documentation in ../../../docs/testDoxygen directory since doxygen can't parse the IR classes
15  * from this source file. Documented entities are marked with a "DOXYGEN" comment here to make it more
16  * obvious when documentation is present.
17  *
18  * NOTE: First part of the file is for classes describing instructions. Middle part is for classes describing binary
19  * containers (organized by container type: ELF, DOS, PE, ...) Last part is the base classes. Unlike C++, the classes
20  * defined in this file need to be defined from the most specific (derived classes) to the most general (base class).
21  *
22  * NOTE: Please use three blank lines between IR node definitions to help make this file more readable. Unless those IR
23  * nodes are so closely related to one another that it's better to keep them close.
24  *
25  * UPDATE: Instead of splitting class declarations into five separate places, we can now use the macros defined below to
26  * put everything but the node name into one place in this file. The node name still needs a line in the
27  * "astNodeList" file. My goal is to eventually remove the src/ROSETTA/Grammar/BinaryInstruction.code file and
28  * the related docs/testDoxygen/xxx.docs files and to add documentation here for all property accessors.
29  *
30  * ROSETTA FAILURE MODES:
31  *
32  * + If you get thousands of compile errors in Cxx_Grammar.h that seem to have absolutely nothing to do with the node
33  * you just added, then double check that the new node type is listed as the descendant of some other node type in a
34  * NEW_NONTERMINAL_MACRO macro expansion.
35  *
36  * + If CxxGrammarMetaProgram uses gigabytes and gigabytes of memory and never terminates then check that all the new
37  * IR node types have a correctly spelled entry in the astNodeList file.
38  *-----------------------------------------------------------------------------------------------------------------------------*/
39 
40 #include "ROSETTA_macros.h"
41 #include "grammar.h"
42 #include "AstNodeClass.h"
43 
44 // The following macros try to make it possile to keep all aspects of a Sage node's declaration in this one file. The old way
45 // of doing things required the class declarations to be split into four places:
46 // (1) The #include files necessary to declare the class were at the top of a src/ROSETTA/Grammar/*.code file
47 // (2) The class declaration and properties were built in src/ROSETTA/src/*.C
48 // (3) The documentation for the class and its properties were in docs/testDoxygen/*.docs files
49 // (4) Additional non-ROSETTA members were in src/ROSETTA/Grammar/*.code files
50 // Implementations were originally also in the src/ROSETTA/Grammar/*.code files but have since been moved to *.C files. The
51 // problem with *.code files is no IDE understands them.
52 //
53 // The following macros take a CLASS_WITHOUT_Sg parameter, which is the name of the Sage node class but without the leading
54 // "Sg". I'm not sure why ROSETTA was written this way. For instance, use "AsmInstruction" instead of "SgAsmInstruction". Most
55 // other things will use the full class name.
56 //
57 // The macros are:
58 // DOCUMENTATION is never defined when compiling, but will be defined when generating documentation and can be used to help
59 // IDE's figure out the indentation and as commentary. We don't use "#if 0" because some IDEs figure out that the code is
60 // never possible and don't indent it properly. For instance, most of the classes are defined like this:
61 // #ifdef DOCUMENTATION
62 // class SgAsmAarch64Instruction: public SgAsmInstruction {
63 // #endif
64 //
65 // ...
66 //
67 // #ifdef DOCUMENTATION
68 // };
69 // #endif
70 //
71 //
72 // DECLARE_LEAF_CLASS is the simpler way to declare a Sage class that has no subclasses. This must be the first macro
73 // invoked when starting a new class declaration. Example, to declare the SgMyClass node, say:
74 // DECLARE_LEAF_CLASS(MyClass);
75 // #ifdef DOCUMENTATION
76 // class SgMyClass: public ...base-classes... {
77 // #endif
78 //
79 //
80 // DECLARE_HEADERS is used to indicate what header files need to be included. Note that due to limitations of ROSETTA
81 // (specifically, not having any portable regular expression library due to prohibition against using boost), the #ifdef and
82 // #endif lines must be *exactly* as written here -- they are sensitive to white space.
83 // DECLARE_HEADERS(MyClass);
84 // #if defined(SgMyClass_HEADERS) || defined(DOCUMENTATION)
85 // #include <someHeader>
86 // #endif // SgMyClass_HEADERS
87 //
88 //
89 // DECLARE_OTHERS is for declaring other class members that don't need to be processed by ROSETTA. Due to limitations of
90 // ROSETTA (specifically, not having any portable regular expression library due to prohibition against using boost), the
91 // #ifdef and #endif lines must be *exactly* as written here -- they are sensitive to white space.
92 // DECLARE_OTHERS(MyClass);
93 // #if defined(SgMyClass_OTHERS) || defined(DOCUMENTATION)
94 // // other declarations here
95 // #endif // SgMyClass_OTHERS
96 
97 //#undef DOCUMENTATION -- commented out so IDEs can't figure it out
98 #ifdef DOCUMENTATION
99 DOCUMENTATION_should_never_be_defined;
100 #endif
101 
102 #ifdef DOCUMENTATION
103 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) /*void*/
104 #else
105 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) \
106  NEW_TERMINAL_MACRO(CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg "Tag"); \
107  CLASS_WITHOUT_Sg.setCppCondition("!defined(DOCUMENTATION)")
108 #endif
109 
110 #ifdef DOCUMENTATION
111 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) /*void*/
112 #else
113 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) \
114  CLASS_WITHOUT_Sg.setPredeclarationString("Sg" #CLASS_WITHOUT_Sg "_HEADERS", \
115  ROSE_AUTOMAKE_ABSOLUTE_PATH_TOP_SRCDIR + "/src/ROSETTA/src/binaryInstruction.C")
116 #endif
117 
118 #ifdef DOCUMENTATION
119 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) /*void*/
120 #else
121 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) \
122  CLASS_WITHOUT_Sg.setFunctionPrototype("Sg" #CLASS_WITHOUT_Sg "_OTHERS", \
123  ROSE_AUTOMAKE_ABSOLUTE_PATH_TOP_SRCDIR + "/src/ROSETTA/src/binaryInstruction.C")
124 #endif
125 
126 #ifdef DOCUMENTATION
127 #define IS_SERIALIZABLE() /*void*/
128 #else
129 #define IS_SERIALIZABLE(CLASS_WITHOUT_Sg) \
130  CLASS_WITHOUT_Sg.isBoostSerializable(true)
131 #endif
132 
133 // Since ROSETTA builds classes from the leaves up to the base, and C++ builds classes from the base down to the leaves, we
134 // need to make sure that doxygen sees the base classes before the derived classes. So just list all the non-leaf classes here.
135 #ifdef DOCUMENTATION
138 class SgAsmDwarfConstruct;
140 class SgAsmElfSection;
142 class SgAsmExpression;
143 class SgAsmGenericHeader;
144 class SgAsmGenericSection;
145 class SgAsmGenericString;
146 class SgAsmGenericStrtab;
147 class SgAsmGenericSymbol;
148 class SgAsmInstruction;
149 class SgAsmNode;
150 class SgAsmPESection;
152 class SgAsmScalarType;
153 class SgAsmStatement;
154 class AsmSynthesizedFieldDeclaration;
155 class SgAsmType;
158 class SgNode;
159 #endif
160 
161 #ifndef DOCUMENTATION
162 void Grammar::setUpBinaryInstructions() {
163 #endif
164 
166 
167  /**************************************************************************************************************************
168  * Instructions.
169  * Base class (SgAsmInstruction) and various subclasses, one per architecture.
170  **************************************************************************************************************************/
171 
173 
174 #ifdef ROSE_ENABLE_ASM_AARCH32
175  DECLARE_LEAF_CLASS(AsmAarch32Instruction);
176  IS_SERIALIZABLE(AsmAarch32Instruction);
177 
178  DECLARE_HEADERS(AsmAarch32Instruction);
179 #if defined(SgAsmAarch32Instruction_HEADERS) || defined(DOCUMENTATION)
180  #include <InstructionEnumsAarch32.h>
181 #endif // SgAsmAarch32Instruction_HEADERS
182 
183 #ifdef DOCUMENTATION
184 
185  class SgAsmAarch32Instruction: public SgAsmInstruction {
186  public:
187 #endif
188 
189 #ifdef DOCUMENTATION
190 
196  Rose::BinaryAnalysis::AArch32InstructionKind get_kind() const;
197  void set_kind(Rose::BinaryAnalysis::Aarch32InstructionKind);
199 #else
200  AsmAarch32Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch32InstructionKind", "kind",
201  "= Rose::BinaryAnalysis::Aarch32InstructionKind::ARM_INS_INVALID",
202  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
203 #endif
204 
205 #ifdef DOCUMENTATION
206 
211  Rose::BinaryAnalysis::Aarch32InstructionCondition get_condition() const;
212  void set_condition(Rose::BinaryAnalysis::Aarch32InstructionCondition);
214 #else
215  AsmAarch32Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch32InstructionCondition", "condition",
216  "= Rose::BinaryAnalysis::Aarch32InstructionCondition::ARM_CC_INVALID",
217  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
218 #endif
219 
220 #ifdef DOCUMENTATION
221 
224  bool get_updatesFlags() const;
225  void set_updatesFlags(bool);
227 #else
228  AsmAarch32Instruction.setDataPrototype("bool", "updatesFlags", "= false",
229  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
230 #endif
231 
232  DECLARE_OTHERS(AsmAarch32Instruction);
233 #if defined(SgAsmAarch32Instruction_OTHERS) || defined(DOCUMENTATION)
234 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
235  private:
236  friend class boost::serialization::access;
237 
238  template<class S>
239  void serialize(S &s, const unsigned /*version*/) {
240  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
241  s & BOOST_SERIALIZATION_NVP(p_kind);
242  }
243 #endif
244 
245  public:
246  // Overrides are documented in the base class
247  virtual std::string description() const $ROSE_OVERRIDE;
248  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
249  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
250  virtual bool isUnknown() const $ROSE_OVERRIDE;
251  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
252  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
253  rose_addr_t *return_va) $ROSE_OVERRIDE;
254  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
255  rose_addr_t *return_va) $ROSE_OVERRIDE;
256  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
257  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
258  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
259 
260 #endif // SgAsmAarch32Instruction_OTHERS
261 #ifdef DOCUMENTATION
262  };
263 #endif
264 #endif
265 
267 
268 #ifdef ROSE_ENABLE_ASM_AARCH64
269  DECLARE_LEAF_CLASS(AsmAarch64Instruction);
270  IS_SERIALIZABLE(AsmAarch64Instruction);
271 
272  DECLARE_HEADERS(AsmAarch64Instruction);
273 #if defined(SgAsmAarch64Instruction_HEADERS) || defined(DOCUMENTATION)
274  #include <InstructionEnumsAarch64.h>
275 #endif // SgAsmAarch64Instruction_HEADERS
276 
277 #ifdef DOCUMENTATION
278 
279  class SgAsmAarch64Instruction: public SgAsmInstruction {
280  public:
281 #endif
282 
283 #ifdef DOCUMENTATION
284 
290  Rose::BinaryAnalysis::Aarch64InstructionKind get_kind() const;
291  void set_kind(Rose::BinaryAnalysis::Aarch64InstructionKind);
293 #else
294  AsmAarch64Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch64InstructionKind", "kind",
295  "= Rose::BinaryAnalysis::Aarch64InstructionKind::ARM64_INS_INVALID",
296  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
297 #endif
298 
299 #ifdef DOCUMENTATION
300 
303  Rose::BinaryAnalysis::Aarch64InstructionCondition get_condition() const;
304  void set_condition(Rose::BinaryAnalysis::Aarch64InstructionCondition);
306 #else
307  AsmAarch64Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch64InstructionCondition", "condition",
308  "= Rose::BinaryAnalysis::Aarch64InstructionCondition::ARM64_CC_INVALID",
309  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
310 #endif
311 
312 #ifdef DOCUMENTATION
313 
316  bool get_updatesFlags() const;
317  void set_updatesFlags(bool);
319 #else
320  AsmAarch64Instruction.setDataPrototype("bool", "updatesFlags", "= false",
321  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
322 #endif
323 
324  DECLARE_OTHERS(AsmAarch64Instruction);
325 #if defined(SgAsmAarch64Instruction_OTHERS) || defined(DOCUMENTATION)
326 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
327  private:
328  friend class boost::serialization::access;
329 
330  template<class S>
331  void serialize(S &s, const unsigned /*version*/) {
332  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
333  s & BOOST_SERIALIZATION_NVP(p_kind);
334  s & BOOST_SERIALIZATION_NVP(p_condition);
335  }
336 #endif
337 
338  public:
339  // Overrides are documented in the base class
340  virtual std::string description() const $ROSE_OVERRIDE;
341  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
342  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
343  virtual bool isUnknown() const $ROSE_OVERRIDE;
344  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
345  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
346  rose_addr_t *return_va) $ROSE_OVERRIDE;
347  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
348  rose_addr_t *return_va) $ROSE_OVERRIDE;
349  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
350  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
351  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
352 
353 #endif // SgAsmAarch64Instruction_OTHERS
354 #ifdef DOCUMENTATION
355  };
356 #endif
357 #endif
358 
360 
361  DECLARE_LEAF_CLASS(AsmX86Instruction);
362  IS_SERIALIZABLE(AsmX86Instruction);
363  DECLARE_HEADERS(AsmX86Instruction);
364 #if defined(SgAsmX86Instruction_HEADERS) || defined(DOCUMENTATION)
365  #include <InstructionEnumsX86.h>
366  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
367 #endif // SgAsmX86Instruction_HEADERS
368 
369 #ifdef DOCUMENTATION
370 
372  public:
373 #endif
374 
375 #ifdef DOCUMENTATION
376 
385 #else
386  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionKind", "kind",
387  "= Rose::BinaryAnalysis::x86_unknown_instruction",
388  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
389 #endif
390 
391 #ifdef DOCUMENTATION
392 
398 #else
399  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "baseSize",
400  "= Rose::BinaryAnalysis::x86_insnsize_none",
401  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
402 #endif
403 
404 #ifdef DOCUMENTATION
405 
411 #else
412  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "operandSize",
413  "= Rose::BinaryAnalysis::x86_insnsize_none",
414  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
415 #endif
416 
417 #ifdef DOCUMENTATION
418 
424 #else
425  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "addressSize",
426  "= Rose::BinaryAnalysis::x86_insnsize_none",
427  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
428 #endif
429 
430 #ifdef DOCUMENTATION
431 
436  bool get_lockPrefix() const;
437  void set_lockPrefix(bool);
439 #else
440  AsmX86Instruction.setDataPrototype("bool", "lockPrefix", "= false",
441  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
442 #endif
443 
444 #ifdef DOCUMENTATION
445 
451 #else
452  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86RepeatPrefix", "repeatPrefix",
453  "= Rose::BinaryAnalysis::x86_repeat_none",
454  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
455 #endif
456 
457 #ifdef DOCUMENTATION
458 
464 #else
465  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86BranchPrediction", "branchPrediction",
466  "= Rose::BinaryAnalysis::x86_branch_prediction_none",
467  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
468 #endif
469 
470 #ifdef DOCUMENTATION
471 
480 #else
481  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86SegmentRegister", "segmentOverride",
482  "= Rose::BinaryAnalysis::x86_segreg_none",
483  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
484 #endif
485 
486 
487  DECLARE_OTHERS(AsmX86Instruction);
488 #if defined(SgAsmX86Instruction_OTHERS) || defined(DOCUMENTATION)
489 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
490  private:
491  friend class boost::serialization::access;
492 
493  template<class S>
494  void serialize(S &s, const unsigned /*version*/) {
495  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
496  s & BOOST_SERIALIZATION_NVP(p_kind);
497  s & BOOST_SERIALIZATION_NVP(p_baseSize);
498  s & BOOST_SERIALIZATION_NVP(p_operandSize);
499  s & BOOST_SERIALIZATION_NVP(p_addressSize);
500  s & BOOST_SERIALIZATION_NVP(p_lockPrefix);
501  s & BOOST_SERIALIZATION_NVP(p_repeatPrefix);
502  s & BOOST_SERIALIZATION_NVP(p_branchPrediction);
503  s & BOOST_SERIALIZATION_NVP(p_segmentOverride);
504  }
505 #endif
506 
507  public:
512 
517 
523 
529 
530  // Overrides are documented in the base class
531  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
532  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
533  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
534  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
535  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
536  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
537  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
538  virtual bool getBranchTarget(rose_addr_t *target/*out*/) $ROSE_OVERRIDE;
539  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
540  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
541  bool &complete,
542  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
543  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
544  virtual bool isUnknown() const $ROSE_OVERRIDE;
545  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
546 #endif // SgAsmX86Instruction_OTHERS
547 #ifdef DOCUMENTATION
548  };
549 #endif
550 
552 
553  DECLARE_LEAF_CLASS(AsmPowerpcInstruction);
554  IS_SERIALIZABLE(AsmPowerpcInstruction);
555  DECLARE_HEADERS(AsmPowerpcInstruction);
556 #if defined(SgAsmPowerpcInstruction_HEADERS) || defined(DOCUMENTATION)
557  #include <InstructionEnumsPowerpc.h>
558 #endif // SgAsmPowerpcInstruction_HEADERS
559 
560 #ifdef DOCUMENTATION
561 
563  public:
564 #endif
565 
566 
567 #ifdef DOCUMENTATION
568 
577 #else
578  AsmPowerpcInstruction.setDataPrototype("Rose::BinaryAnalysis::PowerpcInstructionKind", "kind",
579  "= Rose::BinaryAnalysis::powerpc_unknown_instruction",
580  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
581  COPY_DATA);
582 #endif
583 
584  DECLARE_OTHERS(AsmPowerpcInstruction);
585 #if defined(SgAsmPowerpcInstruction_OTHERS) || defined(DOCUMENTATION)
586 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
587  private:
588  friend class boost::serialization::access;
589 
590  template<class S>
591  void serialize(S &s, const unsigned /*version*/) {
592  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
593  s & BOOST_SERIALIZATION_NVP(p_kind);
594  }
595 #endif
596 
597  public:
603  std::string conditionalBranchDescription() const;
604 
610 
611  // Overrides are documented in the base class
612  virtual std::string description() const $ROSE_OVERRIDE;
613  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
614  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
615  virtual bool isUnknown() const $ROSE_OVERRIDE;
616  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
617  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
618  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
619  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
620  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
621  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
622  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
623 #endif // SgAsmPowerpcInstruction_OTHERS
624 #ifdef DOCUMENTATION
625  };
626 #endif
627 
628 
630 
631  DECLARE_LEAF_CLASS(AsmMipsInstruction);
632  IS_SERIALIZABLE(AsmMipsInstruction);
633  DECLARE_HEADERS(AsmMipsInstruction);
634 #if defined(SgAsmMipsInstruction_HEADERS) || defined(DOCUMENTATION)
635  #include <InstructionEnumsMips.h>
636 #endif // SgAsmMipsInstruction_HEADERS
637 
638 #ifdef DOCUMENTATION
639 
641  public:
642 #endif
643 
644 #ifdef DOCUMENTATION
645 
654 #else
655  AsmMipsInstruction.setDataPrototype("Rose::BinaryAnalysis::MipsInstructionKind", "kind",
656  "= Rose::BinaryAnalysis::mips_unknown_instruction",
657  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
658  COPY_DATA);
659 #endif
660 
661  DECLARE_OTHERS(AsmMipsInstruction);
662 #if defined(SgAsmMipsInstruction_OTHERS) || defined(DOCUMENTATION)
663 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
664  private:
665  friend class boost::serialization::access;
666 
667  template<class S>
668  void serialize(S &s, const unsigned /*version*/) {
669  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
670  s & BOOST_SERIALIZATION_NVP(p_kind);
671  }
672 #endif
673 
674  public:
675  // Overrides are documented in the base class
676  virtual std::string description() const $ROSE_OVERRIDE;
677  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
678  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
679  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
680  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
681  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
682  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
683  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
684  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
685  virtual bool isUnknown() const $ROSE_OVERRIDE;
686  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
687  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
688 #endif // SgAsmMipsInstruction_OTHERS
689 #ifdef DOCUMENTATION
690  };
691 #endif
692 
694 
695  DECLARE_LEAF_CLASS(AsmM68kInstruction);
696  IS_SERIALIZABLE(AsmM68kInstruction);
697  DECLARE_HEADERS(AsmM68kInstruction);
698 #if defined(SgAsmM68kInstruction_HEADERS) || defined(DOCUMENTATION)
699  #include "InstructionEnumsM68k.h"
700 #endif // SgAsmM68kInstruction_HEADERS
701 
702 #ifdef DOCUMENTATION
704  public:
705 #endif
706 
707 #ifdef DOCUMENTATION
708 
717 #else
718  AsmM68kInstruction.setDataPrototype("Rose::BinaryAnalysis::M68kInstructionKind", "kind",
719  " = Rose::BinaryAnalysis::m68k_unknown_instruction",
720  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
721  COPY_DATA);
722 #endif
723 
724  DECLARE_OTHERS(AsmM68kInstruction);
725 #if defined(SgAsmM68kInstruction_OTHERS) || defined(DOCUMENTATION)
726 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
727  private:
728  friend class boost::serialization::access;
729 
730  template<class S>
731  void serialize(S &s, const unsigned /*version*/) {
732  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
733  s & BOOST_SERIALIZATION_NVP(p_kind);
734  }
735 #endif
736 
737  public:
738  // Overrides are documented in the base class
739  virtual std::string description() const $ROSE_OVERRIDE;
740  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
741  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
742  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
743  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
744  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
745  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
746  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
747  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
748  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
749  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
750  bool &complete,
751  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
752  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
753  virtual bool isUnknown() const $ROSE_OVERRIDE;
754  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
755 #endif // SgAsmM68kInstruction_OTHERS
756 #ifdef DOCUMENTATION
757  };
758 #endif
759 
761 
762  DECLARE_LEAF_CLASS(AsmNullInstruction);
763  IS_SERIALIZABLE(AsmNullInstruction);
764 
765 #ifdef DOCUMENTATION
767  public:
768 #endif
769 
770  DECLARE_OTHERS(AsmNullInstruction);
771 #if defined(SgAsmNullInstruction_OTHERS) || defined(DOCUMENTATION)
772 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
773  private:
774  friend class boost::serialization::access;
775 
776  template<class S>
777  void serialize(S & s, const unsigned /*version*/) {
778  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
779  }
780 #endif
781 
782  public:
783  // there's only one kind of null instruction
784  enum Kind { null_unknown };
785 
786  public: // overrides
787  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
788  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
789  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
790  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
791  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
792  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
793  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
794  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
795  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
796  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
797  bool &complete,
798  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
799  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
800  virtual bool isUnknown() const $ROSE_OVERRIDE;
801  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
802 #endif // SgAsmNullInstruction_OTHERS
803 #ifdef DOCUMENTATION
804  };
805 #endif
806 
808 
809  NEW_NONTERMINAL_MACRO(AsmInstruction,
810  AsmX86Instruction
811 #ifdef ROSE_ENABLE_ASM_AARCH32
812  | AsmAarch32Instruction
813 #endif
814 #ifdef ROSE_ENABLE_ASM_AARCH64
815  | AsmAarch64Instruction
816 #endif
817  | AsmPowerpcInstruction | AsmMipsInstruction | AsmM68kInstruction | AsmNullInstruction,
818  "AsmInstruction", "AsmInstructionTag", true);
819  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
820  IS_SERIALIZABLE(AsmInstruction);
821 
822  DECLARE_HEADERS(AsmInstruction);
823 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
824  #include <MemoryMap.h>
825 #endif // SgAsmInstruction_HEADERS
826 
827 #ifdef DOCUMENTATION
828 
850  public:
851 #endif
852 
853 #ifdef DOCUMENTATION
854 
862  const std::string& get_mnemonic() const;
863  void set_mnemonic(const std::string&);
865 #else
866  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
867  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
868 #endif
869 
870 #ifdef DOCUMENTATION
871 
876  const SgUnsignedList& get_raw_bytes() const;
877  void set_raw_bytes(const SgUnsignedList&);
879 #else
880  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
881  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
882 #endif
883 
884 #ifdef DOCUMENTATION
885 
894 #else
895  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
896  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
897 #endif
898 
899 #ifdef DOCUMENTATION
900  // Documentation is below because it uses different names than normal. Functions are not automatically generated because
901  // we need to synchronize access to the private p_cacheLockCount data member. However, we still use ROSETTA to generate
902  // the data member because we need to make sure it gets initialized to zero in the constructors. What a mess.
903 #else
904  AsmInstruction.setDataPrototype("size_t", "cacheLockCount", "= 0",
905  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
906 #endif
907 
908 #ifdef DOCUMENTATION
909  // FIXME[Robb P Matzke 2017-02-13]: unused?
910 #else
911  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
912  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
913 #endif
914 
915 #ifdef DOCUMENTATION
916 
922  int64_t get_stackDeltaIn() const;
923  void set_stackDeltaIn(int64_t);
925 #else
926  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
927  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
928 #endif
929 
930 #ifdef DOCUMENTATION
931 
936 #else
937  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
938  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
939 #endif
940 
941  DECLARE_OTHERS(AsmInstruction);
942 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
943 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
944  private:
945  friend class boost::serialization::access;
946 
947  template<class S>
948  void serialize(S &s, const unsigned version) {
949  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
950  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
951  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
952  s & BOOST_SERIALIZATION_NVP(p_operandList);
953  s & BOOST_SERIALIZATION_NVP(p_sources);
954  if (version >= 1)
955  s & BOOST_SERIALIZATION_NVP(semanticFailure_);
956  //s & BOOST_SERIALIZATION_NVP(p_cacheLockCount); -- definitely not!
957  }
958 #endif
959 
960  private:
961  struct SemanticFailure {
962  size_t n;
963  SemanticFailure(): n(0) {}
964 
965 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
966  private:
967  friend class boost::serialization::access;
968  template<class S>
969  void serialize(S &s, const unsigned /*version*/) {
970  s & BOOST_SERIALIZATION_NVP(n);
971  }
972 #endif
973  };
974  SemanticFailure semanticFailure_;
975 
976  // Synchronized data members. All the following data members (as listed in binaryInstruction.C, not the ROSETTA-generated
977  // code) should be procted by the mutex_. Additionally, the p_cacheLockCount data member is synchronized.
978  mutable SAWYER_THREAD_TRAITS::Mutex mutex_;
979 
980  public:
985  static const int64_t INVALID_STACK_DELTA;
986 
992  virtual std::string description() const { return ""; }
993 
994  // FIXME[Robb P Matzke 2017-02-13]: unused?
995  void appendSources( SgAsmInstruction* instruction );
996 
998  size_t nOperands() const;
999 
1003  SgAsmExpression* operand(size_t) const;
1004 
1011  virtual bool terminatesBasicBlock();
1012 
1026  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
1027  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
1039  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
1040  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
1046  bool isFirstInBlock();
1047 
1051  bool isLastInBlock();
1052 
1057  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
1058 
1193  virtual bool hasEffect();
1194 
1203  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
1204  bool relax_stack_semantics=false);
1205 
1215  virtual std::vector<std::pair<size_t,size_t> >
1216  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
1217  bool relax_stack_semantics=false);
1218 
1225  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete); /*subclasses must redefine*/
1226 
1235  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1236  bool &complete,
1237  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1239 
1245  virtual size_t get_size() const;
1246 
1252  virtual bool isUnknown() const;
1253 
1287  virtual unsigned get_anyKind() const;
1288 
1292  virtual std::string toString() const;
1293 
1298  virtual std::set<rose_addr_t> explicitConstants() const;
1299 
1309  size_t semanticFailure() const;
1310  void semanticFailure(size_t);
1311  void incrementSemanticFailure();
1321  size_t cacheLockCount() const;
1322  void adjustCacheLockCount(int increment);
1324 #endif // SgAsmInstruction_OTHERS
1325 
1326 #ifdef DOCUMENTATION
1327  };
1328 #endif
1329 
1330 
1331 
1333 
1334  /**************************************************************************************************************************
1335  * Instruction Expressions
1336  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1337  **************************************************************************************************************************/
1338 
1340 
1341  DECLARE_LEAF_CLASS(AsmOperandList);
1342  IS_SERIALIZABLE(AsmOperandList);
1343 
1344 #ifdef DOCUMENTATION
1345 
1346  class SgAsmOperandList: public SgAsmNode {
1347  public:
1348 #endif
1349 
1350 #ifdef DOCUMENTATION
1351 
1357  const SgAsmExpressionPtrList& get_operands() const;
1358  void set_oerands(const SgAsmExpressionPtrList&);
1360 #else
1361  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1362  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1363 #endif
1364 
1365  DECLARE_OTHERS(AsmOperandList);
1366 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1367 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1368  private:
1369  friend class boost::serialization::access;
1370 
1371  template<class S>
1372  void serialize(S &s, const unsigned /*version*/) {
1373  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1374  s & BOOST_SERIALIZATION_NVP(p_operands);
1375  }
1376 #endif
1377 
1378  public:
1380  void append_operand(SgAsmExpression* operand);
1381 #endif // SgAsmOperandList_OTHERS
1382 
1383 #ifdef DOCUMENTATION
1384  };
1385 #endif
1386 
1387  // FIXME[Robb P Matzke 2016-10-31]
1388  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1389 
1391 
1392  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1393  IS_SERIALIZABLE(AsmBinaryAdd);
1394 
1395 #ifdef DOCUMENTATION
1396 
1398  public:
1399 #endif
1400 
1401  DECLARE_OTHERS(AsmBinaryAdd);
1402 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1403 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1404  private:
1405  friend class boost::serialization::access;
1406 
1407  template<class S>
1408  void serialize(S &s, const unsigned /*version*/) {
1409  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1410  }
1411 #endif
1412 #endif // SgAsmBinaryAdd_OTHERS
1413 
1414 #ifdef DOCUMENTATION
1415  };
1416 #endif
1417 
1419 
1420  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1421  IS_SERIALIZABLE(AsmBinarySubtract);
1422 
1423 #ifdef DOCUMENTATION
1424 
1426  public:
1427 #endif
1428 
1429  DECLARE_OTHERS(AsmBinarySubtract);
1430 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1431 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1432  private:
1433  friend class boost::serialization::access;
1434 
1435  template<class S>
1436  void serialize(S &s, const unsigned /*version*/) {
1437  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1438  }
1439 #endif
1440 #endif // SgAsmBinarySubtract_OTHERS
1441 
1442 #ifdef DOCUMENTATION
1443  };
1444 #endif
1445 
1447 
1448  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1449  IS_SERIALIZABLE(AsmBinaryMultiply);
1450 
1451 #ifdef DOCUMENTATION
1452 
1454  public:
1455 #endif
1456 
1457  DECLARE_OTHERS(AsmBinaryMultiply);
1458 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1459 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1460  private:
1461  friend class boost::serialization::access;
1462 
1463  template<class S>
1464  void serialize(S &s, const unsigned /*version*/) {
1465  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1466  }
1467 #endif
1468 #endif // SgAsmBinaryMultiply_OTHERS
1469 
1470 #ifdef DOCUMENTATION
1471  };
1472 #endif
1473 
1475 
1476  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1477  IS_SERIALIZABLE(AsmBinaryDivide);
1478 
1479 #ifdef DOCUMENTATION
1480 
1482  public:
1483 #endif
1484 
1485  DECLARE_OTHERS(AsmBinaryDivide);
1486 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1487 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1488  private:
1489  friend class boost::serialization::access;
1490 
1491  template<class S>
1492  void serialize(S &s, const unsigned /*version*/) {
1493  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1494  }
1495 #endif
1496 #endif // SgAsmBinaryDivide_OTHERS
1497 
1498 #ifdef DOCUMENTATION
1499  };
1500 #endif
1501 
1503 
1504  DECLARE_LEAF_CLASS(AsmBinaryMod);
1505  IS_SERIALIZABLE(AsmBinaryMod);
1506 
1507 #ifdef DOCUMENTATION
1508 
1510  public:
1511 #endif
1512 
1513  DECLARE_OTHERS(AsmBinaryMod);
1514 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1515 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1516  private:
1517  friend class boost::serialization::access;
1518 
1519  template<class S>
1520  void serialize(S &s, const unsigned /*version*/) {
1521  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1522  }
1523 #endif
1524 #endif // SgAsmBinaryMod_OTHERS
1525 
1526 #ifdef DOCUMENTATION
1527  };
1528 #endif
1529 
1531 
1532  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1533  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1534 
1535 #ifdef DOCUMENTATION
1536 
1538  public:
1539 #endif
1540 
1541  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1542 #if defined(SgAsmBinaryAddPreupdate_OTHERS) || defined(DOCUMENTATION)
1543 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1544  private:
1545  friend class boost::serialization::access;
1546 
1547  template<class S>
1548  void serialize(S &s, const unsigned /*version*/) {
1549  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1550  }
1551 #endif
1552 #endif // SgAsmBinaryAddPreupdate_OTHERS
1553 
1554 #ifdef DOCUMENTATION
1555  };
1556 #endif
1557 
1559 
1560  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1561  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1562 
1563 #ifdef DOCUMENTATION
1564 
1566  public:
1567 #endif
1568 
1569  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1570 #if defined(SgAsmBinarySubtractPreupdate_OTHERS) || defined(DOCUMENTATION)
1571 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1572  private:
1573  friend class boost::serialization::access;
1574 
1575  template<class S>
1576  void serialize(S &s, const unsigned /*version*/) {
1577  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1578  }
1579 #endif
1580 #endif // SgAsmBinarySubtractPreupdate_OTHERS
1581 
1582 #ifdef DOCUMENTATION
1583  };
1584 #endif
1585 
1587 
1588  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1589  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1590 
1591 #ifdef DOCUMENTATION
1592 
1594  public:
1595 #endif
1596 
1597  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1598 #if defined(SgAsmBinaryAddPostupdate_OTHERS) || defined(DOCUMENTATION)
1599 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1600  private:
1601  friend class boost::serialization::access;
1602 
1603  template<class S>
1604  void serialize(S &s, const unsigned /*version*/) {
1605  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1606  }
1607 #endif
1608 #endif // SgAsmBinaryAddPostupdate_OTHERS
1609 
1610 #ifdef DOCUMENTATION
1611  };
1612 #endif
1613 
1615 
1616  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1617  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1618 
1619 #ifdef DOCUMENTATION
1620 
1622  public:
1623 #endif
1624 
1625  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1626 #if defined(SgAsmBinarySubtractPostupdate_OTHERS) || defined(DOCUMENTATION)
1627 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1628  private:
1629  friend class boost::serialization::access;
1630 
1631  template<class S>
1632  void serialize(S &s, const unsigned /*version*/) {
1633  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1634  }
1635 #endif
1636 #endif // SgAsmBinarySubtractPostupdate_OTHERS
1637 
1638 #ifdef DOCUMENTATION
1639  };
1640 #endif
1641 
1643 
1644  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1645  IS_SERIALIZABLE(AsmBinaryLsl);
1646 
1647 #ifdef DOCUMENTATION
1648 
1650  public:
1651 #endif
1652 
1653  DECLARE_OTHERS(AsmBinaryLsl);
1654 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1655 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1656  private:
1657  friend class boost::serialization::access;
1658 
1659  template<class S>
1660  void serialize(S &s, const unsigned /*version*/) {
1661  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1662  }
1663 #endif
1664 #endif // SgAsmBinaryLsl_OTHERS
1665 
1666 #ifdef DOCUMENTATION
1667  };
1668 #endif
1669 
1671 
1672  DECLARE_LEAF_CLASS(AsmBinaryMsl);
1673  IS_SERIALIZABLE(AsmBinaryMsl);
1674 
1675 #ifdef DOCUMENTATION
1676 
1680  public:
1681 #endif
1682 
1683  DECLARE_OTHERS(AsmBinaryMsl);
1684 #if defined(SgAsmBinaryMsl_OTHERS) || defined(DOCUMENTATION)
1685 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1686  private:
1687  friend class boost::serialization::access;
1688 
1689  template<class S>
1690  void serialize(S &s, const unsigned /*version*/) {
1691  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1692  }
1693 #endif
1694 #endif // SgAsmBinaryMsl_OTHERS
1695 
1696 #ifdef DOCUMENTATION
1697  };
1698 #endif
1699 
1701 
1702  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1703  IS_SERIALIZABLE(AsmBinaryLsr);
1704 
1705 #ifdef DOCUMENTATION
1706 
1708  public:
1709 #endif
1710 
1711  DECLARE_OTHERS(AsmBinaryLsr);
1712 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1713 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1714  private:
1715  friend class boost::serialization::access;
1716 
1717  template<class S>
1718  void serialize(S &s, const unsigned /*version*/) {
1719  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1720  }
1721 #endif
1722 #endif // SgAsmBinaryLsr_OTHERS
1723 
1724 #ifdef DOCUMENTATION
1725  };
1726 #endif
1727 
1729 
1730  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1731  IS_SERIALIZABLE(AsmBinaryAsr);
1732 
1733 #ifdef DOCUMENTATION
1734 
1736  public:
1737 #endif
1738 
1739  DECLARE_OTHERS(AsmBinaryAsr);
1740 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1741 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1742  private:
1743  friend class boost::serialization::access;
1744 
1745  template<class S>
1746  void serialize(S &s, const unsigned /*version*/) {
1747  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1748  }
1749 #endif
1750 #endif // SgAsmBinaryAsr_OTHERS
1751 
1752 #ifdef DOCUMENTATION
1753  };
1754 #endif
1755 
1757 
1758  DECLARE_LEAF_CLASS(AsmBinaryRor);
1759  IS_SERIALIZABLE(AsmBinaryRor);
1760 
1761 #ifdef DOCUMENTATION
1762 
1764  public:
1765 #endif
1766 
1767  DECLARE_OTHERS(AsmBinaryRor);
1768 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1769 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1770  private:
1771  friend class boost::serialization::access;
1772 
1773  template<class S>
1774  void serialize(S &s, const unsigned /*version*/) {
1775  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1776  }
1777 #endif
1778 #endif // SgAsmBinaryRor_OTHERS
1779 
1780 #ifdef DOCUMENTATION
1781  };
1782 #endif
1783 
1785 
1786  DECLARE_LEAF_CLASS(AsmBinaryConcat);
1787  IS_SERIALIZABLE(AsmBinaryConcat);
1788 
1789 #ifdef DOCUMENTATION
1790 
1792  public:
1793 #endif
1794 
1795  DECLARE_OTHERS(AsmBinaryConcat);
1796 #if defined(SgAsmBinaryConcat_OTHERS) || defined(DOCUMENTATION)
1797 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1798  private:
1799  friend class boost::serialization::access;
1800 
1801  template<class S>
1802  void serialize(S &s, const unsigned /*version*/) {
1803  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1804  }
1805 #endif
1806 #endif // SgAsmBinaryConcat_OTHERS
1807 
1808 #ifdef DOCUMENTATION
1809  };
1810 #endif
1811 
1813 
1814  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1815  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1816  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1817  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1818  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1819  AsmBinaryRor | AsmBinaryMsl | AsmBinaryConcat,
1820  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1821  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1822  IS_SERIALIZABLE(AsmBinaryExpression);
1823 
1824 #ifdef DOCUMENTATION
1825 
1827  public:
1828 #endif
1829 
1830 #ifdef DOCUMENTATION
1831 
1834  SgAsmExpression* get_lhs() const;
1835  void set_lhs(SgAsmExpression*);
1837 #else
1838  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1839  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1840 #endif
1841 
1842 #ifdef DOCUMENTATION
1843 
1846  SgAsmExpression* get_rhs() const;
1847  void set_rhs(SgAsmExpression*);
1849 #else
1850  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1851  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1852 #endif
1853 
1854  DECLARE_OTHERS(AsmBinaryExpression);
1855 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1856 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1857  private:
1858  friend class boost::serialization::access;
1859 
1860  template<class S>
1861  void serialize(S &s, const unsigned /*version*/) {
1862  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1863  s & BOOST_SERIALIZATION_NVP(p_lhs);
1864  s & BOOST_SERIALIZATION_NVP(p_rhs);
1865  }
1866 #endif
1867 #endif // SgAsmBinaryExpression_OTHERS
1868 
1869 #ifdef DOCUMENTATION
1870  };
1871 #endif
1872 
1874 
1875  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1876  IS_SERIALIZABLE(AsmUnaryPlus);
1877 
1878 #ifdef DOCUMENTATION
1879 
1881  public:
1882 #endif
1883 
1884  DECLARE_OTHERS(AsmUnaryPlus);
1885 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1886 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1887  private:
1888  friend class boost::serialization::access;
1889 
1890  template<class S>
1891  void serialize(S &s, const unsigned /*version*/) {
1892  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1893  }
1894 #endif
1895 #endif // SgAsmUnaryPlus_OTHERS
1896 
1897 #ifdef DOCUMENTATION
1898  };
1899 #endif
1900 
1902 
1903  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1904  IS_SERIALIZABLE(AsmUnaryMinus);
1905 
1906 #ifdef DOCUMENTATION
1907 
1909  public:
1910 #endif
1911 
1912  DECLARE_OTHERS(AsmUnaryMinus);
1913 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1914 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1915  private:
1916  friend class boost::serialization::access;
1917 
1918  template<class S>
1919  void serialize(S &s, const unsigned /*version*/) {
1920  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1921  }
1922 #endif
1923 #endif // SgAsmUnaryMinus_OTHERS
1924 
1925 #ifdef DOCUMENTATION
1926  };
1927 #endif
1928 
1930 
1931  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1932  IS_SERIALIZABLE(AsmUnaryRrx);
1933 
1934 #ifdef DOCUMENTATION
1935  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1937  public:
1938 #endif
1939 
1940  DECLARE_OTHERS(AsmUnaryRrx);
1941 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1942 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1943  private:
1944  friend class boost::serialization::access;
1945 
1946  template<class S>
1947  void serialize(S &s, const unsigned /*version*/) {
1948  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1949  }
1950 #endif
1951 #endif // SgAsmUnaryRrx_OTHERS
1952 
1953 #ifdef DOCUMENTATION
1954  };
1955 #endif
1956 
1958 
1959  DECLARE_LEAF_CLASS(AsmUnaryTruncate);
1960  IS_SERIALIZABLE(AsmUnaryTruncate);
1961 
1962 #ifdef DOCUMENTATION
1963 
1969  public:
1970 #endif
1971 
1972  DECLARE_OTHERS(AsmUnaryTruncate);
1973 #if defined(SgAsmUnaryTruncate_OTHERS) || defined(DOCUMENTATION)
1974 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1975  private:
1976  friend class boost::serialization::access;
1977 
1978  template<class S>
1979  void serialize(S &s, const unsigned /*version*/) {
1980  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1981  }
1982 #endif
1983 #endif // SgAsmUnaryTruncate_OTHERS
1984 
1985 #ifdef DOCUMENTATION
1986  };
1987 #endif
1988 
1990 
1991  DECLARE_LEAF_CLASS(AsmUnarySignedExtend);
1992  IS_SERIALIZABLE(AsmUnarySignedExtend);
1993 
1994 #ifdef DOCUMENTATION
1995 
2001  public:
2002 #endif
2003 
2004  DECLARE_OTHERS(AsmUnarySignedExtend);
2005 #if defined(SgAsmUnarySignedExtend_OTHERS) || defined(DOCUMENTATION)
2006 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2007  private:
2008  friend class boost::serialization::access;
2009 
2010  template<class S>
2011  void serialize(S &s, const unsigned /*version*/) {
2012  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2013  }
2014 #endif
2015 #endif // SgAsmUnarySignedExtend_OTHERS
2016 
2017 #ifdef DOCUMENTATION
2018  };
2019 #endif
2020 
2022 
2023  DECLARE_LEAF_CLASS(AsmUnaryUnsignedExtend);
2024  IS_SERIALIZABLE(AsmUnaryUnsignedExtend);
2025 
2026 #ifdef DOCUMENTATION
2027 
2033  public:
2034 #endif
2035 
2036  DECLARE_OTHERS(AsmUnaryUnsignedExtend);
2037 #if defined(SgAsmUnaryUnsignedExtend_OTHERS) || defined(DOCUMENTATION)
2038 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2039  private:
2040  friend class boost::serialization::access;
2041 
2042  template<class S>
2043  void serialize(S &s, const unsigned /*version*/) {
2044  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2045  }
2046 #endif
2047 #endif // SgAsmUnaryUnsignedExtend_OTHERS
2048 
2049 #ifdef DOCUMENTATION
2050  };
2051 #endif
2052 
2054 
2055 #ifdef ROSE_ENABLE_ASM_AARCH64
2056  DECLARE_LEAF_CLASS(AsmAarch64AtOperand);
2057  IS_SERIALIZABLE(AsmAarch64AtOperand);
2058 
2059 #ifdef DOCUMENTATION
2060 
2061  class SgAsmAarch64AtOperand: public SgAsmExpression {
2062  public:
2063 #endif
2064 
2065  DECLARE_OTHERS(AsmAarch64AtOperand);
2066 #if defined(SgAsmAarch64AtOperand_OTHERS) || defined(DOCUMENTATION)
2067 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2068  private:
2069  friend class boost::serialization::access;
2070 
2071  template<class S>
2072  void serialize(S &s, const unsigned /*version*/) {
2073  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2074  s & BOOST_SERIALIZATION_NVP(operation_);
2075  }
2076 #endif
2077 
2078  private:
2079  Rose::BinaryAnalysis::Aarch64AtOperation operation_;
2080 
2081  public:
2083  explicit SgAsmAarch64AtOperand(Rose::BinaryAnalysis::Aarch64AtOperation op)
2084  : operation_(op) {}
2085 
2091  Rose::BinaryAnalysis::Aarch64AtOperation operation() const {
2092  return operation_;
2093  }
2094  void operation(Rose::BinaryAnalysis::Aarch64AtOperation op) {
2095  operation_ = op;
2096  }
2098 #endif // SgAsmAarch64AtOperand_OTHERS
2099 
2100 #ifdef DOCUMENTATION
2101  };
2102 #endif
2103 #endif
2104 
2106 
2107 #ifdef ROSE_ENABLE_ASM_AARCH64
2108  DECLARE_LEAF_CLASS(AsmAarch64PrefetchOperand);
2109  IS_SERIALIZABLE(AsmAarch64PrefetchOperand);
2110 
2111 #ifdef DOCUMENTATION
2112 
2113  class SgAsmAarch64PrefetchOperand: public SgAsmExpression {
2114  public:
2115 #endif
2116 
2117  DECLARE_OTHERS(AsmAarch64PrefetchOperand);
2118 #if defined(SgAsmAarch64PrefetchOperand_OTHERS) || defined(DOCUMENTATION)
2119 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2120  private:
2121  friend class boost::serialization::access;
2122 
2123  template<class S>
2124  void serialize(S &s, const unsigned /*version*/) {
2125  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2126  s & BOOST_SERIALIZATION_NVP(operation_);
2127  }
2128 #endif
2129 
2130  private:
2131  Rose::BinaryAnalysis::Aarch64PrefetchOperation operation_;
2132 
2133  public:
2135  explicit SgAsmAarch64PrefetchOperand(Rose::BinaryAnalysis::Aarch64PrefetchOperation op)
2136  : operation_(op) {}
2137 
2143  Rose::BinaryAnalysis::Aarch64PrefetchOperation operation() const {
2144  return operation_;
2145  }
2146  void operation(Rose::BinaryAnalysis::Aarch64PrefetchOperation op) {
2147  operation_ = op;
2148  }
2150 #endif // SgAsmAarch64PrefetchOperand_OTHERS
2151 
2152 #ifdef DOCUMENTATION
2153  };
2154 #endif
2155 #endif
2156 
2158 
2159 #ifdef ROSE_ENABLE_ASM_AARCH64
2160  DECLARE_LEAF_CLASS(AsmAarch64SysMoveOperand);
2161  IS_SERIALIZABLE(AsmAarch64SysMoveOperand);
2162 
2163 #ifdef DOCUMENTATION
2164 
2165  class SgAsmAarch64SysMoveOperand: public SgAsmExpression {
2166  public:
2167 #endif
2168 
2169  DECLARE_OTHERS(AsmAarch64SysMoveOperand);
2170 #if defined(SgAsmAarch64SysMoveOperand_OTHERS) || defined(DOCUMENTATION)
2171 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2172  private:
2173  friend class boost::serialization::access;
2174 
2175  template<class S>
2176  void serialize(S &s, const unsigned /*version*/) {
2177  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2178  s & BOOST_SERIALIZATION_NVP(access_);
2179  }
2180 #endif
2181 
2182  private:
2183  unsigned access_;
2184 
2185  public:
2187  explicit SgAsmAarch64SysMoveOperand(unsigned access)
2188  : access_(access) {}
2189 
2195  unsigned access() const {
2196  return access_;
2197  }
2198  void access(unsigned ac) {
2199  access_ = ac;
2200  }
2202 #endif // SgAsmAarch64SysMoveOperand_OTHERS
2203 
2204 #ifdef DOCUMENTATION
2205  };
2206 #endif
2207 #endif
2208 
2210 
2211 #ifdef ROSE_ENABLE_ASM_AARCH64
2212  DECLARE_LEAF_CLASS(AsmAarch64CImmediateOperand);
2213  IS_SERIALIZABLE(AsmAarch64CImmediateOperand);
2214 
2215 #ifdef DOCUMENTATION
2216 
2217  class SgAsmAarch64CImmediateOperand: public SgAsmExpression {
2218  public:
2219 #endif
2220 
2221  DECLARE_OTHERS(AsmAarch64CImmediateOperand);
2222 #if defined(SgAsmAarch64CImmediateOperand_OTHERS) || defined(DOCUMENTATION)
2223 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2224  private:
2225  friend class boost::serialization::access;
2226 
2227  template<class S>
2228  void serialize(S &s, const unsigned /*version*/) {
2229  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2230  s & BOOST_SERIALIZATION_NVP(imm_);
2231  }
2232 #endif
2233 
2234  private:
2235  unsigned imm_;
2236 
2237  public:
2239  explicit SgAsmAarch64CImmediateOperand(unsigned imm)
2240  : imm_(imm) {}
2241 
2247  unsigned immediate() const {
2248  return imm_;
2249  }
2250  void immediate(unsigned imm) {
2251  imm_ = imm;
2252  }
2254 #endif // SgAsmAarch64CImmediateOperand_OTHERS
2255 
2256 #ifdef DOCUMENTATION
2257  };
2258 #endif
2259 #endif
2260 
2262 
2263 #ifdef ROSE_ENABLE_ASM_AARCH64
2264  DECLARE_LEAF_CLASS(AsmAarch64BarrierOperand);
2265  IS_SERIALIZABLE(AsmAarch64BarrierOperand);
2266 
2267 #ifdef DOCUMENTATION
2268 
2269  class SgAsmAarch64BarrierOperand: public SgAsmExpression {
2270  public:
2271 #endif
2272 
2273  DECLARE_OTHERS(AsmAarch64BarrierOperand);
2274 #if defined(SgAsmAarch64BarrierOperand_OTHERS) || defined(DOCUMENTATION)
2275 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2276  private:
2277  friend class boost::serialization::access;
2278 
2279  template<class S>
2280  void serialize(S &s, const unsigned /*version*/) {
2281  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2282  s & BOOST_SERIALIZATION_NVP(operation_);
2283  }
2284 #endif
2285 
2286  private:
2287  Rose::BinaryAnalysis::Aarch64BarrierOperation operation_;
2288 
2289  public:
2291  explicit SgAsmAarch64BarrierOperand(Rose::BinaryAnalysis::Aarch64BarrierOperation operation)
2292  : operation_(operation) {}
2293 
2297  Rose::BinaryAnalysis::Aarch64BarrierOperation operation() const {
2298  return operation_;
2299  }
2300  void operation(Rose::BinaryAnalysis::Aarch64BarrierOperation op) {
2301  operation_ = op;
2302  }
2304 #endif // SgAsmAarch64BarrierOperand_OTHERS
2305 
2306 #ifdef DOCUMENTATION
2307  };
2308 #endif
2309 #endif
2310 
2312 
2313  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
2314  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryTruncate | AsmUnarySignedExtend
2315  | AsmUnaryUnsignedExtend,
2316  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
2317  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
2318  IS_SERIALIZABLE(AsmUnaryExpression);
2319 
2320 #ifdef DOCUMENTATION
2321 
2323  public:
2324 #endif
2325 
2326 #ifdef DOCUMENTATION
2327 
2330  SgAsmExpression* get_operand() const;
2333 #else
2334  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
2335  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2336 #endif
2337 
2338  DECLARE_OTHERS(AsmUnaryExpression);
2339 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
2340 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2341  private:
2342  friend class boost::serialization::access;
2343 
2344  template<class S>
2345  void serialize(S &s, const unsigned /*version*/) {
2346  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2347  s & BOOST_SERIALIZATION_NVP(p_operand);
2348  }
2349 #endif
2350 #endif // SgAsmUnaryExpression_OTHERS
2351 
2352 #ifdef DOCUMENTATION
2353  };
2354 #endif
2355 
2357 
2358  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
2359  IS_SERIALIZABLE(AsmDirectRegisterExpression);
2360 
2361 #ifdef DOCUMENTATION
2362 
2364  public:
2365 #endif
2366 
2367  DECLARE_OTHERS(AsmDirectRegisterExpression);
2368 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
2369 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2370  private:
2371  friend class boost::serialization::access;
2372 
2373  template<class S>
2374  void serialize(S &s, const unsigned /*version*/) {
2375  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
2376  }
2377 #endif
2378 
2379  private:
2380  // Default c'tor needed for serialization
2382 #endif // SgAsmDirectRegisterExpression_OTHERS
2383 
2384 #ifdef DOCUMENTATION
2385  };
2386 #endif
2387 
2389 
2390  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
2391  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
2392 
2393 #ifdef DOCUMENTATION
2394 
2411  public:
2412 #endif
2413 
2414 #ifdef DOCUMENTATION
2415 
2423 #else
2424  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "stride", "",
2425  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2426 #endif
2427 
2428 #ifdef DOCUMENTATION
2429 
2437 #else
2438  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "offset", "",
2439  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2440 #endif
2441 
2442 #ifdef DOCUMENTATION
2443 
2448  size_t get_index() const;
2449  void set_index(size_t);
2451 #else
2452  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
2453  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2454 #endif
2455 
2456 #ifdef DOCUMENTATION
2457 
2462  size_t get_modulus() const;
2463  void set_modulus(size_t);
2465 #else
2466  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
2467  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2468 #endif
2469 
2470  DECLARE_OTHERS(AsmIndirectRegisterExpression);
2471 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
2472 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2473  private:
2474  friend class boost::serialization::access;
2475 
2476  template<class S>
2477  void serialize(S &s, const unsigned /*version*/) {
2478  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
2479  s & BOOST_SERIALIZATION_NVP(p_stride);
2480  s & BOOST_SERIALIZATION_NVP(p_offset);
2481  s & BOOST_SERIALIZATION_NVP(p_index);
2482  s & BOOST_SERIALIZATION_NVP(p_modulus);
2483  }
2484 #endif
2485 
2486  private:
2487  // Default c'tor needed for serialization
2489  : p_index(0), p_modulus(0) {}
2490 #endif // SgAsmIndirectRegisterExpression_OTHERS
2491 
2492 #ifdef DOCUMENTATION
2493  };
2494 #endif
2495 
2497 
2498  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
2499  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
2500  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
2501  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
2502 
2503 #ifdef DOCUMENTATION
2504 
2506  public:
2507 #endif
2508 
2509 #ifdef DOCUMENTATION
2510 
2516 #else
2517  AsmRegisterReferenceExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "descriptor", "",
2518  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2519 #endif
2520 
2521 #ifdef DOCUMENTATION
2522 
2527  int get_adjustment() const;
2528  void set_adjustment(int);
2530 #else
2531  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
2532  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
2533  NO_DELETE);
2534 #endif
2535 
2536  DECLARE_OTHERS(AsmRegisterReferenceExpression);
2537 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2538 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2539  private:
2540  friend class boost::serialization::access;
2541 
2542  template<class S>
2543  void serialize(S &s, const unsigned /*version*/) {
2544  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2545  s & BOOST_SERIALIZATION_NVP(p_descriptor);
2546  s & BOOST_SERIALIZATION_NVP(p_adjustment);
2547  }
2548 #endif
2549 
2550  protected:
2551  // Default c'tor needed for serialization
2553  : p_adjustment(0) {}
2554 #endif // SgAsmRegisterReferenceExpression_OTHERS
2555 
2556 #ifdef DOCUMENTATION
2557  };
2558 #endif
2559 
2561 
2562  DECLARE_LEAF_CLASS(AsmRegisterNames);
2563  IS_SERIALIZABLE(AsmRegisterNames);
2564 
2565 #ifdef DOCUMENTATION
2566 
2568  public:
2569 #endif
2570 
2571 #ifdef DOCUMENTATION
2572 
2578  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
2579  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
2581 #else
2582  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
2583  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2584 #endif
2585 
2586 #ifdef DOCUMENTATION
2587 
2593  unsigned get_mask() const;
2594  void set_mask(unsigned);
2596 #else
2597  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
2598  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2599 #endif
2600 
2601  DECLARE_OTHERS(AsmRegisterNames);
2602 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
2603 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2604  private:
2605  friend class boost::serialization::access;
2606 
2607  template<class S>
2608  void serialize(S &s, const unsigned /*version*/) {
2609  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2610  s & BOOST_SERIALIZATION_NVP(p_registers);
2611  s & BOOST_SERIALIZATION_NVP(p_mask);
2612  }
2613 #endif
2614 #endif // SgAsmRegisterNames_OTHERS
2615 
2616 #ifdef DOCUMENTATION
2617  };
2618 #endif
2619 
2621 
2622  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2623  IS_SERIALIZABLE(AsmIntegerValueExpression);
2624 
2625 #ifdef DOCUMENTATION
2626 
2642  public:
2643 #endif
2644 
2645 #ifdef DOCUMENTATION
2646 
2656  SgNode* get_baseNode() const;
2657  void set_baseNode(SgNode*);
2659 #else
2660  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2661  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2662 #endif
2663 
2664  DECLARE_OTHERS(AsmIntegerValueExpression);
2665 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2666 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2667  private:
2668  friend class boost::serialization::access;
2669 
2670  template<class S>
2671  void serialize(S &s, const unsigned /*version*/) {
2672  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2673  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2674  }
2675 #endif
2676 
2677  public:
2682  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2683 
2690 
2692  static uint64_t virtualAddress(SgNode*);
2693 
2713  std::string get_label(bool quiet=false) const;
2714 
2716  size_t get_significantBits() const;
2717 
2723  void makeRelativeTo(SgNode *baseNode);
2724 
2729  uint64_t get_baseAddress() const;
2730 
2736  uint64_t get_absoluteValue(size_t nbits=0) const;
2737 
2741  void set_absoluteValue(uint64_t);
2742 
2744  int64_t get_signedValue() const;
2745 
2749  int64_t get_relativeValue() const;
2750 
2755  void set_relativeValue(int64_t v, size_t nbits=64);
2756 
2757  uint64_t get_value() const { return get_absoluteValue(); }
2758 
2759 #endif // SgAsmIntegerValueExpression_OTHERS
2760 
2761 #ifdef DOCUMENTATION
2762  };
2763 #endif
2764 
2766 
2767  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2768  IS_SERIALIZABLE(AsmFloatValueExpression);
2769 
2770 #ifdef DOCUMENTATION
2771 
2776  public:
2777 #endif
2778 
2779  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2780 
2781  DECLARE_OTHERS(AsmFloatValueExpression);
2782 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2783  private:
2784  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2785  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2786  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2787  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2788  // understand "mutable".
2789  mutable double p_nativeValue;
2790  mutable bool p_nativeValueIsValid;
2791 
2792 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2793  private:
2794  friend class boost::serialization::access;
2795 
2796  template<class S>
2797  void serialize(S &s, const unsigned /*version*/) {
2798  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2799  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2800  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2801  }
2802 #endif
2803 
2804  public:
2809  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2810 
2816  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2817 
2824 
2826  void set_nativeValue(double);
2827 
2829  double get_nativeValue() const;
2830 
2835  void updateBitVector();
2836 
2841  void updateNativeValue() const;
2842 #endif // SgAsmFloatValueExpression_OTHERS
2843 
2844 #ifdef DOCUMENTATION
2845  };
2846 #endif
2847 
2849 #ifdef ROSE_ENABLE_ASM_AARCH32
2850  DECLARE_LEAF_CLASS(AsmAarch32Coprocessor);
2851  IS_SERIALIZABLE(AsmAarch32Coprocessor);
2852 
2853 #ifdef DOCUMENTATION
2854 
2855  class SgAsmAarch32Coprocessor: public SgAsmExpression {
2856  public:
2857 #endif
2858 
2859  DECLARE_OTHERS(AsmAarch32Coprocessor);
2860 #if defined(SgAsmAarch32Coprocessor_OTHERS) || defined(DOCUMENTATION)
2861 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2862  private:
2863  friend class boost::serialization::access;
2864 
2865  template<class S>
2866  void serialize(S & s, const unsigned /*version*/) {
2867  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2868  s & BOOST_SERIALIZATION_NVP(coprocessor_);
2869  }
2870 #endif
2871 
2872  private:
2873  int coprocessor_;
2874 
2875  public:
2876  explicit SgAsmAarch32Coprocessor(int coprocessor)
2877  : coprocessor_(coprocessor) {}
2878 
2882  int coprocessor() const { return coprocessor_; }
2883  void coprocessor(int n) { coprocessor_ = n; }
2885 #endif // SgAsmAarch32Coprocessor_OTHERS
2886 
2887 #ifdef DOCUMENTATION
2888  };
2889 #endif
2890 #endif
2891 
2893  DECLARE_LEAF_CLASS(AsmByteOrder);
2894  IS_SERIALIZABLE(AsmByteOrder);
2895 
2896 #ifdef DOCUMENTATION
2897 
2899  public:
2900 #endif
2901 
2902  DECLARE_OTHERS(AsmByteOrder);
2903 #if defined(SgAsmByteOrder_OTHERS) || defined(DOCUMENTATION)
2904 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2905  private:
2906  friend class boost::serialization::access;
2907 
2908  template<class S>
2909  void serialize(S & s, const unsigned /*version*/) {
2910  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2911  s & BOOST_SERIALIZATION_NVP(byteOrder_);
2912  }
2913 #endif
2914 
2915  private:
2916  ByteOrder::Endianness byteOrder_;
2917 
2918  public:
2919  explicit SgAsmByteOrder(ByteOrder::Endianness byteOrder)
2920  : byteOrder_(byteOrder) {}
2921 
2925  ByteOrder::Endianness byteOrder() const { return byteOrder_; }
2926  void byteOrder(ByteOrder::Endianness sex) { byteOrder_ = sex; }
2928 #endif // SgAsmByteOrder_OTHERS
2929 
2930 #ifdef DOCUMENTATION
2931  };
2932 #endif
2933 
2935 
2936  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2937  AsmIntegerValueExpression | AsmFloatValueExpression,
2938  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2939  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2940  IS_SERIALIZABLE(AsmConstantExpression);
2941 
2942  DECLARE_HEADERS(AsmConstantExpression);
2943 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2944  #include <Sawyer/BitVector.h>
2945 #endif // SgAsmConstantExpression_HEADERS
2946 
2947 #ifdef DOCUMENTATION
2948 
2953  public:
2954 #endif
2955 
2956 #ifndef DOCUMENTATION
2957  // Documented below. Implemented below due to ROSETTA limitations.
2958  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2959  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2960 #endif
2961 
2962  DECLARE_OTHERS(AsmConstantExpression);
2963 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2964 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2965  private:
2966  friend class boost::serialization::access;
2967 
2968  template<class S>
2969  void serialize(S &s, const unsigned /*version*/) {
2970  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2971  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2972  }
2973 #endif
2974 
2975  public:
2981  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2982  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2983  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2985 #endif // SgAsmConstantExpression_OTHERS
2986 
2987 #ifdef DOCUMENTATION
2988  };
2989 #endif
2990 
2992 
2993  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2994  AsmConstantExpression,
2995  "AsmValueExpression", "AsmValueExpressionTag", false);
2996  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2997  IS_SERIALIZABLE(AsmValueExpression);
2998 
2999 #ifdef DOCUMENTATION
3000 
3008  public:
3009 #endif
3010 
3011 #ifdef DOCUMENTATION
3012 
3022 #else
3023  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
3024  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3025 #endif
3026 
3027 #ifdef DOCUMENTATION
3028 
3036  unsigned short get_bit_offset() const;
3037  void set_bit_offset(unsigned short);
3039 #else
3040  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
3041  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3042 #endif
3043 
3044 #ifdef DOCUMENTATION
3045 
3051  unsigned short get_bit_size() const;
3052  void set_bit_size(unsigned short);
3054 #else
3055  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
3056  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3057 #endif
3058 
3059 #ifdef DOCUMENTATION
3060 
3066  SgSymbol* get_symbol() const;
3067  void set_symbol(SgSymbol*);
3069 #else
3070  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
3071  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3072 #endif
3073 
3074  DECLARE_OTHERS(AsmValueExpression);
3075 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
3076 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3077  private:
3078  friend class boost::serialization::access;
3079 
3080  template<class S>
3081  void serialize(S &s, const unsigned /*version*/) {
3082  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3083  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
3084  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
3085  s & BOOST_SERIALIZATION_NVP(p_bit_size);
3086 #if 1
3087  ASSERT_require2(p_symbol == NULL, "not implemented yet");
3088 #else
3089  s & BOOST_SERIALIZATION_NVP(p_symbol);
3090 #endif
3091  }
3092 #endif
3093 #endif // SgAsmValueExpression_OTHERS
3094 
3095 #ifdef DOCUMENTATION
3096  };
3097 #endif
3098 
3100 
3101  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
3102  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
3103 
3104 #ifdef DOCUMENTATION
3105 
3107  public:
3108 #endif
3109 
3110 #ifdef DOCUMENTATION
3111 
3118  SgAsmExpression* get_address() const;
3121 #else
3122  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
3123  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3124 #endif
3125 
3126 #ifdef DOCUMENTATION
3127 
3134  SgAsmExpression* get_segment() const;
3137 #else
3138  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
3139  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3140 #endif
3141 
3142  DECLARE_OTHERS(AsmMemoryReferenceExpression);
3143 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
3144 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3145  private:
3146  friend class boost::serialization::access;
3147 
3148  template<class S>
3149  void serialize(S &s, const unsigned /*version*/) {
3150  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3151  s & BOOST_SERIALIZATION_NVP(p_address);
3152  s & BOOST_SERIALIZATION_NVP(p_segment);
3153  }
3154 #endif
3155 #endif // SgAsmMemoryReferenceExpression_OTHERS
3156 
3157 #ifdef DOCUMENTATION
3158  };
3159 #endif
3160 
3162 
3163  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
3164  IS_SERIALIZABLE(AsmControlFlagsExpression);
3165 
3166 #ifdef DOCUMENTATION
3167  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
3169  public:
3170 #endif
3171 
3172 #ifndef DOCUMENTATION
3173  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
3174  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3175 #endif
3176 
3177  DECLARE_OTHERS(AsmControlFlagsExpression);
3178 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
3179 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3180  private:
3181  friend class boost::serialization::access;
3182 
3183  template<class S>
3184  void serialize(S &s, const unsigned /*version*/) {
3185  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3186  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
3187  }
3188 #endif
3189 #endif // SgAsmControlFlagsExpression_OTHERS
3190 
3191 #ifdef DOCUMENTATION
3192  };
3193 #endif
3194 
3196 
3197  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
3198  IS_SERIALIZABLE(AsmCommonSubExpression);
3199 
3200 #ifdef DOCUMENTATION
3201  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
3203  public:
3204 #endif
3205 
3206 #ifndef DOCUMENTATION
3207  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
3208  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3209 #endif
3210 
3211  DECLARE_OTHERS(AsmCommonSubExpression);
3212 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
3213 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3214  private:
3215  friend class boost::serialization::access;
3216 
3217  template<class S>
3218  void serialize(S &s, const unsigned /*version*/) {
3219  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3220  s & BOOST_SERIALIZATION_NVP(p_subexpression);
3221  }
3222 #endif
3223 #endif // SgAsmCommonSubExpression_OTHERS
3224 
3225 #ifdef DOCUMENTATION
3226  };
3227 #endif
3228 
3230 
3231  DECLARE_LEAF_CLASS(AsmRiscOperation);
3232  IS_SERIALIZABLE(AsmRiscOperation);
3233 
3234 #ifdef DOCUMENTATION
3235 
3244  public:
3245 #endif
3246 
3247 #ifdef DOCUMENTATION
3248 
3257 #else
3258  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
3259  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3260 #endif
3261 
3262 #ifdef DOCUMENTATION
3263 
3269  SgAsmExprListExp* get_operands() const;
3272 #else
3273  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
3274  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3275 #endif
3276 
3277  DECLARE_OTHERS(AsmRiscOperation);
3278 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
3279  public:
3286  OP_NONE,
3287  OP_bottom,
3288  OP_undefined,
3289  OP_unspecified,
3290  OP_filterCallTarget,
3291  OP_filterReturnTarget,
3292  OP_filterIndirectJumpTarget,
3293  OP_hlt,
3294  OP_cpuid,
3295  OP_rdtsc,
3296  OP_and_,
3297  OP_or_,
3298  OP_xor_,
3299  OP_invert,
3300  OP_extract,
3301  OP_concat,
3302  OP_leastSignificantSetBit,
3303  OP_mostSignificantSetBit,
3304  OP_rotateLeft,
3305  OP_rotateRight,
3306  OP_shiftLeft,
3307  OP_shiftRight,
3308  OP_shiftRightArithmetic,
3309  OP_equalToZero,
3310  OP_ite,
3311  OP_isEqual,
3312  OP_isNotEqual,
3313  OP_isUnsignedLessThan,
3314  OP_isUnsignedLessThanOrEqual,
3315  OP_isUnsignedGreaterThan,
3316  OP_isUnsignedGreaterThanOrEqual,
3317  OP_isSignedLessThan,
3318  OP_isSignedLessThanOrEqual,
3319  OP_isSignedGreaterThan,
3320  OP_isSignedGreaterThanOrEqual,
3321  OP_unsignedExtend,
3322  OP_signExtend,
3325  OP_subtract,
3326  OP_negate,
3327  OP_signedDivide,
3328  OP_signedModulo,
3329  OP_signedMultiply,
3330  OP_unsignedDivide,
3331  OP_unsignedModulo,
3332  OP_unsignedMultiply,
3333  OP_interrupt,
3334  OP_readRegister,
3335  OP_peekRegister,
3336  OP_writeRegister,
3338  OP_peekMemory,
3340  OP_N_OPERATORS // MUST BE LAST!
3341  };
3342 
3343 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3344  private:
3345  friend class boost::serialization::access;
3346 
3347  template<class S>
3348  void serialize(S &s, const unsigned /*version*/) {
3349  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3350  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
3351  s & BOOST_SERIALIZATION_NVP(p_operands);
3352  }
3353 #endif
3354 #endif // SgAsmRiscOperation_OTHERS
3355 
3356 #ifdef DOCUMENTATION
3357  };
3358 #endif
3359 
3361 
3362  DECLARE_LEAF_CLASS(AsmExprListExp);
3363  IS_SERIALIZABLE(AsmExprListExp);
3364 
3365 #ifdef DOCUMENTATION
3366 
3368  public:
3369 #endif
3370 
3371 #ifdef DOCUMENTATION
3372 
3378  const SgAsmExpressionPtrList& get_expressions() const;
3379  void set_expressions(const SgAsmExpressionPtrList&);
3381 #else
3382  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
3383  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3384 #endif
3385 
3386  DECLARE_OTHERS(AsmExprListExp);
3387 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
3388 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3389  private:
3390  friend class boost::serialization::access;
3391 
3392  template<class S>
3393  void serialize(S &s, const unsigned /*version*/) {
3394  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3395  s & BOOST_SERIALIZATION_NVP(p_expressions);
3396  }
3397 #endif
3398 #endif // SgAsmExprListExp_OTHERS
3399 
3400 #ifdef DOCUMENTATION
3401  };
3402 #endif
3403 
3405 
3406  NEW_NONTERMINAL_MACRO(AsmExpression,
3407  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
3408  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
3409  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
3410  AsmRiscOperation
3411 #ifdef ROSE_ENABLE_ASM_AARCH64
3412  | AsmAarch64AtOperand | AsmAarch64PrefetchOperand | AsmAarch64SysMoveOperand
3413  | AsmAarch64CImmediateOperand | AsmAarch64BarrierOperand
3414 #endif
3415 #ifdef ROSE_ENABLE_ASM_AARCH32
3416  | AsmAarch32Coprocessor
3417 #endif
3418  | AsmByteOrder,
3419  "AsmExpression", "AsmExpressionTag", false);
3420  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
3421  IS_SERIALIZABLE(AsmExpression);
3422 
3423 #ifdef DOCUMENTATION
3424 
3425  class SgAsmExpression: public SgAsmNode {
3426  public:
3427 #endif
3428 
3429 #ifdef DOCUMENTATION
3430 
3435  SgAsmType* get_type() const;
3436  void set_type(SgAsmType*);
3438 #else
3439  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
3440  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3441 #endif
3442 
3443 #ifdef DOCUMENTATION
3444 
3449  const std::string& get_comment() const;
3450  void set_comment(const std::string&);
3452 #else
3453  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
3454  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3455 #endif
3456 
3457  DECLARE_OTHERS(AsmExpression);
3458 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
3459 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3460  private:
3461  friend class boost::serialization::access;
3462 
3463  template<class S>
3464  void serialize(S &s, const unsigned /*version*/) {
3465  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3466  s & BOOST_SERIALIZATION_NVP(p_type);
3467  s & BOOST_SERIALIZATION_NVP(p_comment);
3468  }
3469 #endif
3470 
3471  public:
3475  size_t get_nBits() const;
3476 
3482 
3488 
3489 #endif // SgAsmExpression_OTHERS
3490 
3491 #ifdef DOCUMENTATION
3492  };
3493 #endif
3494 
3495 
3496 
3497 
3499 
3500  /***************************************************************************************************************************
3501  * Data Types (new interface 2014-07)
3502  *
3503  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
3504  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
3505  * be true, which means that when we ask for a particular type we get the same pointer as before. This can only work if we
3506  * don't allow types to be modified after they're created.
3507  ***************************************************************************************************************************/
3508 
3510 
3511  DECLARE_LEAF_CLASS(AsmIntegerType);
3512  IS_SERIALIZABLE(AsmIntegerType);
3513 
3514 #ifdef DOCUMENTATION
3515 
3517  public:
3518 #endif
3519 
3520 #ifndef DOCUMENTATION
3521  // Documented below due to ROSETTA limitations
3522  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
3523  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3524 #endif
3525 
3526  DECLARE_OTHERS(AsmIntegerType);
3527 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
3528 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3529  private:
3530  friend class boost::serialization::access;
3531 
3532  template<class S>
3533  void serialize(S &s, const unsigned /*version*/) {
3534  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
3535  s & BOOST_SERIALIZATION_NVP(p_isSigned);
3536  }
3537 #endif
3538 
3539  public:
3543  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
3544 
3548  bool get_isSigned() const;
3549 
3550  // Overrides documented in base class
3551  virtual void check() const $ROSE_OVERRIDE;
3552  virtual std::string toString() const $ROSE_OVERRIDE;
3553 #endif // SgAsmIntegerType_OTHERS
3554 
3555 #ifdef DOCUMENTATION
3556  };
3557 #endif
3558 
3560 
3561  DECLARE_LEAF_CLASS(AsmFloatType);
3562  IS_SERIALIZABLE(AsmFloatType);
3563 
3564  DECLARE_HEADERS(AsmFloatType);
3565 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
3566  #include <Sawyer/BitVector.h>
3567  #include <BitFlags.h>
3568 #endif // SgAsmFloatType_HEADERS
3569 
3570 #ifdef DOCUMENTATION
3571 
3573  public:
3574 #endif
3575 
3576 #ifndef DOCUMENTATION
3577  // Documented below because of ROSETTA limitations (they're read-only)
3578  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
3579  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3580  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
3581  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3582  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
3583  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3584  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
3585  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3586  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
3587  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3588  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
3589  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3590  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
3591  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3592 #endif
3593 
3594  DECLARE_OTHERS(AsmFloatType);
3595 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
3596 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3597  private:
3598  friend class boost::serialization::access;
3599 
3600  template<class S>
3601  void serialize(S &s, const unsigned /*version*/) {
3602  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
3603  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
3604  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
3605  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
3606  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
3607  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
3608  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
3609  s & BOOST_SERIALIZATION_NVP(p_flags);
3610  }
3611 #endif
3612 
3613  public:
3615  enum Flag {
3616  GRADUAL_UNDERFLOW = 0x00000001,
3618  };
3619 
3622 
3625 
3627  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
3628  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
3629  uint64_t exponentBias, Flags flags);
3630 
3632  BitRange significandBits() const;
3633 
3635  BitRange exponentBits() const;
3636 
3638  size_t signBit() const;
3639 
3641  uint64_t exponentBias() const;
3642 
3644  Flags flags() const;
3645 
3650  static Flags ieeeFlags();
3651 
3657  bool gradualUnderflow() const;
3658 
3666  bool implicitBitConvention() const;
3667 
3670  // Overrides documented in base class
3671  virtual void check() const $ROSE_OVERRIDE;
3672  virtual std::string toString() const $ROSE_OVERRIDE;
3673 #endif // SgAsmFloatType_OTHERS
3674 
3675 #ifdef DOCUMENTATION
3676  };
3677 #endif
3678 
3680 
3681  NEW_NONTERMINAL_MACRO(AsmScalarType,
3682  AsmIntegerType | AsmFloatType,
3683  "AsmScalarType", "AsmScalarTypeTag", false);
3684  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
3685  IS_SERIALIZABLE(AsmScalarType);
3686 
3687 #ifdef DOCUMENTATION
3688 
3689  class SgAsmScalarType: public SgAsmType {
3690  public:
3691 #endif
3692 
3693 #ifndef DOCUMENTATION
3694  // Documented below due to ROSETTA limitations (read-only)
3695  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3696  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3697  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3698  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3699  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
3700  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3701  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
3702  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3703 #endif
3704 
3705  DECLARE_OTHERS(AsmScalarType);
3706 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
3707 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3708  private:
3709  friend class boost::serialization::access;
3710 
3711  template<class S>
3712  void serialize(S &s, const unsigned /*version*/) {
3713  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3714  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
3715  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
3716  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
3717  s & BOOST_SERIALIZATION_NVP(p_nBits);
3718  }
3719 #endif
3720 
3721  protected:
3726  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
3727 
3728  public:
3730  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3731 
3733  ByteOrder::Endianness get_minorOrder() const;
3734 
3736  ByteOrder::Endianness get_majorOrder() const;
3737 
3739  size_t get_majorNBytes() const;
3740 
3741  // Overrides documented in base class
3742  virtual void check() const $ROSE_OVERRIDE;
3743  virtual std::string toString() const $ROSE_OVERRIDE;
3744 #endif // SgAsmScalarType_OTHERS
3745 
3746 #ifdef DOCUMENTATION
3747  };
3748 #endif
3749 
3751 
3752  DECLARE_LEAF_CLASS(AsmVectorType);
3753  IS_SERIALIZABLE(AsmVectorType);
3754 
3755 #ifdef DOCUMENTATION
3756 
3757  class SgAsmVectorType: public SgAsmType {
3758  public:
3759 #endif
3760 
3761 #ifndef DOCUMENTATION
3762  // Documented below due to ROSETTA limitations (read-only)
3763  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3764  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3765  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3766  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3767 #endif
3768 
3769  DECLARE_OTHERS(AsmVectorType);
3770 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3771 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3772  private:
3773  friend class boost::serialization::access;
3774 
3775  template<class S>
3776  void serialize(S &s, const unsigned /*version*/) {
3777  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3778  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3779  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3780  }
3781 #endif
3782 
3783  public:
3785  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3786 
3788  size_t get_nElmts() const;
3789 
3791  SgAsmType* get_elmtType() const;
3792 
3793  // Overrides documented in base class
3794  virtual void check() const $ROSE_OVERRIDE;
3795  virtual std::string toString() const $ROSE_OVERRIDE;
3796  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3797 #endif // SgAsmVectorType_OTHERS
3798 
3799 #ifdef DOCUMENTATION
3800  };
3801 #endif
3802 
3804 
3805  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3806  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3807  IS_SERIALIZABLE(AsmType);
3808 
3809 #ifdef DOCUMENTATION
3810 
3811  class SgAsmType: public SgAsmNode {
3812  public:
3813 #endif
3814 
3815  DECLARE_OTHERS(AsmType);
3816 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3817  private:
3819 
3820 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3821  private:
3822  friend class boost::serialization::access;
3823 
3824  template<class S>
3825  void serialize(S &s, const unsigned /*version*/) {
3826  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3827  }
3828 #endif
3829 
3830  public:
3838  virtual void check() const;
3839 
3845  virtual std::string toString() const {
3846  abort(); // ROSETTA limitation: intended pure virtual
3847  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3848  }
3849 
3851  virtual size_t get_nBits() const {
3852  abort(); // ROSETTA limitation: intended pure virtual
3853  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3854  }
3855 
3857  virtual size_t get_nBytes() const;
3858 
3864  template<class Type> // Type is a subclass of SgAsmType
3865  static Type* registerOrDelete(Type *toInsert) {
3866  ASSERT_not_null(toInsert);
3867  std::string key = toInsert->toString();
3868  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3869  ASSERT_not_null(retval);
3870  if (retval!=toInsert)
3871  delete toInsert;
3872  return retval;
3873  }
3874 #endif // SgAsmType_OTHERS
3875 
3876 #ifdef DOCUMENTATION
3877  };
3878 #endif
3879 
3880 
3881 
3883 
3884  /**************************************************************************************************************************
3885  * Collections of Instructions
3886  **************************************************************************************************************************/
3887 
3889 
3890  DECLARE_LEAF_CLASS(AsmFunction);
3891  IS_SERIALIZABLE(AsmFunction);
3892 
3893 #ifdef DOCUMENTATION
3894 
3910  public:
3911 #endif
3912 
3913 #ifdef DOCUMENTATION
3914 
3919  const std::string& get_name() const;
3920  void set_name(const std::string&);
3922 #else
3923  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3924  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3925 #endif
3926 
3927 #ifdef DOCUMENTATION
3928 
3934  unsigned get_reason() const;
3935  void set_reason(unsigned);
3937 #else
3938  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3939  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3940 #endif
3941 
3942 #ifdef DOCUMENTATION
3943 
3950  const std::string& get_reasonComment() const;
3951  void set_reasonComment(const std::string&);
3953 #else
3954  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
3955  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3956 #endif
3957 
3958 #ifdef DOCUMENTATION
3959 
3967 #else
3968  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3969  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3970 #endif
3971 
3972 #ifdef DOCUMENTATION
3973 
3976  MayReturn get_may_return() const;
3977  void set_may_return(MayReturn);
3979 #else
3980  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3981  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3982 #endif
3983 
3984 #ifdef DOCUMENTATION
3985 
3990  const std::string& get_name_md5() const;
3991  void set_name_md5(const std::string&);
3993 #else
3994  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3995  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3996 #endif
3997 
3998 #ifdef DOCUMENTATION
3999 
4004  const SgAsmStatementPtrList& get_statementList() const;
4005  void set_statementList(const SgAsmStatementPtrList&);
4007 #else
4008  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
4009  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4010 #endif
4011 
4012 #ifdef DOCUMENTATION
4013  // FIXME[Robb P Matzke 2017-02-13]: unused?
4014 #else
4015  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
4016  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4017 #endif
4018 
4019 #ifdef DOCUMENTATION
4020 
4026  rose_addr_t get_entry_va() const;
4027  void set_entry_va(rose_addr_t);
4029 #else
4030  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
4031  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4032 #endif
4033 
4034 #ifdef DOCUMENTATION
4035 
4044 #else
4045  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
4046  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
4047 #endif
4048 
4049 #ifdef DOCUMENTATION
4050  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4051 #else
4052  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
4053  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4054 #endif
4055 
4056 #ifdef DOCUMENTATION
4057 
4066  int64_t get_stackDelta() const;
4067  void set_stackDelta(int64_t);
4069 #else
4070  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
4071  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4072 #endif
4073 
4074 #ifdef DOCUMENTATION
4075 
4083  const std::string& get_callingConvention() const;
4084  void set_callingConvention(const std::string&);
4086 #else
4087  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
4088  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4089 #endif
4090 
4091  DECLARE_OTHERS(AsmFunction);
4092 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
4093 
4094 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4095  private:
4096  friend class boost::serialization::access;
4097 
4098  template<class S>
4099  void serialize(S &s, const unsigned /*version*/) {
4100  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4101  s & BOOST_SERIALIZATION_NVP(p_name);
4102  s & BOOST_SERIALIZATION_NVP(p_reason);
4103  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
4104  s & BOOST_SERIALIZATION_NVP(p_function_kind);
4105  s & BOOST_SERIALIZATION_NVP(p_may_return);
4106  s & BOOST_SERIALIZATION_NVP(p_name_md5);
4107  s & BOOST_SERIALIZATION_NVP(p_statementList);
4108  s & BOOST_SERIALIZATION_NVP(p_dest);
4109  s & BOOST_SERIALIZATION_NVP(p_entry_va);
4110  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
4111  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
4112  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
4113  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
4114  }
4115 #endif
4116 
4117  public:
4120 
4124  void remove_statement(SgAsmStatement* statement);
4125 
4130  SgAsmBlock* get_entry_block() const;
4131 
4133  enum MayReturn {
4138  };
4139 
4144  // NOTE: If you add more here, then fix Partitioner::parse_switches()
4145  // Also fix SgAsmFunction::reason_key()
4146  FUNC_NONE = 0x00000000,
4147  FUNC_THUNK_TARGET= 0x00004000,
4149  = 0x00008000,
4150  FUNC_ENTRY_POINT = 0x00010000,
4151  FUNC_CALL_TARGET = 0x00020000,
4154  FUNC_CALL_INSN = 0x00040000,
4160  FUNC_EH_FRAME = 0x00080000,
4161  FUNC_SYMBOL = 0x00100000,
4162  FUNC_PATTERN = 0x00200000,
4167  FUNC_GRAPH = 0x00400000,
4171  FUNC_USERDEF = 0x00800000,
4172  FUNC_PADDING = 0x01000000,
4177  FUNC_DISCONT = 0x02000000,
4180  FUNC_INSNHEAD = 0x04000000,
4181  FUNC_IMPORT = 0x08000000,
4184  FUNC_LEFTOVERS = 0x10000000,
4188  FUNC_INTRABLOCK = 0x20000000,
4196  FUNC_THUNK = 0x40000000,
4205  FUNC_EXPORT = 0x80000000,
4207  FUNC_DEFAULT = 0xefff80ff,
4209  /*========= Miscellaneous Reasons ===========================================================================
4210  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
4211  * availalble for users to use as they see fit. */
4212  FUNC_MISCMASK = 0x000000ff,
4227  };
4228 
4232  static std::string reason_key(const std::string &prefix="");
4233 
4235  std::string reason_str(bool pad) const;
4236 
4240  static std::string reason_str(bool pad, unsigned reason);
4241 
4244  public:
4245  virtual ~NodeSelector() {}
4246  virtual bool operator()(SgNode*) = 0;
4247  };
4248 
4288  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
4289  NodeSelector *selector=NULL);
4290 
4296  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
4297 
4300  e_unknown = 0,
4301  e_standard = 1,
4302  e_library = 2,
4303  e_imported = 3,
4304  e_thunk = 4,
4305  e_last
4306  };
4307 #endif // SgAsmFunction_OTHERS
4308 
4309 
4310 #ifdef DOCUMENTATION
4311  };
4312 #endif
4313 
4314 
4316 
4317  DECLARE_LEAF_CLASS(AsmBlock);
4318  IS_SERIALIZABLE(AsmBlock);
4319 
4320 #ifdef DOCUMENTATION
4321 
4341  class SgAsmBlock: public SgAsmStatement {
4342  public:
4343 #endif
4344 
4345 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
4346  // [tps 05Apr07] needed for the control_flow_graph
4347  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
4348  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4349 #endif
4350 
4351 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
4352  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
4353  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4354 #endif
4355 
4356 #ifdef DOCUMENTATION
4357 
4362  rose_addr_t get_id() const;
4363  void set_id(rose_addr_t);
4365 #else
4366  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
4367  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4368 #endif
4369 
4370 #ifdef DOCUMENTATION
4371 
4376  unsigned get_reason() const;
4377  void set_reason(unsigned);
4379 #else
4380  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
4381  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4382 #endif
4383 
4384 #ifdef DOCUMENTATION
4385  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
4386  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
4387  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
4388  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
4395  const SgAsmStatementPtrList& get_statementList() const;
4396  void set_statementList(const SgAsmStatementPtrList&);
4398 #else
4399  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
4400  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4401 #endif
4402 
4403 #ifdef DOCUMENTATION
4404  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
4405  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
4406  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
4407  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
4415  const SgAsmIntegerValuePtrList& get_successors() const;
4416  void set_successors(const SgAsmIntegerValuePtrList&);
4418 #else
4419  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
4420  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4421 #endif
4422 
4423 #ifdef DOCUMENTATION
4424 
4434  bool get_successors_complete() const;
4435  void set_successors_complete(bool);
4437 #else
4438  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
4439  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4440 #endif
4441 
4442 #ifdef DOCUMENTATION
4443 
4455 #else
4456  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
4457  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4458 #endif
4459 
4460 #ifdef DOCUMENTATION
4461 
4469  size_t get_cached_vertex() const;
4470  void set_cached_vertex(size_t);
4472 #else
4473  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
4474  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4475 #endif
4476 
4477 #ifdef DOCUMENTATION
4478 
4484  double get_code_likelihood() const;
4485  void set_code_likelihood(double);
4487 #else
4488  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
4489  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4490 #endif
4491 
4492 #ifdef DOCUMENTATION
4493 
4501  int64_t get_stackDeltaOut() const;
4502  void set_stackDeltaOut(int64_t);
4504 #else
4505  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
4506  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4507 #endif
4508 
4509  DECLARE_OTHERS(AsmBlock);
4510 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
4511 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4512  private:
4513  friend class boost::serialization::access;
4514 
4515  template<class S>
4516  void serialize(S &s, const unsigned /*version*/) {
4517  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4518  s & BOOST_SERIALIZATION_NVP(p_reason);
4519  s & BOOST_SERIALIZATION_NVP(p_statementList);
4520  s & BOOST_SERIALIZATION_NVP(p_successors);
4521  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
4522  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
4523  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
4524  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
4525  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
4526  }
4527 #endif
4528 
4529  public:
4531  enum Reason {
4532  // Please update SgAsmBlock::reason_str() if you change this enum!
4533  BLK_NONE = 0x00000000,
4534  BLK_ENTRY_POINT = 0x00010000,
4535  BLK_PADDING = 0x00020000,
4536  BLK_FRAGMENT = 0x00080000,
4538  BLK_CFGHEAD = 0x00100000,
4539  BLK_USERDEF = 0x00200000,
4540  BLK_LEFTOVERS = 0x00400000,
4542  BLK_JUMPTABLE = 0x00800000,
4543  BLK_GRAPH1 = 0x01000000,
4544  BLK_GRAPH2 = 0x02000000,
4545  BLK_GRAPH3 = 0x04000000,
4547  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
4548 
4549  // ========= Miscellaneous Reasons ===========================================================================
4550  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
4551  // availalble for users to use as they see fit.
4552  BLK_MISCMASK = 0x000000ff,
4554  BLK_FINDDATA = 0x00000001,
4556  BLK_POSTFUNC = 0x00000002
4558  };
4559 
4564 
4569 
4570  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
4575  void remove_children();
4576 
4581  rose_addr_t get_fallthrough_va();
4582 
4587 
4593  bool has_instructions() const;
4594 
4600  bool is_basic_block() const { return has_instructions(); }
4601 
4611  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
4612 
4616  static std::string reason_key(const std::string &prefix="");
4617 
4621  std::string reason_str(bool pad) const;
4622 
4628  static std::string reason_str(bool pad, unsigned reason);
4629 #endif // SgAsmBlock_OTHERS
4630 
4631 #ifdef DOCUMENTATION
4632  };
4633 #endif
4634 
4635 
4637 
4638  DECLARE_LEAF_CLASS(AsmStaticData);
4639  IS_SERIALIZABLE(AsmStaticData);
4640 
4641 #ifdef DOCUMENTATION
4642 
4650  public:
4651 #endif
4652 
4653 #ifdef DOCUMENTATION
4654 
4660  const SgUnsignedCharList& get_raw_bytes() const;
4661  void set_raw_bytes(const SgUnsignedCharList&);
4663 #else
4664  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
4665  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4666 #endif
4667 
4668  DECLARE_OTHERS(AsmStaticData);
4669 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
4670 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4671  private:
4672  friend class boost::serialization::access;
4673 
4674  template<class S>
4675  void serialize(S &s, const unsigned /*version*/) {
4676  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4677  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
4678  }
4679 #endif
4680 
4681  public:
4685  size_t get_size() const { return p_raw_bytes.size(); }
4686 #endif // SgAsmStaticData_OTHERS
4687 
4688 #ifdef DOCUMENTATION
4689  };
4690 #endif
4691 
4692 
4694 
4695  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
4696  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
4697 
4698 #ifdef DOCUMENTATION
4699 
4710  public:
4711 #endif
4712 
4713  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4714 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4715 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4716  private:
4717  friend class boost::serialization::access;
4718 
4719  template<class S>
4720  void serialize(S & s, const unsigned /*version*/) {
4721  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4722  }
4723 #endif
4724  protected:
4725  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4726 
4727  public:
4730  p_declarationList.push_back(declaration);
4731  }
4732 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4733 
4734 #ifdef DOCUMENTATION
4735  };
4736 #endif
4737 
4738 
4740 
4741  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4742  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4743 
4744 #ifdef DOCUMENTATION
4745  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4747  public:
4748 #endif
4749 
4750 #ifdef DOCUMENTATION
4751 
4754  const std::string& get_name() const;
4755  void set_name(const std::string&);
4757 #else
4758  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4759  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4760  NO_DELETE);
4761 #endif
4762 
4763 #ifdef DOCUMENTATION
4764  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4768  uint64_t get_offset() const;
4769  void set_ofset(uint64_t);
4771 #else
4772  // Not clear if we want to store the offset explicitly
4773  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4774  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4775  NO_DELETE);
4776 #endif
4777 
4778  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4779 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4780 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4781  private:
4782  friend class boost::serialization::access;
4783 
4784  template<class S>
4785  void serialize(S &s, const unsigned /*version*/) {
4786  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4787  }
4788 #endif
4789 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4790 
4791 #ifdef DOCUMENTATION
4792  };
4793 #endif
4794 
4795 
4797 
4798  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4799  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4800  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4801  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4802  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4803 
4804 #ifdef DOCUMENTATION
4805 
4812  public:
4813 #endif
4814 
4815  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4816 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4817 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4818  private:
4819  friend class boost::serialization::access;
4820 
4821  template<class S>
4822  void serialize(S &s, const unsigned /*version*/) {
4823  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4824  };
4825 #endif
4826 #endif // SgAsmSynthesizedDeclaration_OTHERS
4827 
4828 #ifdef DOCUMENTATION
4829  };
4830 #endif
4831 
4832 
4834 
4835  NEW_NONTERMINAL_MACRO(AsmStatement,
4836  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4837  "AsmStatement", "AsmStatementTag", false);
4838  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4839  IS_SERIALIZABLE(AsmStatement);
4840 
4841 #ifdef DOCUMENTATION
4842 
4846  class SgAsmStatement: public SgAsmNode {
4847  public:
4848 #endif
4849 
4850 #ifdef DOCUMENTATION
4851 
4856  rose_addr_t get_address() const;
4857  void set_address(rose_addr_t);
4859 #else
4860  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4861  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4862 #endif
4863 
4864 
4865 #ifdef DOCUMENTATION
4866 
4869  const std::string& get_comment() const;
4870  void set_comment(const std::string&);
4872 #else
4873  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4874  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4875 #endif
4876 
4877  DECLARE_OTHERS(AsmStatement);
4878 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4879 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4880  private:
4881  friend class boost::serialization::access;
4882 
4883  template<class S>
4884  void serialize(S &s, const unsigned /*version*/) {
4885  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4886  s & BOOST_SERIALIZATION_NVP(p_address);
4887  s & BOOST_SERIALIZATION_NVP(p_comment);
4888  }
4889 #endif
4890 #endif // SgAsmStatement_OTHERS
4891 
4892 #ifdef DOCUMENTATION
4893  };
4894 #endif
4895 
4896 
4897 
4898 
4900 
4901  /*************************************************************************************************************************
4902  * Binary Interpretations
4903  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4904  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4905  * an AST that represents a single, coherent sub-part of the file.
4906  *************************************************************************************************************************/
4907 
4909 
4910  DECLARE_LEAF_CLASS(AsmInterpretationList);
4911  IS_SERIALIZABLE(AsmInterpretationList);
4912 
4913 #ifdef DOCUMENTATION
4914 
4916  public:
4917 #endif
4918 
4919 #ifdef DOCUMENTATION
4920 
4929 #else
4930  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4931  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4932  NO_DELETE);
4933 #endif
4934 
4935  DECLARE_OTHERS(AsmInterpretationList);
4936 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4937 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4938  private:
4939  friend class boost::serialization::access;
4940 
4941  template<class S>
4942  void serialize(S &s, const unsigned /*version*/) {
4943  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4944  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4945  }
4946 #endif
4947 #endif // SgAsmInterpretationList_OTHERS
4948 
4949 #ifdef DOCUMENTATION
4950  };
4951 #endif
4952 
4954 
4955  DECLARE_LEAF_CLASS(AsmInterpretation);
4956  IS_SERIALIZABLE(AsmInterpretation);
4957 
4958  DECLARE_HEADERS(AsmInterpretation);
4959 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4960  #include <MemoryMap.h>
4961  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
4962 #endif // SgAsmInterpretation_HEADERS
4963 
4964 #ifdef DOCUMENTATION
4965 
4972  public:
4973 #endif
4974 
4975 #ifdef DOCUMENTATION
4976  // documentation and definition are below
4977 #else
4978  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4979 #endif
4980 
4981 #ifdef DOCUMENTATION
4982 
4993 #else
4994  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4995  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4996 #endif
4997 
4998 #ifdef DOCUMENTATION
4999 
5004  SgAsmBlock* get_global_block() const;
5007 #else
5008  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
5009  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5010 #endif
5011 
5012  DECLARE_OTHERS(AsmInterpretation);
5013 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
5014  private:
5016  const Rose::BinaryAnalysis::RegisterDictionary *p_registers;
5017  bool coverageComputed; // true iff percentageCoverage has been computed
5018  mutable InstructionMap instruction_map; // cached instruction map
5019 
5021  // disassembly into instructions.
5022  double percentageCoverage;
5023 
5024 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5025  private:
5026  friend class boost::serialization::access;
5027 
5028  template<class S>
5029  void serialize(S &s, const unsigned /*version*/) {
5030  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
5031  s & BOOST_SERIALIZATION_NVP(p_headers);
5032  s & BOOST_SERIALIZATION_NVP(p_global_block);
5033  s & BOOST_SERIALIZATION_NVP(p_map);
5034  s & BOOST_SERIALIZATION_NVP(p_registers);
5035  s & BOOST_SERIALIZATION_NVP(coverageComputed);
5036  s & BOOST_SERIALIZATION_NVP(instruction_map);
5037  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
5038  }
5039 #endif
5040 
5041  public:
5044  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
5045  ctor();
5046  }
5047 
5052  SgAsmGenericFilePtrList get_files() const;
5053 
5080  InstructionMap& get_instruction_map(bool recompute=false);
5081  void set_instruction_map(const InstructionMap&);
5088  void insert_instructions(InstructionMap&/*in,out*/);
5089 
5094  void erase_instructions(InstructionMap&/*in,out*/);
5095 
5101  void set_coverageComputed(bool x) { coverageComputed = x; }
5102  void set_percentageCoverage(double x) { percentageCoverage = x; }
5105  private:
5106  void ctor(); // finalize construction
5107 #endif // SgAsmInterpretation_OTHERS
5108 
5109 #ifdef DOCUMENTATION
5110  };
5111 #endif
5112 
5113 
5114 
5116 
5117  /*************************************************************************************************************************
5118  * ELF File Header
5119  *************************************************************************************************************************/
5120 
5122 
5123  DECLARE_LEAF_CLASS(AsmElfFileHeader);
5124  IS_SERIALIZABLE(AsmElfFileHeader);
5125 
5126 #ifdef DOCUMENTATION
5127 
5136  public:
5137 #endif
5138 
5139 #ifdef DOCUMENTATION
5140 
5145  unsigned char get_e_ident_file_class() const;
5146  void set_e_ident_file_class(unsigned char);
5148 #else
5149  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
5150  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5151 #endif
5152 
5153 #ifdef DOCUMENTATION
5154 
5159  unsigned char get_e_ident_data_encoding() const;
5160  void set_e_ident_data_encoding(unsigned char);
5162 #else
5163  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
5164  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5165 #endif
5166 
5167 #ifdef DOCUMENTATION
5168 
5173  unsigned char get_e_ident_file_version() const;
5174  void set_e_ident_file_version(unsigned char*);
5176 #else
5177  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
5178  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5179 #endif
5180 
5181 #ifdef DOCUMENTATION
5182 
5187  const SgUnsignedCharList& get_e_ident_padding() const;
5188  void set_e_ident_padding(const SgUnsignedCharList&);
5190 #else
5191  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
5192  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5193 #endif
5194 
5195 #ifdef DOCUMENTATION
5196 
5201  unsigned long get_e_type() const;
5202  void set_e_type(unsigned long);
5204 #else
5205  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
5206  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5207 #endif
5208 
5209 #ifdef DOCUMENTATION
5210 
5215  unsigned long get_e_machine() const;
5216  void set_e_machine(unsigned long);
5218 #else
5219  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
5220  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5221 #endif
5222 
5223 #ifdef DOCUMENTATION
5224 
5229  unsigned long get_e_flags() const;
5230  void set_e_flags(unsigned long);
5232 #else
5233  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
5234  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5235 #endif
5236 
5237 #ifdef DOCUMENTATION
5238 
5243  unsigned long get_e_ehsize() const;
5244  void set_e_ehsize(unsigned long);
5246 #else
5247  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
5248  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5249 #endif
5250 
5251 #ifdef DOCUMENTATION
5252 
5257  unsigned long get_phextrasz() const;
5258  void set_phextrasz(unsigned long);
5260 #else
5261  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
5262  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5263 #endif
5264 
5265 #ifdef DOCUMENTATION
5266 
5271  unsigned long get_e_phnum() const;
5272  void set_e_phnum(unsigned long);
5274 #else
5275  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
5276  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5277 #endif
5278 
5279 #ifdef DOCUMENTATION
5280 
5285  unsigned long get_shextrasz() const;
5286  void set_shextrasz(unsigned long);
5288 #else
5289  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
5290  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5291 #endif
5292 
5293 #ifdef DOCUMENTATION
5294 
5299  unsigned long get_e_shnum() const;
5300  void set_e_shnum(unsigned long);
5302 #else
5303  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
5304  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5305 #endif
5306 
5307 #ifdef DOCUMENTATION
5308 
5313  unsigned long get_e_shstrndx() const;
5314  void set_e_shstrndx(unsigned long);
5316 #else
5317  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
5318  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5319 #endif
5320 
5321 #ifdef DOCUMENTATION
5322 
5332 #else
5333  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
5334  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5335 #endif
5336 
5337 #ifdef DOCUMENTATION
5338 
5347 #else
5348  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
5349  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5350 #endif
5351 
5352  DECLARE_OTHERS(AsmElfFileHeader);
5353 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
5354 
5355 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5356  private:
5357  friend class boost::serialization::access;
5358 
5359  template<class S>
5360  void serialize(S &s, const unsigned /*version*/) {
5361  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
5362  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
5363  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
5364  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
5365  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
5366  s & BOOST_SERIALIZATION_NVP(p_e_type);
5367  s & BOOST_SERIALIZATION_NVP(p_e_machine);
5368  s & BOOST_SERIALIZATION_NVP(p_e_flags);
5369  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
5370  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
5371  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
5372  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
5373  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
5374  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
5375  s & BOOST_SERIALIZATION_NVP(p_section_table);
5376  s & BOOST_SERIALIZATION_NVP(p_segment_table);
5377  }
5378 #endif
5379 
5380  public:
5382  enum ObjectType {
5383  ET_NONE = 0
5384  ,ET_REL = 1
5385  ,ET_EXEC = 2
5386  ,ET_DYN = 3
5387  ,ET_CORE = 4
5389  ,ET_LOOS = 0xfe00
5390  ,ET_HIOS = 0xfeff
5391  ,ET_LOPROC = 0xff00
5392  ,ET_HIPROC = 0xffff
5393  };
5394 
5395  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
5396  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
5397  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
5398  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
5399  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
5400 #ifdef _MSC_VER
5401 # pragma pack (1)
5402 #endif
5403 
5410  unsigned char e_ident_magic[4];
5411  unsigned char e_ident_file_class;
5412  unsigned char e_ident_data_encoding;
5413  unsigned char e_ident_file_version;
5414  unsigned char e_ident_padding[9];
5415  uint16_t e_type;
5416  uint16_t e_machine;
5417  uint32_t e_version;
5418  uint32_t e_entry;
5419  uint32_t e_phoff;
5420  uint32_t e_shoff;
5421  uint32_t e_flags;
5422  uint16_t e_ehsize;
5423  uint16_t e_phentsize;
5424  uint16_t e_phnum;
5425  uint16_t e_shentsize;
5426  uint16_t e_shnum;
5427  uint16_t e_shstrndx;
5428  }
5429 #if !defined(SWIG) && !defined(_MSC_VER)
5430  __attribute__((packed))
5431 #endif
5432  ;
5433 
5435  unsigned char e_ident_magic[4];
5436  unsigned char e_ident_file_class;
5437  unsigned char e_ident_data_encoding;
5438  unsigned char e_ident_file_version;
5439  unsigned char e_ident_padding[9];
5440  uint16_t e_type;
5441  uint16_t e_machine;
5442  uint32_t e_version;
5443  uint64_t e_entry;
5444  uint64_t e_phoff;
5445  uint64_t e_shoff;
5446  uint32_t e_flags;
5447  uint16_t e_ehsize;
5448  uint16_t e_phentsize;
5449  uint16_t e_phnum;
5450  uint16_t e_shentsize;
5451  uint16_t e_shnum;
5452  uint16_t e_shstrndx;
5453  }
5454 #if !defined(SWIG) && !defined(_MSC_VER)
5455  __attribute__((packed))
5456 #endif
5457  ;
5458 
5459 #ifdef _MSC_VER
5460 # pragma pack ()
5461 #endif
5462 
5470  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
5471  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
5472  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
5473  ctor();
5474  }
5475 
5481  uint64_t max_page_size();
5482 
5485 
5488 
5494  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
5495 
5497  virtual bool reallocate() $ROSE_OVERRIDE;
5498 
5500  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5501 
5503  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5504 
5506  static bool is_ELF(SgAsmGenericFile*);
5507 
5509  SgAsmGenericSectionPtrList get_sectab_sections();
5510 
5512  SgAsmGenericSectionPtrList get_segtab_sections();
5513 
5514  // Overrides documented in base class
5515  virtual const char *format_name() const $ROSE_OVERRIDE;
5516 
5517  private:
5518  void ctor(); // called by constructors
5519  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
5520  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
5521 #endif // SgAsmElfFileHeader_OTHERS
5522 
5523 #ifdef DOCUMENTATION
5524  };
5525 #endif
5526 
5527 
5528 
5530 
5531  /*************************************************************************************************************************
5532  * ELF Section Tables
5533  *************************************************************************************************************************/
5534 
5536 
5537  DECLARE_LEAF_CLASS(AsmElfSectionTable);
5538  IS_SERIALIZABLE(AsmElfSectionTable);
5539 
5540 #ifdef DOCUMENTATION
5541 
5547  public:
5548 #endif
5549 
5550  DECLARE_OTHERS(AsmElfSectionTable);
5551 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
5552 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5553  private:
5554  friend class boost::serialization::access;
5555 
5556  template<class S>
5557  void serialize(S &s, const unsigned /*version*/) {
5558  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5559  }
5560 #endif
5561 
5562  public:
5565  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5566  ctor();
5567  }
5568 
5574  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
5575 
5587 
5591  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5592 
5594  virtual bool reallocate() $ROSE_OVERRIDE;
5595 
5597  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5598 
5600  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5601 
5602  private:
5603  void ctor();
5604 #endif // SgAsmElfSectionTable_OTHERS
5605 
5606 #ifdef DOCUMENTATION
5607  };
5608 #endif
5609 
5610 
5612 
5613  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
5614  IS_SERIALIZABLE(AsmElfSectionTableEntry);
5615 
5616 #ifdef DOCUMENTATION
5617 
5619  public:
5620 #endif
5621 
5622 #ifdef DOCUMENTATION
5623 
5628  unsigned get_sh_name() const;
5629  void set_sh_name(unsigned);
5631 #else
5632  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
5633  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5634 #endif
5635 
5636 #ifdef DOCUMENTATION
5637 
5642  SectionType get_sh_type() const;
5643  void set_sh_type(SectionType);
5645 #else
5646  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
5647  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5648 #endif
5649 
5650 #ifdef DOCUMENTATION
5651 
5656  unsigned long get_sh_link() const;
5657  void set_sh_link(unsigned long);
5659 #else
5660  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
5661  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5662 #endif
5663 
5664 #ifdef DOCUMENTATION
5665 
5670  unsigned long get_sh_info() const;
5671  void set_sh_info(unsigned long);
5673 #else
5674  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
5675  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5676 #endif
5677 
5678 #ifdef DOCUMENTATION
5679 
5684  uint64_t get_sh_flags() const;
5685  void set_sh_flags(uint64_t);
5687 #else
5688  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
5689  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5690 #endif
5691 
5692 #ifdef DOCUMENTATION
5693 
5698  rose_addr_t get_sh_addr() const;
5699  void set_sh_addr(rose_addr_t);
5701 #else
5702  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
5703  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5704 #endif
5705 
5706 #ifdef DOCUMENTATION
5707 
5712  rose_addr_t get_sh_offset() const;
5713  void set_sh_offset(rose_addr_t);
5715 #else
5716  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
5717  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5718 #endif
5719 
5720 #ifdef DOCUMENTATION
5721 
5726  rose_addr_t get_sh_size() const;
5727  void set_sh_size(rose_addr_t);
5729 #else
5730  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
5731  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5732 #endif
5733 
5734 #ifdef DOCUMENTATION
5735 
5740  rose_addr_t get_sh_addralign() const;
5741  void set_sh_addralign(rose_addr_t);
5743 #else
5744  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
5745  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5746 #endif
5747 
5748 #ifdef DOCUMENTATION
5749 
5754  rose_addr_t get_sh_entsize() const;
5755  void set_sh_entsize(rose_addr_t);
5757 #else
5758  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
5759  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5760 #endif
5761 
5762 #ifdef DOCUMENTATION
5763 
5768  const SgUnsignedCharList& get_extra() const;
5769  void set_extra(const SgUnsignedCharLit&);
5771 #else
5772  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5773  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5774  NO_DELETE);
5775 #endif
5776 
5777  DECLARE_OTHERS(AsmElfSectionTableEntry);
5778 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5779 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5780  private:
5781  friend class boost::serialization::access;
5782 
5783  template<class S>
5784  void serialize(S &s, const unsigned /*version*/) {
5785  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5786  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5787  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5788  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5789  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5790  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5791  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5792  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5793  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5794  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5795  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5796  s & BOOST_SERIALIZATION_NVP(p_extra);
5797  }
5798 #endif
5799 
5800  public:
5803  SHT_NULL = 0,
5807  SHT_RELA = 4,
5808  SHT_HASH = 5,
5810  SHT_NOTE = 7,
5812  SHT_REL = 9,
5813  SHT_SHLIB = 10,
5814  SHT_DYNSYM = 11,
5816  SHT_LOOS = 0x60000000,
5817  SHT_GNU_verdef = 0x6ffffffd,
5818  SHT_GNU_verneed = 0x6ffffffe,
5819  SHT_GNU_versym = 0x6fffffff,
5820  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5821 
5822  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5823  SHT_HIPROC = 0x7fffffff,
5824  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5825  SHT_HIUSER = 0xffffffff
5826  };
5827 
5831  SHF_WRITE= (1 << 0),
5832  SHF_ALLOC= (1 << 1),
5833  SHF_EXECINSTR= (1 << 2),
5834  SHF_MERGE= (1 << 4),
5835  SHF_STRINGS= (1 << 5),
5836  SHF_INFO_LINK= (1 << 6),
5837  SHF_LINK_ORDER= (1 << 7),
5839  SHF_GROUP= (1 << 9),
5840  SHF_TLS= (1 << 10),
5841  SHF_MASKOS= 0x0ff00000,
5842  SHF_MASKPROC= 0xf0000000
5843  };
5844 
5851 #ifdef _MSC_VER
5852 # pragma pack (1)
5853 #endif
5855  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5856  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5857  uint32_t sh_flags; /* 0x08 Bit flags */
5858  uint32_t sh_addr; /* 0x0c Desired mapped address */
5859  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5860  uint32_t sh_size; /* 0x14 Section size in bytes */
5861  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5862  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5863  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5864  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5865  } /* 0x28 */
5866 #if !defined(SWIG) && !defined(_MSC_VER)
5867  __attribute__((packed))
5868 #endif
5869  ;
5870 
5872  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5873  uint32_t sh_type; /* 0x04 */
5874  uint64_t sh_flags; /* 0x08 */
5875  uint64_t sh_addr; /* 0x10 */
5876  uint64_t sh_offset; /* 0x18 */
5877  uint64_t sh_size; /* 0x20 */
5878  uint32_t sh_link; /* 0x28 */
5879  uint32_t sh_info; /* 0x2c */
5880  uint64_t sh_addralign; /* 0x30 */
5881  uint64_t sh_entsize; /* 0x38 */
5882  } /* 0x40 */
5883 #if !defined(SWIG) && !defined(_MSC_VER)
5884  __attribute__((packed))
5885 #endif
5886  ;
5887 #ifdef _MSC_VER
5888 # pragma pack ()
5889 #endif
5890 
5892  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5894 
5896  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5898 
5902  void *encode(ByteOrder::Endianness sex,
5904  void *encode(ByteOrder::Endianness sex,
5910 
5912  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5913 
5914  // Use Rose::stringify... function instead.
5915  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5916  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5917 
5918  private:
5919  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5920  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5921 #endif // SgAsmElfSectionTableEntry_OTHERS
5922 
5923 #ifdef DOCUMENTATION
5924  };
5925 #endif
5926 
5927 
5928 
5930 
5931  /*************************************************************************************************************************
5932  * ELF Segment Tables
5933  *************************************************************************************************************************/
5934 
5936 
5937  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5938  IS_SERIALIZABLE(AsmElfSegmentTable);
5939 
5940 #ifdef DOCUMENTATION
5941 
5948  public:
5949 #endif
5950 
5951  DECLARE_OTHERS(AsmElfSegmentTable);
5952 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5953 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5954  private:
5955  friend class boost::serialization::access;
5956 
5957  template<class S>
5958  void serialize(S &s, const unsigned /*version*/) {
5959  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5960  }
5961 #endif
5962 
5963  public:
5966  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5967  ctor();
5968  }
5969 
5974  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5975 
5990 
5994  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5995 
5997  virtual bool reallocate() $ROSE_OVERRIDE;
5998 
6000  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6001 
6003  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6004 
6005  private:
6006  void ctor();
6007 #endif // SgAsmElfSegmentTable_OTHERS
6008 
6009 #ifdef DOCUMENTATION
6010  };
6011 #endif
6012 
6014 
6015  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
6016  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
6017 
6018 #ifdef DOCUMENTATION
6020  public:
6021 #endif
6022 
6023 #ifdef DOCUMENTATION
6024 
6030  const SgAsmElfSegmentTableEntryPtrList& get_entries();
6031  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
6033 #else
6034  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
6035  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6036  NO_DELETE);
6037 #endif
6038 
6039  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
6040 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
6041 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6042  private:
6043  friend class boost::serialization::access;
6044 
6045  template<class S>
6046  void serialize(S &s, const unsigned /*version*/) {
6047  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6048  }
6049 #endif
6050 #endif // SgAsmElfSegmentTableEntryList_OTHERS
6051 
6052 #ifdef DOCUMENTATION
6053  };
6054 #endif
6055 
6056 
6058 
6059  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
6060  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
6061 
6062 #ifdef DOCUMENTATION
6063 
6065  public:
6066 #endif
6067 
6068 #ifdef DOCUMENTATION
6069 
6074  size_t get_index() const;
6075  void set_index(size_t);
6077 #else
6078  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
6079  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6080 #endif
6081 
6082 #ifdef DOCUMENTATION
6083 
6086  SegmentType get_type() const;
6087  void set_type(SegmentType);
6089 #else
6090  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
6091  "= SgAsmElfSegmentTableEntry::PT_LOAD",
6092  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6093 #endif
6094 
6095 #ifdef DOCUMENTATION
6096 
6099  SegmentFlags get_flags() const;
6100  void set_flags(SegmentFlags);
6102 #else
6103  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
6104  "= SgAsmElfSegmentTableEntry::PF_NONE",
6105  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6106 #endif
6107 
6108 #ifdef DOCUMENTATION
6109 
6114  rose_addr_t get_offset() const;
6115  void set_offset(rose_addr_t);
6117 #else
6118  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
6119  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6120 #endif
6121 
6122 #ifdef DOCUMENTATION
6123 
6129  rose_addr_t get_vaddr() const;
6130  void set_vaddr(rose_addr_t);
6132 #else
6133  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
6134  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6135 #endif
6136 
6137 #ifdef DOCUMENTATION
6138 
6143  rose_addr_t get_paddr() const;
6144  void set_paddr(rose_addr_t);
6146 #else
6147  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
6148  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6149 #endif
6150 
6151 #ifdef DOCUMENTATION
6152 
6157  rose_addr_t get_filesz() const;
6158  void set_filesz(rose_addr_t);
6160 #else
6161  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
6162  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6163 #endif
6164 
6165 #ifdef DOCUMENTATION
6166 
6171  rose_addr_t get_memsz() const;
6172  void set_memsz(rose_addr_t);
6174 #else
6175  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
6176  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6177 #endif
6178 
6179 #ifdef DOCUMENTATION
6180 
6185  rose_addr_t get_align() const;
6186  void set_align(rose_addr_t);
6188 #else
6189  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
6190  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6191 #endif
6192 
6193 #ifdef DOCUMENTATION
6194 
6199  const SgUnsignedCharList& get_extra() const;
6200  void set_extra(const SgUnsignedCharList&);
6202 #else
6203  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
6204  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6205 #endif
6206 
6207  DECLARE_OTHERS(AsmElfSegmentTableEntry);
6208 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
6209 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6210  private:
6211  friend class boost::serialization::access;
6212 
6213  template<class S>
6214  void serialize(S &s, const unsigned /*version*/) {
6215  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6216  s & BOOST_SERIALIZATION_NVP(p_index);
6217  s & BOOST_SERIALIZATION_NVP(p_type);
6218  s & BOOST_SERIALIZATION_NVP(p_flags);
6219  s & BOOST_SERIALIZATION_NVP(p_offset);
6220  s & BOOST_SERIALIZATION_NVP(p_vaddr);
6221  s & BOOST_SERIALIZATION_NVP(p_paddr);
6222  s & BOOST_SERIALIZATION_NVP(p_filesz);
6223  s & BOOST_SERIALIZATION_NVP(p_memsz);
6224  s & BOOST_SERIALIZATION_NVP(p_align);
6225  s & BOOST_SERIALIZATION_NVP(p_extra);
6226  }
6227 #endif
6228 
6229  public:
6232  PT_NULL = 0,
6233  PT_LOAD = 1,
6236  PT_NOTE = 4,
6237  PT_SHLIB = 5,
6238  PT_PHDR = 6,
6239  PT_TLS = 7,
6241  // OS- and Processor-specific ranges
6242  PT_LOOS = 0x60000000,
6243  PT_HIOS = 0x6fffffff,
6244  PT_LOPROC = 0x70000000,
6245  PT_HIPROC = 0x7fffffff,
6246 
6247  // OS-specific values for GNU/Linux
6248  PT_GNU_EH_FRAME = 0x6474e550,
6249  PT_GNU_STACK = 0x6474e551,
6250  PT_GNU_RELRO = 0x6474e552,
6251  PT_PAX_FLAGS = 0x65041580,
6253  // OS-specific values for Sun
6254  PT_SUNWBSS = 0x6ffffffa,
6255  PT_SUNWSTACK = 0x6ffffffb
6256  };
6257 
6260  PF_NONE = 0,
6261  PF_RESERVED = 0x000ffff8,
6262  PF_XPERM = 0x00000001,
6263  PF_WPERM = 0x00000002,
6264  PF_RPERM = 0x00000004,
6265  PF_OS_MASK = 0x0ff00000,
6266  PF_PROC_MASK = 0xf0000000
6267  };
6268 
6269 #ifdef _MSC_VER
6270 # pragma pack (1)
6271 #endif
6272 
6280  uint32_t p_type;
6281  uint32_t p_offset;
6282  uint32_t p_vaddr;
6283  uint32_t p_paddr;
6284  uint32_t p_filesz;
6285  uint32_t p_memsz;
6286  uint32_t p_flags;
6287  uint32_t p_align;
6288  } /* 0x30 */
6289 #if !defined(SWIG) && !defined(_MSC_VER)
6290  __attribute__((packed))
6291 #endif
6292  ;
6293 
6295  uint32_t p_type; /* 0x00 */
6296  uint32_t p_flags; /* 0x04 */
6297  uint64_t p_offset; /* 0x08 */
6298  uint64_t p_vaddr; /* 0x10 */
6299  uint64_t p_paddr; /* 0x18 */
6300  uint64_t p_filesz; /* 0x20 */
6301  uint64_t p_memsz; /* 0x28 */
6302  uint64_t p_align; /* 0x30 */
6303  } /* 0x38 */
6304 #if !defined(SWIG) && !defined(_MSC_VER)
6305  __attribute__((packed))
6306 #endif
6307  ;
6308 #ifdef _MSC_VER
6309 # pragma pack ()
6310 #endif
6311 
6313  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6315 
6317  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6319 
6323  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
6324  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
6329 
6331  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
6332 
6335 
6338 
6339  private:
6340  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
6341  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
6342 #endif // SgAsmElfSegmentTableEntry_OTHERS
6343 
6344 #ifdef DOCUMENTATION
6345  };
6346 #endif
6347 
6348 
6349 
6351 
6352  /*************************************************************************************************************************
6353  * ELF Symbol Tables
6354  *************************************************************************************************************************/
6355 
6357 
6358  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
6359  IS_SERIALIZABLE(AsmElfSymbolSection);
6360 
6361 #ifdef DOCUMENTATION
6362 
6364  public:
6365 #endif
6366 
6367 #ifdef DOCUMENTATION
6368 
6371  bool get_is_dynamic() const;
6372  void set_is_dynamic(bool);
6374 #else
6375  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
6376  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6377 #endif
6378 
6379 #ifdef DOCUMENTATION
6380 
6389 #else
6390  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
6391  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6392 #endif
6393 
6394  DECLARE_OTHERS(AsmElfSymbolSection);
6395 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
6396 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6397  private:
6398  friend class boost::serialization::access;
6399 
6400  template<class S>
6401  void serialize(S &s, const unsigned /*version*/) {
6402  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6403  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
6404  s & BOOST_SERIALIZATION_NVP(p_symbols);
6405  }
6406 #endif
6407 
6408  public:
6411  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
6412  ctor(strsec);
6413  }
6414 
6416  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
6417 
6430  virtual void finish_parsing() $ROSE_OVERRIDE;
6431 
6433  size_t index_of(SgAsmElfSymbol*);
6434 
6439  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6440 
6444  virtual bool reallocate() $ROSE_OVERRIDE;
6445 
6447  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6448 
6450  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6451 
6452  private:
6453  void ctor(SgAsmElfStringSection*);
6454 #endif // SgAsmElfSymbolSection_OTHERS
6455 
6456 #ifdef DOCUMENTATION
6457  };
6458 #endif
6459 
6461 
6462  DECLARE_LEAF_CLASS(AsmElfSymbolList);
6463  IS_SERIALIZABLE(AsmElfSymbolList);
6464 
6465 #ifdef DOCUMENTATION
6467  public:
6468 #endif
6469 
6470 #ifdef DOCUMENTATION
6471 
6477  const SgAsmElfSymbolPtrList& get_symbols() const;
6478  void set_symbols(const SgAsmElfSymbolPtrList&);
6480 #else
6481  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
6482  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6483 #endif
6484 
6485  DECLARE_OTHERS(AsmElfSymbolList);
6486 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
6487 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6488  private:
6489  friend class boost::serialization::access;
6490 
6491  template<class S>
6492  void serialize(S &s, const unsigned /*version*/) {
6493  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6494  s & BOOST_SERIALIZATION_NVP(p_symbols);
6495  }
6496 #endif
6497 #endif // SgAsmElfSymbolList_OTHERS
6498 
6499 #ifdef DOCUMENTATION
6500  };
6501 #endif
6502 
6504 
6505  DECLARE_LEAF_CLASS(AsmElfSymbol);
6506  IS_SERIALIZABLE(AsmElfSymbol);
6507 
6508 #ifdef DOCUMENTATION
6509 
6514  public:
6515 #endif
6516 
6517 #ifdef DOCUMENTATION
6518 
6523  unsigned char get_st_info() const;
6524  void set_st_info(unsigned char);
6526 #else
6527  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
6528  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6529 #endif
6530 
6531 #ifdef DOCUMENTATION
6532 
6537  unsigned char get_st_res1() const;
6538  void set_st_res1(unsigned char);
6540 #else
6541  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
6542  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6543 #endif
6544 
6545 #ifdef DOCUMENTATION
6546 
6551  unsigned get_st_shndx() const;
6552  void set_st_shndx(unsigned);
6554 #else
6555  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
6556  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6557 #endif
6558 
6559 #ifdef DOCUMENTATION
6560 
6565  rose_addr_t get_st_size() const;
6566  void set_st_size(rose_addr_t);
6568 #else
6569  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
6570  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6571 #endif
6572 
6573 #ifdef DOCUMENTATION
6574 
6579  const SgUnsignedCharList& get_extra() const;
6580  void set_extra(const SgUnsignedCharList&);
6582 #else
6583  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
6584  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6585 #endif
6586 
6587  DECLARE_OTHERS(AsmElfSymbol);
6588 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
6589 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6590  private:
6591  friend class boost::serialization::access;
6592 
6593  template<class S>
6594  void serialize(S &s, const unsigned /*version*/) {
6595  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
6596  s & BOOST_SERIALIZATION_NVP(p_st_info);
6597  s & BOOST_SERIALIZATION_NVP(p_st_res1);
6598  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
6599  s & BOOST_SERIALIZATION_NVP(p_st_size);
6600  s & BOOST_SERIALIZATION_NVP(p_extra);
6601  }
6602 #endif
6603 
6604  public:
6605  enum ElfSymBinding {
6606  STB_LOCAL=0,
6607  STB_GLOBAL=1,
6608  STB_WEAK=2
6609  };
6610 
6611  enum ElfSymType {
6614  STT_FUNC = 2,
6616  STT_FILE = 4,
6618  STT_TLS = 6,
6620  };
6621 
6622 #ifdef _MSC_VER
6623 # pragma pack (1)
6624 #endif
6625 
6628  uint32_t st_name;
6629  uint32_t st_value;
6630  uint32_t st_size;
6631  unsigned char st_info;
6632  unsigned char st_res1;
6633  uint16_t st_shndx;
6634  }
6635 #if !defined(SWIG) && !defined(_MSC_VER)
6636  __attribute__((packed))
6637 #endif
6638  ;
6639 
6641  uint32_t st_name;
6642  unsigned char st_info;
6643  unsigned char st_res1;
6644  uint16_t st_shndx;
6645  uint64_t st_value;
6646  uint64_t st_size;
6647  }
6648 #if !defined(SWIG) && !defined(_MSC_VER)
6649  __attribute__((packed))
6650 #endif
6651  ;
6652 
6653 #ifdef _MSC_VER
6654 # pragma pack ()
6655 #endif
6656 
6658  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
6659 
6663  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
6664 
6668  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
6669 
6673  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
6674  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
6682  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6683  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
6687  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
6688 
6691 
6693  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
6694 
6696  static std::string to_string(SgAsmElfSymbol::ElfSymType);
6697 
6698  private:
6699  void ctor(SgAsmElfSymbolSection*);
6700  void parse_common(); // initialization common to all parse() methods
6701 #endif // SgAsmElfSymbol_OTHERS
6702 
6703 #ifdef DOCUMENTATION
6704  };
6705 #endif
6706 
6707 
6708 
6710 
6711  /*************************************************************************************************************************
6712  * ELF Symbol Version Tables
6713  *************************************************************************************************************************/
6714 
6716 
6717  DECLARE_LEAF_CLASS(AsmElfSymverSection);
6718  IS_SERIALIZABLE(AsmElfSymverSection);
6719 
6720 #ifdef DOCUMENTATION
6721 
6726  public:
6727 #endif
6728 
6729 #ifdef DOCUMENTATION
6730 
6739 #else
6740  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
6741  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6742 #endif
6743 
6744  DECLARE_OTHERS(AsmElfSymverSection);
6745 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
6746 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6747  private:
6748  friend class boost::serialization::access;
6749 
6750  template<class S>
6751  void serialize(S &s, const unsigned /*version*/) {
6752  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6753  s & BOOST_SERIALIZATION_NVP(p_entries);
6754  }
6755 #endif
6756 
6757  public:
6760  : SgAsmElfSection(fhdr) {
6761  ctor();
6762  }
6763 
6765  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
6766 
6771  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6772 
6774  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6775 
6777  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6778  private:
6779  void ctor();
6780 #endif // SgAsmElfSymverSection_OTHERS
6781 
6782 #ifdef DOCUMENTATION
6783  };
6784 #endif
6785 
6787 
6788  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6789  IS_SERIALIZABLE(AsmElfSymverEntry);
6790 
6791 #ifdef DOCUMENTATION
6792 
6794  public:
6795 #endif
6796 
6797 #ifdef DOCUMENTATION
6798 
6803  size_t get_value() const;
6804  void set_value(size_t);
6806 #else
6807  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6808  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6809 #endif
6810 
6811  DECLARE_OTHERS(AsmElfSymverEntry);
6812 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6813 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6814  private:
6815  friend class boost::serialization::access;
6816 
6817  template<class S>
6818  void serialize(S &s, const unsigned /*version*/) {
6819  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6820  s & BOOST_SERIALIZATION_NVP(p_value);
6821  }
6822 #endif
6823 
6824  public:
6827  : p_value(0) {
6828  ctor(symver);
6829  }
6830 
6832  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6833 
6834  private:
6835  void ctor(SgAsmElfSymverSection*);
6836 #endif // SgAsmElfSymverEntry_OTHERS
6837 
6838 #ifdef DOCUMENTATION
6839  };
6840 #endif
6841 
6843 
6844 
6845  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6846  IS_SERIALIZABLE(AsmElfSymverEntryList);
6847 
6848 #ifdef DOCUMENTATION
6849 
6854  public:
6855 #endif
6856 
6857 #ifdef DOCUMENTATION
6858 
6861  const SgAsmElfSymverEntryPtrList& get_entries() const;
6862  void set_entries(const SgAsmElfSymverEntryPtrList&);
6864 #else
6865  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6866  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6867  NO_DELETE);
6868 #endif
6869 
6870  DECLARE_OTHERS(AsmElfSymverEntryList);
6871 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6872 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6873  private:
6874  friend class boost::serialization::access;
6875 
6876  template<class S>
6877  void serialize(S &s, const unsigned /*version*/) {
6878  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6879  s & BOOST_SERIALIZATION_NVP(p_entries);
6880  }
6881 #endif
6882 #endif // SgAsmElfSymverEntryList_OTHERS
6883 
6884 #ifdef DOCUMENTATION
6885  };
6886 #endif
6887 
6889 
6890  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6891  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6892 
6893 #ifdef DOCUMENTATION
6894 
6900  public:
6901 #endif
6902 
6903 #ifdef DOCUMENTATION
6904 
6913 #else
6914  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6915  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6916  NO_DELETE);
6917 #endif
6918 
6919  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6920 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6921 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6922  private:
6923  friend class boost::serialization::access;
6924 
6925  template<class S>
6926  void serialize(S &s, const unsigned /*version*/) {
6927  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6928  s & BOOST_SERIALIZATION_NVP(p_entries);
6929  }
6930 #endif
6931 
6932  public:
6935  : SgAsmElfSection(fhdr) {
6936  ctor(strsec);
6937  }
6938 
7007  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
7008 
7011  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
7012 
7016  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7017 
7019  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7020 
7021  private:
7022  void ctor(SgAsmElfStringSection*);
7023 #endif // SgAsmElfSymverDefinedSection_OTHERS
7024 
7025 #ifdef DOCUMENTATION
7026  };
7027 #endif
7028 
7030 
7031  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
7032  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
7033 
7034 #ifdef DOCUMENTATION
7035 
7040  public:
7041 #endif
7042 
7043 #ifdef DOCUMENTATION
7044 
7047  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
7048  void set_entries(const SgAsmElfSymverDefinedPtrList&);
7050 #else
7051  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
7052  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7053  NO_DELETE);
7054 #endif
7055 
7056  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
7057 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
7058 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7059  private:
7060  friend class boost::serialization::access;
7061 
7062  template<class S>
7063  void serialize(S &s, const unsigned /*version*/) {
7064  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7065  s & BOOST_SERIALIZATION_NVP(p_entries);
7066  }
7067 #endif
7068 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
7069 
7070 #ifdef DOCUMENTATION
7071  };
7072 #endif
7073 
7075 
7076  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
7077  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
7078 
7079 #ifdef DOCUMENTATION
7080 
7082  public:
7083 #endif
7084 
7085 #ifdef DOCUMENTATION
7086 
7091  size_t get_version() const;
7092  void set_version(size_t);
7094 #else
7095  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
7096  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7097 #endif
7098 
7099 #ifdef DOCUMENTATION
7100 
7105  int get_flags() const;
7106  void set_flags(int);
7108 #else
7109  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
7110  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7111 #endif
7112 
7113 #ifdef DOCUMENTATION
7114 
7119  size_t get_index() const;
7120  void set_index(size_t);
7122 #else
7123  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
7124  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7125 #endif
7126 
7127 #ifdef DOCUMENTATION
7128 
7133  uint32_t get_hash() const;
7134  void set_hash(uint32_t);
7136 #else
7137  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
7138  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7139 #endif
7140 
7141 #ifdef DOCUMENTATION
7142 
7151 #else
7152  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
7153  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7154 #endif
7155 
7156  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
7157 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
7158 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7159  private:
7160  friend class boost::serialization::access;
7161 
7162  template<class S>
7163  void serialize(S &s, const unsigned /*version*/) {
7164  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7165  s & BOOST_SERIALIZATION_NVP(p_version);
7166  s & BOOST_SERIALIZATION_NVP(p_flags);
7167  s & BOOST_SERIALIZATION_NVP(p_index);
7168  s & BOOST_SERIALIZATION_NVP(p_hash);
7169  s & BOOST_SERIALIZATION_NVP(p_entries);
7170  }
7171 #endif
7172 
7173  public:
7174 #ifdef _MSC_VER
7175 # pragma pack (1)
7176 #endif
7177 
7179  uint16_t vd_version;
7180  uint16_t vd_flags;
7181  uint16_t vd_ndx;
7182  uint16_t vd_cnt;
7183  uint32_t vd_hash;
7184  uint32_t vd_aux;
7185  uint32_t vd_next;
7186  }
7187 #if !defined(SWIG) && !defined(_MSC_VER)
7188  __attribute__((packed))
7189 #endif
7190  ;
7191 
7192 #ifdef _MSC_VER
7193 # pragma pack ()
7194 #endif
7195 
7198  ctor(symver_defined);
7199  }
7200 
7202  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
7203 
7205  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
7206 
7208  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7209 
7210  private:
7211  void ctor(SgAsmElfSymverDefinedSection*);
7212 #endif // SgAsmElfSymverDefinedEntry_OTHERS
7213 
7214 #ifdef DOCUMENTATION
7215  };
7216 #endif
7217 
7219 
7220  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
7221  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
7222 
7223 #ifdef DOCUMENTATION
7224 
7229  pbulic:
7230 #endif
7231 
7232 #ifdef DOCUMENTATION
7233 
7236  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
7237  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
7239 #else
7240  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
7241  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7242  NO_DELETE);
7243 #endif
7244 
7245  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
7246 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
7247 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7248  private:
7249  friend class boost::serialization::access;
7250 
7251  template<class S>
7252  void serialize(S &s, const unsigned /*version*/) {
7253  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7254  s & BOOST_SERIALIZATION_NVP(p_entries);
7255  }
7256 #endif
7257 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
7258 
7259 #ifdef DOCUMENTATION
7260  };
7261 #endif
7262 
7264 
7265  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
7266  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
7267 
7268 #ifdef DOCUMENTATION
7270  public:
7271 #endif
7272 
7273 #ifdef DOCUMENTATION
7274 
7277  SgAsmGenericString* get_name() const;
7280 #else
7281  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7282  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7283 #endif
7284 
7285  DECLARE_OTHERS(AsmElfSymverDefinedAux);
7286 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
7287 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7288  private:
7289  friend class boost::serialization::access;
7290 
7291  template<class S>
7292  void serialize(S &s, const unsigned /*version*/) {
7293  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7294  s & BOOST_SERIALIZATION_NVP(p_name);
7295  }
7296 #endif
7297 
7298  public:
7299 #ifdef _MSC_VER
7300 # pragma pack (1)
7301 #endif
7302 
7305  uint32_t vda_name;
7306  uint32_t vda_next;
7307  }
7308 #if !defined(SWIG) && !defined(_MSC_VER)
7309  __attribute__((packed))
7310 #endif
7311  ;
7312 
7313 #ifdef _MSC_VER
7314 # pragma pack ()
7315 #endif
7316 
7321  SgAsmElfSymverDefinedSection *symver_def_sec)
7322  : p_name(NULL) {
7323  ctor(symver_def_entry,symver_def_sec);
7324  }
7325 
7327  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
7328 
7330  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
7331 
7337  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7338 
7339  private:
7340  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
7341 #endif // SgAsmElfSymverDefinedAux_OTHERS
7342 
7343 #ifdef DOCUMENTATION
7344  };
7345 #endif
7346 
7348 
7349  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
7350  IS_SERIALIZABLE(AsmElfSymverNeededSection);
7351 
7352 #ifdef DOCUMENTATION
7353 
7359  public:
7360 #endif
7361 
7362 #ifdef DOCUMENTATION
7363 
7372 #else
7373  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
7374  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7375 #endif
7376 
7377  DECLARE_OTHERS(AsmElfSymverNeededSection);
7378 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
7379 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7380  private:
7381  friend class boost::serialization::access;
7382 
7383  template<class S>
7384  void serialize(S &s, const unsigned /*version*/) {
7385  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7386  s & BOOST_SERIALIZATION_NVP(p_entries);
7387  }
7388 #endif
7389 
7390  public:
7395  : SgAsmElfSection(fhdr) {
7396  ctor(strsec);
7397  }
7398 
7408  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
7409 
7414  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
7415 
7419  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7420 
7422  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7423 
7424  private:
7425  void ctor(SgAsmElfStringSection*);
7426 #endif // SgAsmElfSymverNeededSection_OTHERS
7427 
7428 #ifdef DOCUMENTATION
7429  };
7430 #endif
7431 
7433 
7434  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
7435  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
7436 
7437 #ifdef DOCUMENTATION
7438 
7443  public:
7444 #endif
7445 
7446 #ifdef DOCUMENTATION
7447 
7450  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
7451  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
7453 #else
7454  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
7455  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7456  NO_DELETE);
7457 #endif
7458 
7459  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
7460 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
7461 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7462  private:
7463  friend class boost::serialization::access;
7464 
7465  template<class S>
7466  void serialize(S &s, const unsigned /*version*/) {
7467  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7468  s & BOOST_SERIALIZATION_NVP(p_entries);
7469  }
7470 #endif
7471 #endif // SgAsmElfSymverNeededEntryList_OTHERS
7472 
7473 #ifdef DOCUMENTATION
7474  };
7475 #endif
7476 
7478 
7479  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
7480  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
7481 
7482 #ifdef DOCUMENTATION
7483 
7485  public:
7486 #endif
7487 
7488 #ifdef DOCUMENTATION
7489 
7494  size_t get_version() const;
7495  void set_version(size_t);
7497 #else
7498  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
7499  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7500 #endif
7501 
7502 #ifdef DOCUMENTATION
7503 
7509 #else
7510  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
7511  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7512 #endif
7513 
7514 #ifdef DOCUMENTATION
7515 
7524 #else
7525  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
7526  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7527 #endif
7528 
7529  DECLARE_OTHERS(AsmElfSymverNeededEntry);
7530 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
7531 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7532  private:
7533  friend class boost::serialization::access;
7534 
7535  template<class S>
7536  void serialize(S &s, const unsigned /*version*/) {
7537  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7538  s & BOOST_SERIALIZATION_NVP(p_version);
7539  s & BOOST_SERIALIZATION_NVP(p_file_name);
7540  s & BOOST_SERIALIZATION_NVP(p_entries);
7541  }
7542 #endif
7543 
7544  public:
7545 #ifdef _MSC_VER
7546 # pragma pack (1)
7547 #endif
7548 
7551  uint16_t vn_version;
7552  uint16_t vn_cnt;
7553  uint32_t vn_file;
7554  uint32_t vn_aux;
7555  uint32_t vn_next;
7556  }
7557 #if !defined(SWIG) && !defined(_MSC_VER)
7558  __attribute__((packed))
7559 #endif
7560  ;
7561 
7562 #ifdef _MSC_VER
7563 # pragma pack ()
7564 #endif
7565 
7568  : p_file_name(NULL) {
7569  ctor(symver_needed);
7570  }
7571 
7573  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
7574 
7576  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
7577 
7579  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7580 
7581  private:
7582  void ctor(SgAsmElfSymverNeededSection*);
7583 #endif // SgAsmElfSymverNeededEntry_OTHERS
7584 
7585 #ifdef DOCUMENTATION
7586  };
7587 #endif
7588 
7590 
7591  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
7592  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
7593 
7594 #ifdef DOCUMENTATION
7595 
7600  public:
7601 #endif
7602 
7603 #ifdef DOCUMENTATION
7604 
7607  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
7608  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
7610 #else
7611  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
7612  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7613  NO_DELETE);
7614 #endif
7615 
7616  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
7617 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
7618 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7619  private:
7620  friend class boost::serialization::access;
7621 
7622  template<class S>
7623  void serialize(S &s, const unsigned /*version*/) {
7624  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7625  s & BOOST_SERIALIZATION_NVP(p_entries);
7626  }
7627 #endif
7628 #endif // SgAsmElfSymverNeededAuxList_OTHERS
7629 
7630 #ifdef DOCUMENTATION
7631  };
7632 #endif
7633 
7635 
7636  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
7637  IS_SERIALIZABLE(AsmElfSymverNeededAux);
7638 
7639 #ifdef DOCUMENTATION
7640 
7642  public:
7643 #endif
7644 
7645 #ifdef DOCUMENTATION
7646 
7651  uint32_t get_hash() const;
7652  void set_hash(uint32_t);
7654 #else
7655  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
7656  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7657 #endif
7658 
7659 #ifdef DOCUMENTATION
7660 
7665  int get_flags() const;
7666  void set_flags(int);
7668 #else
7669  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
7670  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7671 #endif
7672 
7673 #ifdef DOCUMENTATION
7674 
7679  size_t get_other() const;
7680  void set_other(size_t);
7682 #else
7683  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
7684  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7685 #endif
7686 
7687 #ifdef DOCUMENTATION
7688 
7691  SgAsmGenericString* get_name() const;
7694 #else
7695  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7696  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7697 #endif
7698 
7699  DECLARE_OTHERS(AsmElfSymverNeededAux);
7700 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
7701 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7702  private:
7703  friend class boost::serialization::access;
7704 
7705  template<class S>
7706  void serialize(S &s, const unsigned /*version*/) {
7707  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7708  s & BOOST_SERIALIZATION_NVP(p_hash);
7709  s & BOOST_SERIALIZATION_NVP(p_flags);
7710  s & BOOST_SERIALIZATION_NVP(p_other);
7711  s & BOOST_SERIALIZATION_NVP(p_name);
7712  }
7713 #endif
7714 
7715  public:
7716 #ifdef _MSC_VER
7717 # pragma pack (1)
7718 #endif
7719 
7722  uint32_t vna_hash;
7723  uint16_t vna_flags;
7724  uint16_t vna_other;
7725  uint32_t vna_name;
7726  uint32_t vna_next;
7727  }
7728 #if !defined(SWIG) && !defined(_MSC_VER)
7729  __attribute__((packed))
7730 #endif
7731  ;
7732 
7733 #ifdef _MSC_VER
7734 # pragma pack ()
7735 #endif
7736 
7742  : p_name(NULL) {
7743  ctor(symver_needed_entry,symver_needed_sec);
7744  }
7745 
7747  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
7748 
7750  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
7751 
7757  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7758 
7759  private:
7761 #endif // SgAsmElfSymverNeededAux_OTHERS
7762 
7763 #ifdef DOCUMENTATION
7764  };
7765 #endif
7766 
7767 
7768 
7769 
7771 
7772  /*************************************************************************************************************************
7773  * ELF Relocation Tables
7774  *************************************************************************************************************************/
7775 
7777 
7778  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7779  IS_SERIALIZABLE(AsmElfRelocSection);
7780 
7781 #ifdef DOCUMENTATION
7782 
7784  public:
7785 #endif
7786 
7787 #ifdef DOCUMENTATION
7788 
7791  bool get_uses_addend() const;
7792  void set_uses_addend(bool);
7794 #else
7795  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7796  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7797 #endif
7798 
7799 #ifdef DOCUMENTATION
7800 
7806 #else
7807  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7808  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7809 #endif
7810 
7811 #ifdef DOCUMENTATION
7812 
7820 #else
7821  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7822  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7823 #endif
7824 
7825  DECLARE_OTHERS(AsmElfRelocSection);
7826 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7827 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7828  private:
7829  friend class boost::serialization::access;
7830 
7831  template<class S>
7832  void serialize(S &s, const unsigned /*version*/) {
7833  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7834  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7835  s & BOOST_SERIALIZATION_NVP(p_target_section);
7836  s & BOOST_SERIALIZATION_NVP(p_entries);
7837  }
7838 #endif
7839 
7840  public:
7842  : SgAsmElfSection(fhdr) {
7843  ctor(symsec,targetsec);
7844  }
7845 
7848  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7849 
7851  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7852 
7854  virtual bool reallocate() $ROSE_OVERRIDE;
7855 
7857  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7858 
7860  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7861 
7862  private:
7864 #endif // SgAsmElfRelocSection_OTHERS
7865 
7866 #ifdef DOCUMENTATION
7867  };
7868 #endif
7869 
7871 
7872  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7873  IS_SERIALIZABLE(AsmElfRelocEntryList);
7874 
7875 #ifdef DOCUMENTATION
7876 
7881  public:
7882 #endif
7883 
7884 #ifdef DOCUMENTATION
7885 
7888  const SgAsmElfRelocEntryPtrList& get_entries() const;
7889  void set_entries(const SgAsmElfRelocEntryPtrList&);
7891 #else
7892  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7893  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7894  NO_DELETE);
7895 #endif
7896 
7897  DECLARE_OTHERS(AsmElfRelocEntryList);
7898 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7899 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7900  private:
7901  friend class boost::serialization::access;
7902 
7903  template<class S>
7904  void serialize(S &s, const unsigned /*version*/) {
7905  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7906  s & BOOST_SERIALIZATION_NVP(p_entries);
7907  }
7908 #endif
7909 #endif // SgAsmElfRelocEntryList_OTHERS
7910 
7911 #ifdef DOCUMENTATION
7912  };
7913 #endif
7914 
7916 
7917  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7918  IS_SERIALIZABLE(AsmElfRelocEntry);
7919 
7920 #ifdef DOCUMENTATION
7921 
7923  public:
7924 #endif
7925 
7926 #ifdef DOCUMENTATION
7927 
7932  rose_addr_t get_r_offset() const;
7933  void set_r_offset(rose_addr_t);
7935 #else
7936  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7937  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7938 #endif
7939 
7940 #ifdef DOCUMENTATION
7941 
7946  rose_addr_t get_r_addend() const;
7947  void set_r_addend(rose_addr_t);
7949 #else
7950  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7951  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7952 #endif
7953 
7954 #ifdef DOCUMENTATION
7955 
7960  unsigned long get_sym() const;
7961  void set_sym(unsigned long);
7963 #else
7964  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7965  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7966 #endif
7967 
7968 #ifdef DOCUMENTATION
7969 
7974  RelocType get_type() const;
7975  void set_type(RelocType);
7977 #else
7978  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7979  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7980 #endif
7981 
7982 #ifdef DOCUMENTATION
7983 
7986  const SgUnsignedCharList& get_extra() const;
7987  void set_extra(const SgUnsignedCharList&);
7989 #else
7990  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7991  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7992 #endif
7993 
7994  DECLARE_OTHERS(AsmElfRelocEntry);
7995 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7996 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7997  private:
7998  friend class boost::serialization::access;
7999 
8000  template<class S>
8001  void serialize(S &s, const unsigned /*version*/) {
8002  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8003  s & BOOST_SERIALIZATION_NVP(p_r_offset);
8004  s & BOOST_SERIALIZATION_NVP(p_r_addend);
8005  s & BOOST_SERIALIZATION_NVP(p_sym);
8006  s & BOOST_SERIALIZATION_NVP(p_type);
8007  s & BOOST_SERIALIZATION_NVP(p_extra);
8008  }
8009 #endif
8010 
8011  public:
8014  // Intel 80386 specific definitions.
8026  R_386_32PLT =11,
8033  R_386_16 =20,
8034  R_386_PC16 =21,
8035  R_386_8 =22,
8036  R_386_PC8 =23,
8052  // First Entry for X86-64
8067  R_X86_64_8 =114,
8077  };
8078 
8079 #ifdef _MSC_VER
8080 # pragma pack (1)
8081 #endif
8082 
8084  uint32_t r_offset;
8085  uint32_t r_info;
8086  uint32_t r_addend;
8087  }
8088 #if !defined(SWIG) && !defined(_MSC_VER)
8089  __attribute__((packed))
8090 #endif
8091  ;
8092 
8094  uint64_t r_offset;
8095  uint64_t r_info;
8096  uint64_t r_addend;
8097  }
8098 #if !defined(SWIG) && !defined(_MSC_VER)
8099  __attribute__((packed))
8100 #endif
8101  ;
8102 
8104  uint32_t r_offset;
8105  uint32_t r_info;
8106  }
8107 #if !defined(SWIG) && !defined(_MSC_VER)
8108  __attribute__((packed))
8109 #endif
8110  ;
8111 
8113  uint64_t r_offset;
8114  uint64_t r_info;
8115  }
8116 #if !defined(SWIG) && !defined(_MSC_VER)
8117  __attribute__((packed))
8118 #endif
8119  ;
8120 
8121 #ifdef _MSC_VER
8122 # pragma pack ()
8123 #endif
8124 
8127  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
8128  ctor(section);
8129  }
8130 
8134  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
8135  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
8136  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
8137  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
8143  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
8144  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
8145  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
8146  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
8152  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
8153  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
8154  dump(f, prefix, idx, NULL);
8155  }
8159  std::string reloc_name() const;
8160 
8161  private:
8162  void ctor(SgAsmElfRelocSection*);
8163 #endif // SgAsmElfRelocEntry_OTHERS
8164 
8165 #ifdef DOCUMENTATION
8166  };
8167 #endif
8168 
8169 
8170 
8172 
8173  /*************************************************************************************************************************
8174  * ELF Dynamic Linking
8175  *************************************************************************************************************************/
8176 
8178 
8179  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
8180  IS_SERIALIZABLE(AsmElfDynamicSection);
8181 
8182 #ifdef DOCUMENTATION
8183 
8185  public:
8186 #endif
8187 
8188 #ifdef DOCUMENTATION
8189 
8198 #else
8199  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
8200  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8201 #endif
8202 
8203  DECLARE_OTHERS(AsmElfDynamicSection);
8204 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
8205 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8206  private:
8207  friend class boost::serialization::access;
8208 
8209  template<class S>
8210  void serialize(S &s, const unsigned /*version*/) {
8211  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8212  s & BOOST_SERIALIZATION_NVP(p_entries);
8213  }
8214 #endif
8215 
8216  public:
8219  : SgAsmElfSection(fhdr) {
8220  ctor(strsec);
8221  }
8222 
8224  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
8225 
8227  virtual void finish_parsing() $ROSE_OVERRIDE;
8228 
8231  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
8232 
8234  virtual bool reallocate() $ROSE_OVERRIDE;
8235 
8237  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8238 
8240  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8241 
8242  private:
8243  void ctor(