ROSE  0.10.13.0
binaryInstruction.C
1 #include <featureTests.h>
2 #ifdef ROSE_BUILD_BINARY_ANALYSIS_SUPPORT
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 SgAsmA64Instruction: 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_A64
175  DECLARE_LEAF_CLASS(AsmA64Instruction);
176  IS_SERIALIZABLE(AsmA64Instruction);
177 
178  DECLARE_HEADERS(AsmA64Instruction);
179 #if defined(SgAsmA64Instruction_HEADERS) || defined(DOCUMENTATION)
180  #include <InstructionEnumsA64.h>
181 #endif // SgAsmA64Instruction_HEADERS
182 
183 #ifdef DOCUMENTATION
184 
185  class SgAsmA64Instruction: public SgAsmInstruction {
186  public:
187 #endif
188 
189 #ifdef DOCUMENTATION
190 
196  Rose::BinaryAnalysis::A64InstructionKind get_kind() const;
197  void set_kind(Rose::BinaryAnalysis::A64InstructionKind);
199 #else
200  AsmA64Instruction.setDataPrototype("Rose::BinaryAnalysis::A64InstructionKind", "kind",
201  "= Rose::BinaryAnalysis::A64InstructionKind::ARM64_INS_INVALID",
202  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
203 #endif
204 
205 #ifdef DOCUMENTATION
206 
209  Rose::BinaryAnalysis::A64InstructionCondition get_condition() const;
210  void set_condition(Rose::BinaryAnalysis::A64InstructionCondition);
212 #else
213  AsmA64Instruction.setDataPrototype("Rose::BinaryAnalysis::A64InstructionCondition", "condition",
214  "= Rose::BinaryAnalysis::A64InstructionCondition::ARM64_CC_INVALID",
215  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
216 #endif
217 
218 #ifdef DOCUMENTATION
219 
222  bool get_updatesFlags() const;
223  void set_updatesFlags(bool);
225 #else
226  AsmA64Instruction.setDataPrototype("bool", "updatesFlags", "= false",
227  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
228 #endif
229 
230  DECLARE_OTHERS(AsmA64Instruction);
231 #if defined(SgAsmA64Instruction_OTHERS) || defined(DOCUMENTATION)
232 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
233  private:
234  friend class boost::serialization::access;
235 
236  template<class S>
237  void serialize(S &s, const unsigned /*version*/) {
238  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
239  s & BOOST_SERIALIZATION_NVP(p_kind);
240  s & BOOST_SERIALIZATION_NVP(p_condition);
241  }
242 #endif
243 
244  public:
245  // Overrides are documented in the base class
246  virtual std::string description() const $ROSE_OVERRIDE;
247  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
248  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
249  virtual bool isUnknown() const $ROSE_OVERRIDE;
250  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
251 #endif // SgAsmA64Instruction_OTHERS
252 #ifdef DOCUMENTATION
253  };
254 #endif
255 #endif
256 
258 
259  DECLARE_LEAF_CLASS(AsmX86Instruction);
260  IS_SERIALIZABLE(AsmX86Instruction);
261  DECLARE_HEADERS(AsmX86Instruction);
262 #if defined(SgAsmX86Instruction_HEADERS) || defined(DOCUMENTATION)
263  #include <InstructionEnumsX86.h>
264  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
265 #endif // SgAsmX86Instruction_HEADERS
266 
267 #ifdef DOCUMENTATION
268 
270  public:
271 #endif
272 
273 #ifdef DOCUMENTATION
274 
283 #else
284  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionKind", "kind",
285  "= Rose::BinaryAnalysis::x86_unknown_instruction",
286  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
287 #endif
288 
289 #ifdef DOCUMENTATION
290 
296 #else
297  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "baseSize",
298  "= Rose::BinaryAnalysis::x86_insnsize_none",
299  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
300 #endif
301 
302 #ifdef DOCUMENTATION
303 
309 #else
310  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "operandSize",
311  "= Rose::BinaryAnalysis::x86_insnsize_none",
312  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
313 #endif
314 
315 #ifdef DOCUMENTATION
316 
322 #else
323  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "addressSize",
324  "= Rose::BinaryAnalysis::x86_insnsize_none",
325  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
326 #endif
327 
328 #ifdef DOCUMENTATION
329 
334  bool get_lockPrefix() const;
335  void set_lockPrefix(bool);
337 #else
338  AsmX86Instruction.setDataPrototype("bool", "lockPrefix", "= false",
339  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
340 #endif
341 
342 #ifdef DOCUMENTATION
343 
349 #else
350  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86RepeatPrefix", "repeatPrefix",
351  "= Rose::BinaryAnalysis::x86_repeat_none",
352  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
353 #endif
354 
355 #ifdef DOCUMENTATION
356 
362 #else
363  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86BranchPrediction", "branchPrediction",
364  "= Rose::BinaryAnalysis::x86_branch_prediction_none",
365  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
366 #endif
367 
368 #ifdef DOCUMENTATION
369 
378 #else
379  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86SegmentRegister", "segmentOverride",
380  "= Rose::BinaryAnalysis::x86_segreg_none",
381  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
382 #endif
383 
384 
385  DECLARE_OTHERS(AsmX86Instruction);
386 #if defined(SgAsmX86Instruction_OTHERS) || defined(DOCUMENTATION)
387 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
388  private:
389  friend class boost::serialization::access;
390 
391  template<class S>
392  void serialize(S &s, const unsigned /*version*/) {
393  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
394  s & BOOST_SERIALIZATION_NVP(p_kind);
395  s & BOOST_SERIALIZATION_NVP(p_baseSize);
396  s & BOOST_SERIALIZATION_NVP(p_operandSize);
397  s & BOOST_SERIALIZATION_NVP(p_addressSize);
398  s & BOOST_SERIALIZATION_NVP(p_lockPrefix);
399  s & BOOST_SERIALIZATION_NVP(p_repeatPrefix);
400  s & BOOST_SERIALIZATION_NVP(p_branchPrediction);
401  s & BOOST_SERIALIZATION_NVP(p_segmentOverride);
402  }
403 #endif
404 
405  public:
410 
415 
421 
427 
428  // Overrides are documented in the base class
429  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
430  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
431  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
432  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
433  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
434  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
435  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
436  virtual bool getBranchTarget(rose_addr_t *target/*out*/) $ROSE_OVERRIDE;
437  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
438  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
439  bool &complete,
440  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
441  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
442  virtual bool isUnknown() const $ROSE_OVERRIDE;
443  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
444 #endif // SgAsmX86Instruction_OTHERS
445 #ifdef DOCUMENTATION
446  };
447 #endif
448 
450 
451  DECLARE_LEAF_CLASS(AsmPowerpcInstruction);
452  IS_SERIALIZABLE(AsmPowerpcInstruction);
453  DECLARE_HEADERS(AsmPowerpcInstruction);
454 #if defined(SgAsmPowerpcInstruction_HEADERS) || defined(DOCUMENTATION)
455  #include <InstructionEnumsPowerpc.h>
456 #endif // SgAsmPowerpcInstruction_HEADERS
457 
458 #ifdef DOCUMENTATION
459 
461  public:
462 #endif
463 
464 
465 #ifdef DOCUMENTATION
466 
475 #else
476  AsmPowerpcInstruction.setDataPrototype("Rose::BinaryAnalysis::PowerpcInstructionKind", "kind",
477  "= Rose::BinaryAnalysis::powerpc_unknown_instruction",
478  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
479  COPY_DATA);
480 #endif
481 
482  DECLARE_OTHERS(AsmPowerpcInstruction);
483 #if defined(SgAsmPowerpcInstruction_OTHERS) || defined(DOCUMENTATION)
484 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
485  private:
486  friend class boost::serialization::access;
487 
488  template<class S>
489  void serialize(S &s, const unsigned /*version*/) {
490  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
491  s & BOOST_SERIALIZATION_NVP(p_kind);
492  }
493 #endif
494 
495  public:
501  std::string conditionalBranchDescription() const;
502 
508 
509  // Overrides are documented in the base class
510  virtual std::string description() const $ROSE_OVERRIDE;
511  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
512  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
513  virtual bool isUnknown() const $ROSE_OVERRIDE;
514  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
515  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
516  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
517  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
518  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
519  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
520  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
521 #endif // SgAsmPowerpcInstruction_OTHERS
522 #ifdef DOCUMENTATION
523  };
524 #endif
525 
526 
528 
529  DECLARE_LEAF_CLASS(AsmMipsInstruction);
530  IS_SERIALIZABLE(AsmMipsInstruction);
531  DECLARE_HEADERS(AsmMipsInstruction);
532 #if defined(SgAsmMipsInstruction_HEADERS) || defined(DOCUMENTATION)
533  #include <InstructionEnumsMips.h>
534 #endif // SgAsmMipsInstruction_HEADERS
535 
536 #ifdef DOCUMENTATION
537 
539  public:
540 #endif
541 
542 #ifdef DOCUMENTATION
543 
552 #else
553  AsmMipsInstruction.setDataPrototype("Rose::BinaryAnalysis::MipsInstructionKind", "kind",
554  "= Rose::BinaryAnalysis::mips_unknown_instruction",
555  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
556  COPY_DATA);
557 #endif
558 
559  DECLARE_OTHERS(AsmMipsInstruction);
560 #if defined(SgAsmMipsInstruction_OTHERS) || defined(DOCUMENTATION)
561 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
562  private:
563  friend class boost::serialization::access;
564 
565  template<class S>
566  void serialize(S &s, const unsigned /*version*/) {
567  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
568  s & BOOST_SERIALIZATION_NVP(p_kind);
569  }
570 #endif
571 
572  public:
573  // Overrides are documented in the base class
574  virtual std::string description() const $ROSE_OVERRIDE;
575  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
576  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
577  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
578  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
579  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
580  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
581  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
582  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
583  virtual bool isUnknown() const $ROSE_OVERRIDE;
584  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
585  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
586 #endif // SgAsmMipsInstruction_OTHERS
587 #ifdef DOCUMENTATION
588  };
589 #endif
590 
592 
593  DECLARE_LEAF_CLASS(AsmM68kInstruction);
594  IS_SERIALIZABLE(AsmM68kInstruction);
595  DECLARE_HEADERS(AsmM68kInstruction);
596 #if defined(SgAsmM68kInstruction_HEADERS) || defined(DOCUMENTATION)
597  #include "InstructionEnumsM68k.h"
598 #endif // SgAsmM68kInstruction_HEADERS
599 
600 #ifdef DOCUMENTATION
602  public:
603 #endif
604 
605 #ifdef DOCUMENTATION
606 
615 #else
616  AsmM68kInstruction.setDataPrototype("Rose::BinaryAnalysis::M68kInstructionKind", "kind",
617  " = Rose::BinaryAnalysis::m68k_unknown_instruction",
618  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
619  COPY_DATA);
620 #endif
621 
622  DECLARE_OTHERS(AsmM68kInstruction);
623 #if defined(SgAsmM68kInstruction_OTHERS) || defined(DOCUMENTATION)
624 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
625  private:
626  friend class boost::serialization::access;
627 
628  template<class S>
629  void serialize(S &s, const unsigned /*version*/) {
630  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
631  s & BOOST_SERIALIZATION_NVP(p_kind);
632  }
633 #endif
634 
635  public:
636  // Overrides are documented in the base class
637  virtual std::string description() const $ROSE_OVERRIDE;
638  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
639  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
640  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
641  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
642  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
643  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
644  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
645  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
646  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
647  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
648  bool &complete,
649  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
650  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
651  virtual bool isUnknown() const $ROSE_OVERRIDE;
652  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
653 #endif // SgAsmM68kInstruction_OTHERS
654 #ifdef DOCUMENTATION
655  };
656 #endif
657 
659 
660  NEW_NONTERMINAL_MACRO(AsmInstruction,
661  AsmX86Instruction
662 #ifdef ROSE_ENABLE_ASM_A64
663  | AsmA64Instruction
664 #endif
665  | AsmPowerpcInstruction | AsmMipsInstruction |
666  AsmM68kInstruction,
667  "AsmInstruction", "AsmInstructionTag", true);
668  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
669  IS_SERIALIZABLE(AsmInstruction);
670 
671  DECLARE_HEADERS(AsmInstruction);
672 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
673  #include <MemoryMap.h>
674 #endif // SgAsmInstruction_HEADERS
675 
676 #ifdef DOCUMENTATION
677 
699  public:
700 #endif
701 
702 #ifdef DOCUMENTATION
703 
711  const std::string& get_mnemonic() const;
712  void set_mnemonic(const std::string&);
714 #else
715  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
716  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
717 #endif
718 
719 #ifdef DOCUMENTATION
720 
725  const SgUnsignedList& get_raw_bytes() const;
726  void set_raw_bytes(const SgUnsignedList&);
728 #else
729  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
730  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
731 #endif
732 
733 #ifdef DOCUMENTATION
734 
743 #else
744  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
745  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
746 #endif
747 
748 #ifdef DOCUMENTATION
749  // Documentation is below because it uses different names than normal. Functions are not automatically generated because
750  // we need to synchronize access to the private p_cacheLockCount data member. However, we still use ROSETTA to generate
751  // the data member because we need to make sure it gets initialized to zero in the constructors. What a mess.
752 #else
753  AsmInstruction.setDataPrototype("size_t", "cacheLockCount", "= 0",
754  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
755 #endif
756 
757 #ifdef DOCUMENTATION
758  // FIXME[Robb P Matzke 2017-02-13]: unused?
759 #else
760  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
761  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
762 #endif
763 
764 #ifdef DOCUMENTATION
765 
771  int64_t get_stackDeltaIn() const;
772  void set_stackDeltaIn(int64_t);
774 #else
775  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
776  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
777 #endif
778 
779 #ifdef DOCUMENTATION
780  // FIXME[Robb P Matzke 2017-02-13]: unused?
781 #else
782  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
783  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
784 #endif
785 
786  DECLARE_OTHERS(AsmInstruction);
787 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
788 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
789  private:
790  friend class boost::serialization::access;
791 
792  template<class S>
793  void serialize(S &s, const unsigned version) {
794  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
795  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
796  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
797  s & BOOST_SERIALIZATION_NVP(p_operandList);
798  s & BOOST_SERIALIZATION_NVP(p_sources);
799  if (version >= 1)
800  s & BOOST_SERIALIZATION_NVP(semanticFailure_);
801  //s & BOOST_SERIALIZATION_NVP(p_cacheLockCount); -- definitely not!
802  }
803 #endif
804 
805  private:
806  struct SemanticFailure {
807  size_t n;
808  SemanticFailure(): n(0) {}
809 
810 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
811  private:
812  friend class boost::serialization::access;
813  template<class S>
814  void serialize(S &s, const unsigned /*version*/) {
815  s & BOOST_SERIALIZATION_NVP(n);
816  }
817 #endif
818  };
819  SemanticFailure semanticFailure_;
820 
821  // Synchronized data members. All the following data members (as listed in binaryInstruction.C, not the ROSETTA-generated
822  // code) should be procted by the mutex_. Additionally, the p_cacheLockCount data member is synchronized.
823  mutable SAWYER_THREAD_TRAITS::Mutex mutex_;
824 
825  public:
830  static const int64_t INVALID_STACK_DELTA;
831 
837  virtual std::string description() const { return ""; }
838 
839  // FIXME[Robb P Matzke 2017-02-13]: unused?
840  void appendSources( SgAsmInstruction* instruction );
841 
843  size_t nOperands() const;
844 
848  SgAsmExpression* operand(size_t) const;
849 
856  virtual bool terminatesBasicBlock();
857 
871  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
872  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
884  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
885  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
891  bool isFirstInBlock();
892 
896  bool isLastInBlock();
897 
902  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
903 
1038  virtual bool hasEffect();
1039 
1048  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
1049  bool relax_stack_semantics=false);
1050 
1060  virtual std::vector<std::pair<size_t,size_t> >
1061  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
1062  bool relax_stack_semantics=false);
1063 
1070  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete); /*subclasses must redefine*/
1071 
1080  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1081  bool &complete,
1082  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1084 
1090  virtual size_t get_size() const;
1091 
1097  virtual bool isUnknown() const;
1098 
1132  virtual unsigned get_anyKind() const;
1133 
1137  virtual std::string toString() const;
1138 
1143  virtual std::set<rose_addr_t> explicitConstants() const;
1144 
1154  size_t semanticFailure() const;
1155  void semanticFailure(size_t);
1156  void incrementSemanticFailure();
1166  size_t cacheLockCount() const;
1167  void adjustCacheLockCount(int increment);
1169 #endif // SgAsmInstruction_OTHERS
1170 
1171 #ifdef DOCUMENTATION
1172  };
1173 #endif
1174 
1175 
1176 
1178 
1179  /**************************************************************************************************************************
1180  * Instruction Expressions
1181  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1182  **************************************************************************************************************************/
1183 
1185 
1186  DECLARE_LEAF_CLASS(AsmOperandList);
1187  IS_SERIALIZABLE(AsmOperandList);
1188 
1189 #ifdef DOCUMENTATION
1190 
1191  class SgAsmOperandList: public SgAsmNode {
1192  public:
1193 #endif
1194 
1195 #ifdef DOCUMENTATION
1196 
1202  const SgAsmExpressionPtrList& get_operands() const;
1203  void set_oerands(const SgAsmExpressionPtrList&);
1205 #else
1206  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1207  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1208 #endif
1209 
1210  DECLARE_OTHERS(AsmOperandList);
1211 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1212 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1213  private:
1214  friend class boost::serialization::access;
1215 
1216  template<class S>
1217  void serialize(S &s, const unsigned /*version*/) {
1218  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1219  s & BOOST_SERIALIZATION_NVP(p_operands);
1220  }
1221 #endif
1222 
1223  public:
1225  void append_operand(SgAsmExpression* operand);
1226 #endif // SgAsmOperandList_OTHERS
1227 
1228 #ifdef DOCUMENTATION
1229  };
1230 #endif
1231 
1232  // FIXME[Robb P Matzke 2016-10-31]
1233  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1234 
1236 
1237  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1238  IS_SERIALIZABLE(AsmBinaryAdd);
1239 
1240 #ifdef DOCUMENTATION
1241 
1243  public:
1244 #endif
1245 
1246  DECLARE_OTHERS(AsmBinaryAdd);
1247 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1248 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1249  private:
1250  friend class boost::serialization::access;
1251 
1252  template<class S>
1253  void serialize(S &s, const unsigned /*version*/) {
1254  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1255  }
1256 #endif
1257 #endif // SgAsmBinaryAdd_OTHERS
1258 
1259 #ifdef DOCUMENTATION
1260  };
1261 #endif
1262 
1264 
1265  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1266  IS_SERIALIZABLE(AsmBinarySubtract);
1267 
1268 #ifdef DOCUMENTATION
1269 
1271  public:
1272 #endif
1273 
1274  DECLARE_OTHERS(AsmBinarySubtract);
1275 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1276 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1277  private:
1278  friend class boost::serialization::access;
1279 
1280  template<class S>
1281  void serialize(S &s, const unsigned /*version*/) {
1282  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1283  }
1284 #endif
1285 #endif // SgAsmBinarySubtract_OTHERS
1286 
1287 #ifdef DOCUMENTATION
1288  };
1289 #endif
1290 
1292 
1293  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1294  IS_SERIALIZABLE(AsmBinaryMultiply);
1295 
1296 #ifdef DOCUMENTATION
1297 
1299  public:
1300 #endif
1301 
1302  DECLARE_OTHERS(AsmBinaryMultiply);
1303 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1304 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1305  private:
1306  friend class boost::serialization::access;
1307 
1308  template<class S>
1309  void serialize(S &s, const unsigned /*version*/) {
1310  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1311  }
1312 #endif
1313 #endif // SgAsmBinaryMultiply_OTHERS
1314 
1315 #ifdef DOCUMENTATION
1316  };
1317 #endif
1318 
1320 
1321  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1322  IS_SERIALIZABLE(AsmBinaryDivide);
1323 
1324 #ifdef DOCUMENTATION
1325 
1327  public:
1328 #endif
1329 
1330  DECLARE_OTHERS(AsmBinaryDivide);
1331 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1332 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1333  private:
1334  friend class boost::serialization::access;
1335 
1336  template<class S>
1337  void serialize(S &s, const unsigned /*version*/) {
1338  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1339  }
1340 #endif
1341 #endif // SgAsmBinaryDivide_OTHERS
1342 
1343 #ifdef DOCUMENTATION
1344  };
1345 #endif
1346 
1348 
1349  DECLARE_LEAF_CLASS(AsmBinaryMod);
1350  IS_SERIALIZABLE(AsmBinaryMod);
1351 
1352 #ifdef DOCUMENTATION
1353 
1355  public:
1356 #endif
1357 
1358  DECLARE_OTHERS(AsmBinaryMod);
1359 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1360 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1361  private:
1362  friend class boost::serialization::access;
1363 
1364  template<class S>
1365  void serialize(S &s, const unsigned /*version*/) {
1366  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1367  }
1368 #endif
1369 #endif // SgAsmBinaryMod_OTHERS
1370 
1371 #ifdef DOCUMENTATION
1372  };
1373 #endif
1374 
1376 
1377  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1378  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1379 
1380 #ifdef DOCUMENTATION
1381 
1383  public:
1384 #endif
1385 
1386  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1387 #if defined(SgAsmBinaryAddPreupdate_OTHERS) || defined(DOCUMENTATION)
1388 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1389  private:
1390  friend class boost::serialization::access;
1391 
1392  template<class S>
1393  void serialize(S &s, const unsigned /*version*/) {
1394  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1395  }
1396 #endif
1397 #endif // SgAsmBinaryAddPreupdate_OTHERS
1398 
1399 #ifdef DOCUMENTATION
1400  };
1401 #endif
1402 
1404 
1405  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1406  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1407 
1408 #ifdef DOCUMENTATION
1409 
1411  public:
1412 #endif
1413 
1414  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1415 #if defined(SgAsmBinarySubtractPreupdate_OTHERS) || defined(DOCUMENTATION)
1416 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1417  private:
1418  friend class boost::serialization::access;
1419 
1420  template<class S>
1421  void serialize(S &s, const unsigned /*version*/) {
1422  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1423  }
1424 #endif
1425 #endif // SgAsmBinarySubtractPreupdate_OTHERS
1426 
1427 #ifdef DOCUMENTATION
1428  };
1429 #endif
1430 
1432 
1433  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1434  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1435 
1436 #ifdef DOCUMENTATION
1437 
1439  public:
1440 #endif
1441 
1442  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1443 #if defined(SgAsmBinaryAddPostupdate_OTHERS) || defined(DOCUMENTATION)
1444 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1445  private:
1446  friend class boost::serialization::access;
1447 
1448  template<class S>
1449  void serialize(S &s, const unsigned /*version*/) {
1450  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1451  }
1452 #endif
1453 #endif // SgAsmBinaryAddPostupdate_OTHERS
1454 
1455 #ifdef DOCUMENTATION
1456  };
1457 #endif
1458 
1460 
1461  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1462  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1463 
1464 #ifdef DOCUMENTATION
1465 
1467  public:
1468 #endif
1469 
1470  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1471 #if defined(SgAsmBinarySubtractPostupdate_OTHERS) || defined(DOCUMENTATION)
1472 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1473  private:
1474  friend class boost::serialization::access;
1475 
1476  template<class S>
1477  void serialize(S &s, const unsigned /*version*/) {
1478  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1479  }
1480 #endif
1481 #endif // SgAsmBinarySubtractPostupdate_OTHERS
1482 
1483 #ifdef DOCUMENTATION
1484  };
1485 #endif
1486 
1488 
1489  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1490  IS_SERIALIZABLE(AsmBinaryLsl);
1491 
1492 #ifdef DOCUMENTATION
1493 
1495  public:
1496 #endif
1497 
1498  DECLARE_OTHERS(AsmBinaryLsl);
1499 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1500 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1501  private:
1502  friend class boost::serialization::access;
1503 
1504  template<class S>
1505  void serialize(S &s, const unsigned /*version*/) {
1506  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1507  }
1508 #endif
1509 #endif // SgAsmBinaryLsl_OTHERS
1510 
1511 #ifdef DOCUMENTATION
1512  };
1513 #endif
1514 
1516 
1517  DECLARE_LEAF_CLASS(AsmBinaryMsl);
1518  IS_SERIALIZABLE(AsmBinaryMsl);
1519 
1520 #ifdef DOCUMENTATION
1521 
1525  public:
1526 #endif
1527 
1528  DECLARE_OTHERS(AsmBinaryMsl);
1529 #if defined(SgAsmBinaryMsl_OTHERS) || defined(DOCUMENTATION)
1530 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1531  private:
1532  friend class boost::serialization::access;
1533 
1534  template<class S>
1535  void serialize(S &s, const unsigned /*version*/) {
1536  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1537  }
1538 #endif
1539 #endif // SgAsmBinaryMsl_OTHERS
1540 
1541 #ifdef DOCUMENTATION
1542  };
1543 #endif
1544 
1546 
1547  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1548  IS_SERIALIZABLE(AsmBinaryLsr);
1549 
1550 #ifdef DOCUMENTATION
1551 
1553  public:
1554 #endif
1555 
1556  DECLARE_OTHERS(AsmBinaryLsr);
1557 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1558 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1559  private:
1560  friend class boost::serialization::access;
1561 
1562  template<class S>
1563  void serialize(S &s, const unsigned /*version*/) {
1564  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1565  }
1566 #endif
1567 #endif // SgAsmBinaryLsr_OTHERS
1568 
1569 #ifdef DOCUMENTATION
1570  };
1571 #endif
1572 
1574 
1575  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1576  IS_SERIALIZABLE(AsmBinaryAsr);
1577 
1578 #ifdef DOCUMENTATION
1579 
1581  public:
1582 #endif
1583 
1584  DECLARE_OTHERS(AsmBinaryAsr);
1585 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1586 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1587  private:
1588  friend class boost::serialization::access;
1589 
1590  template<class S>
1591  void serialize(S &s, const unsigned /*version*/) {
1592  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1593  }
1594 #endif
1595 #endif // SgAsmBinaryAsr_OTHERS
1596 
1597 #ifdef DOCUMENTATION
1598  };
1599 #endif
1600 
1602 
1603  DECLARE_LEAF_CLASS(AsmBinaryRor);
1604  IS_SERIALIZABLE(AsmBinaryRor);
1605 
1606 #ifdef DOCUMENTATION
1607 
1609  public:
1610 #endif
1611 
1612  DECLARE_OTHERS(AsmBinaryRor);
1613 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1614 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1615  private:
1616  friend class boost::serialization::access;
1617 
1618  template<class S>
1619  void serialize(S &s, const unsigned /*version*/) {
1620  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1621  }
1622 #endif
1623 #endif // SgAsmBinaryRor_OTHERS
1624 
1625 #ifdef DOCUMENTATION
1626  };
1627 #endif
1628 
1630 
1631  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1632  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1633  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1634  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1635  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1636  AsmBinaryRor | AsmBinaryMsl,
1637  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1638  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1639  IS_SERIALIZABLE(AsmBinaryExpression);
1640 
1641 #ifdef DOCUMENTATION
1642 
1644  public:
1645 #endif
1646 
1647 #ifdef DOCUMENTATION
1648 
1651  SgAsmExpression* get_lhs() const;
1652  void set_lhs(SgAsmExpression*);
1654 #else
1655  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1656  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1657 #endif
1658 
1659 #ifdef DOCUMENTATION
1660 
1663  SgAsmExpression* get_rhs() const;
1664  void set_rhs(SgAsmExpression*);
1666 #else
1667  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1668  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1669 #endif
1670 
1671  DECLARE_OTHERS(AsmBinaryExpression);
1672 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1673 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1674  private:
1675  friend class boost::serialization::access;
1676 
1677  template<class S>
1678  void serialize(S &s, const unsigned /*version*/) {
1679  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1680  s & BOOST_SERIALIZATION_NVP(p_lhs);
1681  s & BOOST_SERIALIZATION_NVP(p_rhs);
1682  }
1683 #endif
1684 #endif // SgAsmBinaryExpression_OTHERS
1685 
1686 #ifdef DOCUMENTATION
1687  };
1688 #endif
1689 
1691 
1692  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1693  IS_SERIALIZABLE(AsmUnaryPlus);
1694 
1695 #ifdef DOCUMENTATION
1696 
1698  public:
1699 #endif
1700 
1701  DECLARE_OTHERS(AsmUnaryPlus);
1702 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1703 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1704  private:
1705  friend class boost::serialization::access;
1706 
1707  template<class S>
1708  void serialize(S &s, const unsigned /*version*/) {
1709  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1710  }
1711 #endif
1712 #endif // SgAsmUnaryPlus_OTHERS
1713 
1714 #ifdef DOCUMENTATION
1715  };
1716 #endif
1717 
1719 
1720  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1721  IS_SERIALIZABLE(AsmUnaryMinus);
1722 
1723 #ifdef DOCUMENTATION
1724 
1726  public:
1727 #endif
1728 
1729  DECLARE_OTHERS(AsmUnaryMinus);
1730 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1731 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1732  private:
1733  friend class boost::serialization::access;
1734 
1735  template<class S>
1736  void serialize(S &s, const unsigned /*version*/) {
1737  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1738  }
1739 #endif
1740 #endif // SgAsmUnaryMinus_OTHERS
1741 
1742 #ifdef DOCUMENTATION
1743  };
1744 #endif
1745 
1747 
1748  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1749  IS_SERIALIZABLE(AsmUnaryRrx);
1750 
1751 #ifdef DOCUMENTATION
1752  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1754  public:
1755 #endif
1756 
1757  DECLARE_OTHERS(AsmUnaryRrx);
1758 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1759 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1760  private:
1761  friend class boost::serialization::access;
1762 
1763  template<class S>
1764  void serialize(S &s, const unsigned /*version*/) {
1765  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1766  }
1767 #endif
1768 #endif // SgAsmUnaryRrx_OTHERS
1769 
1770 #ifdef DOCUMENTATION
1771  };
1772 #endif
1773 
1775 
1776  DECLARE_LEAF_CLASS(AsmUnaryTruncate);
1777  IS_SERIALIZABLE(AsmUnaryTruncate);
1778 
1779 #ifdef DOCUMENTATION
1780 
1786  public:
1787 #endif
1788 
1789  DECLARE_OTHERS(AsmUnaryTruncate);
1790 #if defined(SgAsmUnaryTruncate_OTHERS) || defined(DOCUMENTATION)
1791 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1792  private:
1793  friend class boost::serialization::access;
1794 
1795  template<class S>
1796  void serialize(S &s, const unsigned /*version*/) {
1797  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1798  }
1799 #endif
1800 #endif // SgAsmUnaryTruncate_OTHERS
1801 
1802 #ifdef DOCUMENTATION
1803  };
1804 #endif
1805 
1807 
1808  DECLARE_LEAF_CLASS(AsmUnarySignedExtend);
1809  IS_SERIALIZABLE(AsmUnarySignedExtend);
1810 
1811 #ifdef DOCUMENTATION
1812 
1818  public:
1819 #endif
1820 
1821  DECLARE_OTHERS(AsmUnarySignedExtend);
1822 #if defined(SgAsmUnarySignedExtend_OTHERS) || defined(DOCUMENTATION)
1823 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1824  private:
1825  friend class boost::serialization::access;
1826 
1827  template<class S>
1828  void serialize(S &s, const unsigned /*version*/) {
1829  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1830  }
1831 #endif
1832 #endif // SgAsmUnarySignedExtend_OTHERS
1833 
1834 #ifdef DOCUMENTATION
1835  };
1836 #endif
1837 
1839 
1840  DECLARE_LEAF_CLASS(AsmUnaryUnsignedExtend);
1841  IS_SERIALIZABLE(AsmUnaryUnsignedExtend);
1842 
1843 #ifdef DOCUMENTATION
1844 
1850  public:
1851 #endif
1852 
1853  DECLARE_OTHERS(AsmUnaryUnsignedExtend);
1854 #if defined(SgAsmUnaryUnsignedExtend_OTHERS) || defined(DOCUMENTATION)
1855 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1856  private:
1857  friend class boost::serialization::access;
1858 
1859  template<class S>
1860  void serialize(S &s, const unsigned /*version*/) {
1861  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1862  }
1863 #endif
1864 #endif // SgAsmUnaryUnsignedExtend_OTHERS
1865 
1866 #ifdef DOCUMENTATION
1867  };
1868 #endif
1869 
1871 
1872 #ifdef ROSE_ENABLE_ASM_A64
1873  DECLARE_LEAF_CLASS(AsmA64AtOperand);
1874  IS_SERIALIZABLE(AsmA64AtOperand);
1875 
1876 #ifdef DOCUMENTATION
1877 
1878  class SgAsmA64AtOperand: public SgAsmUnaryExpression {
1879  public:
1880 #endif
1881 
1882  DECLARE_OTHERS(AsmA64AtOperand);
1883 #if defined(SgAsmA64AtOperand_OTHERS) || defined(DOCUMENTATION)
1884 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1885  private:
1886  friend class boost::serialization::access;
1887 
1888  template<class S>
1889  void serialize(S &s, const unsigned /*version*/) {
1890  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1891  s & BOOST_SERIALIZATION_NVP(operation_);
1892  }
1893 #endif
1894 
1895  private:
1896  Rose::BinaryAnalysis::A64AtOperation operation_;
1897 
1898  public:
1900  explicit SgAsmA64AtOperand(Rose::BinaryAnalysis::A64AtOperation op)
1901  : operation_(op) {}
1902 
1908  Rose::BinaryAnalysis::A64AtOperation operation() const {
1909  return operation_;
1910  }
1911  void operation(Rose::BinaryAnalysis::A64AtOperation op) {
1912  operation_ = op;
1913  }
1915 #endif // SgAsmA64AtOperand_OTHERS
1916 
1917 #ifdef DOCUMENTATION
1918  };
1919 #endif
1920 #endif
1921 
1923 
1924 #ifdef ROSE_ENABLE_ASM_A64
1925  DECLARE_LEAF_CLASS(AsmA64PrefetchOperand);
1926  IS_SERIALIZABLE(AsmA64PrefetchOperand);
1927 
1928 #ifdef DOCUMENTATION
1929 
1930  class SgAsmA64PrefetchOperand: public SgAsmUnaryExpression {
1931  public:
1932 #endif
1933 
1934  DECLARE_OTHERS(AsmA64PrefetchOperand);
1935 #if defined(SgAsmA64PrefetchOperand_OTHERS) || defined(DOCUMENTATION)
1936 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1937  private:
1938  friend class boost::serialization::access;
1939 
1940  template<class S>
1941  void serialize(S &s, const unsigned /*version*/) {
1942  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1943  s & BOOST_SERIALIZATION_NVP(operation_);
1944  }
1945 #endif
1946 
1947  private:
1948  Rose::BinaryAnalysis::A64PrefetchOperation operation_;
1949 
1950  public:
1952  explicit SgAsmA64PrefetchOperand(Rose::BinaryAnalysis::A64PrefetchOperation op)
1953  : operation_(op) {}
1954 
1960  Rose::BinaryAnalysis::A64PrefetchOperation operation() const {
1961  return operation_;
1962  }
1963  void operation(Rose::BinaryAnalysis::A64PrefetchOperation op) {
1964  operation_ = op;
1965  }
1967 #endif // SgAsmA64PrefetchOperand_OTHERS
1968 
1969 #ifdef DOCUMENTATION
1970  };
1971 #endif
1972 #endif
1973 
1975 
1976 #ifdef ROSE_ENABLE_ASM_A64
1977  DECLARE_LEAF_CLASS(AsmA64SysMoveOperand);
1978  IS_SERIALIZABLE(AsmA64SysMoveOperand);
1979 
1980 #ifdef DOCUMENTATION
1981 
1982  class SgAsmA64SysMoveOperand: public SgAsmUnaryExpression {
1983  public:
1984 #endif
1985 
1986  DECLARE_OTHERS(AsmA64SysMoveOperand);
1987 #if defined(SgAsmA64SysMoveOperand_OTHERS) || defined(DOCUMENTATION)
1988 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1989  private:
1990  friend class boost::serialization::access;
1991 
1992  template<class S>
1993  void serialize(S &s, const unsigned /*version*/) {
1994  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1995  s & BOOST_SERIALIZATION_NVP(access_);
1996  }
1997 #endif
1998 
1999  private:
2000  unsigned access_;
2001 
2002  public:
2004  explicit SgAsmA64SysMoveOperand(unsigned access)
2005  : access_(access) {}
2006 
2012  unsigned access() const {
2013  return access_;
2014  }
2015  void access(unsigned ac) {
2016  access_ = ac;
2017  }
2019 #endif // SgAsmA64SysMoveOperand_OTHERS
2020 
2021 #ifdef DOCUMENTATION
2022  };
2023 #endif
2024 #endif
2025 
2027 
2028 #ifdef ROSE_ENABLE_ASM_A64
2029  DECLARE_LEAF_CLASS(AsmA64CImmediateOperand);
2030  IS_SERIALIZABLE(AsmA64CImmediateOperand);
2031 
2032 #ifdef DOCUMENTATION
2033 
2034  class SgAsmA64CImmediateOperand: public SgAsmUnaryExpression {
2035  public:
2036 #endif
2037 
2038  DECLARE_OTHERS(AsmA64CImmediateOperand);
2039 #if defined(SgAsmA64CImmediateOperand_OTHERS) || defined(DOCUMENTATION)
2040 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2041  private:
2042  friend class boost::serialization::access;
2043 
2044  template<class S>
2045  void serialize(S &s, const unsigned /*version*/) {
2046  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2047  s & BOOST_SERIALIZATION_NVP(imm_);
2048  }
2049 #endif
2050 
2051  private:
2052  unsigned imm_;
2053 
2054  public:
2056  explicit SgAsmA64CImmediateOperand(unsigned imm)
2057  : imm_(imm) {}
2058 
2064  unsigned immediate() const {
2065  return imm_;
2066  }
2067  void immediate(unsigned imm) {
2068  imm_ = imm;
2069  }
2071 #endif // SgAsmA64CImmediateOperand_OTHERS
2072 
2073 #ifdef DOCUMENTATION
2074  };
2075 #endif
2076 #endif
2077 
2079 
2080 #ifdef ROSE_ENABLE_ASM_A64
2081  DECLARE_LEAF_CLASS(AsmA64BarrierOperand);
2082  IS_SERIALIZABLE(AsmA64BarrierOperand);
2083 
2084 #ifdef DOCUMENTATION
2085 
2086  class SgAsmA64BarrierOperand: public SgAsmUnaryExpression {
2087  public:
2088 #endif
2089 
2090  DECLARE_OTHERS(AsmA64BarrierOperand);
2091 #if defined(SgAsmA64BarrierOperand_OTHERS) || defined(DOCUMENTATION)
2092 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2093  private:
2094  friend class boost::serialization::access;
2095 
2096  template<class S>
2097  void serialize(S &s, const unsigned /*version*/) {
2098  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2099  s & BOOST_SERIALIZATION_NVP(operation_);
2100  }
2101 #endif
2102 
2103  private:
2104  Rose::BinaryAnalysis::A64BarrierOperation operation_;
2105 
2106  public:
2108  explicit SgAsmA64BarrierOperand(Rose::BinaryAnalysis::A64BarrierOperation operation)
2109  : operation_(operation) {}
2110 
2114  Rose::BinaryAnalysis::A64BarrierOperation operation() const {
2115  return operation_;
2116  }
2117  void operation(Rose::BinaryAnalysis::A64BarrierOperation op) {
2118  operation_ = op;
2119  }
2121 #endif // SgAsmA64BarrierOperand_OTHERS
2122 
2123 #ifdef DOCUMENTATION
2124  };
2125 #endif
2126 #endif
2127 
2129 
2130  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
2131  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryTruncate | AsmUnarySignedExtend
2132  | AsmUnaryUnsignedExtend
2133 #ifdef ROSE_ENABLE_ASM_A64
2134  | AsmA64AtOperand | AsmA64PrefetchOperand | AsmA64SysMoveOperand | AsmA64CImmediateOperand
2135  | AsmA64BarrierOperand
2136 #endif
2137  , "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
2138  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
2139  IS_SERIALIZABLE(AsmUnaryExpression);
2140 
2141 #ifdef DOCUMENTATION
2142 
2144  public:
2145 #endif
2146 
2147 #ifdef DOCUMENTATION
2148 
2151  SgAsmExpression* get_operand() const;
2154 #else
2155  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
2156  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2157 #endif
2158 
2159  DECLARE_OTHERS(AsmUnaryExpression);
2160 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
2161 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2162  private:
2163  friend class boost::serialization::access;
2164 
2165  template<class S>
2166  void serialize(S &s, const unsigned /*version*/) {
2167  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2168  s & BOOST_SERIALIZATION_NVP(p_operand);
2169  }
2170 #endif
2171 #endif // SgAsmUnaryExpression_OTHERS
2172 
2173 #ifdef DOCUMENTATION
2174  };
2175 #endif
2176 
2178 
2179  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
2180  IS_SERIALIZABLE(AsmDirectRegisterExpression);
2181 
2182 #ifdef DOCUMENTATION
2183 
2185  public:
2186 #endif
2187 
2188  DECLARE_OTHERS(AsmDirectRegisterExpression);
2189 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
2190 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2191  private:
2192  friend class boost::serialization::access;
2193 
2194  template<class S>
2195  void serialize(S &s, const unsigned /*version*/) {
2196  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
2197  }
2198 #endif
2199 
2200  private:
2201  // Default c'tor needed for serialization
2203 #endif // SgAsmDirectRegisterExpression_OTHERS
2204 
2205 #ifdef DOCUMENTATION
2206  };
2207 #endif
2208 
2210 
2211  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
2212  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
2213 
2214 #ifdef DOCUMENTATION
2215 
2232  public:
2233 #endif
2234 
2235 #ifdef DOCUMENTATION
2236 
2244 #else
2245  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "stride", "",
2246  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2247 #endif
2248 
2249 #ifdef DOCUMENTATION
2250 
2258 #else
2259  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "offset", "",
2260  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2261 #endif
2262 
2263 #ifdef DOCUMENTATION
2264 
2269  size_t get_index() const;
2270  void set_index(size_t);
2272 #else
2273  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
2274  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2275 #endif
2276 
2277 #ifdef DOCUMENTATION
2278 
2283  size_t get_modulus() const;
2284  void set_modulus(size_t);
2286 #else
2287  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
2288  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2289 #endif
2290 
2291  DECLARE_OTHERS(AsmIndirectRegisterExpression);
2292 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
2293 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2294  private:
2295  friend class boost::serialization::access;
2296 
2297  template<class S>
2298  void serialize(S &s, const unsigned /*version*/) {
2299  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
2300  s & BOOST_SERIALIZATION_NVP(p_stride);
2301  s & BOOST_SERIALIZATION_NVP(p_offset);
2302  s & BOOST_SERIALIZATION_NVP(p_index);
2303  s & BOOST_SERIALIZATION_NVP(p_modulus);
2304  }
2305 #endif
2306 
2307  private:
2308  // Default c'tor needed for serialization
2310  : p_index(0), p_modulus(0) {}
2311 #endif // SgAsmIndirectRegisterExpression_OTHERS
2312 
2313 #ifdef DOCUMENTATION
2314  };
2315 #endif
2316 
2318 
2319  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
2320  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
2321  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
2322  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
2323 
2324 #ifdef DOCUMENTATION
2325 
2327  public:
2328 #endif
2329 
2330 #ifdef DOCUMENTATION
2331 
2337 #else
2338  AsmRegisterReferenceExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "descriptor", "",
2339  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2340 #endif
2341 
2342 #ifdef DOCUMENTATION
2343 
2348  int get_adjustment() const;
2349  void set_adjustment(int);
2351 #else
2352  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
2353  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
2354  NO_DELETE);
2355 #endif
2356 
2357  DECLARE_OTHERS(AsmRegisterReferenceExpression);
2358 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2359 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2360  private:
2361  friend class boost::serialization::access;
2362 
2363  template<class S>
2364  void serialize(S &s, const unsigned /*version*/) {
2365  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2366  s & BOOST_SERIALIZATION_NVP(p_descriptor);
2367  s & BOOST_SERIALIZATION_NVP(p_adjustment);
2368  }
2369 #endif
2370 
2371  protected:
2372  // Default c'tor needed for serialization
2374  : p_adjustment(0) {}
2375 #endif // SgAsmRegisterReferenceExpression_OTHERS
2376 
2377 #ifdef DOCUMENTATION
2378  };
2379 #endif
2380 
2382 
2383  DECLARE_LEAF_CLASS(AsmRegisterNames);
2384  IS_SERIALIZABLE(AsmRegisterNames);
2385 
2386 #ifdef DOCUMENTATION
2387 
2389  public:
2390 #endif
2391 
2392 #ifdef DOCUMENTATION
2393 
2399  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
2400  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
2402 #else
2403  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
2404  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2405 #endif
2406 
2407 #ifdef DOCUMENTATION
2408 
2414  unsigned get_mask() const;
2415  void set_mask(unsigned);
2417 #else
2418  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
2419  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2420 #endif
2421 
2422  DECLARE_OTHERS(AsmRegisterNames);
2423 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
2424 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2425  private:
2426  friend class boost::serialization::access;
2427 
2428  template<class S>
2429  void serialize(S &s, const unsigned /*version*/) {
2430  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2431  s & BOOST_SERIALIZATION_NVP(p_registers);
2432  s & BOOST_SERIALIZATION_NVP(p_mask);
2433  }
2434 #endif
2435 #endif // SgAsmRegisterNames_OTHERS
2436 
2437 #ifdef DOCUMENTATION
2438  };
2439 #endif
2440 
2442 
2443  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2444  IS_SERIALIZABLE(AsmIntegerValueExpression);
2445 
2446 #ifdef DOCUMENTATION
2447 
2463  public:
2464 #endif
2465 
2466 #ifdef DOCUMENTATION
2467 
2477  SgNode* get_baseNode() const;
2478  void set_baseNode(SgNode*);
2480 #else
2481  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2482  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2483 #endif
2484 
2485  DECLARE_OTHERS(AsmIntegerValueExpression);
2486 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2487 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2488  private:
2489  friend class boost::serialization::access;
2490 
2491  template<class S>
2492  void serialize(S &s, const unsigned /*version*/) {
2493  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2494  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2495  }
2496 #endif
2497 
2498  public:
2503  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2504 
2511 
2513  static uint64_t virtualAddress(SgNode*);
2514 
2534  std::string get_label(bool quiet=false) const;
2535 
2537  size_t get_significantBits() const;
2538 
2544  void makeRelativeTo(SgNode *baseNode);
2545 
2550  uint64_t get_baseAddress() const;
2551 
2557  uint64_t get_absoluteValue(size_t nbits=0) const;
2558 
2562  void set_absoluteValue(uint64_t);
2563 
2565  int64_t get_signedValue() const;
2566 
2570  int64_t get_relativeValue() const;
2571 
2576  void set_relativeValue(int64_t v, size_t nbits=64);
2577 
2578  uint64_t get_value() const { return get_absoluteValue(); }
2579 
2580 #endif // SgAsmIntegerValueExpression_OTHERS
2581 
2582 #ifdef DOCUMENTATION
2583  };
2584 #endif
2585 
2587 
2588  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2589  IS_SERIALIZABLE(AsmFloatValueExpression);
2590 
2591 #ifdef DOCUMENTATION
2592 
2597  public:
2598 #endif
2599 
2600  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2601 
2602  DECLARE_OTHERS(AsmFloatValueExpression);
2603 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2604  private:
2605  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2606  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2607  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2608  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2609  // understand "mutable".
2610  mutable double p_nativeValue;
2611  mutable bool p_nativeValueIsValid;
2612 
2613 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2614  private:
2615  friend class boost::serialization::access;
2616 
2617  template<class S>
2618  void serialize(S &s, const unsigned /*version*/) {
2619  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2620  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2621  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2622  }
2623 #endif
2624 
2625  public:
2630  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2631 
2637  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2638 
2645 
2647  void set_nativeValue(double);
2648 
2650  double get_nativeValue() const;
2651 
2656  void updateBitVector();
2657 
2662  void updateNativeValue() const;
2663 #endif // SgAsmFloatValueExpression_OTHERS
2664 
2665 #ifdef DOCUMENTATION
2666  };
2667 #endif
2668 
2670 
2671  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2672  AsmIntegerValueExpression | AsmFloatValueExpression,
2673  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2674  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2675  IS_SERIALIZABLE(AsmConstantExpression);
2676 
2677  DECLARE_HEADERS(AsmConstantExpression);
2678 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2679  #include <Sawyer/BitVector.h>
2680 #endif // SgAsmConstantExpression_HEADERS
2681 
2682 #ifdef DOCUMENTATION
2683 
2688  public:
2689 #endif
2690 
2691 #ifndef DOCUMENTATION
2692  // Documented below. Implemented below due to ROSETTA limitations.
2693  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2694  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2695 #endif
2696 
2697  DECLARE_OTHERS(AsmConstantExpression);
2698 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2699 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2700  private:
2701  friend class boost::serialization::access;
2702 
2703  template<class S>
2704  void serialize(S &s, const unsigned /*version*/) {
2705  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2706  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2707  }
2708 #endif
2709 
2710  public:
2716  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2717  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2718  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2720 #endif // SgAsmConstantExpression_OTHERS
2721 
2722 #ifdef DOCUMENTATION
2723  };
2724 #endif
2725 
2727 
2728  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2729  AsmConstantExpression,
2730  "AsmValueExpression", "AsmValueExpressionTag", false);
2731  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2732  IS_SERIALIZABLE(AsmValueExpression);
2733 
2734 #ifdef DOCUMENTATION
2735 
2743  public:
2744 #endif
2745 
2746 #ifdef DOCUMENTATION
2747 
2757 #else
2758  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
2759  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2760 #endif
2761 
2762 #ifdef DOCUMENTATION
2763 
2771  unsigned short get_bit_offset() const;
2772  void set_bit_offset(unsigned short);
2774 #else
2775  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
2776  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2777 #endif
2778 
2779 #ifdef DOCUMENTATION
2780 
2786  unsigned short get_bit_size() const;
2787  void set_bit_size(unsigned short);
2789 #else
2790  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
2791  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2792 #endif
2793 
2794 #ifdef DOCUMENTATION
2795 
2801  SgSymbol* get_symbol() const;
2802  void set_symbol(SgSymbol*);
2804 #else
2805  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
2806  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2807 #endif
2808 
2809  DECLARE_OTHERS(AsmValueExpression);
2810 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
2811 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2812  private:
2813  friend class boost::serialization::access;
2814 
2815  template<class S>
2816  void serialize(S &s, const unsigned /*version*/) {
2817  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2818  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
2819  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
2820  s & BOOST_SERIALIZATION_NVP(p_bit_size);
2821 #if 1
2822  ASSERT_require2(p_symbol == NULL, "not implemented yet");
2823 #else
2824  s & BOOST_SERIALIZATION_NVP(p_symbol);
2825 #endif
2826  }
2827 #endif
2828 #endif // SgAsmValueExpression_OTHERS
2829 
2830 #ifdef DOCUMENTATION
2831  };
2832 #endif
2833 
2835 
2836  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
2837  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
2838 
2839 #ifdef DOCUMENTATION
2840 
2842  public:
2843 #endif
2844 
2845 #ifdef DOCUMENTATION
2846 
2853  SgAsmExpression* get_address() const;
2856 #else
2857  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
2858  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2859 #endif
2860 
2861 #ifdef DOCUMENTATION
2862 
2869  SgAsmExpression* get_segment() const;
2872 #else
2873  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
2874  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2875 #endif
2876 
2877  DECLARE_OTHERS(AsmMemoryReferenceExpression);
2878 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2879 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2880  private:
2881  friend class boost::serialization::access;
2882 
2883  template<class S>
2884  void serialize(S &s, const unsigned /*version*/) {
2885  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2886  s & BOOST_SERIALIZATION_NVP(p_address);
2887  s & BOOST_SERIALIZATION_NVP(p_segment);
2888  }
2889 #endif
2890 #endif // SgAsmMemoryReferenceExpression_OTHERS
2891 
2892 #ifdef DOCUMENTATION
2893  };
2894 #endif
2895 
2897 
2898  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
2899  IS_SERIALIZABLE(AsmControlFlagsExpression);
2900 
2901 #ifdef DOCUMENTATION
2902  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2904  public:
2905 #endif
2906 
2907 #ifndef DOCUMENTATION
2908  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
2909  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2910 #endif
2911 
2912  DECLARE_OTHERS(AsmControlFlagsExpression);
2913 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
2914 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2915  private:
2916  friend class boost::serialization::access;
2917 
2918  template<class S>
2919  void serialize(S &s, const unsigned /*version*/) {
2920  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2921  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
2922  }
2923 #endif
2924 #endif // SgAsmControlFlagsExpression_OTHERS
2925 
2926 #ifdef DOCUMENTATION
2927  };
2928 #endif
2929 
2931 
2932  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
2933  IS_SERIALIZABLE(AsmCommonSubExpression);
2934 
2935 #ifdef DOCUMENTATION
2936  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2938  public:
2939 #endif
2940 
2941 #ifndef DOCUMENTATION
2942  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
2943  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2944 #endif
2945 
2946  DECLARE_OTHERS(AsmCommonSubExpression);
2947 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
2948 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2949  private:
2950  friend class boost::serialization::access;
2951 
2952  template<class S>
2953  void serialize(S &s, const unsigned /*version*/) {
2954  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2955  s & BOOST_SERIALIZATION_NVP(p_subexpression);
2956  }
2957 #endif
2958 #endif // SgAsmCommonSubExpression_OTHERS
2959 
2960 #ifdef DOCUMENTATION
2961  };
2962 #endif
2963 
2965 
2966  DECLARE_LEAF_CLASS(AsmRiscOperation);
2967  IS_SERIALIZABLE(AsmRiscOperation);
2968 
2969 #ifdef DOCUMENTATION
2970 
2979  public:
2980 #endif
2981 
2982 #ifdef DOCUMENTATION
2983 
2992 #else
2993  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
2994  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
2995 #endif
2996 
2997 #ifdef DOCUMENTATION
2998 
3004  SgAsmExprListExp* get_operands() const;
3007 #else
3008  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
3009  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3010 #endif
3011 
3012  DECLARE_OTHERS(AsmRiscOperation);
3013 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
3014  public:
3021  OP_NONE,
3022  OP_bottom,
3023  OP_undefined,
3024  OP_unspecified,
3025  OP_filterCallTarget,
3026  OP_filterReturnTarget,
3027  OP_filterIndirectJumpTarget,
3028  OP_hlt,
3029  OP_cpuid,
3030  OP_rdtsc,
3031  OP_and_,
3032  OP_or_,
3033  OP_xor_,
3034  OP_invert,
3035  OP_extract,
3036  OP_concat,
3037  OP_leastSignificantSetBit,
3038  OP_mostSignificantSetBit,
3039  OP_rotateLeft,
3040  OP_rotateRight,
3041  OP_shiftLeft,
3042  OP_shiftRight,
3043  OP_shiftRightArithmetic,
3044  OP_equalToZero,
3045  OP_ite,
3046  OP_isEqual,
3047  OP_isNotEqual,
3048  OP_isUnsignedLessThan,
3049  OP_isUnsignedLessThanOrEqual,
3050  OP_isUnsignedGreaterThan,
3051  OP_isUnsignedGreaterThanOrEqual,
3052  OP_isSignedLessThan,
3053  OP_isSignedLessThanOrEqual,
3054  OP_isSignedGreaterThan,
3055  OP_isSignedGreaterThanOrEqual,
3056  OP_unsignedExtend,
3057  OP_signExtend,
3060  OP_subtract,
3061  OP_negate,
3062  OP_signedDivide,
3063  OP_signedModulo,
3064  OP_signedMultiply,
3065  OP_unsignedDivide,
3066  OP_unsignedModulo,
3067  OP_unsignedMultiply,
3068  OP_interrupt,
3069  OP_readRegister,
3070  OP_peekRegister,
3071  OP_writeRegister,
3073  OP_peekMemory,
3075  OP_N_OPERATORS // MUST BE LAST!
3076  };
3077 
3078 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3079  private:
3080  friend class boost::serialization::access;
3081 
3082  template<class S>
3083  void serialize(S &s, const unsigned /*version*/) {
3084  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3085  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
3086  s & BOOST_SERIALIZATION_NVP(p_operands);
3087  }
3088 #endif
3089 #endif // SgAsmRiscOperation_OTHERS
3090 
3091 #ifdef DOCUMENTATION
3092  };
3093 #endif
3094 
3096 
3097  DECLARE_LEAF_CLASS(AsmExprListExp);
3098  IS_SERIALIZABLE(AsmExprListExp);
3099 
3100 #ifdef DOCUMENTATION
3101 
3103  public:
3104 #endif
3105 
3106 #ifdef DOCUMENTATION
3107 
3113  const SgAsmExpressionPtrList& get_expressions() const;
3114  void set_expressions(const SgAsmExpressionPtrList&);
3116 #else
3117  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
3118  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3119 #endif
3120 
3121  DECLARE_OTHERS(AsmExprListExp);
3122 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
3123 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3124  private:
3125  friend class boost::serialization::access;
3126 
3127  template<class S>
3128  void serialize(S &s, const unsigned /*version*/) {
3129  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3130  s & BOOST_SERIALIZATION_NVP(p_expressions);
3131  }
3132 #endif
3133 #endif // SgAsmExprListExp_OTHERS
3134 
3135 #ifdef DOCUMENTATION
3136  };
3137 #endif
3138 
3140 
3141  NEW_NONTERMINAL_MACRO(AsmExpression,
3142  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
3143  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
3144  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
3145  AsmRiscOperation,
3146  "AsmExpression", "AsmExpressionTag", false);
3147  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
3148  IS_SERIALIZABLE(AsmExpression);
3149 
3150 #ifdef DOCUMENTATION
3151 
3152  class SgAsmExpression: public SgAsmNode {
3153  public:
3154 #endif
3155 
3156 #ifdef DOCUMENTATION
3157 
3162  SgAsmType* get_type() const;
3163  void set_type(SgAsmType*);
3165 #else
3166  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
3167  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3168 #endif
3169 
3170 #ifdef DOCUMENTATION
3171 
3176  const std::string& get_comment() const;
3177  void set_comment(const std::string&);
3179 #else
3180  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
3181  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3182 #endif
3183 
3184  DECLARE_OTHERS(AsmExpression);
3185 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
3186 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3187  private:
3188  friend class boost::serialization::access;
3189 
3190  template<class S>
3191  void serialize(S &s, const unsigned /*version*/) {
3192  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3193  s & BOOST_SERIALIZATION_NVP(p_type);
3194  s & BOOST_SERIALIZATION_NVP(p_comment);
3195  }
3196 #endif
3197 
3198  public:
3202  size_t get_nBits() const;
3203 
3209 
3215 
3216 #endif // SgAsmExpression_OTHERS
3217 
3218 #ifdef DOCUMENTATION
3219  };
3220 #endif
3221 
3222 
3223 
3224 
3226 
3227  /***************************************************************************************************************************
3228  * Data Types (new interface 2014-07)
3229  *
3230  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
3231  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
3232  * 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
3233  * don't allow types to be modified after they're created.
3234  ***************************************************************************************************************************/
3235 
3237 
3238  DECLARE_LEAF_CLASS(AsmIntegerType);
3239  IS_SERIALIZABLE(AsmIntegerType);
3240 
3241 #ifdef DOCUMENTATION
3242 
3244  public:
3245 #endif
3246 
3247 #ifndef DOCUMENTATION
3248  // Documented below due to ROSETTA limitations
3249  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
3250  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3251 #endif
3252 
3253  DECLARE_OTHERS(AsmIntegerType);
3254 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
3255 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3256  private:
3257  friend class boost::serialization::access;
3258 
3259  template<class S>
3260  void serialize(S &s, const unsigned /*version*/) {
3261  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
3262  s & BOOST_SERIALIZATION_NVP(p_isSigned);
3263  }
3264 #endif
3265 
3266  public:
3270  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
3271 
3275  bool get_isSigned() const;
3276 
3277  // Overrides documented in base class
3278  virtual void check() const $ROSE_OVERRIDE;
3279  virtual std::string toString() const $ROSE_OVERRIDE;
3280 #endif // SgAsmIntegerType_OTHERS
3281 
3282 #ifdef DOCUMENTATION
3283  };
3284 #endif
3285 
3287 
3288  DECLARE_LEAF_CLASS(AsmFloatType);
3289  IS_SERIALIZABLE(AsmFloatType);
3290 
3291  DECLARE_HEADERS(AsmFloatType);
3292 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
3293  #include <Sawyer/BitVector.h>
3294  #include <BitFlags.h>
3295 #endif // SgAsmFloatType_HEADERS
3296 
3297 #ifdef DOCUMENTATION
3298 
3300  public:
3301 #endif
3302 
3303 #ifndef DOCUMENTATION
3304  // Documented below because of ROSETTA limitations (they're read-only)
3305  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
3306  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3307  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
3308  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3309  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
3310  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3311  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
3312  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3313  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
3314  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3315  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
3316  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3317  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
3318  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3319 #endif
3320 
3321  DECLARE_OTHERS(AsmFloatType);
3322 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
3323 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3324  private:
3325  friend class boost::serialization::access;
3326 
3327  template<class S>
3328  void serialize(S &s, const unsigned /*version*/) {
3329  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
3330  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
3331  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
3332  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
3333  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
3334  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
3335  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
3336  s & BOOST_SERIALIZATION_NVP(p_flags);
3337  }
3338 #endif
3339 
3340  public:
3342  enum Flag {
3343  GRADUAL_UNDERFLOW = 0x00000001,
3345  };
3346 
3349 
3352 
3354  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
3355  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
3356  uint64_t exponentBias, Flags flags);
3357 
3359  BitRange significandBits() const;
3360 
3362  BitRange exponentBits() const;
3363 
3365  size_t signBit() const;
3366 
3368  uint64_t exponentBias() const;
3369 
3371  Flags flags() const;
3372 
3377  static Flags ieeeFlags();
3378 
3384  bool gradualUnderflow() const;
3385 
3393  bool implicitBitConvention() const;
3394 
3397  // Overrides documented in base class
3398  virtual void check() const $ROSE_OVERRIDE;
3399  virtual std::string toString() const $ROSE_OVERRIDE;
3400 #endif // SgAsmFloatType_OTHERS
3401 
3402 #ifdef DOCUMENTATION
3403  };
3404 #endif
3405 
3407 
3408  NEW_NONTERMINAL_MACRO(AsmScalarType,
3409  AsmIntegerType | AsmFloatType,
3410  "AsmScalarType", "AsmScalarTypeTag", false);
3411  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
3412  IS_SERIALIZABLE(AsmScalarType);
3413 
3414 #ifdef DOCUMENTATION
3415 
3416  class SgAsmScalarType: public SgAsmType {
3417  public:
3418 #endif
3419 
3420 #ifndef DOCUMENTATION
3421  // Documented below due to ROSETTA limitations (read-only)
3422  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3423  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3424  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3425  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3426  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
3427  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3428  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
3429  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3430 #endif
3431 
3432  DECLARE_OTHERS(AsmScalarType);
3433 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
3434 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3435  private:
3436  friend class boost::serialization::access;
3437 
3438  template<class S>
3439  void serialize(S &s, const unsigned /*version*/) {
3440  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3441  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
3442  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
3443  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
3444  s & BOOST_SERIALIZATION_NVP(p_nBits);
3445  }
3446 #endif
3447 
3448  protected:
3453  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
3454 
3455  public:
3457  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3458 
3460  ByteOrder::Endianness get_minorOrder() const;
3461 
3463  ByteOrder::Endianness get_majorOrder() const;
3464 
3466  size_t get_majorNBytes() const;
3467 
3468  // Overrides documented in base class
3469  virtual void check() const $ROSE_OVERRIDE;
3470  virtual std::string toString() const $ROSE_OVERRIDE;
3471 #endif // SgAsmScalarType_OTHERS
3472 
3473 #ifdef DOCUMENTATION
3474  };
3475 #endif
3476 
3478 
3479  DECLARE_LEAF_CLASS(AsmVectorType);
3480  IS_SERIALIZABLE(AsmVectorType);
3481 
3482 #ifdef DOCUMENTATION
3483 
3484  class SgAsmVectorType: public SgAsmType {
3485  public:
3486 #endif
3487 
3488 #ifndef DOCUMENTATION
3489  // Documented below due to ROSETTA limitations (read-only)
3490  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3491  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3492  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3493  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3494 #endif
3495 
3496  DECLARE_OTHERS(AsmVectorType);
3497 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3498 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3499  private:
3500  friend class boost::serialization::access;
3501 
3502  template<class S>
3503  void serialize(S &s, const unsigned /*version*/) {
3504  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3505  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3506  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3507  }
3508 #endif
3509 
3510  public:
3512  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3513 
3515  size_t get_nElmts() const;
3516 
3518  SgAsmType* get_elmtType() const;
3519 
3520  // Overrides documented in base class
3521  virtual void check() const $ROSE_OVERRIDE;
3522  virtual std::string toString() const $ROSE_OVERRIDE;
3523  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3524 #endif // SgAsmVectorType_OTHERS
3525 
3526 #ifdef DOCUMENTATION
3527  };
3528 #endif
3529 
3531 
3532  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3533  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3534  IS_SERIALIZABLE(AsmType);
3535 
3536 #ifdef DOCUMENTATION
3537 
3538  class SgAsmType: public SgAsmNode {
3539  public:
3540 #endif
3541 
3542  DECLARE_OTHERS(AsmType);
3543 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3544  private:
3546 
3547 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3548  private:
3549  friend class boost::serialization::access;
3550 
3551  template<class S>
3552  void serialize(S &s, const unsigned /*version*/) {
3553  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3554  }
3555 #endif
3556 
3557  public:
3565  virtual void check() const;
3566 
3572  virtual std::string toString() const {
3573  abort(); // ROSETTA limitation: intended pure virtual
3574  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3575  }
3576 
3578  virtual size_t get_nBits() const {
3579  abort(); // ROSETTA limitation: intended pure virtual
3580  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3581  }
3582 
3584  virtual size_t get_nBytes() const;
3585 
3591  template<class Type> // Type is a subclass of SgAsmType
3592  static Type* registerOrDelete(Type *toInsert) {
3593  ASSERT_not_null(toInsert);
3594  std::string key = toInsert->toString();
3595  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3596  ASSERT_not_null(retval);
3597  if (retval!=toInsert)
3598  delete toInsert;
3599  return retval;
3600  }
3601 #endif // SgAsmType_OTHERS
3602 
3603 #ifdef DOCUMENTATION
3604  };
3605 #endif
3606 
3607 
3608 
3610 
3611  /**************************************************************************************************************************
3612  * Collections of Instructions
3613  **************************************************************************************************************************/
3614 
3616 
3617  DECLARE_LEAF_CLASS(AsmFunction);
3618  IS_SERIALIZABLE(AsmFunction);
3619 
3620 #ifdef DOCUMENTATION
3621 
3637  public:
3638 #endif
3639 
3640 #ifdef DOCUMENTATION
3641 
3646  const std::string& get_name() const;
3647  void set_name(const std::string&);
3649 #else
3650  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3651  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3652 #endif
3653 
3654 #ifdef DOCUMENTATION
3655 
3661  unsigned get_reason() const;
3662  void set_reason(unsigned);
3664 #else
3665  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3666  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3667 #endif
3668 
3669 #ifdef DOCUMENTATION
3670 
3677  const std::string& get_reasonComment() const;
3678  void set_reasonComment(const std::string&);
3680 #else
3681  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
3682  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3683 #endif
3684 
3685 #ifdef DOCUMENTATION
3686 
3694 #else
3695  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3696  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3697 #endif
3698 
3699 #ifdef DOCUMENTATION
3700 
3703  MayReturn get_may_return() const;
3704  void set_may_return(MayReturn);
3706 #else
3707  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3708  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3709 #endif
3710 
3711 #ifdef DOCUMENTATION
3712 
3717  const std::string& get_name_md5() const;
3718  void set_name_md5(const std::string&);
3720 #else
3721  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3722  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3723 #endif
3724 
3725 #ifdef DOCUMENTATION
3726 
3731  const SgAsmStatementPtrList& get_statementList() const;
3732  void set_statementList(const SgAsmStatementPtrList&);
3734 #else
3735  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3736  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3737 #endif
3738 
3739 #ifdef DOCUMENTATION
3740  // FIXME[Robb P Matzke 2017-02-13]: unused?
3741 #else
3742  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3743  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3744 #endif
3745 
3746 #ifdef DOCUMENTATION
3747 
3753  rose_addr_t get_entry_va() const;
3754  void set_entry_va(rose_addr_t);
3756 #else
3757  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3758  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3759 #endif
3760 
3761 #ifdef DOCUMENTATION
3762 
3771 #else
3772  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3773  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3774 #endif
3775 
3776 #ifdef DOCUMENTATION
3777  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3778 #else
3779  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3780  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3781 #endif
3782 
3783 #ifdef DOCUMENTATION
3784 
3793  int64_t get_stackDelta() const;
3794  void set_stackDelta(int64_t);
3796 #else
3797  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3798  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3799 #endif
3800 
3801 #ifdef DOCUMENTATION
3802 
3810  const std::string& get_callingConvention() const;
3811  void set_callingConvention(const std::string&);
3813 #else
3814  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3815  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3816 #endif
3817 
3818  DECLARE_OTHERS(AsmFunction);
3819 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3820 
3821 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3822  private:
3823  friend class boost::serialization::access;
3824 
3825  template<class S>
3826  void serialize(S &s, const unsigned /*version*/) {
3827  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3828  s & BOOST_SERIALIZATION_NVP(p_name);
3829  s & BOOST_SERIALIZATION_NVP(p_reason);
3830  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
3831  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3832  s & BOOST_SERIALIZATION_NVP(p_may_return);
3833  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3834  s & BOOST_SERIALIZATION_NVP(p_statementList);
3835  s & BOOST_SERIALIZATION_NVP(p_dest);
3836  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3837  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3838  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3839  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3840  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3841  }
3842 #endif
3843 
3844  public:
3847 
3851  void remove_statement(SgAsmStatement* statement);
3852 
3857  SgAsmBlock* get_entry_block() const;
3858 
3860  enum MayReturn {
3865  };
3866 
3871  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3872  // Also fix SgAsmFunction::reason_key()
3873  FUNC_NONE = 0x00000000,
3874  FUNC_THUNK_TARGET= 0x00004000,
3876  = 0x00008000,
3877  FUNC_ENTRY_POINT = 0x00010000,
3878  FUNC_CALL_TARGET = 0x00020000,
3881  FUNC_CALL_INSN = 0x00040000,
3887  FUNC_EH_FRAME = 0x00080000,
3888  FUNC_SYMBOL = 0x00100000,
3889  FUNC_PATTERN = 0x00200000,
3894  FUNC_GRAPH = 0x00400000,
3898  FUNC_USERDEF = 0x00800000,
3899  FUNC_PADDING = 0x01000000,
3904  FUNC_DISCONT = 0x02000000,
3907  FUNC_INSNHEAD = 0x04000000,
3908  FUNC_IMPORT = 0x08000000,
3911  FUNC_LEFTOVERS = 0x10000000,
3915  FUNC_INTRABLOCK = 0x20000000,
3923  FUNC_THUNK = 0x40000000,
3932  FUNC_EXPORT = 0x80000000,
3934  FUNC_DEFAULT = 0xefff80ff,
3936  /*========= Miscellaneous Reasons ===========================================================================
3937  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3938  * availalble for users to use as they see fit. */
3939  FUNC_MISCMASK = 0x000000ff,
3954  };
3955 
3959  static std::string reason_key(const std::string &prefix="");
3960 
3962  std::string reason_str(bool pad) const;
3963 
3967  static std::string reason_str(bool pad, unsigned reason);
3968 
3971  public:
3972  virtual ~NodeSelector() {}
3973  virtual bool operator()(SgNode*) = 0;
3974  };
3975 
4015  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
4016  NodeSelector *selector=NULL);
4017 
4023  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
4024 
4027  e_unknown = 0,
4028  e_standard = 1,
4029  e_library = 2,
4030  e_imported = 3,
4031  e_thunk = 4,
4032  e_last
4033  };
4034 #endif // SgAsmFunction_OTHERS
4035 
4036 
4037 #ifdef DOCUMENTATION
4038  };
4039 #endif
4040 
4041 
4043 
4044  DECLARE_LEAF_CLASS(AsmBlock);
4045  IS_SERIALIZABLE(AsmBlock);
4046 
4047 #ifdef DOCUMENTATION
4048 
4068  class SgAsmBlock: public SgAsmStatement {
4069  public:
4070 #endif
4071 
4072 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
4073  // [tps 05Apr07] needed for the control_flow_graph
4074  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
4075  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4076 #endif
4077 
4078 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
4079  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
4080  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4081 #endif
4082 
4083 #ifdef DOCUMENTATION
4084 
4089  rose_addr_t get_id() const;
4090  void set_id(rose_addr_t);
4092 #else
4093  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
4094  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4095 #endif
4096 
4097 #ifdef DOCUMENTATION
4098 
4103  unsigned get_reason() const;
4104  void set_reason(unsigned);
4106 #else
4107  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
4108  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4109 #endif
4110 
4111 #ifdef DOCUMENTATION
4112  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
4113  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
4114  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
4115  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
4122  const SgAsmStatementPtrList& get_statementList() const;
4123  void set_statementList(const SgAsmStatementPtrList&);
4125 #else
4126  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
4127  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4128 #endif
4129 
4130 #ifdef DOCUMENTATION
4131  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
4132  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
4133  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
4134  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
4142  const SgAsmIntegerValuePtrList& get_successors() const;
4143  void set_successors(const SgAsmIntegerValuePtrList&);
4145 #else
4146  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
4147  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4148 #endif
4149 
4150 #ifdef DOCUMENTATION
4151 
4161  bool get_successors_complete() const;
4162  void set_successors_complete(bool);
4164 #else
4165  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
4166  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4167 #endif
4168 
4169 #ifdef DOCUMENTATION
4170 
4182 #else
4183  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
4184  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4185 #endif
4186 
4187 #ifdef DOCUMENTATION
4188 
4196  size_t get_cached_vertex() const;
4197  void set_cached_vertex(size_t);
4199 #else
4200  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
4201  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4202 #endif
4203 
4204 #ifdef DOCUMENTATION
4205 
4211  double get_code_likelihood() const;
4212  void set_code_likelihood(double);
4214 #else
4215  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
4216  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4217 #endif
4218 
4219 #ifdef DOCUMENTATION
4220 
4228  int64_t get_stackDeltaOut() const;
4229  void set_stackDeltaOut(int64_t);
4231 #else
4232  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
4233  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4234 #endif
4235 
4236  DECLARE_OTHERS(AsmBlock);
4237 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
4238 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4239  private:
4240  friend class boost::serialization::access;
4241 
4242  template<class S>
4243  void serialize(S &s, const unsigned /*version*/) {
4244  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4245  s & BOOST_SERIALIZATION_NVP(p_reason);
4246  s & BOOST_SERIALIZATION_NVP(p_statementList);
4247  s & BOOST_SERIALIZATION_NVP(p_successors);
4248  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
4249  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
4250  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
4251  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
4252  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
4253  }
4254 #endif
4255 
4256  public:
4258  enum Reason {
4259  // Please update SgAsmBlock::reason_str() if you change this enum!
4260  BLK_NONE = 0x00000000,
4261  BLK_ENTRY_POINT = 0x00010000,
4262  BLK_PADDING = 0x00020000,
4263  BLK_FRAGMENT = 0x00080000,
4265  BLK_CFGHEAD = 0x00100000,
4266  BLK_USERDEF = 0x00200000,
4267  BLK_LEFTOVERS = 0x00400000,
4269  BLK_JUMPTABLE = 0x00800000,
4270  BLK_GRAPH1 = 0x01000000,
4271  BLK_GRAPH2 = 0x02000000,
4272  BLK_GRAPH3 = 0x04000000,
4274  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
4275 
4276  // ========= Miscellaneous Reasons ===========================================================================
4277  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
4278  // availalble for users to use as they see fit.
4279  BLK_MISCMASK = 0x000000ff,
4281  BLK_FINDDATA = 0x00000001,
4283  BLK_POSTFUNC = 0x00000002
4285  };
4286 
4291 
4296 
4297  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
4302  void remove_children();
4303 
4308  rose_addr_t get_fallthrough_va();
4309 
4314 
4320  bool has_instructions() const;
4321 
4327  bool is_basic_block() const { return has_instructions(); }
4328 
4338  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
4339 
4343  static std::string reason_key(const std::string &prefix="");
4344 
4348  std::string reason_str(bool pad) const;
4349 
4355  static std::string reason_str(bool pad, unsigned reason);
4356 #endif // SgAsmBlock_OTHERS
4357 
4358 #ifdef DOCUMENTATION
4359  };
4360 #endif
4361 
4362 
4364 
4365  DECLARE_LEAF_CLASS(AsmStaticData);
4366  IS_SERIALIZABLE(AsmStaticData);
4367 
4368 #ifdef DOCUMENTATION
4369 
4377  public:
4378 #endif
4379 
4380 #ifdef DOCUMENTATION
4381 
4387  const SgUnsignedCharList& get_raw_bytes() const;
4388  void set_raw_bytes(const SgUnsignedCharList&);
4390 #else
4391  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
4392  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4393 #endif
4394 
4395  DECLARE_OTHERS(AsmStaticData);
4396 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
4397 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4398  private:
4399  friend class boost::serialization::access;
4400 
4401  template<class S>
4402  void serialize(S &s, const unsigned /*version*/) {
4403  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4404  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
4405  }
4406 #endif
4407 
4408  public:
4412  size_t get_size() const { return p_raw_bytes.size(); }
4413 #endif // SgAsmStaticData_OTHERS
4414 
4415 #ifdef DOCUMENTATION
4416  };
4417 #endif
4418 
4419 
4421 
4422  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
4423  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
4424 
4425 #ifdef DOCUMENTATION
4426 
4437  public:
4438 #endif
4439 
4440  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4441 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4442 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4443  private:
4444  friend class boost::serialization::access;
4445 
4446  template<class S>
4447  void serialize(S & s, const unsigned /*version*/) {
4448  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4449  }
4450 #endif
4451  protected:
4452  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4453 
4454  public:
4457  p_declarationList.push_back(declaration);
4458  }
4459 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4460 
4461 #ifdef DOCUMENTATION
4462  };
4463 #endif
4464 
4465 
4467 
4468  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4469  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4470 
4471 #ifdef DOCUMENTATION
4472  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4474  public:
4475 #endif
4476 
4477 #ifdef DOCUMENTATION
4478 
4481  const std::string& get_name() const;
4482  void set_name(const std::string&);
4484 #else
4485  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4486  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4487  NO_DELETE);
4488 #endif
4489 
4490 #ifdef DOCUMENTATION
4491  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4495  uint64_t get_offset() const;
4496  void set_ofset(uint64_t);
4498 #else
4499  // Not clear if we want to store the offset explicitly
4500  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4501  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4502  NO_DELETE);
4503 #endif
4504 
4505  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4506 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4507 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4508  private:
4509  friend class boost::serialization::access;
4510 
4511  template<class S>
4512  void serialize(S &s, const unsigned /*version*/) {
4513  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4514  }
4515 #endif
4516 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4517 
4518 #ifdef DOCUMENTATION
4519  };
4520 #endif
4521 
4522 
4524 
4525  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4526  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4527  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4528  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4529  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4530 
4531 #ifdef DOCUMENTATION
4532 
4539  public:
4540 #endif
4541 
4542  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4543 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4544 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4545  private:
4546  friend class boost::serialization::access;
4547 
4548  template<class S>
4549  void serialize(S &s, const unsigned /*version*/) {
4550  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4551  };
4552 #endif
4553 #endif // SgAsmSynthesizedDeclaration_OTHERS
4554 
4555 #ifdef DOCUMENTATION
4556  };
4557 #endif
4558 
4559 
4561 
4562  NEW_NONTERMINAL_MACRO(AsmStatement,
4563  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4564  "AsmStatement", "AsmStatementTag", false);
4565  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4566  IS_SERIALIZABLE(AsmStatement);
4567 
4568 #ifdef DOCUMENTATION
4569 
4573  class SgAsmStatement: public SgAsmNode {
4574  public:
4575 #endif
4576 
4577 #ifdef DOCUMENTATION
4578 
4583  rose_addr_t get_address() const;
4584  void set_address(rose_addr_t);
4586 #else
4587  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4588  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4589 #endif
4590 
4591 
4592 #ifdef DOCUMENTATION
4593 
4596  const std::string& get_comment() const;
4597  void set_comment(const std::string&);
4599 #else
4600  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4601  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4602 #endif
4603 
4604  DECLARE_OTHERS(AsmStatement);
4605 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4606 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4607  private:
4608  friend class boost::serialization::access;
4609 
4610  template<class S>
4611  void serialize(S &s, const unsigned /*version*/) {
4612  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4613  s & BOOST_SERIALIZATION_NVP(p_address);
4614  s & BOOST_SERIALIZATION_NVP(p_comment);
4615  }
4616 #endif
4617 #endif // SgAsmStatement_OTHERS
4618 
4619 #ifdef DOCUMENTATION
4620  };
4621 #endif
4622 
4623 
4624 
4625 
4627 
4628  /*************************************************************************************************************************
4629  * Binary Interpretations
4630  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4631  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4632  * an AST that represents a single, coherent sub-part of the file.
4633  *************************************************************************************************************************/
4634 
4636 
4637  DECLARE_LEAF_CLASS(AsmInterpretationList);
4638  IS_SERIALIZABLE(AsmInterpretationList);
4639 
4640 #ifdef DOCUMENTATION
4641 
4643  public:
4644 #endif
4645 
4646 #ifdef DOCUMENTATION
4647 
4656 #else
4657  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4658  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4659  NO_DELETE);
4660 #endif
4661 
4662  DECLARE_OTHERS(AsmInterpretationList);
4663 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4664 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4665  private:
4666  friend class boost::serialization::access;
4667 
4668  template<class S>
4669  void serialize(S &s, const unsigned /*version*/) {
4670  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4671  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4672  }
4673 #endif
4674 #endif // SgAsmInterpretationList_OTHERS
4675 
4676 #ifdef DOCUMENTATION
4677  };
4678 #endif
4679 
4681 
4682  DECLARE_LEAF_CLASS(AsmInterpretation);
4683  IS_SERIALIZABLE(AsmInterpretation);
4684 
4685  DECLARE_HEADERS(AsmInterpretation);
4686 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4687  #include <MemoryMap.h>
4688  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
4689 #endif // SgAsmInterpretation_HEADERS
4690 
4691 #ifdef DOCUMENTATION
4692 
4699  public:
4700 #endif
4701 
4702 #ifdef DOCUMENTATION
4703  // documentation and definition are below
4704 #else
4705  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4706 #endif
4707 
4708 #ifdef DOCUMENTATION
4709 
4720 #else
4721  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4722  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4723 #endif
4724 
4725 #ifdef DOCUMENTATION
4726 
4731  SgAsmBlock* get_global_block() const;
4734 #else
4735  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4736  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4737 #endif
4738 
4739  DECLARE_OTHERS(AsmInterpretation);
4740 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4741  private:
4743  const Rose::BinaryAnalysis::RegisterDictionary *p_registers;
4744  bool coverageComputed; // true iff percentageCoverage has been computed
4745  mutable InstructionMap instruction_map; // cached instruction map
4746 
4748  // disassembly into instructions.
4749  double percentageCoverage;
4750 
4751 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4752  private:
4753  friend class boost::serialization::access;
4754 
4755  template<class S>
4756  void serialize(S &s, const unsigned /*version*/) {
4757  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4758  s & BOOST_SERIALIZATION_NVP(p_headers);
4759  s & BOOST_SERIALIZATION_NVP(p_global_block);
4760  s & BOOST_SERIALIZATION_NVP(p_map);
4761  s & BOOST_SERIALIZATION_NVP(p_registers);
4762  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4763  s & BOOST_SERIALIZATION_NVP(instruction_map);
4764  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4765  }
4766 #endif
4767 
4768  public:
4771  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4772  ctor();
4773  }
4774 
4779  SgAsmGenericFilePtrList get_files() const;
4780 
4807  InstructionMap& get_instruction_map(bool recompute=false);
4808  void set_instruction_map(const InstructionMap&);
4815  void insert_instructions(InstructionMap&/*in,out*/);
4816 
4821  void erase_instructions(InstructionMap&/*in,out*/);
4822 
4828  void set_coverageComputed(bool x) { coverageComputed = x; }
4829  void set_percentageCoverage(double x) { percentageCoverage = x; }
4832  private:
4833  void ctor(); // finalize construction
4834 #endif // SgAsmInterpretation_OTHERS
4835 
4836 #ifdef DOCUMENTATION
4837  };
4838 #endif
4839 
4840 
4841 
4843 
4844  /*************************************************************************************************************************
4845  * ELF File Header
4846  *************************************************************************************************************************/
4847 
4849 
4850  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4851  IS_SERIALIZABLE(AsmElfFileHeader);
4852 
4853 #ifdef DOCUMENTATION
4854 
4863  public:
4864 #endif
4865 
4866 #ifdef DOCUMENTATION
4867 
4872  unsigned char get_e_ident_file_class() const;
4873  void set_e_ident_file_class(unsigned char);
4875 #else
4876  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4877  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4878 #endif
4879 
4880 #ifdef DOCUMENTATION
4881 
4886  unsigned char get_e_ident_data_encoding() const;
4887  void set_e_ident_data_encoding(unsigned char);
4889 #else
4890  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4891  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4892 #endif
4893 
4894 #ifdef DOCUMENTATION
4895 
4900  unsigned char get_e_ident_file_version() const;
4901  void set_e_ident_file_version(unsigned char*);
4903 #else
4904  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4905  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4906 #endif
4907 
4908 #ifdef DOCUMENTATION
4909 
4914  const SgUnsignedCharList& get_e_ident_padding() const;
4915  void set_e_ident_padding(const SgUnsignedCharList&);
4917 #else
4918  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4919  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4920 #endif
4921 
4922 #ifdef DOCUMENTATION
4923 
4928  unsigned long get_e_type() const;
4929  void set_e_type(unsigned long);
4931 #else
4932  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4933  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4934 #endif
4935 
4936 #ifdef DOCUMENTATION
4937 
4942  unsigned long get_e_machine() const;
4943  void set_e_machine(unsigned long);
4945 #else
4946  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4947  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4948 #endif
4949 
4950 #ifdef DOCUMENTATION
4951 
4956  unsigned long get_e_flags() const;
4957  void set_e_flags(unsigned long);
4959 #else
4960  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4961  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4962 #endif
4963 
4964 #ifdef DOCUMENTATION
4965 
4970  unsigned long get_e_ehsize() const;
4971  void set_e_ehsize(unsigned long);
4973 #else
4974  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4975  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4976 #endif
4977 
4978 #ifdef DOCUMENTATION
4979 
4984  unsigned long get_phextrasz() const;
4985  void set_phextrasz(unsigned long);
4987 #else
4988  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4989  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4990 #endif
4991 
4992 #ifdef DOCUMENTATION
4993 
4998  unsigned long get_e_phnum() const;
4999  void set_e_phnum(unsigned long);
5001 #else
5002  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
5003  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5004 #endif
5005 
5006 #ifdef DOCUMENTATION
5007 
5012  unsigned long get_shextrasz() const;
5013  void set_shextrasz(unsigned long);
5015 #else
5016  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
5017  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5018 #endif
5019 
5020 #ifdef DOCUMENTATION
5021 
5026  unsigned long get_e_shnum() const;
5027  void set_e_shnum(unsigned long);
5029 #else
5030  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
5031  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5032 #endif
5033 
5034 #ifdef DOCUMENTATION
5035 
5040  unsigned long get_e_shstrndx() const;
5041  void set_e_shstrndx(unsigned long);
5043 #else
5044  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
5045  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5046 #endif
5047 
5048 #ifdef DOCUMENTATION
5049 
5059 #else
5060  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
5061  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5062 #endif
5063 
5064 #ifdef DOCUMENTATION
5065 
5074 #else
5075  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
5076  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5077 #endif
5078 
5079  DECLARE_OTHERS(AsmElfFileHeader);
5080 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
5081 
5082 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5083  private:
5084  friend class boost::serialization::access;
5085 
5086  template<class S>
5087  void serialize(S &s, const unsigned /*version*/) {
5088  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
5089  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
5090  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
5091  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
5092  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
5093  s & BOOST_SERIALIZATION_NVP(p_e_type);
5094  s & BOOST_SERIALIZATION_NVP(p_e_machine);
5095  s & BOOST_SERIALIZATION_NVP(p_e_flags);
5096  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
5097  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
5098  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
5099  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
5100  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
5101  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
5102  s & BOOST_SERIALIZATION_NVP(p_section_table);
5103  s & BOOST_SERIALIZATION_NVP(p_segment_table);
5104  }
5105 #endif
5106 
5107  public:
5109  enum ObjectType {
5110  ET_NONE = 0
5111  ,ET_REL = 1
5112  ,ET_EXEC = 2
5113  ,ET_DYN = 3
5114  ,ET_CORE = 4
5116  ,ET_LOOS = 0xfe00
5117  ,ET_HIOS = 0xfeff
5118  ,ET_LOPROC = 0xff00
5119  ,ET_HIPROC = 0xffff
5120  };
5121 
5122  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
5123  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
5124  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
5125  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
5126  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
5127 #ifdef _MSC_VER
5128 # pragma pack (1)
5129 #endif
5130 
5137  unsigned char e_ident_magic[4];
5138  unsigned char e_ident_file_class;
5139  unsigned char e_ident_data_encoding;
5140  unsigned char e_ident_file_version;
5141  unsigned char e_ident_padding[9];
5142  uint16_t e_type;
5143  uint16_t e_machine;
5144  uint32_t e_version;
5145  uint32_t e_entry;
5146  uint32_t e_phoff;
5147  uint32_t e_shoff;
5148  uint32_t e_flags;
5149  uint16_t e_ehsize;
5150  uint16_t e_phentsize;
5151  uint16_t e_phnum;
5152  uint16_t e_shentsize;
5153  uint16_t e_shnum;
5154  uint16_t e_shstrndx;
5155  }
5156 #if !defined(SWIG) && !defined(_MSC_VER)
5157  __attribute__((packed))
5158 #endif
5159  ;
5160 
5162  unsigned char e_ident_magic[4];
5163  unsigned char e_ident_file_class;
5164  unsigned char e_ident_data_encoding;
5165  unsigned char e_ident_file_version;
5166  unsigned char e_ident_padding[9];
5167  uint16_t e_type;
5168  uint16_t e_machine;
5169  uint32_t e_version;
5170  uint64_t e_entry;
5171  uint64_t e_phoff;
5172  uint64_t e_shoff;
5173  uint32_t e_flags;
5174  uint16_t e_ehsize;
5175  uint16_t e_phentsize;
5176  uint16_t e_phnum;
5177  uint16_t e_shentsize;
5178  uint16_t e_shnum;
5179  uint16_t e_shstrndx;
5180  }
5181 #if !defined(SWIG) && !defined(_MSC_VER)
5182  __attribute__((packed))
5183 #endif
5184  ;
5185 
5186 #ifdef _MSC_VER
5187 # pragma pack ()
5188 #endif
5189 
5197  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
5198  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
5199  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
5200  ctor();
5201  }
5202 
5208  uint64_t max_page_size();
5209 
5212 
5215 
5221  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
5222 
5224  virtual bool reallocate() $ROSE_OVERRIDE;
5225 
5227  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5228 
5230  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5231 
5233  static bool is_ELF(SgAsmGenericFile*);
5234 
5236  SgAsmGenericSectionPtrList get_sectab_sections();
5237 
5239  SgAsmGenericSectionPtrList get_segtab_sections();
5240 
5241  // Overrides documented in base class
5242  virtual const char *format_name() const $ROSE_OVERRIDE;
5243 
5244  private:
5245  void ctor(); // called by constructors
5246  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
5247  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
5248 #endif // SgAsmElfFileHeader_OTHERS
5249 
5250 #ifdef DOCUMENTATION
5251  };
5252 #endif
5253 
5254 
5255 
5257 
5258  /*************************************************************************************************************************
5259  * ELF Section Tables
5260  *************************************************************************************************************************/
5261 
5263 
5264  DECLARE_LEAF_CLASS(AsmElfSectionTable);
5265  IS_SERIALIZABLE(AsmElfSectionTable);
5266 
5267 #ifdef DOCUMENTATION
5268 
5274  public:
5275 #endif
5276 
5277  DECLARE_OTHERS(AsmElfSectionTable);
5278 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
5279 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5280  private:
5281  friend class boost::serialization::access;
5282 
5283  template<class S>
5284  void serialize(S &s, const unsigned /*version*/) {
5285  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5286  }
5287 #endif
5288 
5289  public:
5292  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5293  ctor();
5294  }
5295 
5301  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
5302 
5314 
5318  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5319 
5321  virtual bool reallocate() $ROSE_OVERRIDE;
5322 
5324  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5325 
5327  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5328 
5329  private:
5330  void ctor();
5331 #endif // SgAsmElfSectionTable_OTHERS
5332 
5333 #ifdef DOCUMENTATION
5334  };
5335 #endif
5336 
5337 
5339 
5340  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
5341  IS_SERIALIZABLE(AsmElfSectionTableEntry);
5342 
5343 #ifdef DOCUMENTATION
5344 
5346  public:
5347 #endif
5348 
5349 #ifdef DOCUMENTATION
5350 
5355  unsigned get_sh_name() const;
5356  void set_sh_name(unsigned);
5358 #else
5359  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
5360  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5361 #endif
5362 
5363 #ifdef DOCUMENTATION
5364 
5369  SectionType get_sh_type() const;
5370  void set_sh_type(SectionType);
5372 #else
5373  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
5374  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5375 #endif
5376 
5377 #ifdef DOCUMENTATION
5378 
5383  unsigned long get_sh_link() const;
5384  void set_sh_link(unsigned long);
5386 #else
5387  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
5388  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5389 #endif
5390 
5391 #ifdef DOCUMENTATION
5392 
5397  unsigned long get_sh_info() const;
5398  void set_sh_info(unsigned long);
5400 #else
5401  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
5402  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5403 #endif
5404 
5405 #ifdef DOCUMENTATION
5406 
5411  uint64_t get_sh_flags() const;
5412  void set_sh_flags(uint64_t);
5414 #else
5415  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
5416  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5417 #endif
5418 
5419 #ifdef DOCUMENTATION
5420 
5425  rose_addr_t get_sh_addr() const;
5426  void set_sh_addr(rose_addr_t);
5428 #else
5429  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
5430  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5431 #endif
5432 
5433 #ifdef DOCUMENTATION
5434 
5439  rose_addr_t get_sh_offset() const;
5440  void set_sh_offset(rose_addr_t);
5442 #else
5443  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
5444  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5445 #endif
5446 
5447 #ifdef DOCUMENTATION
5448 
5453  rose_addr_t get_sh_size() const;
5454  void set_sh_size(rose_addr_t);
5456 #else
5457  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
5458  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5459 #endif
5460 
5461 #ifdef DOCUMENTATION
5462 
5467  rose_addr_t get_sh_addralign() const;
5468  void set_sh_addralign(rose_addr_t);
5470 #else
5471  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
5472  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5473 #endif
5474 
5475 #ifdef DOCUMENTATION
5476 
5481  rose_addr_t get_sh_entsize() const;
5482  void set_sh_entsize(rose_addr_t);
5484 #else
5485  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
5486  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5487 #endif
5488 
5489 #ifdef DOCUMENTATION
5490 
5495  const SgUnsignedCharList& get_extra() const;
5496  void set_extra(const SgUnsignedCharLit&);
5498 #else
5499  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5500  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5501  NO_DELETE);
5502 #endif
5503 
5504  DECLARE_OTHERS(AsmElfSectionTableEntry);
5505 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5506 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5507  private:
5508  friend class boost::serialization::access;
5509 
5510  template<class S>
5511  void serialize(S &s, const unsigned /*version*/) {
5512  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5513  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5514  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5515  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5516  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5517  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5518  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5519  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5520  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5521  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5522  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5523  s & BOOST_SERIALIZATION_NVP(p_extra);
5524  }
5525 #endif
5526 
5527  public:
5530  SHT_NULL = 0,
5534  SHT_RELA = 4,
5535  SHT_HASH = 5,
5537  SHT_NOTE = 7,
5539  SHT_REL = 9,
5540  SHT_SHLIB = 10,
5541  SHT_DYNSYM = 11,
5543  SHT_LOOS = 0x60000000,
5544  SHT_GNU_verdef = 0x6ffffffd,
5545  SHT_GNU_verneed = 0x6ffffffe,
5546  SHT_GNU_versym = 0x6fffffff,
5547  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5548 
5549  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5550  SHT_HIPROC = 0x7fffffff,
5551  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5552  SHT_HIUSER = 0xffffffff
5553  };
5554 
5558  SHF_WRITE= (1 << 0),
5559  SHF_ALLOC= (1 << 1),
5560  SHF_EXECINSTR= (1 << 2),
5561  SHF_MERGE= (1 << 4),
5562  SHF_STRINGS= (1 << 5),
5563  SHF_INFO_LINK= (1 << 6),
5564  SHF_LINK_ORDER= (1 << 7),
5566  SHF_GROUP= (1 << 9),
5567  SHF_TLS= (1 << 10),
5568  SHF_MASKOS= 0x0ff00000,
5569  SHF_MASKPROC= 0xf0000000
5570  };
5571 
5578 #ifdef _MSC_VER
5579 # pragma pack (1)
5580 #endif
5582  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5583  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5584  uint32_t sh_flags; /* 0x08 Bit flags */
5585  uint32_t sh_addr; /* 0x0c Desired mapped address */
5586  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5587  uint32_t sh_size; /* 0x14 Section size in bytes */
5588  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5589  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5590  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5591  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5592  } /* 0x28 */
5593 #if !defined(SWIG) && !defined(_MSC_VER)
5594  __attribute__((packed))
5595 #endif
5596  ;
5597 
5599  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5600  uint32_t sh_type; /* 0x04 */
5601  uint64_t sh_flags; /* 0x08 */
5602  uint64_t sh_addr; /* 0x10 */
5603  uint64_t sh_offset; /* 0x18 */
5604  uint64_t sh_size; /* 0x20 */
5605  uint32_t sh_link; /* 0x28 */
5606  uint32_t sh_info; /* 0x2c */
5607  uint64_t sh_addralign; /* 0x30 */
5608  uint64_t sh_entsize; /* 0x38 */
5609  } /* 0x40 */
5610 #if !defined(SWIG) && !defined(_MSC_VER)
5611  __attribute__((packed))
5612 #endif
5613  ;
5614 #ifdef _MSC_VER
5615 # pragma pack ()
5616 #endif
5617 
5619  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5621 
5623  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5625 
5629  void *encode(ByteOrder::Endianness sex,
5631  void *encode(ByteOrder::Endianness sex,
5637 
5639  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5640 
5641  // Use Rose::stringify... function instead.
5642  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5643  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5644 
5645  private:
5646  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5647  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5648 #endif // SgAsmElfSectionTableEntry_OTHERS
5649 
5650 #ifdef DOCUMENTATION
5651  };
5652 #endif
5653 
5654 
5655 
5657 
5658  /*************************************************************************************************************************
5659  * ELF Segment Tables
5660  *************************************************************************************************************************/
5661 
5663 
5664  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5665  IS_SERIALIZABLE(AsmElfSegmentTable);
5666 
5667 #ifdef DOCUMENTATION
5668 
5675  public:
5676 #endif
5677 
5678  DECLARE_OTHERS(AsmElfSegmentTable);
5679 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5680 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5681  private:
5682  friend class boost::serialization::access;
5683 
5684  template<class S>
5685  void serialize(S &s, const unsigned /*version*/) {
5686  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5687  }
5688 #endif
5689 
5690  public:
5693  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5694  ctor();
5695  }
5696 
5701  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5702 
5717 
5721  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5722 
5724  virtual bool reallocate() $ROSE_OVERRIDE;
5725 
5727  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5728 
5730  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5731 
5732  private:
5733  void ctor();
5734 #endif // SgAsmElfSegmentTable_OTHERS
5735 
5736 #ifdef DOCUMENTATION
5737  };
5738 #endif
5739 
5741 
5742  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5743  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5744 
5745 #ifdef DOCUMENTATION
5747  public:
5748 #endif
5749 
5750 #ifdef DOCUMENTATION
5751 
5757  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5758  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5760 #else
5761  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5762  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5763  NO_DELETE);
5764 #endif
5765 
5766  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5767 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5768 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5769  private:
5770  friend class boost::serialization::access;
5771 
5772  template<class S>
5773  void serialize(S &s, const unsigned /*version*/) {
5774  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5775  }
5776 #endif
5777 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5778 
5779 #ifdef DOCUMENTATION
5780  };
5781 #endif
5782 
5783 
5785 
5786  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5787  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5788 
5789 #ifdef DOCUMENTATION
5790 
5792  public:
5793 #endif
5794 
5795 #ifdef DOCUMENTATION
5796 
5801  size_t get_index() const;
5802  void set_index(size_t);
5804 #else
5805  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5806  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5807 #endif
5808 
5809 #ifdef DOCUMENTATION
5810 
5813  SegmentType get_type() const;
5814  void set_type(SegmentType);
5816 #else
5817  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5818  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5819  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5820 #endif
5821 
5822 #ifdef DOCUMENTATION
5823 
5826  SegmentFlags get_flags() const;
5827  void set_flags(SegmentFlags);
5829 #else
5830  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5831  "= SgAsmElfSegmentTableEntry::PF_NONE",
5832  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5833 #endif
5834 
5835 #ifdef DOCUMENTATION
5836 
5841  rose_addr_t get_offset() const;
5842  void set_offset(rose_addr_t);
5844 #else
5845  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5846  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5847 #endif
5848 
5849 #ifdef DOCUMENTATION
5850 
5856  rose_addr_t get_vaddr() const;
5857  void set_vaddr(rose_addr_t);
5859 #else
5860  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5861  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5862 #endif
5863 
5864 #ifdef DOCUMENTATION
5865 
5870  rose_addr_t get_paddr() const;
5871  void set_paddr(rose_addr_t);
5873 #else
5874  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5875  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5876 #endif
5877 
5878 #ifdef DOCUMENTATION
5879 
5884  rose_addr_t get_filesz() const;
5885  void set_filesz(rose_addr_t);
5887 #else
5888  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5889  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5890 #endif
5891 
5892 #ifdef DOCUMENTATION
5893 
5898  rose_addr_t get_memsz() const;
5899  void set_memsz(rose_addr_t);
5901 #else
5902  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5903  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5904 #endif
5905 
5906 #ifdef DOCUMENTATION
5907 
5912  rose_addr_t get_align() const;
5913  void set_align(rose_addr_t);
5915 #else
5916  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5917  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5918 #endif
5919 
5920 #ifdef DOCUMENTATION
5921 
5926  const SgUnsignedCharList& get_extra() const;
5927  void set_extra(const SgUnsignedCharList&);
5929 #else
5930  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5931  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5932 #endif
5933 
5934  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5935 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
5936 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5937  private:
5938  friend class boost::serialization::access;
5939 
5940  template<class S>
5941  void serialize(S &s, const unsigned /*version*/) {
5942  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5943  s & BOOST_SERIALIZATION_NVP(p_index);
5944  s & BOOST_SERIALIZATION_NVP(p_type);
5945  s & BOOST_SERIALIZATION_NVP(p_flags);
5946  s & BOOST_SERIALIZATION_NVP(p_offset);
5947  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5948  s & BOOST_SERIALIZATION_NVP(p_paddr);
5949  s & BOOST_SERIALIZATION_NVP(p_filesz);
5950  s & BOOST_SERIALIZATION_NVP(p_memsz);
5951  s & BOOST_SERIALIZATION_NVP(p_align);
5952  s & BOOST_SERIALIZATION_NVP(p_extra);
5953  }
5954 #endif
5955 
5956  public:
5959  PT_NULL = 0,
5960  PT_LOAD = 1,
5963  PT_NOTE = 4,
5964  PT_SHLIB = 5,
5965  PT_PHDR = 6,
5966  PT_TLS = 7,
5968  // OS- and Processor-specific ranges
5969  PT_LOOS = 0x60000000,
5970  PT_HIOS = 0x6fffffff,
5971  PT_LOPROC = 0x70000000,
5972  PT_HIPROC = 0x7fffffff,
5973 
5974  // OS-specific values for GNU/Linux
5975  PT_GNU_EH_FRAME = 0x6474e550,
5976  PT_GNU_STACK = 0x6474e551,
5977  PT_GNU_RELRO = 0x6474e552,
5978  PT_PAX_FLAGS = 0x65041580,
5980  // OS-specific values for Sun
5981  PT_SUNWBSS = 0x6ffffffa,
5982  PT_SUNWSTACK = 0x6ffffffb
5983  };
5984 
5987  PF_NONE = 0,
5988  PF_RESERVED = 0x000ffff8,
5989  PF_XPERM = 0x00000001,
5990  PF_WPERM = 0x00000002,
5991  PF_RPERM = 0x00000004,
5992  PF_OS_MASK = 0x0ff00000,
5993  PF_PROC_MASK = 0xf0000000
5994  };
5995 
5996 #ifdef _MSC_VER
5997 # pragma pack (1)
5998 #endif
5999 
6007  uint32_t p_type;
6008  uint32_t p_offset;
6009  uint32_t p_vaddr;
6010  uint32_t p_paddr;
6011  uint32_t p_filesz;
6012  uint32_t p_memsz;
6013  uint32_t p_flags;
6014  uint32_t p_align;
6015  } /* 0x30 */
6016 #if !defined(SWIG) && !defined(_MSC_VER)
6017  __attribute__((packed))
6018 #endif
6019  ;
6020 
6022  uint32_t p_type; /* 0x00 */
6023  uint32_t p_flags; /* 0x04 */
6024  uint64_t p_offset; /* 0x08 */
6025  uint64_t p_vaddr; /* 0x10 */
6026  uint64_t p_paddr; /* 0x18 */
6027  uint64_t p_filesz; /* 0x20 */
6028  uint64_t p_memsz; /* 0x28 */
6029  uint64_t p_align; /* 0x30 */
6030  } /* 0x38 */
6031 #if !defined(SWIG) && !defined(_MSC_VER)
6032  __attribute__((packed))
6033 #endif
6034  ;
6035 #ifdef _MSC_VER
6036 # pragma pack ()
6037 #endif
6038 
6040  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6042 
6044  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6046 
6050  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
6051  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
6056 
6058  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
6059 
6062 
6065 
6066  private:
6067  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
6068  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
6069 #endif // SgAsmElfSegmentTableEntry_OTHERS
6070 
6071 #ifdef DOCUMENTATION
6072  };
6073 #endif
6074 
6075 
6076 
6078 
6079  /*************************************************************************************************************************
6080  * ELF Symbol Tables
6081  *************************************************************************************************************************/
6082 
6084 
6085  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
6086  IS_SERIALIZABLE(AsmElfSymbolSection);
6087 
6088 #ifdef DOCUMENTATION
6089 
6091  public:
6092 #endif
6093 
6094 #ifdef DOCUMENTATION
6095 
6098  bool get_is_dynamic() const;
6099  void set_is_dynamic(bool);
6101 #else
6102  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
6103  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6104 #endif
6105 
6106 #ifdef DOCUMENTATION
6107 
6116 #else
6117  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
6118  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6119 #endif
6120 
6121  DECLARE_OTHERS(AsmElfSymbolSection);
6122 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
6123 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6124  private:
6125  friend class boost::serialization::access;
6126 
6127  template<class S>
6128  void serialize(S &s, const unsigned /*version*/) {
6129  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6130  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
6131  s & BOOST_SERIALIZATION_NVP(p_symbols);
6132  }
6133 #endif
6134 
6135  public:
6138  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
6139  ctor(strsec);
6140  }
6141 
6143  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
6144 
6157  virtual void finish_parsing() $ROSE_OVERRIDE;
6158 
6160  size_t index_of(SgAsmElfSymbol*);
6161 
6166  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6167 
6171  virtual bool reallocate() $ROSE_OVERRIDE;
6172 
6174  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6175 
6177  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6178 
6179  private:
6180  void ctor(SgAsmElfStringSection*);
6181 #endif // SgAsmElfSymbolSection_OTHERS
6182 
6183 #ifdef DOCUMENTATION
6184  };
6185 #endif
6186 
6188 
6189  DECLARE_LEAF_CLASS(AsmElfSymbolList);
6190  IS_SERIALIZABLE(AsmElfSymbolList);
6191 
6192 #ifdef DOCUMENTATION
6194  public:
6195 #endif
6196 
6197 #ifdef DOCUMENTATION
6198 
6204  const SgAsmElfSymbolPtrList& get_symbols() const;
6205  void set_symbols(const SgAsmElfSymbolPtrList&);
6207 #else
6208  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
6209  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6210 #endif
6211 
6212  DECLARE_OTHERS(AsmElfSymbolList);
6213 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
6214 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6215  private:
6216  friend class boost::serialization::access;
6217 
6218  template<class S>
6219  void serialize(S &s, const unsigned /*version*/) {
6220  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6221  s & BOOST_SERIALIZATION_NVP(p_symbols);
6222  }
6223 #endif
6224 #endif // SgAsmElfSymbolList_OTHERS
6225 
6226 #ifdef DOCUMENTATION
6227  };
6228 #endif
6229 
6231 
6232  DECLARE_LEAF_CLASS(AsmElfSymbol);
6233  IS_SERIALIZABLE(AsmElfSymbol);
6234 
6235 #ifdef DOCUMENTATION
6236 
6241  public:
6242 #endif
6243 
6244 #ifdef DOCUMENTATION
6245 
6250  unsigned char get_st_info() const;
6251  void set_st_info(unsigned char);
6253 #else
6254  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
6255  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6256 #endif
6257 
6258 #ifdef DOCUMENTATION
6259 
6264  unsigned char get_st_res1() const;
6265  void set_st_res1(unsigned char);
6267 #else
6268  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
6269  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6270 #endif
6271 
6272 #ifdef DOCUMENTATION
6273 
6278  unsigned get_st_shndx() const;
6279  void set_st_shndx(unsigned);
6281 #else
6282  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
6283  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6284 #endif
6285 
6286 #ifdef DOCUMENTATION
6287 
6292  rose_addr_t get_st_size() const;
6293  void set_st_size(rose_addr_t);
6295 #else
6296  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
6297  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6298 #endif
6299 
6300 #ifdef DOCUMENTATION
6301 
6306  const SgUnsignedCharList& get_extra() const;
6307  void set_extra(const SgUnsignedCharList&);
6309 #else
6310  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
6311  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6312 #endif
6313 
6314  DECLARE_OTHERS(AsmElfSymbol);
6315 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
6316 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6317  private:
6318  friend class boost::serialization::access;
6319 
6320  template<class S>
6321  void serialize(S &s, const unsigned /*version*/) {
6322  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
6323  s & BOOST_SERIALIZATION_NVP(p_st_info);
6324  s & BOOST_SERIALIZATION_NVP(p_st_res1);
6325  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
6326  s & BOOST_SERIALIZATION_NVP(p_st_size);
6327  s & BOOST_SERIALIZATION_NVP(p_extra);
6328  }
6329 #endif
6330 
6331  public:
6332  enum ElfSymBinding {
6333  STB_LOCAL=0,
6334  STB_GLOBAL=1,
6335  STB_WEAK=2
6336  };
6337 
6338  enum ElfSymType {
6341  STT_FUNC = 2,
6343  STT_FILE = 4,
6345  STT_TLS = 6,
6347  };
6348 
6349 #ifdef _MSC_VER
6350 # pragma pack (1)
6351 #endif
6352 
6355  uint32_t st_name;
6356  uint32_t st_value;
6357  uint32_t st_size;
6358  unsigned char st_info;
6359  unsigned char st_res1;
6360  uint16_t st_shndx;
6361  }
6362 #if !defined(SWIG) && !defined(_MSC_VER)
6363  __attribute__((packed))
6364 #endif
6365  ;
6366 
6368  uint32_t st_name;
6369  unsigned char st_info;
6370  unsigned char st_res1;
6371  uint16_t st_shndx;
6372  uint64_t st_value;
6373  uint64_t st_size;
6374  }
6375 #if !defined(SWIG) && !defined(_MSC_VER)
6376  __attribute__((packed))
6377 #endif
6378  ;
6379 
6380 #ifdef _MSC_VER
6381 # pragma pack ()
6382 #endif
6383 
6385  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
6386 
6390  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
6391 
6395  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
6396 
6400  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
6401  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
6409  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6410  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
6414  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
6415 
6418 
6420  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
6421 
6423  static std::string to_string(SgAsmElfSymbol::ElfSymType);
6424 
6425  private:
6426  void ctor(SgAsmElfSymbolSection*);
6427  void parse_common(); // initialization common to all parse() methods
6428 #endif // SgAsmElfSymbol_OTHERS
6429 
6430 #ifdef DOCUMENTATION
6431  };
6432 #endif
6433 
6434 
6435 
6437 
6438  /*************************************************************************************************************************
6439  * ELF Symbol Version Tables
6440  *************************************************************************************************************************/
6441 
6443 
6444  DECLARE_LEAF_CLASS(AsmElfSymverSection);
6445  IS_SERIALIZABLE(AsmElfSymverSection);
6446 
6447 #ifdef DOCUMENTATION
6448 
6453  public:
6454 #endif
6455 
6456 #ifdef DOCUMENTATION
6457 
6466 #else
6467  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
6468  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6469 #endif
6470 
6471  DECLARE_OTHERS(AsmElfSymverSection);
6472 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
6473 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6474  private:
6475  friend class boost::serialization::access;
6476 
6477  template<class S>
6478  void serialize(S &s, const unsigned /*version*/) {
6479  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6480  s & BOOST_SERIALIZATION_NVP(p_entries);
6481  }
6482 #endif
6483 
6484  public:
6487  : SgAsmElfSection(fhdr) {
6488  ctor();
6489  }
6490 
6492  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
6493 
6498  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6499 
6501  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6502 
6504  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6505  private:
6506  void ctor();
6507 #endif // SgAsmElfSymverSection_OTHERS
6508 
6509 #ifdef DOCUMENTATION
6510  };
6511 #endif
6512 
6514 
6515  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6516  IS_SERIALIZABLE(AsmElfSymverEntry);
6517 
6518 #ifdef DOCUMENTATION
6519 
6521  public:
6522 #endif
6523 
6524 #ifdef DOCUMENTATION
6525 
6530  size_t get_value() const;
6531  void set_value(size_t);
6533 #else
6534  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6535  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6536 #endif
6537 
6538  DECLARE_OTHERS(AsmElfSymverEntry);
6539 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6540 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6541  private:
6542  friend class boost::serialization::access;
6543 
6544  template<class S>
6545  void serialize(S &s, const unsigned /*version*/) {
6546  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6547  s & BOOST_SERIALIZATION_NVP(p_value);
6548  }
6549 #endif
6550 
6551  public:
6554  : p_value(0) {
6555  ctor(symver);
6556  }
6557 
6559  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6560 
6561  private:
6562  void ctor(SgAsmElfSymverSection*);
6563 #endif // SgAsmElfSymverEntry_OTHERS
6564 
6565 #ifdef DOCUMENTATION
6566  };
6567 #endif
6568 
6570 
6571 
6572  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6573  IS_SERIALIZABLE(AsmElfSymverEntryList);
6574 
6575 #ifdef DOCUMENTATION
6576 
6581  public:
6582 #endif
6583 
6584 #ifdef DOCUMENTATION
6585 
6588  const SgAsmElfSymverEntryPtrList& get_entries() const;
6589  void set_entries(const SgAsmElfSymverEntryPtrList&);
6591 #else
6592  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6593  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6594  NO_DELETE);
6595 #endif
6596 
6597  DECLARE_OTHERS(AsmElfSymverEntryList);
6598 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6599 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6600  private:
6601  friend class boost::serialization::access;
6602 
6603  template<class S>
6604  void serialize(S &s, const unsigned /*version*/) {
6605  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6606  s & BOOST_SERIALIZATION_NVP(p_entries);
6607  }
6608 #endif
6609 #endif // SgAsmElfSymverEntryList_OTHERS
6610 
6611 #ifdef DOCUMENTATION
6612  };
6613 #endif
6614 
6616 
6617  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6618  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6619 
6620 #ifdef DOCUMENTATION
6621 
6627  public:
6628 #endif
6629 
6630 #ifdef DOCUMENTATION
6631 
6640 #else
6641  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6642  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6643  NO_DELETE);
6644 #endif
6645 
6646  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6647 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6648 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6649  private:
6650  friend class boost::serialization::access;
6651 
6652  template<class S>
6653  void serialize(S &s, const unsigned /*version*/) {
6654  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6655  s & BOOST_SERIALIZATION_NVP(p_entries);
6656  }
6657 #endif
6658 
6659  public:
6662  : SgAsmElfSection(fhdr) {
6663  ctor(strsec);
6664  }
6665 
6734  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6735 
6738  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6739 
6743  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6744 
6746  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6747 
6748  private:
6749  void ctor(SgAsmElfStringSection*);
6750 #endif // SgAsmElfSymverDefinedSection_OTHERS
6751 
6752 #ifdef DOCUMENTATION
6753  };
6754 #endif
6755 
6757 
6758  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6759  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6760 
6761 #ifdef DOCUMENTATION
6762 
6767  public:
6768 #endif
6769 
6770 #ifdef DOCUMENTATION
6771 
6774  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6775  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6777 #else
6778  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6779  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6780  NO_DELETE);
6781 #endif
6782 
6783  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6784 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6785 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6786  private:
6787  friend class boost::serialization::access;
6788 
6789  template<class S>
6790  void serialize(S &s, const unsigned /*version*/) {
6791  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6792  s & BOOST_SERIALIZATION_NVP(p_entries);
6793  }
6794 #endif
6795 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6796 
6797 #ifdef DOCUMENTATION
6798  };
6799 #endif
6800 
6802 
6803  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6804  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6805 
6806 #ifdef DOCUMENTATION
6807 
6809  public:
6810 #endif
6811 
6812 #ifdef DOCUMENTATION
6813 
6818  size_t get_version() const;
6819  void set_version(size_t);
6821 #else
6822  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6823  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6824 #endif
6825 
6826 #ifdef DOCUMENTATION
6827 
6832  int get_flags() const;
6833  void set_flags(int);
6835 #else
6836  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6837  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6838 #endif
6839 
6840 #ifdef DOCUMENTATION
6841 
6846  size_t get_index() const;
6847  void set_index(size_t);
6849 #else
6850  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6851  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6852 #endif
6853 
6854 #ifdef DOCUMENTATION
6855 
6860  uint32_t get_hash() const;
6861  void set_hash(uint32_t);
6863 #else
6864  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6865  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6866 #endif
6867 
6868 #ifdef DOCUMENTATION
6869 
6878 #else
6879  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6880  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6881 #endif
6882 
6883  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6884 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6885 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6886  private:
6887  friend class boost::serialization::access;
6888 
6889  template<class S>
6890  void serialize(S &s, const unsigned /*version*/) {
6891  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6892  s & BOOST_SERIALIZATION_NVP(p_version);
6893  s & BOOST_SERIALIZATION_NVP(p_flags);
6894  s & BOOST_SERIALIZATION_NVP(p_index);
6895  s & BOOST_SERIALIZATION_NVP(p_hash);
6896  s & BOOST_SERIALIZATION_NVP(p_entries);
6897  }
6898 #endif
6899 
6900  public:
6901 #ifdef _MSC_VER
6902 # pragma pack (1)
6903 #endif
6904 
6906  uint16_t vd_version;
6907  uint16_t vd_flags;
6908  uint16_t vd_ndx;
6909  uint16_t vd_cnt;
6910  uint32_t vd_hash;
6911  uint32_t vd_aux;
6912  uint32_t vd_next;
6913  }
6914 #if !defined(SWIG) && !defined(_MSC_VER)
6915  __attribute__((packed))
6916 #endif
6917  ;
6918 
6919 #ifdef _MSC_VER
6920 # pragma pack ()
6921 #endif
6922 
6925  ctor(symver_defined);
6926  }
6927 
6929  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6930 
6932  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6933 
6935  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6936 
6937  private:
6938  void ctor(SgAsmElfSymverDefinedSection*);
6939 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6940 
6941 #ifdef DOCUMENTATION
6942  };
6943 #endif
6944 
6946 
6947  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6948  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6949 
6950 #ifdef DOCUMENTATION
6951 
6956  pbulic:
6957 #endif
6958 
6959 #ifdef DOCUMENTATION
6960 
6963  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6964  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6966 #else
6967  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6968  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6969  NO_DELETE);
6970 #endif
6971 
6972  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6973 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6974 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6975  private:
6976  friend class boost::serialization::access;
6977 
6978  template<class S>
6979  void serialize(S &s, const unsigned /*version*/) {
6980  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6981  s & BOOST_SERIALIZATION_NVP(p_entries);
6982  }
6983 #endif
6984 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6985 
6986 #ifdef DOCUMENTATION
6987  };
6988 #endif
6989 
6991 
6992  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
6993  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
6994 
6995 #ifdef DOCUMENTATION
6997  public:
6998 #endif
6999 
7000 #ifdef DOCUMENTATION
7001 
7004  SgAsmGenericString* get_name() const;
7007 #else
7008  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7009  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7010 #endif
7011 
7012  DECLARE_OTHERS(AsmElfSymverDefinedAux);
7013 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
7014 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7015  private:
7016  friend class boost::serialization::access;
7017 
7018  template<class S>
7019  void serialize(S &s, const unsigned /*version*/) {
7020  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7021  s & BOOST_SERIALIZATION_NVP(p_name);
7022  }
7023 #endif
7024 
7025  public:
7026 #ifdef _MSC_VER
7027 # pragma pack (1)
7028 #endif
7029 
7032  uint32_t vda_name;
7033  uint32_t vda_next;
7034  }
7035 #if !defined(SWIG) && !defined(_MSC_VER)
7036  __attribute__((packed))
7037 #endif
7038  ;
7039 
7040 #ifdef _MSC_VER
7041 # pragma pack ()
7042 #endif
7043 
7048  SgAsmElfSymverDefinedSection *symver_def_sec)
7049  : p_name(NULL) {
7050  ctor(symver_def_entry,symver_def_sec);
7051  }
7052 
7054  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
7055 
7057  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
7058 
7064  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7065 
7066  private:
7067  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
7068 #endif // SgAsmElfSymverDefinedAux_OTHERS
7069 
7070 #ifdef DOCUMENTATION
7071  };
7072 #endif
7073 
7075 
7076  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
7077  IS_SERIALIZABLE(AsmElfSymverNeededSection);
7078 
7079 #ifdef DOCUMENTATION
7080 
7086  public:
7087 #endif
7088 
7089 #ifdef DOCUMENTATION
7090 
7099 #else
7100  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
7101  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7102 #endif
7103 
7104  DECLARE_OTHERS(AsmElfSymverNeededSection);
7105 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
7106 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7107  private:
7108  friend class boost::serialization::access;
7109 
7110  template<class S>
7111  void serialize(S &s, const unsigned /*version*/) {
7112  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7113  s & BOOST_SERIALIZATION_NVP(p_entries);
7114  }
7115 #endif
7116 
7117  public:
7122  : SgAsmElfSection(fhdr) {
7123  ctor(strsec);
7124  }
7125 
7135  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
7136 
7141  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
7142 
7146  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7147 
7149  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7150 
7151  private:
7152  void ctor(SgAsmElfStringSection*);
7153 #endif // SgAsmElfSymverNeededSection_OTHERS
7154 
7155 #ifdef DOCUMENTATION
7156  };
7157 #endif
7158 
7160 
7161  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
7162  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
7163 
7164 #ifdef DOCUMENTATION
7165 
7170  public:
7171 #endif
7172 
7173 #ifdef DOCUMENTATION
7174 
7177  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
7178  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
7180 #else
7181  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
7182  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7183  NO_DELETE);
7184 #endif
7185 
7186  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
7187 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
7188 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7189  private:
7190  friend class boost::serialization::access;
7191 
7192  template<class S>
7193  void serialize(S &s, const unsigned /*version*/) {
7194  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7195  s & BOOST_SERIALIZATION_NVP(p_entries);
7196  }
7197 #endif
7198 #endif // SgAsmElfSymverNeededEntryList_OTHERS
7199 
7200 #ifdef DOCUMENTATION
7201  };
7202 #endif
7203 
7205 
7206  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
7207  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
7208 
7209 #ifdef DOCUMENTATION
7210 
7212  public:
7213 #endif
7214 
7215 #ifdef DOCUMENTATION
7216 
7221  size_t get_version() const;
7222  void set_version(size_t);
7224 #else
7225  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
7226  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7227 #endif
7228 
7229 #ifdef DOCUMENTATION
7230 
7236 #else
7237  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
7238  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7239 #endif
7240 
7241 #ifdef DOCUMENTATION
7242 
7251 #else
7252  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
7253  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7254 #endif
7255 
7256  DECLARE_OTHERS(AsmElfSymverNeededEntry);
7257 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
7258 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7259  private:
7260  friend class boost::serialization::access;
7261 
7262  template<class S>
7263  void serialize(S &s, const unsigned /*version*/) {
7264  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7265  s & BOOST_SERIALIZATION_NVP(p_version);
7266  s & BOOST_SERIALIZATION_NVP(p_file_name);
7267  s & BOOST_SERIALIZATION_NVP(p_entries);
7268  }
7269 #endif
7270 
7271  public:
7272 #ifdef _MSC_VER
7273 # pragma pack (1)
7274 #endif
7275 
7278  uint16_t vn_version;
7279  uint16_t vn_cnt;
7280  uint32_t vn_file;
7281  uint32_t vn_aux;
7282  uint32_t vn_next;
7283  }
7284 #if !defined(SWIG) && !defined(_MSC_VER)
7285  __attribute__((packed))
7286 #endif
7287  ;
7288 
7289 #ifdef _MSC_VER
7290 # pragma pack ()
7291 #endif
7292 
7295  : p_file_name(NULL) {
7296  ctor(symver_needed);
7297  }
7298 
7300  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
7301 
7303  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
7304 
7306  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7307 
7308  private:
7309  void ctor(SgAsmElfSymverNeededSection*);
7310 #endif // SgAsmElfSymverNeededEntry_OTHERS
7311 
7312 #ifdef DOCUMENTATION
7313  };
7314 #endif
7315 
7317 
7318  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
7319  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
7320 
7321 #ifdef DOCUMENTATION
7322 
7327  public:
7328 #endif
7329 
7330 #ifdef DOCUMENTATION
7331 
7334  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
7335  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
7337 #else
7338  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
7339  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7340  NO_DELETE);
7341 #endif
7342 
7343  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
7344 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
7345 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7346  private:
7347  friend class boost::serialization::access;
7348 
7349  template<class S>
7350  void serialize(S &s, const unsigned /*version*/) {
7351  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7352  s & BOOST_SERIALIZATION_NVP(p_entries);
7353  }
7354 #endif
7355 #endif // SgAsmElfSymverNeededAuxList_OTHERS
7356 
7357 #ifdef DOCUMENTATION
7358  };
7359 #endif
7360 
7362 
7363  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
7364  IS_SERIALIZABLE(AsmElfSymverNeededAux);
7365 
7366 #ifdef DOCUMENTATION
7367 
7369  public:
7370 #endif
7371 
7372 #ifdef DOCUMENTATION
7373 
7378  uint32_t get_hash() const;
7379  void set_hash(uint32_t);
7381 #else
7382  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
7383  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7384 #endif
7385 
7386 #ifdef DOCUMENTATION
7387 
7392  int get_flags() const;
7393  void set_flags(int);
7395 #else
7396  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
7397  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7398 #endif
7399 
7400 #ifdef DOCUMENTATION
7401 
7406  size_t get_other() const;
7407  void set_other(size_t);
7409 #else
7410  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
7411  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7412 #endif
7413 
7414 #ifdef DOCUMENTATION
7415 
7418  SgAsmGenericString* get_name() const;
7421 #else
7422  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7423  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7424 #endif
7425 
7426  DECLARE_OTHERS(AsmElfSymverNeededAux);
7427 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
7428 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7429  private:
7430  friend class boost::serialization::access;
7431 
7432  template<class S>
7433  void serialize(S &s, const unsigned /*version*/) {
7434  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7435  s & BOOST_SERIALIZATION_NVP(p_hash);
7436  s & BOOST_SERIALIZATION_NVP(p_flags);
7437  s & BOOST_SERIALIZATION_NVP(p_other);
7438  s & BOOST_SERIALIZATION_NVP(p_name);
7439  }
7440 #endif
7441 
7442  public:
7443 #ifdef _MSC_VER
7444 # pragma pack (1)
7445 #endif
7446 
7449  uint32_t vna_hash;
7450  uint16_t vna_flags;
7451  uint16_t vna_other;
7452  uint32_t vna_name;
7453  uint32_t vna_next;
7454  }
7455 #if !defined(SWIG) && !defined(_MSC_VER)
7456  __attribute__((packed))
7457 #endif
7458  ;
7459 
7460 #ifdef _MSC_VER
7461 # pragma pack ()
7462 #endif
7463 
7469  : p_name(NULL) {
7470  ctor(symver_needed_entry,symver_needed_sec);
7471  }
7472 
7474  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
7475 
7477  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
7478 
7484  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7485 
7486  private:
7488 #endif // SgAsmElfSymverNeededAux_OTHERS
7489 
7490 #ifdef DOCUMENTATION
7491  };
7492 #endif
7493 
7494 
7495 
7496 
7498 
7499  /*************************************************************************************************************************
7500  * ELF Relocation Tables
7501  *************************************************************************************************************************/
7502 
7504 
7505  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7506  IS_SERIALIZABLE(AsmElfRelocSection);
7507 
7508 #ifdef DOCUMENTATION
7509 
7511  public:
7512 #endif
7513 
7514 #ifdef DOCUMENTATION
7515 
7518  bool get_uses_addend() const;
7519  void set_uses_addend(bool);
7521 #else
7522  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7523  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7524 #endif
7525 
7526 #ifdef DOCUMENTATION
7527 
7533 #else
7534  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7535  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7536 #endif
7537 
7538 #ifdef DOCUMENTATION
7539 
7547 #else
7548  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7549  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7550 #endif
7551 
7552  DECLARE_OTHERS(AsmElfRelocSection);
7553 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7554 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7555  private:
7556  friend class boost::serialization::access;
7557 
7558  template<class S>
7559  void serialize(S &s, const unsigned /*version*/) {
7560  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7561  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7562  s & BOOST_SERIALIZATION_NVP(p_target_section);
7563  s & BOOST_SERIALIZATION_NVP(p_entries);
7564  }
7565 #endif
7566 
7567  public:
7569  : SgAsmElfSection(fhdr) {
7570  ctor(symsec,targetsec);
7571  }
7572 
7575  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7576 
7578  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7579 
7581  virtual bool reallocate() $ROSE_OVERRIDE;
7582 
7584  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7585 
7587  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7588 
7589  private:
7591 #endif // SgAsmElfRelocSection_OTHERS
7592 
7593 #ifdef DOCUMENTATION
7594  };
7595 #endif
7596 
7598 
7599  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7600  IS_SERIALIZABLE(AsmElfRelocEntryList);
7601 
7602 #ifdef DOCUMENTATION
7603 
7608  public:
7609 #endif
7610 
7611 #ifdef DOCUMENTATION
7612 
7615  const SgAsmElfRelocEntryPtrList& get_entries() const;
7616  void set_entries(const SgAsmElfRelocEntryPtrList&);
7618 #else
7619  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7620  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7621  NO_DELETE);
7622 #endif
7623 
7624  DECLARE_OTHERS(AsmElfRelocEntryList);
7625 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7626 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7627  private:
7628  friend class boost::serialization::access;
7629 
7630  template<class S>
7631  void serialize(S &s, const unsigned /*version*/) {
7632  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7633  s & BOOST_SERIALIZATION_NVP(p_entries);
7634  }
7635 #endif
7636 #endif // SgAsmElfRelocEntryList_OTHERS
7637 
7638 #ifdef DOCUMENTATION
7639  };
7640 #endif
7641 
7643 
7644  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7645  IS_SERIALIZABLE(AsmElfRelocEntry);
7646 
7647 #ifdef DOCUMENTATION
7648 
7650  public:
7651 #endif
7652 
7653 #ifdef DOCUMENTATION
7654 
7659  rose_addr_t get_r_offset() const;
7660  void set_r_offset(rose_addr_t);
7662 #else
7663  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7664  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7665 #endif
7666 
7667 #ifdef DOCUMENTATION
7668 
7673  rose_addr_t get_r_addend() const;
7674  void set_r_addend(rose_addr_t);
7676 #else
7677  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7678  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7679 #endif
7680 
7681 #ifdef DOCUMENTATION
7682 
7687  unsigned long get_sym() const;
7688  void set_sym(unsigned long);
7690 #else
7691  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7692  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7693 #endif
7694 
7695 #ifdef DOCUMENTATION
7696 
7701  RelocType get_type() const;
7702  void set_type(RelocType);
7704 #else
7705  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7706  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7707 #endif
7708 
7709 #ifdef DOCUMENTATION
7710 
7713  const SgUnsignedCharList& get_extra() const;
7714  void set_extra(const SgUnsignedCharList&);
7716 #else
7717  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7718  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7719 #endif
7720 
7721  DECLARE_OTHERS(AsmElfRelocEntry);
7722 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7723 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7724  private:
7725  friend class boost::serialization::access;
7726 
7727  template<class S>
7728  void serialize(S &s, const unsigned /*version*/) {
7729  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7730  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7731  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7732  s & BOOST_SERIALIZATION_NVP(p_sym);
7733  s & BOOST_SERIALIZATION_NVP(p_type);
7734  s & BOOST_SERIALIZATION_NVP(p_extra);
7735  }
7736 #endif
7737 
7738  public:
7741  // Intel 80386 specific definitions.
7753  R_386_32PLT =11,
7760  R_386_16 =20,
7761  R_386_PC16 =21,
7762  R_386_8 =22,
7763  R_386_PC8 =23,
7779  // First Entry for X86-64
7794  R_X86_64_8 =114,
7804  };
7805 
7806 #ifdef _MSC_VER
7807 # pragma pack (1)
7808 #endif
7809 
7811  uint32_t r_offset;
7812  uint32_t r_info;
7813  uint32_t r_addend;
7814  }
7815 #if !defined(SWIG) && !defined(_MSC_VER)
7816  __attribute__((packed))
7817 #endif
7818  ;
7819 
7821  uint64_t r_offset;
7822  uint64_t r_info;
7823  uint64_t r_addend;
7824  }
7825 #if !defined(SWIG) && !defined(_MSC_VER)
7826  __attribute__((packed))
7827 #endif
7828  ;
7829 
7831  uint32_t r_offset;
7832  uint32_t r_info;
7833  }
7834 #if !defined(SWIG) && !defined(_MSC_VER)
7835  __attribute__((packed))
7836 #endif
7837  ;
7838 
7840  uint64_t r_offset;
7841  uint64_t r_info;
7842  }
7843 #if !defined(SWIG) && !defined(_MSC_VER)
7844  __attribute__((packed))
7845 #endif
7846  ;
7847 
7848 #ifdef _MSC_VER
7849 # pragma pack ()
7850 #endif
7851 
7854  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7855  ctor(section);
7856  }
7857 
7861  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7862  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7863  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7864  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7870  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7871  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7872  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7873  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7879  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7880  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7881  dump(f, prefix, idx, NULL);
7882  }
7886  std::string reloc_name() const;
7887 
7888  private:
7889  void ctor(SgAsmElfRelocSection*);
7890 #endif // SgAsmElfRelocEntry_OTHERS
7891 
7892 #ifdef DOCUMENTATION
7893  };
7894 #endif
7895 
7896 
7897 
7899 
7900  /*************************************************************************************************************************
7901  * ELF Dynamic Linking
7902  *************************************************************************************************************************/
7903 
7905 
7906  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7907  IS_SERIALIZABLE(AsmElfDynamicSection);
7908 
7909 #ifdef DOCUMENTATION
7910 
7912  public:
7913 #endif
7914 
7915 #ifdef DOCUMENTATION
7916 
7925 #else
7926  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7927  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7928 #endif
7929 
7930  DECLARE_OTHERS(AsmElfDynamicSection);
7931 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7932 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7933  private:
7934  friend class boost::serialization::access;
7935 
7936  template<class S>
7937  void serialize(S &s, const unsigned /*version*/) {
7938  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7939  s & BOOST_SERIALIZATION_NVP(p_entries);
7940  }
7941 #endif
7942 
7943  public:
7946  : SgAsmElfSection(fhdr) {
7947  ctor(strsec);
7948  }
7949 
7951  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7952 
7954  virtual void finish_parsing() $ROSE_OVERRIDE;
7955 
7958  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7959 
7961  virtual bool reallocate() $ROSE_OVERRIDE;
7962 
7964  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7965 
7967  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7968 
7969  private:
7970  void ctor(SgAsmElfStringSection*);
7971 #endif // SgAsmElfDynamicSection_OTHERS
7972 
7973 #ifdef DOCUMENTATION
7974  };
7975 #endif
7976 
7978 
7979  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7980  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7981 
7982 #ifdef DOCUMENTATION
7983 
7988  public:
7989 #endif
7990 
7991 #ifdef DOCUMENTATION
7992 
7995  const SgAsmElfDynamicEntryPtrList& get_entries() const;
7996  void set_entries(const SgAsmElfDynamicEntryPtrList&);
7998 #else
7999  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
8000  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
8001  NO_DELETE);
8002 #endif
8003 
8004  DECLARE_OTHERS(AsmElfDynamicEntryList);
8005 #if defined(SgAsmElfDynamicEntryList_OTHERS) || defined(DOCUMENTATION)
8006 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8007  private:
8008  friend class boost::serialization::access;
8009 
8010  template<class S>
8011  void serialize(S &s, const unsigned /*version*/) {
8012  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8013  s & BOOST_SERIALIZATION_NVP(p_entries);
8014  }
8015 #endif
8016 #endif // SgAsmElfDynamicEntryList_OTHERS
8017 
8018 #ifdef DOCUMENTATION
8019  };
8020 #endif
8021 
8023 
8024  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
8025  IS_SERIALIZABLE(AsmElfDynamicEntry);
8026 
8027 #ifdef DOCUMENTATION
8028 
8030  public:
8031 #endif
8032 
8033 #ifdef DOCUMENTATION
8034 
8039  EntryType get_d_tag() const;
8040  void set_d_tag(EntryType);
8042 #else
8043  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
8044  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8045 #endif
8046 
8047 #ifdef DOCUMENTATION
8048 
8053  rose_rva_t get_d_val() const;
8054  void set_d_val(rose_rva_t);
8056 #else
8057  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
8058  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8059 #endif
8060 
8061 #ifdef DOCUMENTATION
8062  // declared and documented below
8063 #else
8064  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
8065  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8066 #endif
8067 
8068 #ifdef DOCUMENTATION
8069 
8072  const SgUnsignedCharList& get_extra() const;
8073  void set_extra(const SgUnsignedCharList&);
8075 #else
8076  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
8077  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8078 #endif
8079 
8080  DECLARE_OTHERS(AsmElfDynamicEntry);
8081 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
8082 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8083  private:
8084  friend class boost::serialization::access;
8085 
8086  template<class S>
8087  void serialize(S &s, const unsigned /*version*/) {
8088  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8089  s & BOOST_SERIALIZATION_NVP(p_d_tag);
8090  s & BOOST_SERIALIZATION_NVP(p_d_val);
8091  s & BOOST_SERIALIZATION_NVP(p_name);
8092  s & BOOST_SERIALIZATION_NVP(p_extra);
8093  }
8094 #endif
8095 
8096  public:
8097  enum EntryType { /* Type Executable SharedObj Purpose */
8098  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
8099  DT_NEEDED = 1, /* value optional optional Name of needed library */
8100  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
8101  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
8102  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
8103  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
8104  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
8105  DT_RELA = 7, /* pointer mandatory optional Relocation table */
8106  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
8107  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
8108  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
8109  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
8110  DT_INIT = 12, /* pointer optional optional Initialization function */
8111  DT_FINI = 13, /* pointer optional optional Termination function */
8112  DT_SONAME = 14, /* value ignored optional Name of shared object */
8113  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
8114  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
8115  DT_REL = 17, /* pointer mandatory optional Relocation table */
8116  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
8117  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
8118  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
8119  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
8120  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
8121  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
8122  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
8123  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
8124  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
8125  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
8126  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
8127  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
8128  DT_FLAGS = 30, /* value optional ? Bit flags */
8129  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
8130  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
8131  DT_NUM = 34, /* ? ? ? "number used"? */
8132 
8133  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
8134  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
8135  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
8136  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
8137  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
8138  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
8139  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
8140  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
8141  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
8142  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
8143  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
8144 
8145  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
8146  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
8147  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
8148  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
8149  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
8150  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
8151  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
8152  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
8153  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
8154  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
8155  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
8156 
8157  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
8158  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
8159  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
8160  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
8161  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
8162  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
8163  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
8164  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
8165 
8166  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
8167  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
8168  };
8169 
8170 #ifdef _MSC_VER
8171 # pragma pack (1)
8172 #endif
8173 
8176  uint32_t d_tag;
8177  uint32_t d_val;
8178  }
8179 #if !defined(SWIG) && !defined(_MSC_VER)
8180  __attribute__((packed))
8181 #endif
8182  ;
8183 
8185  uint64_t d_tag;
8186  uint64_t d_val;
8187  }
8188 #if !defined(SWIG) && !defined(_MSC_VER)
8189  __attribute__((packed))
8190 #endif
8191  ;
8192 
8193 #ifdef _MSC_VER
8194 # pragma pack ()
8195 #endif
8196 
8199  : p_d_tag(DT_NULL), p_name(NULL) {
8200  ctor(dynsec);
8201  }
8202 
8206  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);
8207  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*);
8213  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*) const;
8214  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*) const;
8218  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
8219