ROSE  0.10.0.0
binaryInstruction.C
1 #include <rosePublicConfig.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 four separate places, we can now use the macros defined below to put
26  * everything into one place in this file. My goal is to eventually remove the
27  * src/ROSETTA/Grammar/BinaryInstruction.code file and the related docs/testDoxygen/xxx.docs files and to add
28  * 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 SgAsmArmInstruction: 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  DECLARE_LEAF_CLASS(AsmArmInstruction);
175  IS_SERIALIZABLE(AsmArmInstruction);
176 
177  DECLARE_HEADERS(AsmArmInstruction);
178 #if defined(SgAsmArmInstruction_HEADERS) || defined(DOCUMENTATION)
179  #include <InstructionEnumsArm.h>
180 #endif // SgAsmArmInstruction_HEADERS
181 
182 #ifdef DOCUMENTATION
183 
185  public:
186 #endif
187 
188 #ifdef DOCUMENTATION
189 
198 #else
199  AsmArmInstruction.setDataPrototype("Rose::BinaryAnalysis::ArmInstructionKind", "kind",
200  "= Rose::BinaryAnalysis::arm_unknown_instruction",
201  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
202 #endif
203 
204 #ifdef DOCUMENTATION
205 
211 #else
212  AsmArmInstruction.setDataPrototype("Rose::BinaryAnalysis::ArmInstructionCondition", "condition",
213  "= Rose::BinaryAnalysis::arm_cond_unknown",
214  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
215 #endif
216 
217 #ifdef DOCUMENTATION
218 
224 #else
225  AsmArmInstruction.setDataPrototype("int", "positionOfConditionInMnemonic", "= -1",
226  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
227 #endif
228 
229  DECLARE_OTHERS(AsmArmInstruction);
230 #if defined(SgAsmArmInstruction_OTHERS) || defined(DOCUMENTATION)
231 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
232  private:
233  friend class boost::serialization::access;
234 
235  template<class S>
236  void serialize(S &s, const unsigned /*version*/) {
237  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
238  s & BOOST_SERIALIZATION_NVP(p_kind);
239  s & BOOST_SERIALIZATION_NVP(p_condition);
240  s & BOOST_SERIALIZATION_NVP(p_positionOfConditionInMnemonic);
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 std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
249  virtual bool isUnknown() const $ROSE_OVERRIDE;
250  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
251 #endif // SgAsmArmInstruction_OTHERS
252 #ifdef DOCUMENTATION
253  };
254 #endif
255 
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 std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
438  virtual std::set<rose_addr_t> 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 std::set<rose_addr_t> 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 std::set<rose_addr_t> 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 std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
647  virtual std::set<rose_addr_t> 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 | AsmArmInstruction | AsmPowerpcInstruction | AsmMipsInstruction |
662  AsmM68kInstruction,
663  "AsmInstruction", "AsmInstructionTag", true);
664  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
665  IS_SERIALIZABLE(AsmInstruction);
666 
667  DECLARE_HEADERS(AsmInstruction);
668 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
669  #include <MemoryMap.h>
670 #endif // SgAsmInstruction_HEADERS
671 
672 #ifdef DOCUMENTATION
673 
695  public:
696 #endif
697 
698 #ifdef DOCUMENTATION
699 
707  const std::string& get_mnemonic() const;
708  void set_mnemonic(const std::string&);
710 #else
711  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
712  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
713 #endif
714 
715 #ifdef DOCUMENTATION
716 
721  const SgUnsignedList& get_raw_bytes() const;
722  void set_raw_bytes(const SgUnsignedList&);
724 #else
725  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
726  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
727 #endif
728 
729 #ifdef DOCUMENTATION
730 
739 #else
740  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
741  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
742 #endif
743 
744 #ifdef DOCUMENTATION
745  // FIXME[Robb P Matzke 2017-02-13]: unused?
746 #else
747  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
748  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
749 #endif
750 
751 #ifdef DOCUMENTATION
752 
758  int64_t get_stackDeltaIn() const;
759  void set_stackDeltaIn(int64_t);
761 #else
762  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
763  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
764 #endif
765 
766 #ifdef DOCUMENTATION
767  // FIXME[Robb P Matzke 2017-02-13]: unused?
768 #else
769  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
770  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
771 #endif
772 
773  DECLARE_OTHERS(AsmInstruction);
774 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
775 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
776  private:
777  friend class boost::serialization::access;
778 
779  template<class S>
780  void serialize(S &s, const unsigned version) {
781  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
782  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
783  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
784  s & BOOST_SERIALIZATION_NVP(p_operandList);
785  s & BOOST_SERIALIZATION_NVP(p_sources);
786  if (version >= 1)
787  s & BOOST_SERIALIZATION_NVP(semanticFailure_);
788  }
789 #endif
790 
791  private:
792  struct SemanticFailure {
793  size_t n;
794  SemanticFailure(): n(0) {}
795 
796 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
797  private:
798  friend class boost::serialization::access;
799  template<class S>
800  void serialize(S &s, const unsigned /*version*/) {
801  s & BOOST_SERIALIZATION_NVP(n);
802  }
803 #endif
804  };
805  SemanticFailure semanticFailure_;
806 
807  public:
812  static const int64_t INVALID_STACK_DELTA;
813 
819  virtual std::string description() const { return ""; }
820 
821  // FIXME[Robb P Matzke 2017-02-13]: unused?
822  void appendSources( SgAsmInstruction* instruction );
823 
825  size_t nOperands() const;
826 
830  SgAsmExpression* operand(size_t) const;
831 
838  virtual bool terminatesBasicBlock();
839 
853  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
854  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
866  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
867  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
873  bool isFirstInBlock();
874 
878  bool isLastInBlock();
879 
884  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
885 
1020  virtual bool hasEffect();
1021 
1030  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
1031  bool relax_stack_semantics=false);
1032 
1042  virtual std::vector<std::pair<size_t,size_t> >
1043  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
1044  bool relax_stack_semantics=false);
1045 
1052  virtual std::set<rose_addr_t> getSuccessors(bool* complete); /*subclasses must redefine*/
1053 
1062  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1063  bool *complete,
1064  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1066 
1072  virtual size_t get_size() const;
1073 
1079  virtual bool isUnknown() const;
1080 
1114  virtual unsigned get_anyKind() const;
1115 
1119  virtual std::string toString() const;
1120 
1125  virtual std::set<rose_addr_t> explicitConstants() const;
1126 
1136  size_t semanticFailure() const;
1137  void semanticFailure(size_t);
1138  void incrementSemanticFailure();
1141 #endif // SgAsmInstruction_OTHERS
1142 
1143 #ifdef DOCUMENTATION
1144  };
1145 #endif
1146 
1147 
1148 
1150 
1151  /**************************************************************************************************************************
1152  * Instruction Expressions
1153  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1154  **************************************************************************************************************************/
1155 
1157 
1158  DECLARE_LEAF_CLASS(AsmOperandList);
1159  IS_SERIALIZABLE(AsmOperandList);
1160 
1161 #ifdef DOCUMENTATION
1162 
1163  class SgAsmOperandList: public SgAsmNode {
1164  public:
1165 #endif
1166 
1167 #ifdef DOCUMENTATION
1168 
1174  const SgAsmExpressionPtrList& get_operands() const;
1175  void set_oerands(const SgAsmExpressionPtrList&);
1177 #else
1178  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1179  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1180 #endif
1181 
1182  DECLARE_OTHERS(AsmOperandList);
1183 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1184 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1185  private:
1186  friend class boost::serialization::access;
1187 
1188  template<class S>
1189  void serialize(S &s, const unsigned /*version*/) {
1190  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1191  s & BOOST_SERIALIZATION_NVP(p_operands);
1192  }
1193 #endif
1194 
1195  public:
1197  void append_operand(SgAsmExpression* operand);
1198 #endif // SgAsmOperandList_OTHERS
1199 
1200 #ifdef DOCUMENTATION
1201  };
1202 #endif
1203 
1204  // FIXME[Robb P Matzke 2016-10-31]
1205  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1206 
1208 
1209  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1210  IS_SERIALIZABLE(AsmBinaryAdd);
1211 
1212 #ifdef DOCUMENTATION
1213 
1215  public:
1216 #endif
1217 
1218  DECLARE_OTHERS(AsmBinaryAdd);
1219 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1220 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1221  private:
1222  friend class boost::serialization::access;
1223 
1224  template<class S>
1225  void serialize(S &s, const unsigned /*version*/) {
1226  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1227  }
1228 #endif
1229 #endif // SgAsmBinaryAdd_OTHERS
1230 
1231 #ifdef DOCUMENTATION
1232  };
1233 #endif
1234 
1236 
1237  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1238  IS_SERIALIZABLE(AsmBinarySubtract);
1239 
1240 #ifdef DOCUMENTATION
1241 
1243  public:
1244 #endif
1245 
1246  DECLARE_OTHERS(AsmBinarySubtract);
1247 #if defined(SgAsmBinarySubtract_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 // SgAsmBinarySubtract_OTHERS
1258 
1259 #ifdef DOCUMENTATION
1260  };
1261 #endif
1262 
1264 
1265  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1266  IS_SERIALIZABLE(AsmBinaryMultiply);
1267 
1268 #ifdef DOCUMENTATION
1269 
1271  public:
1272 #endif
1273 
1274  DECLARE_OTHERS(AsmBinaryMultiply);
1275 #if defined(SgAsmBinaryMultiply_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 // SgAsmBinaryMultiply_OTHERS
1286 
1287 #ifdef DOCUMENTATION
1288  };
1289 #endif
1290 
1292 
1293  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1294  IS_SERIALIZABLE(AsmBinaryDivide);
1295 
1296 #ifdef DOCUMENTATION
1297 
1299  public:
1300 #endif
1301 
1302  DECLARE_OTHERS(AsmBinaryDivide);
1303 #if defined(SgAsmBinaryDivide_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 // SgAsmBinaryDivide_OTHERS
1314 
1315 #ifdef DOCUMENTATION
1316  };
1317 #endif
1318 
1320 
1321  DECLARE_LEAF_CLASS(AsmBinaryMod);
1322  IS_SERIALIZABLE(AsmBinaryMod);
1323 
1324 #ifdef DOCUMENTATION
1325 
1327  public:
1328 #endif
1329 
1330  DECLARE_OTHERS(AsmBinaryMod);
1331 #if defined(SgAsmBinaryMod_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 // SgAsmBinaryMod_OTHERS
1342 
1343 #ifdef DOCUMENTATION
1344  };
1345 #endif
1346 
1348 
1349  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1350  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1351 
1352 #ifdef DOCUMENTATION
1353 
1355  public:
1356 #endif
1357 
1358  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1359 #if defined(SgAsmBinaryAddPreupdate_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 // SgAsmBinaryAddPreupdate_OTHERS
1370 
1371 #ifdef DOCUMENTATION
1372  };
1373 #endif
1374 
1376 
1377  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1378  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1379 
1380 #ifdef DOCUMENTATION
1381 
1383  public:
1384 #endif
1385 
1386  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1387 #if defined(SgAsmBinarySubtractPreupdate_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 // SgAsmBinarySubtractPreupdate_OTHERS
1398 
1399 #ifdef DOCUMENTATION
1400  };
1401 #endif
1402 
1404 
1405  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1406  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1407 
1408 #ifdef DOCUMENTATION
1409 
1411  public:
1412 #endif
1413 
1414  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1415 #if defined(SgAsmBinaryAddPostupdate_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 // SgAsmBinaryAddPostupdate_OTHERS
1426 
1427 #ifdef DOCUMENTATION
1428  };
1429 #endif
1430 
1432 
1433  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1434  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1435 
1436 #ifdef DOCUMENTATION
1437 
1439  public:
1440 #endif
1441 
1442  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1443 #if defined(SgAsmBinarySubtractPostupdate_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 // SgAsmBinarySubtractPostupdate_OTHERS
1454 
1455 #ifdef DOCUMENTATION
1456  };
1457 #endif
1458 
1460 
1461  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1462  IS_SERIALIZABLE(AsmBinaryLsl);
1463 
1464 #ifdef DOCUMENTATION
1465 
1467  public:
1468 #endif
1469 
1470  DECLARE_OTHERS(AsmBinaryLsl);
1471 #if defined(SgAsmBinaryLsl_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 // SgAsmBinaryLsl_OTHERS
1482 
1483 #ifdef DOCUMENTATION
1484  };
1485 #endif
1486 
1488 
1489  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1490  IS_SERIALIZABLE(AsmBinaryLsr);
1491 
1492 #ifdef DOCUMENTATION
1493 
1495  public:
1496 #endif
1497 
1498  DECLARE_OTHERS(AsmBinaryLsr);
1499 #if defined(SgAsmBinaryLsr_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 // SgAsmBinaryLsr_OTHERS
1510 
1511 #ifdef DOCUMENTATION
1512  };
1513 #endif
1514 
1516 
1517  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1518  IS_SERIALIZABLE(AsmBinaryAsr);
1519 
1520 #ifdef DOCUMENTATION
1521 
1523  public:
1524 #endif
1525 
1526  DECLARE_OTHERS(AsmBinaryAsr);
1527 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1528 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1529  private:
1530  friend class boost::serialization::access;
1531 
1532  template<class S>
1533  void serialize(S &s, const unsigned /*version*/) {
1534  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1535  }
1536 #endif
1537 #endif // SgAsmBinaryAsr_OTHERS
1538 
1539 #ifdef DOCUMENTATION
1540  };
1541 #endif
1542 
1544 
1545  DECLARE_LEAF_CLASS(AsmBinaryRor);
1546  IS_SERIALIZABLE(AsmBinaryRor);
1547 
1548 #ifdef DOCUMENTATION
1549 
1551  public:
1552 #endif
1553 
1554  DECLARE_OTHERS(AsmBinaryRor);
1555 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1556 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1557  private:
1558  friend class boost::serialization::access;
1559 
1560  template<class S>
1561  void serialize(S &s, const unsigned /*version*/) {
1562  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1563  }
1564 #endif
1565 #endif // SgAsmBinaryRor_OTHERS
1566 
1567 #ifdef DOCUMENTATION
1568  };
1569 #endif
1570 
1572 
1573  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1574  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1575  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1576  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1577  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1578  AsmBinaryRor,
1579  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1580  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1581  IS_SERIALIZABLE(AsmBinaryExpression);
1582 
1583 #ifdef DOCUMENTATION
1584 
1586  public:
1587 #endif
1588 
1589 #ifdef DOCUMENTATION
1590 
1593  SgAsmExpression* get_lhs() const;
1594  void set_lhs(SgAsmExpression*);
1596 #else
1597  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1598  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1599 #endif
1600 
1601 #ifdef DOCUMENTATION
1602 
1605  SgAsmExpression* get_rhs() const;
1606  void set_rhs(SgAsmExpression*);
1608 #else
1609  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1610  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1611 #endif
1612 
1613  DECLARE_OTHERS(AsmBinaryExpression);
1614 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1615 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1616  private:
1617  friend class boost::serialization::access;
1618 
1619  template<class S>
1620  void serialize(S &s, const unsigned /*version*/) {
1621  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1622  s & BOOST_SERIALIZATION_NVP(p_lhs);
1623  s & BOOST_SERIALIZATION_NVP(p_rhs);
1624  }
1625 #endif
1626 #endif // SgAsmBinaryExpression_OTHERS
1627 
1628 #ifdef DOCUMENTATION
1629  };
1630 #endif
1631 
1633 
1634  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1635  IS_SERIALIZABLE(AsmUnaryPlus);
1636 
1637 #ifdef DOCUMENTATION
1638 
1640  public:
1641 #endif
1642 
1643  DECLARE_OTHERS(AsmUnaryPlus);
1644 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1645 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1646  private:
1647  friend class boost::serialization::access;
1648 
1649  template<class S>
1650  void serialize(S &s, const unsigned /*version*/) {
1651  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1652  }
1653 #endif
1654 #endif // SgAsmUnaryPlus_OTHERS
1655 
1656 #ifdef DOCUMENTATION
1657  };
1658 #endif
1659 
1661 
1662  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1663  IS_SERIALIZABLE(AsmUnaryMinus);
1664 
1665 #ifdef DOCUMENTATION
1666 
1668  public:
1669 #endif
1670 
1671  DECLARE_OTHERS(AsmUnaryMinus);
1672 #if defined(SgAsmUnaryMinus_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(SgAsmUnaryExpression);
1680  }
1681 #endif
1682 #endif // SgAsmUnaryMinus_OTHERS
1683 
1684 #ifdef DOCUMENTATION
1685  };
1686 #endif
1687 
1689 
1690  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1691  IS_SERIALIZABLE(AsmUnaryRrx);
1692 
1693 #ifdef DOCUMENTATION
1694  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1696  public:
1697 #endif
1698 
1699  DECLARE_OTHERS(AsmUnaryRrx);
1700 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1701 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1702  private:
1703  friend class boost::serialization::access;
1704 
1705  template<class S>
1706  void serialize(S &s, const unsigned /*version*/) {
1707  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1708  }
1709 #endif
1710 #endif // SgAsmUnaryRrx_OTHERS
1711 
1712 #ifdef DOCUMENTATION
1713  };
1714 #endif
1715 
1717 
1718  DECLARE_LEAF_CLASS(AsmUnaryArmSpecialRegisterList);
1719  IS_SERIALIZABLE(AsmUnaryArmSpecialRegisterList);
1720 
1721 #ifdef DOCUMENTATION
1722  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1724  public:
1725 #endif
1726 
1727  DECLARE_OTHERS(AsmUnaryArmSpecialRegisterList);
1728 #if defined(SgAsmUnaryArmSpecialRegisterList_OTHERS) || defined(DOCUMENTATION)
1729 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1730  private:
1731  friend class boost::serialization::access;
1732 
1733  template<class S>
1734  void serialize(S &s, const unsigned /*version*/) {
1735  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1736  }
1737 #endif
1738 #endif // SgAsmUnaryArmSpecialRegisterList_OTHERS
1739 
1740 #ifdef DOCUMENTATION
1741  };
1742 #endif
1743 
1745 
1746  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
1747  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryArmSpecialRegisterList,
1748  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
1749  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1750  IS_SERIALIZABLE(AsmUnaryExpression);
1751 
1752 #ifdef DOCUMENTATION
1753 
1755  public:
1756 #endif
1757 
1758 #ifdef DOCUMENTATION
1759 
1762  SgAsmExpression* get_operand() const;
1765 #else
1766  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
1767  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1768 #endif
1769 
1770  DECLARE_OTHERS(AsmUnaryExpression);
1771 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
1772 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1773  private:
1774  friend class boost::serialization::access;
1775 
1776  template<class S>
1777  void serialize(S &s, const unsigned /*version*/) {
1778  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1779  s & BOOST_SERIALIZATION_NVP(p_operand);
1780  }
1781 #endif
1782 #endif // SgAsmUnaryExpression_OTHERS
1783 
1784 #ifdef DOCUMENTATION
1785  };
1786 #endif
1787 
1789 
1790  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
1791  IS_SERIALIZABLE(AsmDirectRegisterExpression);
1792 
1793 #ifdef DOCUMENTATION
1794 
1796  public:
1797 #endif
1798 
1799 #ifdef DOCUMENTATION
1800 
1803  unsigned get_psr_mask() const;
1804  void set_psr_mask(unsigned);
1806 #else
1807  AsmDirectRegisterExpression.setDataPrototype("unsigned", "psr_mask", "=0", // for ARM
1808  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1809  NO_DELETE);
1810 #endif
1811 
1812  DECLARE_OTHERS(AsmDirectRegisterExpression);
1813 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1814 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1815  private:
1816  friend class boost::serialization::access;
1817 
1818  template<class S>
1819  void serialize(S &s, const unsigned /*version*/) {
1820  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1821  s & BOOST_SERIALIZATION_NVP(p_psr_mask);
1822  }
1823 #endif
1824 
1825  private:
1826  // Default c'tor needed for serialization
1828  : p_psr_mask(0) {}
1829 #endif // SgAsmDirectRegisterExpression_OTHERS
1830 
1831 #ifdef DOCUMENTATION
1832  };
1833 #endif
1834 
1836 
1837  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
1838  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
1839 
1840 #ifdef DOCUMENTATION
1841 
1858  public:
1859 #endif
1860 
1861 #ifdef DOCUMENTATION
1862 
1870 #else
1871  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "stride", "",
1872  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1873 #endif
1874 
1875 #ifdef DOCUMENTATION
1876 
1884 #else
1885  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "offset", "",
1886  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1887 #endif
1888 
1889 #ifdef DOCUMENTATION
1890 
1895  size_t get_index() const;
1896  void set_index(size_t);
1898 #else
1899  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
1900  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1901 #endif
1902 
1903 #ifdef DOCUMENTATION
1904 
1909  size_t get_modulus() const;
1910  void set_modulus(size_t);
1912 #else
1913  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
1914  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1915 #endif
1916 
1917  DECLARE_OTHERS(AsmIndirectRegisterExpression);
1918 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1919 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1920  private:
1921  friend class boost::serialization::access;
1922 
1923  template<class S>
1924  void serialize(S &s, const unsigned /*version*/) {
1925  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1926  s & BOOST_SERIALIZATION_NVP(p_stride);
1927  s & BOOST_SERIALIZATION_NVP(p_offset);
1928  s & BOOST_SERIALIZATION_NVP(p_index);
1929  s & BOOST_SERIALIZATION_NVP(p_modulus);
1930  }
1931 #endif
1932 
1933  private:
1934  // Default c'tor needed for serialization
1936  : p_index(0), p_modulus(0) {}
1937 #endif // SgAsmIndirectRegisterExpression_OTHERS
1938 
1939 #ifdef DOCUMENTATION
1940  };
1941 #endif
1942 
1944 
1945  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
1946  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
1947  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
1948  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
1949 
1950 #ifdef DOCUMENTATION
1951 
1953  public:
1954 #endif
1955 
1956 #ifdef DOCUMENTATION
1957 
1963 #else
1964  AsmRegisterReferenceExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "descriptor", "",
1965  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1966 #endif
1967 
1968 #ifdef DOCUMENTATION
1969 
1974  int get_adjustment() const;
1975  void set_adjustment(int);
1977 #else
1978  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
1979  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1980  NO_DELETE);
1981 #endif
1982 
1983  DECLARE_OTHERS(AsmRegisterReferenceExpression);
1984 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
1985 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1986  private:
1987  friend class boost::serialization::access;
1988 
1989  template<class S>
1990  void serialize(S &s, const unsigned /*version*/) {
1991  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1992  s & BOOST_SERIALIZATION_NVP(p_descriptor);
1993  s & BOOST_SERIALIZATION_NVP(p_adjustment);
1994  }
1995 #endif
1996 
1997  protected:
1998  // Default c'tor needed for serialization
2000  : p_adjustment(0) {}
2001 #endif // SgAsmRegisterReferenceExpression_OTHERS
2002 
2003 #ifdef DOCUMENTATION
2004  };
2005 #endif
2006 
2008 
2009  DECLARE_LEAF_CLASS(AsmRegisterNames);
2010  IS_SERIALIZABLE(AsmRegisterNames);
2011 
2012 #ifdef DOCUMENTATION
2013 
2015  public:
2016 #endif
2017 
2018 #ifdef DOCUMENTATION
2019 
2025  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
2026  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
2028 #else
2029  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
2030  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2031 #endif
2032 
2033 #ifdef DOCUMENTATION
2034 
2040  unsigned get_mask() const;
2041  void set_mask(unsigned);
2043 #else
2044  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
2045  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2046 #endif
2047 
2048  DECLARE_OTHERS(AsmRegisterNames);
2049 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
2050 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2051  private:
2052  friend class boost::serialization::access;
2053 
2054  template<class S>
2055  void serialize(S &s, const unsigned /*version*/) {
2056  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2057  s & BOOST_SERIALIZATION_NVP(p_registers);
2058  s & BOOST_SERIALIZATION_NVP(p_mask);
2059  }
2060 #endif
2061 #endif // SgAsmRegisterNames_OTHERS
2062 
2063 #ifdef DOCUMENTATION
2064  };
2065 #endif
2066 
2068 
2069  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2070  IS_SERIALIZABLE(AsmIntegerValueExpression);
2071 
2072 #ifdef DOCUMENTATION
2073 
2089  public:
2090 #endif
2091 
2092 #ifdef DOCUMENTATION
2093 
2103  SgNode* get_baseNode() const;
2104  void set_baseNode(SgNode*);
2106 #else
2107  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2108  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2109 #endif
2110 
2111  DECLARE_OTHERS(AsmIntegerValueExpression);
2112 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2113 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2114  private:
2115  friend class boost::serialization::access;
2116 
2117  template<class S>
2118  void serialize(S &s, const unsigned /*version*/) {
2119  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2120  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2121  }
2122 #endif
2123 
2124  public:
2129  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2130 
2137 
2139  static uint64_t virtualAddress(SgNode*);
2140 
2160  std::string get_label(bool quiet=false) const;
2161 
2163  size_t get_significantBits() const;
2164 
2170  void makeRelativeTo(SgNode *baseNode);
2171 
2176  uint64_t get_baseAddress() const;
2177 
2183  uint64_t get_absoluteValue(size_t nbits=0) const;
2184 
2188  void set_absoluteValue(uint64_t);
2189 
2191  int64_t get_signedValue() const;
2192 
2196  int64_t get_relativeValue() const;
2197 
2202  void set_relativeValue(int64_t v, size_t nbits=64);
2203 
2204  uint64_t get_value() const { return get_absoluteValue(); }
2205 
2206 #endif // SgAsmIntegerValueExpression_OTHERS
2207 
2208 #ifdef DOCUMENTATION
2209  };
2210 #endif
2211 
2213 
2214  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2215  IS_SERIALIZABLE(AsmFloatValueExpression);
2216 
2217 #ifdef DOCUMENTATION
2218 
2223  public:
2224 #endif
2225 
2226  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2227 
2228  DECLARE_OTHERS(AsmFloatValueExpression);
2229 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2230  private:
2231  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2232  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2233  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2234  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2235  // understand "mutable".
2236  mutable double p_nativeValue;
2237  mutable bool p_nativeValueIsValid;
2238 
2239 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2240  private:
2241  friend class boost::serialization::access;
2242 
2243  template<class S>
2244  void serialize(S &s, const unsigned /*version*/) {
2245  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2246  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2247  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2248  }
2249 #endif
2250 
2251  public:
2256  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2257 
2263  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2264 
2271 
2273  void set_nativeValue(double);
2274 
2276  double get_nativeValue() const;
2277 
2282  void updateBitVector();
2283 
2288  void updateNativeValue() const;
2289 #endif // SgAsmFloatValueExpression_OTHERS
2290 
2291 #ifdef DOCUMENTATION
2292  };
2293 #endif
2294 
2296 
2297  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2298  AsmIntegerValueExpression | AsmFloatValueExpression,
2299  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2300  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2301  IS_SERIALIZABLE(AsmConstantExpression);
2302 
2303  DECLARE_HEADERS(AsmConstantExpression);
2304 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2305  #include <Sawyer/BitVector.h>
2306 #endif // SgAsmConstantExpression_HEADERS
2307 
2308 #ifdef DOCUMENTATION
2309 
2314  public:
2315 #endif
2316 
2317 #ifndef DOCUMENTATION
2318  // Documented below. Implemented below due to ROSETTA limitations.
2319  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2320  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2321 #endif
2322 
2323  DECLARE_OTHERS(AsmConstantExpression);
2324 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2325 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2326  private:
2327  friend class boost::serialization::access;
2328 
2329  template<class S>
2330  void serialize(S &s, const unsigned /*version*/) {
2331  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2332  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2333  }
2334 #endif
2335 
2336  public:
2342  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2343  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2344  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2346 #endif // SgAsmConstantExpression_OTHERS
2347 
2348 #ifdef DOCUMENTATION
2349  };
2350 #endif
2351 
2353 
2354  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2355  AsmConstantExpression,
2356  "AsmValueExpression", "AsmValueExpressionTag", false);
2357  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2358  IS_SERIALIZABLE(AsmValueExpression);
2359 
2360 #ifdef DOCUMENTATION
2361 
2369  public:
2370 #endif
2371 
2372 #ifdef DOCUMENTATION
2373 
2383 #else
2384  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
2385  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2386 #endif
2387 
2388 #ifdef DOCUMENTATION
2389 
2397  unsigned short get_bit_offset() const;
2398  void set_bit_offset(unsigned short);
2400 #else
2401  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
2402  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2403 #endif
2404 
2405 #ifdef DOCUMENTATION
2406 
2412  unsigned short get_bit_size() const;
2413  void set_bit_size(unsigned short);
2415 #else
2416  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
2417  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2418 #endif
2419 
2420 #ifdef DOCUMENTATION
2421 
2427  SgSymbol* get_symbol() const;
2428  void set_symbol(SgSymbol*);
2430 #else
2431  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
2432  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2433 #endif
2434 
2435  DECLARE_OTHERS(AsmValueExpression);
2436 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
2437 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2438  private:
2439  friend class boost::serialization::access;
2440 
2441  template<class S>
2442  void serialize(S &s, const unsigned /*version*/) {
2443  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2444  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
2445  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
2446  s & BOOST_SERIALIZATION_NVP(p_bit_size);
2447 #if 1
2448  ASSERT_require2(p_symbol == NULL, "not implemented yet");
2449 #else
2450  s & BOOST_SERIALIZATION_NVP(p_symbol);
2451 #endif
2452  }
2453 #endif
2454 #endif // SgAsmValueExpression_OTHERS
2455 
2456 #ifdef DOCUMENTATION
2457  };
2458 #endif
2459 
2461 
2462  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
2463  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
2464 
2465 #ifdef DOCUMENTATION
2466 
2468  public:
2469 #endif
2470 
2471 #ifdef DOCUMENTATION
2472 
2479  SgAsmExpression* get_address() const;
2482 #else
2483  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
2484  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2485 #endif
2486 
2487 #ifdef DOCUMENTATION
2488 
2495  SgAsmExpression* get_segment() const;
2498 #else
2499  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
2500  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2501 #endif
2502 
2503  DECLARE_OTHERS(AsmMemoryReferenceExpression);
2504 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2505 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2506  private:
2507  friend class boost::serialization::access;
2508 
2509  template<class S>
2510  void serialize(S &s, const unsigned /*version*/) {
2511  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2512  s & BOOST_SERIALIZATION_NVP(p_address);
2513  s & BOOST_SERIALIZATION_NVP(p_segment);
2514  }
2515 #endif
2516 #endif // SgAsmMemoryReferenceExpression_OTHERS
2517 
2518 #ifdef DOCUMENTATION
2519  };
2520 #endif
2521 
2523 
2524  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
2525  IS_SERIALIZABLE(AsmControlFlagsExpression);
2526 
2527 #ifdef DOCUMENTATION
2528  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2530  public:
2531 #endif
2532 
2533 #ifndef DOCUMENTATION
2534  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
2535  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2536 #endif
2537 
2538  DECLARE_OTHERS(AsmControlFlagsExpression);
2539 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
2540 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2541  private:
2542  friend class boost::serialization::access;
2543 
2544  template<class S>
2545  void serialize(S &s, const unsigned /*version*/) {
2546  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2547  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
2548  }
2549 #endif
2550 #endif // SgAsmControlFlagsExpression_OTHERS
2551 
2552 #ifdef DOCUMENTATION
2553  };
2554 #endif
2555 
2557 
2558  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
2559  IS_SERIALIZABLE(AsmCommonSubExpression);
2560 
2561 #ifdef DOCUMENTATION
2562  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2564  public:
2565 #endif
2566 
2567 #ifndef DOCUMENTATION
2568  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
2569  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2570 #endif
2571 
2572  DECLARE_OTHERS(AsmCommonSubExpression);
2573 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
2574 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2575  private:
2576  friend class boost::serialization::access;
2577 
2578  template<class S>
2579  void serialize(S &s, const unsigned /*version*/) {
2580  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2581  s & BOOST_SERIALIZATION_NVP(p_subexpression);
2582  }
2583 #endif
2584 #endif // SgAsmCommonSubExpression_OTHERS
2585 
2586 #ifdef DOCUMENTATION
2587  };
2588 #endif
2589 
2591 
2592  DECLARE_LEAF_CLASS(AsmRiscOperation);
2593  IS_SERIALIZABLE(AsmRiscOperation);
2594 
2595 #ifdef DOCUMENTATION
2596 
2605  public:
2606 #endif
2607 
2608 #ifdef DOCUMENTATION
2609 
2618 #else
2619  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
2620  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
2621 #endif
2622 
2623 #ifdef DOCUMENTATION
2624 
2630  SgAsmExprListExp* get_operands() const;
2633 #else
2634  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
2635  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2636 #endif
2637 
2638  DECLARE_OTHERS(AsmRiscOperation);
2639 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
2640  public:
2647  OP_NONE,
2648  OP_bottom,
2649  OP_undefined,
2650  OP_unspecified,
2651  OP_filterCallTarget,
2652  OP_filterReturnTarget,
2653  OP_filterIndirectJumpTarget,
2654  OP_hlt,
2655  OP_cpuid,
2656  OP_rdtsc,
2657  OP_and_,
2658  OP_or_,
2659  OP_xor_,
2660  OP_invert,
2661  OP_extract,
2662  OP_concat,
2663  OP_leastSignificantSetBit,
2664  OP_mostSignificantSetBit,
2665  OP_rotateLeft,
2666  OP_rotateRight,
2667  OP_shiftLeft,
2668  OP_shiftRight,
2669  OP_shiftRightArithmetic,
2670  OP_equalToZero,
2671  OP_ite,
2672  OP_isEqual,
2673  OP_isNotEqual,
2674  OP_isUnsignedLessThan,
2675  OP_isUnsignedLessThanOrEqual,
2676  OP_isUnsignedGreaterThan,
2677  OP_isUnsignedGreaterThanOrEqual,
2678  OP_isSignedLessThan,
2679  OP_isSignedLessThanOrEqual,
2680  OP_isSignedGreaterThan,
2681  OP_isSignedGreaterThanOrEqual,
2682  OP_unsignedExtend,
2683  OP_signExtend,
2686  OP_subtract,
2687  OP_negate,
2688  OP_signedDivide,
2689  OP_signedModulo,
2690  OP_signedMultiply,
2691  OP_unsignedDivide,
2692  OP_unsignedModulo,
2693  OP_unsignedMultiply,
2694  OP_interrupt,
2695  OP_readRegister,
2696  OP_peekRegister,
2697  OP_writeRegister,
2699  OP_peekMemory,
2701  OP_N_OPERATORS // MUST BE LAST!
2702  };
2703 
2704 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2705  private:
2706  friend class boost::serialization::access;
2707 
2708  template<class S>
2709  void serialize(S &s, const unsigned /*version*/) {
2710  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2711  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
2712  s & BOOST_SERIALIZATION_NVP(p_operands);
2713  }
2714 #endif
2715 #endif // SgAsmRiscOperation_OTHERS
2716 
2717 #ifdef DOCUMENTATION
2718  };
2719 #endif
2720 
2722 
2723  DECLARE_LEAF_CLASS(AsmExprListExp);
2724  IS_SERIALIZABLE(AsmExprListExp);
2725 
2726 #ifdef DOCUMENTATION
2727 
2729  public:
2730 #endif
2731 
2732 #ifdef DOCUMENTATION
2733 
2739  const SgAsmExpressionPtrList& get_expressions() const;
2740  void set_expressions(const SgAsmExpressionPtrList&);
2742 #else
2743  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
2744  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2745 #endif
2746 
2747  DECLARE_OTHERS(AsmExprListExp);
2748 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
2749 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2750  private:
2751  friend class boost::serialization::access;
2752 
2753  template<class S>
2754  void serialize(S &s, const unsigned /*version*/) {
2755  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2756  s & BOOST_SERIALIZATION_NVP(p_expressions);
2757  }
2758 #endif
2759 #endif // SgAsmExprListExp_OTHERS
2760 
2761 #ifdef DOCUMENTATION
2762  };
2763 #endif
2764 
2766 
2767  NEW_NONTERMINAL_MACRO(AsmExpression,
2768  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
2769  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
2770  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
2771  AsmRiscOperation,
2772  "AsmExpression", "AsmExpressionTag", false);
2773  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
2774  IS_SERIALIZABLE(AsmExpression);
2775 
2776 #ifdef DOCUMENTATION
2777 
2778  class SgAsmExpression: public SgAsmNode {
2779  public:
2780 #endif
2781 
2782 #ifdef DOCUMENTATION
2783 
2788  SgAsmType* get_type() const;
2789  void set_type(SgAsmType*);
2791 #else
2792  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
2793  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2794 #endif
2795 
2796 #ifdef DOCUMENTATION
2797 
2802  const std::string& get_comment() const;
2803  void set_comment(const std::string&);
2805 #else
2806  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
2807  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2808 #endif
2809 
2810  DECLARE_OTHERS(AsmExpression);
2811 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
2812 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2813  private:
2814  friend class boost::serialization::access;
2815 
2816  template<class S>
2817  void serialize(S &s, const unsigned /*version*/) {
2818  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
2819  s & BOOST_SERIALIZATION_NVP(p_type);
2820  s & BOOST_SERIALIZATION_NVP(p_comment);
2821  }
2822 #endif
2823 
2824  public:
2828  size_t get_nBits() const;
2829 
2835 
2841 
2842 #endif // SgAsmExpression_OTHERS
2843 
2844 #ifdef DOCUMENTATION
2845  };
2846 #endif
2847 
2848 
2849 
2850 
2852 
2853  /***************************************************************************************************************************
2854  * Data Types (new interface 2014-07)
2855  *
2856  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
2857  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
2858  * 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
2859  * don't allow types to be modified after they're created.
2860  ***************************************************************************************************************************/
2861 
2863 
2864  DECLARE_LEAF_CLASS(AsmIntegerType);
2865  IS_SERIALIZABLE(AsmIntegerType);
2866 
2867 #ifdef DOCUMENTATION
2868 
2870  public:
2871 #endif
2872 
2873 #ifndef DOCUMENTATION
2874  // Documented below due to ROSETTA limitations
2875  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
2876  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2877 #endif
2878 
2879  DECLARE_OTHERS(AsmIntegerType);
2880 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
2881 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2882  private:
2883  friend class boost::serialization::access;
2884 
2885  template<class S>
2886  void serialize(S &s, const unsigned /*version*/) {
2887  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2888  s & BOOST_SERIALIZATION_NVP(p_isSigned);
2889  }
2890 #endif
2891 
2892  public:
2896  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
2897 
2901  bool get_isSigned() const;
2902 
2903  // Overrides documented in base class
2904  virtual void check() const $ROSE_OVERRIDE;
2905  virtual std::string toString() const $ROSE_OVERRIDE;
2906 #endif // SgAsmIntegerType_OTHERS
2907 
2908 #ifdef DOCUMENTATION
2909  };
2910 #endif
2911 
2913 
2914  DECLARE_LEAF_CLASS(AsmFloatType);
2915  IS_SERIALIZABLE(AsmFloatType);
2916 
2917  DECLARE_HEADERS(AsmFloatType);
2918 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
2919  #include <Sawyer/BitVector.h>
2920  #include <BitFlags.h>
2921 #endif // SgAsmFloatType_HEADERS
2922 
2923 #ifdef DOCUMENTATION
2924 
2926  public:
2927 #endif
2928 
2929 #ifndef DOCUMENTATION
2930  // Documented below because of ROSETTA limitations (they're read-only)
2931  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
2932  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2933  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
2934  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2935  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
2936  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2937  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
2938  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2939  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
2940  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2941  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
2942  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2943  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
2944  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2945 #endif
2946 
2947  DECLARE_OTHERS(AsmFloatType);
2948 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
2949 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2950  private:
2951  friend class boost::serialization::access;
2952 
2953  template<class S>
2954  void serialize(S &s, const unsigned /*version*/) {
2955  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2956  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
2957  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
2958  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
2959  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
2960  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
2961  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
2962  s & BOOST_SERIALIZATION_NVP(p_flags);
2963  }
2964 #endif
2965 
2966  public:
2968  enum Flag {
2969  GRADUAL_UNDERFLOW = 0x00000001,
2971  };
2972 
2975 
2978 
2980  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
2981  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
2982  uint64_t exponentBias, Flags flags);
2983 
2985  BitRange significandBits() const;
2986 
2988  BitRange exponentBits() const;
2989 
2991  size_t signBit() const;
2992 
2994  uint64_t exponentBias() const;
2995 
2997  Flags flags() const;
2998 
3003  static Flags ieeeFlags();
3004 
3010  bool gradualUnderflow() const;
3011 
3019  bool implicitBitConvention() const;
3020 
3023  // Overrides documented in base class
3024  virtual void check() const $ROSE_OVERRIDE;
3025  virtual std::string toString() const $ROSE_OVERRIDE;
3026 #endif // SgAsmFloatType_OTHERS
3027 
3028 #ifdef DOCUMENTATION
3029  };
3030 #endif
3031 
3033 
3034  NEW_NONTERMINAL_MACRO(AsmScalarType,
3035  AsmIntegerType | AsmFloatType,
3036  "AsmScalarType", "AsmScalarTypeTag", false);
3037  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
3038  IS_SERIALIZABLE(AsmScalarType);
3039 
3040 #ifdef DOCUMENTATION
3041 
3042  class SgAsmScalarType: public SgAsmType {
3043  public:
3044 #endif
3045 
3046 #ifndef DOCUMENTATION
3047  // Documented below due to ROSETTA limitations (read-only)
3048  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3049  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3050  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3051  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3052  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
3053  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3054  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
3055  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3056 #endif
3057 
3058  DECLARE_OTHERS(AsmScalarType);
3059 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
3060 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3061  private:
3062  friend class boost::serialization::access;
3063 
3064  template<class S>
3065  void serialize(S &s, const unsigned /*version*/) {
3066  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3067  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
3068  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
3069  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
3070  s & BOOST_SERIALIZATION_NVP(p_nBits);
3071  }
3072 #endif
3073 
3074  protected:
3079  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
3080 
3081  public:
3083  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3084 
3086  ByteOrder::Endianness get_minorOrder() const;
3087 
3089  ByteOrder::Endianness get_majorOrder() const;
3090 
3092  size_t get_majorNBytes() const;
3093 
3094  // Overrides documented in base class
3095  virtual void check() const $ROSE_OVERRIDE;
3096  virtual std::string toString() const $ROSE_OVERRIDE;
3097 #endif // SgAsmScalarType_OTHERS
3098 
3099 #ifdef DOCUMENTATION
3100  };
3101 #endif
3102 
3104 
3105  DECLARE_LEAF_CLASS(AsmVectorType);
3106  IS_SERIALIZABLE(AsmVectorType);
3107 
3108 #ifdef DOCUMENTATION
3109 
3110  class SgAsmVectorType: public SgAsmType {
3111  public:
3112 #endif
3113 
3114 #ifndef DOCUMENTATION
3115  // Documented below due to ROSETTA limitations (read-only)
3116  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3117  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3118  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3119  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3120 #endif
3121 
3122  DECLARE_OTHERS(AsmVectorType);
3123 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3124 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3125  private:
3126  friend class boost::serialization::access;
3127 
3128  template<class S>
3129  void serialize(S &s, const unsigned /*version*/) {
3130  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3131  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3132  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3133  }
3134 #endif
3135 
3136  public:
3138  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3139 
3141  size_t get_nElmts() const;
3142 
3144  SgAsmType* get_elmtType() const;
3145 
3146  // Overrides documented in base class
3147  virtual void check() const $ROSE_OVERRIDE;
3148  virtual std::string toString() const $ROSE_OVERRIDE;
3149  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3150 #endif // SgAsmVectorType_OTHERS
3151 
3152 #ifdef DOCUMENTATION
3153  };
3154 #endif
3155 
3157 
3158  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3159  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3160  IS_SERIALIZABLE(AsmType);
3161 
3162 #ifdef DOCUMENTATION
3163 
3164  class SgAsmType: public SgAsmNode {
3165  public:
3166 #endif
3167 
3168  DECLARE_OTHERS(AsmType);
3169 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3170  private:
3172 
3173 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3174  private:
3175  friend class boost::serialization::access;
3176 
3177  template<class S>
3178  void serialize(S &s, const unsigned /*version*/) {
3179  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3180  }
3181 #endif
3182 
3183  public:
3191  virtual void check() const;
3192 
3198  virtual std::string toString() const {
3199  abort(); // ROSETTA limitation: intended pure virtual
3200  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3201  }
3202 
3204  virtual size_t get_nBits() const {
3205  abort(); // ROSETTA limitation: intended pure virtual
3206  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3207  }
3208 
3210  virtual size_t get_nBytes() const;
3211 
3217  template<class Type> // Type is a subclass of SgAsmType
3218  static Type* registerOrDelete(Type *toInsert) {
3219  ASSERT_not_null(toInsert);
3220  std::string key = toInsert->toString();
3221  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3222  ASSERT_not_null(retval);
3223  if (retval!=toInsert)
3224  delete toInsert;
3225  return retval;
3226  }
3227 #endif // SgAsmType_OTHERS
3228 
3229 #ifdef DOCUMENTATION
3230  };
3231 #endif
3232 
3233 
3234 
3236 
3237  /**************************************************************************************************************************
3238  * Collections of Instructions
3239  **************************************************************************************************************************/
3240 
3242 
3243  DECLARE_LEAF_CLASS(AsmFunction);
3244  IS_SERIALIZABLE(AsmFunction);
3245 
3246 #ifdef DOCUMENTATION
3247 
3263  public:
3264 #endif
3265 
3266 #ifdef DOCUMENTATION
3267 
3272  const std::string& get_name() const;
3273  void set_name(const std::string&);
3275 #else
3276  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3277  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3278 #endif
3279 
3280 #ifdef DOCUMENTATION
3281 
3287  unsigned get_reason() const;
3288  void set_reason(unsigned);
3290 #else
3291  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3292  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3293 #endif
3294 
3295 #ifdef DOCUMENTATION
3296 
3303  const std::string& get_reasonComment() const;
3304  void set_reasonComment(const std::string&);
3306 #else
3307  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
3308  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3309 #endif
3310 
3311 #ifdef DOCUMENTATION
3312 
3320 #else
3321  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3322  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3323 #endif
3324 
3325 #ifdef DOCUMENTATION
3326 
3329  MayReturn get_may_return() const;
3330  void set_may_return(MayReturn);
3332 #else
3333  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3334  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3335 #endif
3336 
3337 #ifdef DOCUMENTATION
3338 
3343  const std::string& get_name_md5() const;
3344  void set_name_md5(const std::string&);
3346 #else
3347  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3348  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3349 #endif
3350 
3351 #ifdef DOCUMENTATION
3352 
3357  const SgAsmStatementPtrList& get_statementList() const;
3358  void set_statementList(const SgAsmStatementPtrList&);
3360 #else
3361  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3362  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3363 #endif
3364 
3365 #ifdef DOCUMENTATION
3366  // FIXME[Robb P Matzke 2017-02-13]: unused?
3367 #else
3368  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3369  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3370 #endif
3371 
3372 #ifdef DOCUMENTATION
3373 
3379  rose_addr_t get_entry_va() const;
3380  void set_entry_va(rose_addr_t);
3382 #else
3383  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3384  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3385 #endif
3386 
3387 #ifdef DOCUMENTATION
3388 
3397 #else
3398  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3399  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3400 #endif
3401 
3402 #ifdef DOCUMENTATION
3403  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3404 #else
3405  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3406  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3407 #endif
3408 
3409 #ifdef DOCUMENTATION
3410 
3419  int64_t get_stackDelta() const;
3420  void set_stackDelta(int64_t);
3422 #else
3423  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3424  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3425 #endif
3426 
3427 #ifdef DOCUMENTATION
3428 
3436  const std::string& get_callingConvention() const;
3437  void set_callingConvention(const std::string&);
3439 #else
3440  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3441  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3442 #endif
3443 
3444  DECLARE_OTHERS(AsmFunction);
3445 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3446 
3447 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3448  private:
3449  friend class boost::serialization::access;
3450 
3451  template<class S>
3452  void serialize(S &s, const unsigned /*version*/) {
3453  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3454  s & BOOST_SERIALIZATION_NVP(p_name);
3455  s & BOOST_SERIALIZATION_NVP(p_reason);
3456  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
3457  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3458  s & BOOST_SERIALIZATION_NVP(p_may_return);
3459  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3460  s & BOOST_SERIALIZATION_NVP(p_statementList);
3461  s & BOOST_SERIALIZATION_NVP(p_dest);
3462  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3463  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3464  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3465  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3466  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3467  }
3468 #endif
3469 
3470  public:
3473 
3477  void remove_statement(SgAsmStatement* statement);
3478 
3483  SgAsmBlock* get_entry_block() const;
3484 
3486  enum MayReturn {
3491  };
3492 
3497  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3498  // Also fix SgAsmFunction::reason_key()
3499  FUNC_NONE = 0x00000000,
3500  FUNC_THUNK_TARGET= 0x00004000,
3502  = 0x00008000,
3503  FUNC_ENTRY_POINT = 0x00010000,
3504  FUNC_CALL_TARGET = 0x00020000,
3507  FUNC_CALL_INSN = 0x00040000,
3513  FUNC_EH_FRAME = 0x00080000,
3514  FUNC_SYMBOL = 0x00100000,
3515  FUNC_PATTERN = 0x00200000,
3520  FUNC_GRAPH = 0x00400000,
3524  FUNC_USERDEF = 0x00800000,
3525  FUNC_PADDING = 0x01000000,
3530  FUNC_DISCONT = 0x02000000,
3533  FUNC_INSNHEAD = 0x04000000,
3534  FUNC_IMPORT = 0x08000000,
3537  FUNC_LEFTOVERS = 0x10000000,
3541  FUNC_INTRABLOCK = 0x20000000,
3549  FUNC_THUNK = 0x40000000,
3558  FUNC_EXPORT = 0x80000000,
3560  FUNC_DEFAULT = 0xefff80ff,
3562  /*========= Miscellaneous Reasons ===========================================================================
3563  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3564  * availalble for users to use as they see fit. */
3565  FUNC_MISCMASK = 0x000000ff,
3580  };
3581 
3585  static std::string reason_key(const std::string &prefix="");
3586 
3588  std::string reason_str(bool pad) const;
3589 
3593  static std::string reason_str(bool pad, unsigned reason);
3594 
3597  public:
3598  virtual ~NodeSelector() {}
3599  virtual bool operator()(SgNode*) = 0;
3600  };
3601 
3641  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
3642  NodeSelector *selector=NULL);
3643 
3649  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
3650 
3653  e_unknown = 0,
3654  e_standard = 1,
3655  e_library = 2,
3656  e_imported = 3,
3657  e_thunk = 4,
3658  e_last
3659  };
3660 #endif // SgAsmFunction_OTHERS
3661 
3662 
3663 #ifdef DOCUMENTATION
3664  };
3665 #endif
3666 
3667 
3669 
3670  DECLARE_LEAF_CLASS(AsmBlock);
3671  IS_SERIALIZABLE(AsmBlock);
3672 
3673 #ifdef DOCUMENTATION
3674 
3694  class SgAsmBlock: public SgAsmStatement {
3695  public:
3696 #endif
3697 
3698 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3699  // [tps 05Apr07] needed for the control_flow_graph
3700  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
3701  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3702 #endif
3703 
3704 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3705  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
3706  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3707 #endif
3708 
3709 #ifdef DOCUMENTATION
3710 
3715  rose_addr_t get_id() const;
3716  void set_id(rose_addr_t);
3718 #else
3719  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
3720  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3721 #endif
3722 
3723 #ifdef DOCUMENTATION
3724 
3729  unsigned get_reason() const;
3730  void set_reason(unsigned);
3732 #else
3733  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
3734  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3735 #endif
3736 
3737 #ifdef DOCUMENTATION
3738  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3739  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3740  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3741  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3748  const SgAsmStatementPtrList& get_statementList() const;
3749  void set_statementList(const SgAsmStatementPtrList&);
3751 #else
3752  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3753  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3754 #endif
3755 
3756 #ifdef DOCUMENTATION
3757  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3758  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3759  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3760  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3768  const SgAsmIntegerValuePtrList& get_successors() const;
3769  void set_successors(const SgAsmIntegerValuePtrList&);
3771 #else
3772  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
3773  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3774 #endif
3775 
3776 #ifdef DOCUMENTATION
3777 
3787  bool get_successors_complete() const;
3788  void set_successors_complete(bool);
3790 #else
3791  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
3792  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3793 #endif
3794 
3795 #ifdef DOCUMENTATION
3796 
3808 #else
3809  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
3810  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3811 #endif
3812 
3813 #ifdef DOCUMENTATION
3814 
3822  size_t get_cached_vertex() const;
3823  void set_cached_vertex(size_t);
3825 #else
3826  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
3827  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3828 #endif
3829 
3830 #ifdef DOCUMENTATION
3831 
3837  double get_code_likelihood() const;
3838  void set_code_likelihood(double);
3840 #else
3841  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
3842  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3843 #endif
3844 
3845 #ifdef DOCUMENTATION
3846 
3854  int64_t get_stackDeltaOut() const;
3855  void set_stackDeltaOut(int64_t);
3857 #else
3858  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
3859  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3860 #endif
3861 
3862  DECLARE_OTHERS(AsmBlock);
3863 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
3864 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3865  private:
3866  friend class boost::serialization::access;
3867 
3868  template<class S>
3869  void serialize(S &s, const unsigned /*version*/) {
3870  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3871  s & BOOST_SERIALIZATION_NVP(p_reason);
3872  s & BOOST_SERIALIZATION_NVP(p_statementList);
3873  s & BOOST_SERIALIZATION_NVP(p_successors);
3874  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
3875  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
3876  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3877  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
3878  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
3879  }
3880 #endif
3881 
3882  public:
3884  enum Reason {
3885  // Please update SgAsmBlock::reason_str() if you change this enum!
3886  BLK_NONE = 0x00000000,
3887  BLK_ENTRY_POINT = 0x00010000,
3888  BLK_PADDING = 0x00020000,
3889  BLK_FRAGMENT = 0x00080000,
3891  BLK_CFGHEAD = 0x00100000,
3892  BLK_USERDEF = 0x00200000,
3893  BLK_LEFTOVERS = 0x00400000,
3895  BLK_JUMPTABLE = 0x00800000,
3896  BLK_GRAPH1 = 0x01000000,
3897  BLK_GRAPH2 = 0x02000000,
3898  BLK_GRAPH3 = 0x04000000,
3900  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
3901 
3902  // ========= Miscellaneous Reasons ===========================================================================
3903  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3904  // availalble for users to use as they see fit.
3905  BLK_MISCMASK = 0x000000ff,
3907  BLK_FINDDATA = 0x00000001,
3909  BLK_POSTFUNC = 0x00000002
3911  };
3912 
3917 
3922 
3923  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
3928  void remove_children();
3929 
3934  rose_addr_t get_fallthrough_va();
3935 
3940 
3946  bool has_instructions() const;
3947 
3953  bool is_basic_block() const { return has_instructions(); }
3954 
3964  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
3965 
3969  static std::string reason_key(const std::string &prefix="");
3970 
3974  std::string reason_str(bool pad) const;
3975 
3981  static std::string reason_str(bool pad, unsigned reason);
3982 #endif // SgAsmBlock_OTHERS
3983 
3984 #ifdef DOCUMENTATION
3985  };
3986 #endif
3987 
3988 
3990 
3991  DECLARE_LEAF_CLASS(AsmStaticData);
3992  IS_SERIALIZABLE(AsmStaticData);
3993 
3994 #ifdef DOCUMENTATION
3995 
4003  public:
4004 #endif
4005 
4006 #ifdef DOCUMENTATION
4007 
4013  const SgUnsignedCharList& get_raw_bytes() const;
4014  void set_raw_bytes(const SgUnsignedCharList&);
4016 #else
4017  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
4018  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4019 #endif
4020 
4021  DECLARE_OTHERS(AsmStaticData);
4022 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
4023 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4024  private:
4025  friend class boost::serialization::access;
4026 
4027  template<class S>
4028  void serialize(S &s, const unsigned /*version*/) {
4029  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4030  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
4031  }
4032 #endif
4033 
4034  public:
4038  size_t get_size() const { return p_raw_bytes.size(); }
4039 #endif // SgAsmStaticData_OTHERS
4040 
4041 #ifdef DOCUMENTATION
4042  };
4043 #endif
4044 
4045 
4047 
4048  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
4049  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
4050 
4051 #ifdef DOCUMENTATION
4052 
4063  public:
4064 #endif
4065 
4066  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4067 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4068 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4069  private:
4070  friend class boost::serialization::access;
4071 
4072  template<class S>
4073  void serialize(S & s, const unsigned /*version*/) {
4074  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4075  }
4076 #endif
4077  protected:
4078  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4079 
4080  public:
4083  p_declarationList.push_back(declaration);
4084  }
4085 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4086 
4087 #ifdef DOCUMENTATION
4088  };
4089 #endif
4090 
4091 
4093 
4094  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4095  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4096 
4097 #ifdef DOCUMENTATION
4098  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4100  public:
4101 #endif
4102 
4103 #ifdef DOCUMENTATION
4104 
4107  const std::string& get_name() const;
4108  void set_name(const std::string&);
4110 #else
4111  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4112  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4113  NO_DELETE);
4114 #endif
4115 
4116 #ifdef DOCUMENTATION
4117  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4121  uint64_t get_offset() const;
4122  void set_ofset(uint64_t);
4124 #else
4125  // Not clear if we want to store the offset explicitly
4126  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4127  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4128  NO_DELETE);
4129 #endif
4130 
4131  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4132 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4133 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4134  private:
4135  friend class boost::serialization::access;
4136 
4137  template<class S>
4138  void serialize(S &s, const unsigned /*version*/) {
4139  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4140  }
4141 #endif
4142 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4143 
4144 #ifdef DOCUMENTATION
4145  };
4146 #endif
4147 
4148 
4150 
4151  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4152  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4153  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4154  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4155  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4156 
4157 #ifdef DOCUMENTATION
4158 
4165  public:
4166 #endif
4167 
4168  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4169 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4170 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4171  private:
4172  friend class boost::serialization::access;
4173 
4174  template<class S>
4175  void serialize(S &s, const unsigned /*version*/) {
4176  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4177  };
4178 #endif
4179 #endif // SgAsmSynthesizedDeclaration_OTHERS
4180 
4181 #ifdef DOCUMENTATION
4182  };
4183 #endif
4184 
4185 
4187 
4188  NEW_NONTERMINAL_MACRO(AsmStatement,
4189  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4190  "AsmStatement", "AsmStatementTag", false);
4191  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4192  IS_SERIALIZABLE(AsmStatement);
4193 
4194 #ifdef DOCUMENTATION
4195 
4199  class SgAsmStatement: public SgAsmNode {
4200  public:
4201 #endif
4202 
4203 #ifdef DOCUMENTATION
4204 
4209  rose_addr_t get_address() const;
4210  void set_address(rose_addr_t);
4212 #else
4213  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4214  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4215 #endif
4216 
4217 
4218 #ifdef DOCUMENTATION
4219 
4222  const std::string& get_comment() const;
4223  void set_comment(const std::string&);
4225 #else
4226  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4227  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4228 #endif
4229 
4230  DECLARE_OTHERS(AsmStatement);
4231 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4232 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4233  private:
4234  friend class boost::serialization::access;
4235 
4236  template<class S>
4237  void serialize(S &s, const unsigned /*version*/) {
4238  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4239  s & BOOST_SERIALIZATION_NVP(p_address);
4240  s & BOOST_SERIALIZATION_NVP(p_comment);
4241  }
4242 #endif
4243 #endif // SgAsmStatement_OTHERS
4244 
4245 #ifdef DOCUMENTATION
4246  };
4247 #endif
4248 
4249 
4250 
4251 
4253 
4254  /*************************************************************************************************************************
4255  * Binary Interpretations
4256  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4257  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4258  * an AST that represents a single, coherent sub-part of the file.
4259  *************************************************************************************************************************/
4260 
4262 
4263  DECLARE_LEAF_CLASS(AsmInterpretationList);
4264  IS_SERIALIZABLE(AsmInterpretationList);
4265 
4266 #ifdef DOCUMENTATION
4267 
4269  public:
4270 #endif
4271 
4272 #ifdef DOCUMENTATION
4273 
4282 #else
4283  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4284  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4285  NO_DELETE);
4286 #endif
4287 
4288  DECLARE_OTHERS(AsmInterpretationList);
4289 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4290 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4291  private:
4292  friend class boost::serialization::access;
4293 
4294  template<class S>
4295  void serialize(S &s, const unsigned /*version*/) {
4296  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4297  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4298  }
4299 #endif
4300 #endif // SgAsmInterpretationList_OTHERS
4301 
4302 #ifdef DOCUMENTATION
4303  };
4304 #endif
4305 
4307 
4308  DECLARE_LEAF_CLASS(AsmInterpretation);
4309  IS_SERIALIZABLE(AsmInterpretation);
4310 
4311  DECLARE_HEADERS(AsmInterpretation);
4312 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4313  #include <MemoryMap.h>
4314  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
4315 #endif // SgAsmInterpretation_HEADERS
4316 
4317 #ifdef DOCUMENTATION
4318 
4325  public:
4326 #endif
4327 
4328 #ifdef DOCUMENTATION
4329  // documentation and definition are below
4330 #else
4331  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4332 #endif
4333 
4334 #ifdef DOCUMENTATION
4335 
4346 #else
4347  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4348  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4349 #endif
4350 
4351 #ifdef DOCUMENTATION
4352 
4357  SgAsmBlock* get_global_block() const;
4360 #else
4361  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4362  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4363 #endif
4364 
4365  DECLARE_OTHERS(AsmInterpretation);
4366 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4367  private:
4369  const Rose::BinaryAnalysis::RegisterDictionary *p_registers;
4370  bool coverageComputed; // true iff percentageCoverage has been computed
4371  mutable InstructionMap instruction_map; // cached instruction map
4372 
4374  // disassembly into instructions.
4375  double percentageCoverage;
4376 
4377 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4378  private:
4379  friend class boost::serialization::access;
4380 
4381  template<class S>
4382  void serialize(S &s, const unsigned /*version*/) {
4383  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4384  s & BOOST_SERIALIZATION_NVP(p_headers);
4385  s & BOOST_SERIALIZATION_NVP(p_global_block);
4386  s & BOOST_SERIALIZATION_NVP(p_map);
4387  s & BOOST_SERIALIZATION_NVP(p_registers);
4388  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4389  s & BOOST_SERIALIZATION_NVP(instruction_map);
4390  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4391  }
4392 #endif
4393 
4394  public:
4397  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4398  ctor();
4399  }
4400 
4405  SgAsmGenericFilePtrList get_files() const;
4406 
4433  InstructionMap& get_instruction_map(bool recompute=false);
4434  void set_instruction_map(const InstructionMap&);
4441  void insert_instructions(InstructionMap&/*in,out*/);
4442 
4447  void erase_instructions(InstructionMap&/*in,out*/);
4448 
4454  void set_coverageComputed(bool x) { coverageComputed = x; }
4455  void set_percentageCoverage(double x) { percentageCoverage = x; }
4458  private:
4459  void ctor(); // finalize construction
4460 #endif // SgAsmInterpretation_OTHERS
4461 
4462 #ifdef DOCUMENTATION
4463  };
4464 #endif
4465 
4466 
4467 
4469 
4470  /*************************************************************************************************************************
4471  * ELF File Header
4472  *************************************************************************************************************************/
4473 
4475 
4476  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4477  IS_SERIALIZABLE(AsmElfFileHeader);
4478 
4479 #ifdef DOCUMENTATION
4480 
4489  public:
4490 #endif
4491 
4492 #ifdef DOCUMENTATION
4493 
4498  unsigned char get_e_ident_file_class() const;
4499  void set_e_ident_file_class(unsigned char);
4501 #else
4502  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4503  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4504 #endif
4505 
4506 #ifdef DOCUMENTATION
4507 
4512  unsigned char get_e_ident_data_encoding() const;
4513  void set_e_ident_data_encoding(unsigned char);
4515 #else
4516  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4517  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4518 #endif
4519 
4520 #ifdef DOCUMENTATION
4521 
4526  unsigned char get_e_ident_file_version() const;
4527  void set_e_ident_file_version(unsigned char*);
4529 #else
4530  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4531  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4532 #endif
4533 
4534 #ifdef DOCUMENTATION
4535 
4540  const SgUnsignedCharList& get_e_ident_padding() const;
4541  void set_e_ident_padding(const SgUnsignedCharList&);
4543 #else
4544  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4545  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4546 #endif
4547 
4548 #ifdef DOCUMENTATION
4549 
4554  unsigned long get_e_type() const;
4555  void set_e_type(unsigned long);
4557 #else
4558  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4559  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4560 #endif
4561 
4562 #ifdef DOCUMENTATION
4563 
4568  unsigned long get_e_machine() const;
4569  void set_e_machine(unsigned long);
4571 #else
4572  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4573  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4574 #endif
4575 
4576 #ifdef DOCUMENTATION
4577 
4582  unsigned long get_e_flags() const;
4583  void set_e_flags(unsigned long);
4585 #else
4586  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4587  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4588 #endif
4589 
4590 #ifdef DOCUMENTATION
4591 
4596  unsigned long get_e_ehsize() const;
4597  void set_e_ehsize(unsigned long);
4599 #else
4600  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4601  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4602 #endif
4603 
4604 #ifdef DOCUMENTATION
4605 
4610  unsigned long get_phextrasz() const;
4611  void set_phextrasz(unsigned long);
4613 #else
4614  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4615  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4616 #endif
4617 
4618 #ifdef DOCUMENTATION
4619 
4624  unsigned long get_e_phnum() const;
4625  void set_e_phnum(unsigned long);
4627 #else
4628  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
4629  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4630 #endif
4631 
4632 #ifdef DOCUMENTATION
4633 
4638  unsigned long get_shextrasz() const;
4639  void set_shextrasz(unsigned long);
4641 #else
4642  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
4643  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4644 #endif
4645 
4646 #ifdef DOCUMENTATION
4647 
4652  unsigned long get_e_shnum() const;
4653  void set_e_shnum(unsigned long);
4655 #else
4656  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
4657  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4658 #endif
4659 
4660 #ifdef DOCUMENTATION
4661 
4666  unsigned long get_e_shstrndx() const;
4667  void set_e_shstrndx(unsigned long);
4669 #else
4670  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
4671  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4672 #endif
4673 
4674 #ifdef DOCUMENTATION
4675 
4685 #else
4686  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
4687  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4688 #endif
4689 
4690 #ifdef DOCUMENTATION
4691 
4700 #else
4701  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
4702  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4703 #endif
4704 
4705  DECLARE_OTHERS(AsmElfFileHeader);
4706 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
4707 
4708 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4709  private:
4710  friend class boost::serialization::access;
4711 
4712  template<class S>
4713  void serialize(S &s, const unsigned /*version*/) {
4714  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
4715  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
4716  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
4717  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
4718  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
4719  s & BOOST_SERIALIZATION_NVP(p_e_type);
4720  s & BOOST_SERIALIZATION_NVP(p_e_machine);
4721  s & BOOST_SERIALIZATION_NVP(p_e_flags);
4722  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
4723  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
4724  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
4725  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
4726  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
4727  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
4728  s & BOOST_SERIALIZATION_NVP(p_section_table);
4729  s & BOOST_SERIALIZATION_NVP(p_segment_table);
4730  }
4731 #endif
4732 
4733  public:
4735  enum ObjectType {
4736  ET_NONE = 0
4737  ,ET_REL = 1
4738  ,ET_EXEC = 2
4739  ,ET_DYN = 3
4740  ,ET_CORE = 4
4742  ,ET_LOOS = 0xfe00
4743  ,ET_HIOS = 0xfeff
4744  ,ET_LOPROC = 0xff00
4745  ,ET_HIPROC = 0xffff
4746  };
4747 
4748  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
4749  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
4750  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
4751  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
4752  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
4753 #ifdef _MSC_VER
4754 # pragma pack (1)
4755 #endif
4756 
4763  unsigned char e_ident_magic[4];
4764  unsigned char e_ident_file_class;
4765  unsigned char e_ident_data_encoding;
4766  unsigned char e_ident_file_version;
4767  unsigned char e_ident_padding[9];
4768  uint16_t e_type;
4769  uint16_t e_machine;
4770  uint32_t e_version;
4771  uint32_t e_entry;
4772  uint32_t e_phoff;
4773  uint32_t e_shoff;
4774  uint32_t e_flags;
4775  uint16_t e_ehsize;
4776  uint16_t e_phentsize;
4777  uint16_t e_phnum;
4778  uint16_t e_shentsize;
4779  uint16_t e_shnum;
4780  uint16_t e_shstrndx;
4781  }
4782 #if !defined(SWIG) && !defined(_MSC_VER)
4783  __attribute__((packed))
4784 #endif
4785  ;
4786 
4788  unsigned char e_ident_magic[4];
4789  unsigned char e_ident_file_class;
4790  unsigned char e_ident_data_encoding;
4791  unsigned char e_ident_file_version;
4792  unsigned char e_ident_padding[9];
4793  uint16_t e_type;
4794  uint16_t e_machine;
4795  uint32_t e_version;
4796  uint64_t e_entry;
4797  uint64_t e_phoff;
4798  uint64_t e_shoff;
4799  uint32_t e_flags;
4800  uint16_t e_ehsize;
4801  uint16_t e_phentsize;
4802  uint16_t e_phnum;
4803  uint16_t e_shentsize;
4804  uint16_t e_shnum;
4805  uint16_t e_shstrndx;
4806  }
4807 #if !defined(SWIG) && !defined(_MSC_VER)
4808  __attribute__((packed))
4809 #endif
4810  ;
4811 
4812 #ifdef _MSC_VER
4813 # pragma pack ()
4814 #endif
4815 
4823  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
4824  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
4825  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
4826  ctor();
4827  }
4828 
4834  uint64_t max_page_size();
4835 
4838 
4841 
4847  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
4848 
4850  virtual bool reallocate() $ROSE_OVERRIDE;
4851 
4853  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4854 
4856  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4857 
4859  static bool is_ELF(SgAsmGenericFile*);
4860 
4862  SgAsmGenericSectionPtrList get_sectab_sections();
4863 
4865  SgAsmGenericSectionPtrList get_segtab_sections();
4866 
4867  // Overrides documented in base class
4868  virtual const char *format_name() const $ROSE_OVERRIDE;
4869 
4870  private:
4871  void ctor(); // called by constructors
4872  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
4873  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
4874 #endif // SgAsmElfFileHeader_OTHERS
4875 
4876 #ifdef DOCUMENTATION
4877  };
4878 #endif
4879 
4880 
4881 
4883 
4884  /*************************************************************************************************************************
4885  * ELF Section Tables
4886  *************************************************************************************************************************/
4887 
4889 
4890  DECLARE_LEAF_CLASS(AsmElfSectionTable);
4891  IS_SERIALIZABLE(AsmElfSectionTable);
4892 
4893 #ifdef DOCUMENTATION
4894 
4900  public:
4901 #endif
4902 
4903  DECLARE_OTHERS(AsmElfSectionTable);
4904 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
4905 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4906  private:
4907  friend class boost::serialization::access;
4908 
4909  template<class S>
4910  void serialize(S &s, const unsigned /*version*/) {
4911  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
4912  }
4913 #endif
4914 
4915  public:
4918  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
4919  ctor();
4920  }
4921 
4927  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
4928 
4940 
4944  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
4945 
4947  virtual bool reallocate() $ROSE_OVERRIDE;
4948 
4950  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4951 
4953  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4954 
4955  private:
4956  void ctor();
4957 #endif // SgAsmElfSectionTable_OTHERS
4958 
4959 #ifdef DOCUMENTATION
4960  };
4961 #endif
4962 
4963 
4965 
4966  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
4967  IS_SERIALIZABLE(AsmElfSectionTableEntry);
4968 
4969 #ifdef DOCUMENTATION
4970 
4972  public:
4973 #endif
4974 
4975 #ifdef DOCUMENTATION
4976 
4981  unsigned get_sh_name() const;
4982  void set_sh_name(unsigned);
4984 #else
4985  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
4986  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4987 #endif
4988 
4989 #ifdef DOCUMENTATION
4990 
4995  SectionType get_sh_type() const;
4996  void set_sh_type(SectionType);
4998 #else
4999  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
5000  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5001 #endif
5002 
5003 #ifdef DOCUMENTATION
5004 
5009  unsigned long get_sh_link() const;
5010  void set_sh_link(unsigned long);
5012 #else
5013  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
5014  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5015 #endif
5016 
5017 #ifdef DOCUMENTATION
5018 
5023  unsigned long get_sh_info() const;
5024  void set_sh_info(unsigned long);
5026 #else
5027  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
5028  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5029 #endif
5030 
5031 #ifdef DOCUMENTATION
5032 
5037  uint64_t get_sh_flags() const;
5038  void set_sh_flags(uint64_t);
5040 #else
5041  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
5042  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5043 #endif
5044 
5045 #ifdef DOCUMENTATION
5046 
5051  rose_addr_t get_sh_addr() const;
5052  void set_sh_addr(rose_addr_t);
5054 #else
5055  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
5056  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5057 #endif
5058 
5059 #ifdef DOCUMENTATION
5060 
5065  rose_addr_t get_sh_offset() const;
5066  void set_sh_offset(rose_addr_t);
5068 #else
5069  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
5070  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5071 #endif
5072 
5073 #ifdef DOCUMENTATION
5074 
5079  rose_addr_t get_sh_size() const;
5080  void set_sh_size(rose_addr_t);
5082 #else
5083  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
5084  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5085 #endif
5086 
5087 #ifdef DOCUMENTATION
5088 
5093  rose_addr_t get_sh_addralign() const;
5094  void set_sh_addralign(rose_addr_t);
5096 #else
5097  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
5098  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5099 #endif
5100 
5101 #ifdef DOCUMENTATION
5102 
5107  rose_addr_t get_sh_entsize() const;
5108  void set_sh_entsize(rose_addr_t);
5110 #else
5111  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
5112  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5113 #endif
5114 
5115 #ifdef DOCUMENTATION
5116 
5121  const SgUnsignedCharList& get_extra() const;
5122  void set_extra(const SgUnsignedCharLit&);
5124 #else
5125  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5126  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5127  NO_DELETE);
5128 #endif
5129 
5130  DECLARE_OTHERS(AsmElfSectionTableEntry);
5131 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5132 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5133  private:
5134  friend class boost::serialization::access;
5135 
5136  template<class S>
5137  void serialize(S &s, const unsigned /*version*/) {
5138  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5139  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5140  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5141  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5142  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5143  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5144  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5145  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5146  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5147  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5148  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5149  s & BOOST_SERIALIZATION_NVP(p_extra);
5150  }
5151 #endif
5152 
5153  public:
5156  SHT_NULL = 0,
5160  SHT_RELA = 4,
5161  SHT_HASH = 5,
5163  SHT_NOTE = 7,
5165  SHT_REL = 9,
5166  SHT_SHLIB = 10,
5167  SHT_DYNSYM = 11,
5169  SHT_LOOS = 0x60000000,
5170  SHT_GNU_verdef = 0x6ffffffd,
5171  SHT_GNU_verneed = 0x6ffffffe,
5172  SHT_GNU_versym = 0x6fffffff,
5173  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5174 
5175  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5176  SHT_HIPROC = 0x7fffffff,
5177  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5178  SHT_HIUSER = 0xffffffff
5179  };
5180 
5184  SHF_WRITE= (1 << 0),
5185  SHF_ALLOC= (1 << 1),
5186  SHF_EXECINSTR= (1 << 2),
5187  SHF_MERGE= (1 << 4),
5188  SHF_STRINGS= (1 << 5),
5189  SHF_INFO_LINK= (1 << 6),
5190  SHF_LINK_ORDER= (1 << 7),
5192  SHF_GROUP= (1 << 9),
5193  SHF_TLS= (1 << 10),
5194  SHF_MASKOS= 0x0ff00000,
5195  SHF_MASKPROC= 0xf0000000
5196  };
5197 
5204 #ifdef _MSC_VER
5205 # pragma pack (1)
5206 #endif
5208  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5209  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5210  uint32_t sh_flags; /* 0x08 Bit flags */
5211  uint32_t sh_addr; /* 0x0c Desired mapped address */
5212  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5213  uint32_t sh_size; /* 0x14 Section size in bytes */
5214  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5215  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5216  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5217  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5218  } /* 0x28 */
5219 #if !defined(SWIG) && !defined(_MSC_VER)
5220  __attribute__((packed))
5221 #endif
5222  ;
5223 
5225  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5226  uint32_t sh_type; /* 0x04 */
5227  uint64_t sh_flags; /* 0x08 */
5228  uint64_t sh_addr; /* 0x10 */
5229  uint64_t sh_offset; /* 0x18 */
5230  uint64_t sh_size; /* 0x20 */
5231  uint32_t sh_link; /* 0x28 */
5232  uint32_t sh_info; /* 0x2c */
5233  uint64_t sh_addralign; /* 0x30 */
5234  uint64_t sh_entsize; /* 0x38 */
5235  } /* 0x40 */
5236 #if !defined(SWIG) && !defined(_MSC_VER)
5237  __attribute__((packed))
5238 #endif
5239  ;
5240 #ifdef _MSC_VER
5241 # pragma pack ()
5242 #endif
5243 
5245  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5247 
5249  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5251 
5255  void *encode(ByteOrder::Endianness sex,
5257  void *encode(ByteOrder::Endianness sex,
5263 
5265  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5266 
5267  // Use Rose::stringify... function instead.
5268  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5269  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5270 
5271  private:
5272  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5273  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5274 #endif // SgAsmElfSectionTableEntry_OTHERS
5275 
5276 #ifdef DOCUMENTATION
5277  };
5278 #endif
5279 
5280 
5281 
5283 
5284  /*************************************************************************************************************************
5285  * ELF Segment Tables
5286  *************************************************************************************************************************/
5287 
5289 
5290  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5291  IS_SERIALIZABLE(AsmElfSegmentTable);
5292 
5293 #ifdef DOCUMENTATION
5294 
5301  public:
5302 #endif
5303 
5304  DECLARE_OTHERS(AsmElfSegmentTable);
5305 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5306 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5307  private:
5308  friend class boost::serialization::access;
5309 
5310  template<class S>
5311  void serialize(S &s, const unsigned /*version*/) {
5312  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5313  }
5314 #endif
5315 
5316  public:
5319  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5320  ctor();
5321  }
5322 
5327  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5328 
5343 
5347  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5348 
5350  virtual bool reallocate() $ROSE_OVERRIDE;
5351 
5353  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5354 
5356  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5357 
5358  private:
5359  void ctor();
5360 #endif // SgAsmElfSegmentTable_OTHERS
5361 
5362 #ifdef DOCUMENTATION
5363  };
5364 #endif
5365 
5367 
5368  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5369  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5370 
5371 #ifdef DOCUMENTATION
5373  public:
5374 #endif
5375 
5376 #ifdef DOCUMENTATION
5377 
5383  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5384  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5386 #else
5387  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5388  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5389  NO_DELETE);
5390 #endif
5391 
5392  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5393 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5394 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5395  private:
5396  friend class boost::serialization::access;
5397 
5398  template<class S>
5399  void serialize(S &s, const unsigned /*version*/) {
5400  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5401  }
5402 #endif
5403 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5404 
5405 #ifdef DOCUMENTATION
5406  };
5407 #endif
5408 
5409 
5411 
5412  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5413  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5414 
5415 #ifdef DOCUMENTATION
5416 
5418  public:
5419 #endif
5420 
5421 #ifdef DOCUMENTATION
5422 
5427  size_t get_index() const;
5428  void set_index(size_t);
5430 #else
5431  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5432  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5433 #endif
5434 
5435 #ifdef DOCUMENTATION
5436 
5439  SegmentType get_type() const;
5440  void set_type(SegmentType);
5442 #else
5443  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5444  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5445  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5446 #endif
5447 
5448 #ifdef DOCUMENTATION
5449 
5452  SegmentFlags get_flags() const;
5453  void set_flags(SegmentFlags);
5455 #else
5456  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5457  "= SgAsmElfSegmentTableEntry::PF_NONE",
5458  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5459 #endif
5460 
5461 #ifdef DOCUMENTATION
5462 
5467  rose_addr_t get_offset() const;
5468  void set_offset(rose_addr_t);
5470 #else
5471  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5472  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5473 #endif
5474 
5475 #ifdef DOCUMENTATION
5476 
5482  rose_addr_t get_vaddr() const;
5483  void set_vaddr(rose_addr_t);
5485 #else
5486  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5487  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5488 #endif
5489 
5490 #ifdef DOCUMENTATION
5491 
5496  rose_addr_t get_paddr() const;
5497  void set_paddr(rose_addr_t);
5499 #else
5500  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5501  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5502 #endif
5503 
5504 #ifdef DOCUMENTATION
5505 
5510  rose_addr_t get_filesz() const;
5511  void set_filesz(rose_addr_t);
5513 #else
5514  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5515  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5516 #endif
5517 
5518 #ifdef DOCUMENTATION
5519 
5524  rose_addr_t get_memsz() const;
5525  void set_memsz(rose_addr_t);
5527 #else
5528  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5529  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5530 #endif
5531 
5532 #ifdef DOCUMENTATION
5533 
5538  rose_addr_t get_align() const;
5539  void set_align(rose_addr_t);
5541 #else
5542  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5543  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5544 #endif
5545 
5546 #ifdef DOCUMENTATION
5547 
5552  const SgUnsignedCharList& get_extra() const;
5553  void set_extra(const SgUnsignedCharList&);
5555 #else
5556  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5557  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5558 #endif
5559 
5560  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5561 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
5562 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5563  private:
5564  friend class boost::serialization::access;
5565 
5566  template<class S>
5567  void serialize(S &s, const unsigned /*version*/) {
5568  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5569  s & BOOST_SERIALIZATION_NVP(p_index);
5570  s & BOOST_SERIALIZATION_NVP(p_type);
5571  s & BOOST_SERIALIZATION_NVP(p_flags);
5572  s & BOOST_SERIALIZATION_NVP(p_offset);
5573  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5574  s & BOOST_SERIALIZATION_NVP(p_paddr);
5575  s & BOOST_SERIALIZATION_NVP(p_filesz);
5576  s & BOOST_SERIALIZATION_NVP(p_memsz);
5577  s & BOOST_SERIALIZATION_NVP(p_align);
5578  s & BOOST_SERIALIZATION_NVP(p_extra);
5579  }
5580 #endif
5581 
5582  public:
5585  PT_NULL = 0,
5586  PT_LOAD = 1,
5589  PT_NOTE = 4,
5590  PT_SHLIB = 5,
5591  PT_PHDR = 6,
5592  PT_TLS = 7,
5594  // OS- and Processor-specific ranges
5595  PT_LOOS = 0x60000000,
5596  PT_HIOS = 0x6fffffff,
5597  PT_LOPROC = 0x70000000,
5598  PT_HIPROC = 0x7fffffff,
5599 
5600  // OS-specific values for GNU/Linux
5601  PT_GNU_EH_FRAME = 0x6474e550,
5602  PT_GNU_STACK = 0x6474e551,
5603  PT_GNU_RELRO = 0x6474e552,
5604  PT_PAX_FLAGS = 0x65041580,
5606  // OS-specific values for Sun
5607  PT_SUNWBSS = 0x6ffffffa,
5608  PT_SUNWSTACK = 0x6ffffffb
5609  };
5610 
5613  PF_NONE = 0,
5614  PF_RESERVED = 0x000ffff8,
5615  PF_XPERM = 0x00000001,
5616  PF_WPERM = 0x00000002,
5617  PF_RPERM = 0x00000004,
5618  PF_OS_MASK = 0x0ff00000,
5619  PF_PROC_MASK = 0xf0000000
5620  };
5621 
5622 #ifdef _MSC_VER
5623 # pragma pack (1)
5624 #endif
5625 
5633  uint32_t p_type;
5634  uint32_t p_offset;
5635  uint32_t p_vaddr;
5636  uint32_t p_paddr;
5637  uint32_t p_filesz;
5638  uint32_t p_memsz;
5639  uint32_t p_flags;
5640  uint32_t p_align;
5641  } /* 0x30 */
5642 #if !defined(SWIG) && !defined(_MSC_VER)
5643  __attribute__((packed))
5644 #endif
5645  ;
5646 
5648  uint32_t p_type; /* 0x00 */
5649  uint32_t p_flags; /* 0x04 */
5650  uint64_t p_offset; /* 0x08 */
5651  uint64_t p_vaddr; /* 0x10 */
5652  uint64_t p_paddr; /* 0x18 */
5653  uint64_t p_filesz; /* 0x20 */
5654  uint64_t p_memsz; /* 0x28 */
5655  uint64_t p_align; /* 0x30 */
5656  } /* 0x38 */
5657 #if !defined(SWIG) && !defined(_MSC_VER)
5658  __attribute__((packed))
5659 #endif
5660  ;
5661 #ifdef _MSC_VER
5662 # pragma pack ()
5663 #endif
5664 
5666  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5668 
5670  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5672 
5676  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
5677  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
5682 
5684  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5685 
5688 
5691 
5692  private:
5693  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
5694  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
5695 #endif // SgAsmElfSegmentTableEntry_OTHERS
5696 
5697 #ifdef DOCUMENTATION
5698  };
5699 #endif
5700 
5701 
5702 
5704 
5705  /*************************************************************************************************************************
5706  * ELF Symbol Tables
5707  *************************************************************************************************************************/
5708 
5710 
5711  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
5712  IS_SERIALIZABLE(AsmElfSymbolSection);
5713 
5714 #ifdef DOCUMENTATION
5715 
5717  public:
5718 #endif
5719 
5720 #ifdef DOCUMENTATION
5721 
5724  bool get_is_dynamic() const;
5725  void set_is_dynamic(bool);
5727 #else
5728  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
5729  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5730 #endif
5731 
5732 #ifdef DOCUMENTATION
5733 
5742 #else
5743  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
5744  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5745 #endif
5746 
5747  DECLARE_OTHERS(AsmElfSymbolSection);
5748 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
5749 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5750  private:
5751  friend class boost::serialization::access;
5752 
5753  template<class S>
5754  void serialize(S &s, const unsigned /*version*/) {
5755  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5756  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
5757  s & BOOST_SERIALIZATION_NVP(p_symbols);
5758  }
5759 #endif
5760 
5761  public:
5764  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
5765  ctor(strsec);
5766  }
5767 
5769  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
5770 
5783  virtual void finish_parsing() $ROSE_OVERRIDE;
5784 
5786  size_t index_of(SgAsmElfSymbol*);
5787 
5792  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5793 
5797  virtual bool reallocate() $ROSE_OVERRIDE;
5798 
5800  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5801 
5803  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5804 
5805  private:
5806  void ctor(SgAsmElfStringSection*);
5807 #endif // SgAsmElfSymbolSection_OTHERS
5808 
5809 #ifdef DOCUMENTATION
5810  };
5811 #endif
5812 
5814 
5815  DECLARE_LEAF_CLASS(AsmElfSymbolList);
5816  IS_SERIALIZABLE(AsmElfSymbolList);
5817 
5818 #ifdef DOCUMENTATION
5820  public:
5821 #endif
5822 
5823 #ifdef DOCUMENTATION
5824 
5830  const SgAsmElfSymbolPtrList& get_symbols() const;
5831  void set_symbols(const SgAsmElfSymbolPtrList&);
5833 #else
5834  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
5835  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5836 #endif
5837 
5838  DECLARE_OTHERS(AsmElfSymbolList);
5839 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
5840 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5841  private:
5842  friend class boost::serialization::access;
5843 
5844  template<class S>
5845  void serialize(S &s, const unsigned /*version*/) {
5846  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5847  s & BOOST_SERIALIZATION_NVP(p_symbols);
5848  }
5849 #endif
5850 #endif // SgAsmElfSymbolList_OTHERS
5851 
5852 #ifdef DOCUMENTATION
5853  };
5854 #endif
5855 
5857 
5858  DECLARE_LEAF_CLASS(AsmElfSymbol);
5859  IS_SERIALIZABLE(AsmElfSymbol);
5860 
5861 #ifdef DOCUMENTATION
5862 
5867  public:
5868 #endif
5869 
5870 #ifdef DOCUMENTATION
5871 
5876  unsigned char get_st_info() const;
5877  void set_st_info(unsigned char);
5879 #else
5880  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
5881  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5882 #endif
5883 
5884 #ifdef DOCUMENTATION
5885 
5890  unsigned char get_st_res1() const;
5891  void set_st_res1(unsigned char);
5893 #else
5894  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
5895  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5896 #endif
5897 
5898 #ifdef DOCUMENTATION
5899 
5904  unsigned get_st_shndx() const;
5905  void set_st_shndx(unsigned);
5907 #else
5908  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
5909  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5910 #endif
5911 
5912 #ifdef DOCUMENTATION
5913 
5918  rose_addr_t get_st_size() const;
5919  void set_st_size(rose_addr_t);
5921 #else
5922  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
5923  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5924 #endif
5925 
5926 #ifdef DOCUMENTATION
5927 
5932  const SgUnsignedCharList& get_extra() const;
5933  void set_extra(const SgUnsignedCharList&);
5935 #else
5936  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
5937  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5938 #endif
5939 
5940  DECLARE_OTHERS(AsmElfSymbol);
5941 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
5942 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5943  private:
5944  friend class boost::serialization::access;
5945 
5946  template<class S>
5947  void serialize(S &s, const unsigned /*version*/) {
5948  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
5949  s & BOOST_SERIALIZATION_NVP(p_st_info);
5950  s & BOOST_SERIALIZATION_NVP(p_st_res1);
5951  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
5952  s & BOOST_SERIALIZATION_NVP(p_st_size);
5953  s & BOOST_SERIALIZATION_NVP(p_extra);
5954  }
5955 #endif
5956 
5957  public:
5958  enum ElfSymBinding {
5959  STB_LOCAL=0,
5960  STB_GLOBAL=1,
5961  STB_WEAK=2
5962  };
5963 
5964  enum ElfSymType {
5967  STT_FUNC = 2,
5969  STT_FILE = 4,
5971  STT_TLS = 6,
5973  };
5974 
5975 #ifdef _MSC_VER
5976 # pragma pack (1)
5977 #endif
5978 
5981  uint32_t st_name;
5982  uint32_t st_value;
5983  uint32_t st_size;
5984  unsigned char st_info;
5985  unsigned char st_res1;
5986  uint16_t st_shndx;
5987  }
5988 #if !defined(SWIG) && !defined(_MSC_VER)
5989  __attribute__((packed))
5990 #endif
5991  ;
5992 
5994  uint32_t st_name;
5995  unsigned char st_info;
5996  unsigned char st_res1;
5997  uint16_t st_shndx;
5998  uint64_t st_value;
5999  uint64_t st_size;
6000  }
6001 #if !defined(SWIG) && !defined(_MSC_VER)
6002  __attribute__((packed))
6003 #endif
6004  ;
6005 
6006 #ifdef _MSC_VER
6007 # pragma pack ()
6008 #endif
6009 
6011  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
6012 
6016  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
6017 
6021  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
6022 
6026  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
6027  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
6035  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6036  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
6040  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
6041 
6044 
6046  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
6047 
6049  static std::string to_string(SgAsmElfSymbol::ElfSymType);
6050 
6051  private:
6052  void ctor(SgAsmElfSymbolSection*);
6053  void parse_common(); // initialization common to all parse() methods
6054 #endif // SgAsmElfSymbol_OTHERS
6055 
6056 #ifdef DOCUMENTATION
6057  };
6058 #endif
6059 
6060 
6061 
6063 
6064  /*************************************************************************************************************************
6065  * ELF Symbol Version Tables
6066  *************************************************************************************************************************/
6067 
6069 
6070  DECLARE_LEAF_CLASS(AsmElfSymverSection);
6071  IS_SERIALIZABLE(AsmElfSymverSection);
6072 
6073 #ifdef DOCUMENTATION
6074 
6079  public:
6080 #endif
6081 
6082 #ifdef DOCUMENTATION
6083 
6092 #else
6093  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
6094  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6095 #endif
6096 
6097  DECLARE_OTHERS(AsmElfSymverSection);
6098 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
6099 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6100  private:
6101  friend class boost::serialization::access;
6102 
6103  template<class S>
6104  void serialize(S &s, const unsigned /*version*/) {
6105  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6106  s & BOOST_SERIALIZATION_NVP(p_entries);
6107  }
6108 #endif
6109 
6110  public:
6113  : SgAsmElfSection(fhdr) {
6114  ctor();
6115  }
6116 
6118  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
6119 
6124  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6125 
6127  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6128 
6130  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6131  private:
6132  void ctor();
6133 #endif // SgAsmElfSymverSection_OTHERS
6134 
6135 #ifdef DOCUMENTATION
6136  };
6137 #endif
6138 
6140 
6141  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6142  IS_SERIALIZABLE(AsmElfSymverEntry);
6143 
6144 #ifdef DOCUMENTATION
6145 
6147  public:
6148 #endif
6149 
6150 #ifdef DOCUMENTATION
6151 
6156  size_t get_value() const;
6157  void set_value(size_t);
6159 #else
6160  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6161  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6162 #endif
6163 
6164  DECLARE_OTHERS(AsmElfSymverEntry);
6165 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6166 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6167  private:
6168  friend class boost::serialization::access;
6169 
6170  template<class S>
6171  void serialize(S &s, const unsigned /*version*/) {
6172  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6173  s & BOOST_SERIALIZATION_NVP(p_value);
6174  }
6175 #endif
6176 
6177  public:
6180  : p_value(0) {
6181  ctor(symver);
6182  }
6183 
6185  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6186 
6187  private:
6188  void ctor(SgAsmElfSymverSection*);
6189 #endif // SgAsmElfSymverEntry_OTHERS
6190 
6191 #ifdef DOCUMENTATION
6192  };
6193 #endif
6194 
6196 
6197 
6198  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6199  IS_SERIALIZABLE(AsmElfSymverEntryList);
6200 
6201 #ifdef DOCUMENTATION
6202 
6207  public:
6208 #endif
6209 
6210 #ifdef DOCUMENTATION
6211 
6214  const SgAsmElfSymverEntryPtrList& get_entries() const;
6215  void set_entries(const SgAsmElfSymverEntryPtrList&);
6217 #else
6218  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6219  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6220  NO_DELETE);
6221 #endif
6222 
6223  DECLARE_OTHERS(AsmElfSymverEntryList);
6224 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6225 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6226  private:
6227  friend class boost::serialization::access;
6228 
6229  template<class S>
6230  void serialize(S &s, const unsigned /*version*/) {
6231  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6232  s & BOOST_SERIALIZATION_NVP(p_entries);
6233  }
6234 #endif
6235 #endif // SgAsmElfSymverEntryList_OTHERS
6236 
6237 #ifdef DOCUMENTATION
6238  };
6239 #endif
6240 
6242 
6243  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6244  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6245 
6246 #ifdef DOCUMENTATION
6247 
6253  public:
6254 #endif
6255 
6256 #ifdef DOCUMENTATION
6257 
6266 #else
6267  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6268  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6269  NO_DELETE);
6270 #endif
6271 
6272  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6273 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6274 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6275  private:
6276  friend class boost::serialization::access;
6277 
6278  template<class S>
6279  void serialize(S &s, const unsigned /*version*/) {
6280  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6281  s & BOOST_SERIALIZATION_NVP(p_entries);
6282  }
6283 #endif
6284 
6285  public:
6288  : SgAsmElfSection(fhdr) {
6289  ctor(strsec);
6290  }
6291 
6360  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6361 
6364  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6365 
6369  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6370 
6372  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6373 
6374  private:
6375  void ctor(SgAsmElfStringSection*);
6376 #endif // SgAsmElfSymverDefinedSection_OTHERS
6377 
6378 #ifdef DOCUMENTATION
6379  };
6380 #endif
6381 
6383 
6384  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6385  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6386 
6387 #ifdef DOCUMENTATION
6388 
6393  public:
6394 #endif
6395 
6396 #ifdef DOCUMENTATION
6397 
6400  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6401  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6403 #else
6404  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6405  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6406  NO_DELETE);
6407 #endif
6408 
6409  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6410 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6411 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6412  private:
6413  friend class boost::serialization::access;
6414 
6415  template<class S>
6416  void serialize(S &s, const unsigned /*version*/) {
6417  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6418  s & BOOST_SERIALIZATION_NVP(p_entries);
6419  }
6420 #endif
6421 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6422 
6423 #ifdef DOCUMENTATION
6424  };
6425 #endif
6426 
6428 
6429  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6430  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6431 
6432 #ifdef DOCUMENTATION
6433 
6435  public:
6436 #endif
6437 
6438 #ifdef DOCUMENTATION
6439 
6444  size_t get_version() const;
6445  void set_version(size_t);
6447 #else
6448  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6449  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6450 #endif
6451 
6452 #ifdef DOCUMENTATION
6453 
6458  int get_flags() const;
6459  void set_flags(int);
6461 #else
6462  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6463  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6464 #endif
6465 
6466 #ifdef DOCUMENTATION
6467 
6472  size_t get_index() const;
6473  void set_index(size_t);
6475 #else
6476  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6477  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6478 #endif
6479 
6480 #ifdef DOCUMENTATION
6481 
6486  uint32_t get_hash() const;
6487  void set_hash(uint32_t);
6489 #else
6490  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6491  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6492 #endif
6493 
6494 #ifdef DOCUMENTATION
6495 
6504 #else
6505  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6506  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6507 #endif
6508 
6509  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6510 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6511 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6512  private:
6513  friend class boost::serialization::access;
6514 
6515  template<class S>
6516  void serialize(S &s, const unsigned /*version*/) {
6517  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6518  s & BOOST_SERIALIZATION_NVP(p_version);
6519  s & BOOST_SERIALIZATION_NVP(p_flags);
6520  s & BOOST_SERIALIZATION_NVP(p_index);
6521  s & BOOST_SERIALIZATION_NVP(p_hash);
6522  s & BOOST_SERIALIZATION_NVP(p_entries);
6523  }
6524 #endif
6525 
6526  public:
6527 #ifdef _MSC_VER
6528 # pragma pack (1)
6529 #endif
6530 
6532  uint16_t vd_version;
6533  uint16_t vd_flags;
6534  uint16_t vd_ndx;
6535  uint16_t vd_cnt;
6536  uint32_t vd_hash;
6537  uint32_t vd_aux;
6538  uint32_t vd_next;
6539  }
6540 #if !defined(SWIG) && !defined(_MSC_VER)
6541  __attribute__((packed))
6542 #endif
6543  ;
6544 
6545 #ifdef _MSC_VER
6546 # pragma pack ()
6547 #endif
6548 
6551  ctor(symver_defined);
6552  }
6553 
6555  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6556 
6558  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6559 
6561  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6562 
6563  private:
6564  void ctor(SgAsmElfSymverDefinedSection*);
6565 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6566 
6567 #ifdef DOCUMENTATION
6568  };
6569 #endif
6570 
6572 
6573  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6574  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6575 
6576 #ifdef DOCUMENTATION
6577 
6582  pbulic:
6583 #endif
6584 
6585 #ifdef DOCUMENTATION
6586 
6589  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6590  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6592 #else
6593  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6594  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6595  NO_DELETE);
6596 #endif
6597 
6598  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6599 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6600 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6601  private:
6602  friend class boost::serialization::access;
6603 
6604  template<class S>
6605  void serialize(S &s, const unsigned /*version*/) {
6606  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6607  s & BOOST_SERIALIZATION_NVP(p_entries);
6608  }
6609 #endif
6610 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6611 
6612 #ifdef DOCUMENTATION
6613  };
6614 #endif
6615 
6617 
6618  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
6619  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
6620 
6621 #ifdef DOCUMENTATION
6623  public:
6624 #endif
6625 
6626 #ifdef DOCUMENTATION
6627 
6630  SgAsmGenericString* get_name() const;
6633 #else
6634  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6635  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6636 #endif
6637 
6638  DECLARE_OTHERS(AsmElfSymverDefinedAux);
6639 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
6640 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6641  private:
6642  friend class boost::serialization::access;
6643 
6644  template<class S>
6645  void serialize(S &s, const unsigned /*version*/) {
6646  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6647  s & BOOST_SERIALIZATION_NVP(p_name);
6648  }
6649 #endif
6650 
6651  public:
6652 #ifdef _MSC_VER
6653 # pragma pack (1)
6654 #endif
6655 
6658  uint32_t vda_name;
6659  uint32_t vda_next;
6660  }
6661 #if !defined(SWIG) && !defined(_MSC_VER)
6662  __attribute__((packed))
6663 #endif
6664  ;
6665 
6666 #ifdef _MSC_VER
6667 # pragma pack ()
6668 #endif
6669 
6674  SgAsmElfSymverDefinedSection *symver_def_sec)
6675  : p_name(NULL) {
6676  ctor(symver_def_entry,symver_def_sec);
6677  }
6678 
6680  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
6681 
6683  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
6684 
6690  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6691 
6692  private:
6693  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
6694 #endif // SgAsmElfSymverDefinedAux_OTHERS
6695 
6696 #ifdef DOCUMENTATION
6697  };
6698 #endif
6699 
6701 
6702  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
6703  IS_SERIALIZABLE(AsmElfSymverNeededSection);
6704 
6705 #ifdef DOCUMENTATION
6706 
6712  public:
6713 #endif
6714 
6715 #ifdef DOCUMENTATION
6716 
6725 #else
6726  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
6727  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6728 #endif
6729 
6730  DECLARE_OTHERS(AsmElfSymverNeededSection);
6731 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
6732 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6733  private:
6734  friend class boost::serialization::access;
6735 
6736  template<class S>
6737  void serialize(S &s, const unsigned /*version*/) {
6738  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6739  s & BOOST_SERIALIZATION_NVP(p_entries);
6740  }
6741 #endif
6742 
6743  public:
6748  : SgAsmElfSection(fhdr) {
6749  ctor(strsec);
6750  }
6751 
6761  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
6762 
6767  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6768 
6772  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6773 
6775  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6776 
6777  private:
6778  void ctor(SgAsmElfStringSection*);
6779 #endif // SgAsmElfSymverNeededSection_OTHERS
6780 
6781 #ifdef DOCUMENTATION
6782  };
6783 #endif
6784 
6786 
6787  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
6788  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
6789 
6790 #ifdef DOCUMENTATION
6791 
6796  public:
6797 #endif
6798 
6799 #ifdef DOCUMENTATION
6800 
6803  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
6804  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
6806 #else
6807  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
6808  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6809  NO_DELETE);
6810 #endif
6811 
6812  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
6813 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
6814 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6815  private:
6816  friend class boost::serialization::access;
6817 
6818  template<class S>
6819  void serialize(S &s, const unsigned /*version*/) {
6820  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6821  s & BOOST_SERIALIZATION_NVP(p_entries);
6822  }
6823 #endif
6824 #endif // SgAsmElfSymverNeededEntryList_OTHERS
6825 
6826 #ifdef DOCUMENTATION
6827  };
6828 #endif
6829 
6831 
6832  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
6833  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
6834 
6835 #ifdef DOCUMENTATION
6836 
6838  public:
6839 #endif
6840 
6841 #ifdef DOCUMENTATION
6842 
6847  size_t get_version() const;
6848  void set_version(size_t);
6850 #else
6851  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
6852  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6853 #endif
6854 
6855 #ifdef DOCUMENTATION
6856 
6862 #else
6863  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
6864  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6865 #endif
6866 
6867 #ifdef DOCUMENTATION
6868 
6877 #else
6878  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
6879  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6880 #endif
6881 
6882  DECLARE_OTHERS(AsmElfSymverNeededEntry);
6883 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
6884 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6885  private:
6886  friend class boost::serialization::access;
6887 
6888  template<class S>
6889  void serialize(S &s, const unsigned /*version*/) {
6890  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6891  s & BOOST_SERIALIZATION_NVP(p_version);
6892  s & BOOST_SERIALIZATION_NVP(p_file_name);
6893  s & BOOST_SERIALIZATION_NVP(p_entries);
6894  }
6895 #endif
6896 
6897  public:
6898 #ifdef _MSC_VER
6899 # pragma pack (1)
6900 #endif
6901 
6904  uint16_t vn_version;
6905  uint16_t vn_cnt;
6906  uint32_t vn_file;
6907  uint32_t vn_aux;
6908  uint32_t vn_next;
6909  }
6910 #if !defined(SWIG) && !defined(_MSC_VER)
6911  __attribute__((packed))
6912 #endif
6913  ;
6914 
6915 #ifdef _MSC_VER
6916 # pragma pack ()
6917 #endif
6918 
6921  : p_file_name(NULL) {
6922  ctor(symver_needed);
6923  }
6924 
6926  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
6927 
6929  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
6930 
6932  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6933 
6934  private:
6935  void ctor(SgAsmElfSymverNeededSection*);
6936 #endif // SgAsmElfSymverNeededEntry_OTHERS
6937 
6938 #ifdef DOCUMENTATION
6939  };
6940 #endif
6941 
6943 
6944  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
6945  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
6946 
6947 #ifdef DOCUMENTATION
6948 
6953  public:
6954 #endif
6955 
6956 #ifdef DOCUMENTATION
6957 
6960  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
6961  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
6963 #else
6964  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
6965  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6966  NO_DELETE);
6967 #endif
6968 
6969  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
6970 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
6971 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6972  private:
6973  friend class boost::serialization::access;
6974 
6975  template<class S>
6976  void serialize(S &s, const unsigned /*version*/) {
6977  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6978  s & BOOST_SERIALIZATION_NVP(p_entries);
6979  }
6980 #endif
6981 #endif // SgAsmElfSymverNeededAuxList_OTHERS
6982 
6983 #ifdef DOCUMENTATION
6984  };
6985 #endif
6986 
6988 
6989  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
6990  IS_SERIALIZABLE(AsmElfSymverNeededAux);
6991 
6992 #ifdef DOCUMENTATION
6993 
6995  public:
6996 #endif
6997 
6998 #ifdef DOCUMENTATION
6999 
7004  uint32_t get_hash() const;
7005  void set_hash(uint32_t);
7007 #else
7008  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
7009  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7010 #endif
7011 
7012 #ifdef DOCUMENTATION
7013 
7018  int get_flags() const;
7019  void set_flags(int);
7021 #else
7022  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
7023  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7024 #endif
7025 
7026 #ifdef DOCUMENTATION
7027 
7032  size_t get_other() const;
7033  void set_other(size_t);
7035 #else
7036  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
7037  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7038 #endif
7039 
7040 #ifdef DOCUMENTATION
7041 
7044  SgAsmGenericString* get_name() const;
7047 #else
7048  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7049  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7050 #endif
7051 
7052  DECLARE_OTHERS(AsmElfSymverNeededAux);
7053 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
7054 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7055  private:
7056  friend class boost::serialization::access;
7057 
7058  template<class S>
7059  void serialize(S &s, const unsigned /*version*/) {
7060  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7061  s & BOOST_SERIALIZATION_NVP(p_hash);
7062  s & BOOST_SERIALIZATION_NVP(p_flags);
7063  s & BOOST_SERIALIZATION_NVP(p_other);
7064  s & BOOST_SERIALIZATION_NVP(p_name);
7065  }
7066 #endif
7067 
7068  public:
7069 #ifdef _MSC_VER
7070 # pragma pack (1)
7071 #endif
7072 
7075  uint32_t vna_hash;
7076  uint16_t vna_flags;
7077  uint16_t vna_other;
7078  uint32_t vna_name;
7079  uint32_t vna_next;
7080  }
7081 #if !defined(SWIG) && !defined(_MSC_VER)
7082  __attribute__((packed))
7083 #endif
7084  ;
7085 
7086 #ifdef _MSC_VER
7087 # pragma pack ()
7088 #endif
7089 
7095  : p_name(NULL) {
7096  ctor(symver_needed_entry,symver_needed_sec);
7097  }
7098 
7100  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
7101 
7103  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
7104 
7110  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7111 
7112  private:
7114 #endif // SgAsmElfSymverNeededAux_OTHERS
7115 
7116 #ifdef DOCUMENTATION
7117  };
7118 #endif
7119 
7120 
7121 
7122 
7124 
7125  /*************************************************************************************************************************
7126  * ELF Relocation Tables
7127  *************************************************************************************************************************/
7128 
7130 
7131  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7132  IS_SERIALIZABLE(AsmElfRelocSection);
7133 
7134 #ifdef DOCUMENTATION
7135 
7137  public:
7138 #endif
7139 
7140 #ifdef DOCUMENTATION
7141 
7144  bool get_uses_addend() const;
7145  void set_uses_addend(bool);
7147 #else
7148  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7149  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7150 #endif
7151 
7152 #ifdef DOCUMENTATION
7153 
7159 #else
7160  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7161  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7162 #endif
7163 
7164 #ifdef DOCUMENTATION
7165 
7173 #else
7174  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7175  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7176 #endif
7177 
7178  DECLARE_OTHERS(AsmElfRelocSection);
7179 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7180 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7181  private:
7182  friend class boost::serialization::access;
7183 
7184  template<class S>
7185  void serialize(S &s, const unsigned /*version*/) {
7186  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7187  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7188  s & BOOST_SERIALIZATION_NVP(p_target_section);
7189  s & BOOST_SERIALIZATION_NVP(p_entries);
7190  }
7191 #endif
7192 
7193  public:
7195  : SgAsmElfSection(fhdr) {
7196  ctor(symsec,targetsec);
7197  }
7198 
7201  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7202 
7204  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7205 
7207  virtual bool reallocate() $ROSE_OVERRIDE;
7208 
7210  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7211 
7213  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7214 
7215  private:
7217 #endif // SgAsmElfRelocSection_OTHERS
7218 
7219 #ifdef DOCUMENTATION
7220  };
7221 #endif
7222 
7224 
7225  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7226  IS_SERIALIZABLE(AsmElfRelocEntryList);
7227 
7228 #ifdef DOCUMENTATION
7229 
7234  public:
7235 #endif
7236 
7237 #ifdef DOCUMENTATION
7238 
7241  const SgAsmElfRelocEntryPtrList& get_entries() const;
7242  void set_entries(const SgAsmElfRelocEntryPtrList&);
7244 #else
7245  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7246  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7247  NO_DELETE);
7248 #endif
7249 
7250  DECLARE_OTHERS(AsmElfRelocEntryList);
7251 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7252 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7253  private:
7254  friend class boost::serialization::access;
7255 
7256  template<class S>
7257  void serialize(S &s, const unsigned /*version*/) {
7258  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7259  s & BOOST_SERIALIZATION_NVP(p_entries);
7260  }
7261 #endif
7262 #endif // SgAsmElfRelocEntryList_OTHERS
7263 
7264 #ifdef DOCUMENTATION
7265  };
7266 #endif
7267 
7269 
7270  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7271  IS_SERIALIZABLE(AsmElfRelocEntry);
7272 
7273 #ifdef DOCUMENTATION
7274 
7276  public:
7277 #endif
7278 
7279 #ifdef DOCUMENTATION
7280 
7285  rose_addr_t get_r_offset() const;
7286  void set_r_offset(rose_addr_t);
7288 #else
7289  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7290  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7291 #endif
7292 
7293 #ifdef DOCUMENTATION
7294 
7299  rose_addr_t get_r_addend() const;
7300  void set_r_addend(rose_addr_t);
7302 #else
7303  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7304  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7305 #endif
7306 
7307 #ifdef DOCUMENTATION
7308 
7313  unsigned long get_sym() const;
7314  void set_sym(unsigned long);
7316 #else
7317  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7318  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7319 #endif
7320 
7321 #ifdef DOCUMENTATION
7322 
7327  RelocType get_type() const;
7328  void set_type(RelocType);
7330 #else
7331  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7332  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7333 #endif
7334 
7335 #ifdef DOCUMENTATION
7336 
7339  const SgUnsignedCharList& get_extra() const;
7340  void set_extra(const SgUnsignedCharList&);
7342 #else
7343  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7344  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7345 #endif
7346 
7347  DECLARE_OTHERS(AsmElfRelocEntry);
7348 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7349 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7350  private:
7351  friend class boost::serialization::access;
7352 
7353  template<class S>
7354  void serialize(S &s, const unsigned /*version*/) {
7355  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7356  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7357  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7358  s & BOOST_SERIALIZATION_NVP(p_sym);
7359  s & BOOST_SERIALIZATION_NVP(p_type);
7360  s & BOOST_SERIALIZATION_NVP(p_extra);
7361  }
7362 #endif
7363 
7364  public:
7367  // Intel 80386 specific definitions.
7379  R_386_32PLT =11,
7386  R_386_16 =20,
7387  R_386_PC16 =21,
7388  R_386_8 =22,
7389  R_386_PC8 =23,
7405  // First Entry for X86-64
7420  R_X86_64_8 =114,
7430  };
7431 
7432 #ifdef _MSC_VER
7433 # pragma pack (1)
7434 #endif
7435 
7437  uint32_t r_offset;
7438  uint32_t r_info;
7439  uint32_t r_addend;
7440  }
7441 #if !defined(SWIG) && !defined(_MSC_VER)
7442  __attribute__((packed))
7443 #endif
7444  ;
7445 
7447  uint64_t r_offset;
7448  uint64_t r_info;
7449  uint64_t r_addend;
7450  }
7451 #if !defined(SWIG) && !defined(_MSC_VER)
7452  __attribute__((packed))
7453 #endif
7454  ;
7455 
7457  uint32_t r_offset;
7458  uint32_t r_info;
7459  }
7460 #if !defined(SWIG) && !defined(_MSC_VER)
7461  __attribute__((packed))
7462 #endif
7463  ;
7464 
7466  uint64_t r_offset;
7467  uint64_t r_info;
7468  }
7469 #if !defined(SWIG) && !defined(_MSC_VER)
7470  __attribute__((packed))
7471 #endif
7472  ;
7473 
7474 #ifdef _MSC_VER
7475 # pragma pack ()
7476 #endif
7477 
7480  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7481  ctor(section);
7482  }
7483 
7487  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7488  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7489  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7490  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7496  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7497  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7498  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7499  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7505  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7506  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7507  dump(f, prefix, idx, NULL);
7508  }
7512  std::string reloc_name() const;
7513 
7514  private:
7515  void ctor(SgAsmElfRelocSection*);
7516 #endif // SgAsmElfRelocEntry_OTHERS
7517 
7518 #ifdef DOCUMENTATION
7519  };
7520 #endif
7521 
7522 
7523 
7525 
7526  /*************************************************************************************************************************
7527  * ELF Dynamic Linking
7528  *************************************************************************************************************************/
7529 
7531 
7532  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7533  IS_SERIALIZABLE(AsmElfDynamicSection);
7534 
7535 #ifdef DOCUMENTATION
7536 
7538  public:
7539 #endif
7540 
7541 #ifdef DOCUMENTATION
7542 
7551 #else
7552  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7553  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7554 #endif
7555 
7556  DECLARE_OTHERS(AsmElfDynamicSection);
7557 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7558 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7559  private:
7560  friend class boost::serialization::access;
7561 
7562  template<class S>
7563  void serialize(S &s, const unsigned /*version*/) {
7564  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7565  s & BOOST_SERIALIZATION_NVP(p_entries);
7566  }
7567 #endif
7568 
7569  public:
7572  : SgAsmElfSection(fhdr) {
7573  ctor(strsec);
7574  }
7575 
7577  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7578 
7580  virtual void finish_parsing() $ROSE_OVERRIDE;
7581 
7584  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7585 
7587  virtual bool reallocate() $ROSE_OVERRIDE;
7588 
7590  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7591 
7593  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7594 
7595  private:
7596  void ctor(SgAsmElfStringSection*);
7597 #endif // SgAsmElfDynamicSection_OTHERS
7598 
7599 #ifdef DOCUMENTATION
7600  };
7601 #endif
7602 
7604 
7605  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7606  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7607 
7608 #ifdef DOCUMENTATION
7609 
7614  public:
7615 #endif
7616 
7617 #ifdef DOCUMENTATION
7618 
7621  const SgAsmElfDynamicEntryPtrList& get_entries() const;
7622  void set_entries(const SgAsmElfDynamicEntryPtrList&);
7624 #else
7625  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
7626  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
7627  NO_DELETE);
7628 #endif
7629 
7630  DECLARE_OTHERS(AsmElfDynamicEntryList);
7631 #if defined(SgAsmElfDynamicEntryList_OTHERS) || defined(DOCUMENTATION)
7632 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7633  private:
7634  friend class boost::serialization::access;
7635 
7636  template<class S>
7637  void serialize(S &s, const unsigned /*version*/) {
7638  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7639  s & BOOST_SERIALIZATION_NVP(p_entries);
7640  }
7641 #endif
7642 #endif // SgAsmElfDynamicEntryList_OTHERS
7643 
7644 #ifdef DOCUMENTATION
7645  };
7646 #endif
7647 
7649 
7650  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
7651  IS_SERIALIZABLE(AsmElfDynamicEntry);
7652 
7653 #ifdef DOCUMENTATION
7654 
7656  public:
7657 #endif
7658 
7659 #ifdef DOCUMENTATION
7660 
7665  EntryType get_d_tag() const;
7666  void set_d_tag(EntryType);
7668 #else
7669  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
7670  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7671 #endif
7672 
7673 #ifdef DOCUMENTATION
7674 
7679  rose_rva_t get_d_val() const;
7680  void set_d_val(rose_rva_t);
7682 #else
7683  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
7684  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7685 #endif
7686 
7687 #ifdef DOCUMENTATION
7688  // declared and documented below
7689 #else
7690  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
7691  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7692 #endif
7693 
7694 #ifdef DOCUMENTATION
7695 
7698  const SgUnsignedCharList& get_extra() const;
7699  void set_extra(const SgUnsignedCharList&);
7701 #else
7702  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7703  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7704 #endif
7705 
7706  DECLARE_OTHERS(AsmElfDynamicEntry);
7707 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
7708 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7709  private:
7710  friend class boost::serialization::access;
7711 
7712  template<class S>
7713  void serialize(S &s, const unsigned /*version*/) {
7714  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7715  s & BOOST_SERIALIZATION_NVP(p_d_tag);
7716  s & BOOST_SERIALIZATION_NVP(p_d_val);
7717  s & BOOST_SERIALIZATION_NVP(p_name);
7718  s & BOOST_SERIALIZATION_NVP(p_extra);
7719  }
7720 #endif
7721 
7722  public:
7723  enum EntryType { /* Type Executable SharedObj Purpose */
7724  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
7725  DT_NEEDED = 1, /* value optional optional Name of needed library */
7726  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
7727  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
7728  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
7729  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
7730  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
7731  DT_RELA = 7, /* pointer mandatory optional Relocation table */
7732  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
7733  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
7734  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
7735  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
7736  DT_INIT = 12, /* pointer optional optional Initialization function */
7737  DT_FINI = 13, /* pointer optional optional Termination function */
7738  DT_SONAME = 14, /* value ignored optional Name of shared object */
7739  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
7740  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
7741  DT_REL = 17, /* pointer mandatory optional Relocation table */
7742  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
7743  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
7744  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
7745  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
7746  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
7747  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
7748  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
7749  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
7750  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
7751  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
7752  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
7753  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
7754  DT_FLAGS = 30, /* value optional ? Bit flags */
7755  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
7756  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
7757  DT_NUM = 34, /* ? ? ? "number used"? */
7758 
7759  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
7760  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
7761  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
7762  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
7763  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
7764  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
7765  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
7766  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
7767  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
7768  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
7769  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
7770 
7771  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
7772  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
7773  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
7774  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
7775  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
7776  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
7777  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
7778  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
7779  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
7780  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
7781  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
7782 
7783  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
7784  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
7785  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
7786  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
7787  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
7788  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
7789  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
7790  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
7791 
7792  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
7793  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
7794  };
7795 
7796 #ifdef _MSC_VER
7797 # pragma pack (1)
7798 #endif
7799 
7802  uint32_t d_tag;
7803  uint32_t d_val;
7804  }
7805 #if !defined(SWIG) && !defined(_MSC_VER)
7806  __attribute__((packed))
7807 #endif
7808  ;
7809 
7811  uint64_t d_tag;
7812  uint64_t d_val;
7813  }
7814 #if !defined(SWIG) && !defined(_MSC_VER)
7815  __attribute__((packed))
7816 #endif
7817  ;
7818 
7819 #ifdef _MSC_VER
7820 # pragma pack ()
7821 #endif
7822 
7825  : p_d_tag(DT_NULL), p_name(NULL) {
7826  ctor(dynsec);
7827  }
7828 
7832  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);
7833  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*);
7839  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*) const;
7840  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*) const;
7844  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
7845 
7847  static std::string to_string(SgAsmElfDynamicEntry::EntryType);
7848 
7852  SgAsmGenericString* get_name() const { return p_name; }
7856  private:
7857  void ctor(SgAsmElfDynamicSection*);
7858 #endif // SgAsmElfDynamicEntry_OTHERS
7859 
7860 #ifdef DOCUMENTATION
7861  };
7862 #endif
7863 
7864 
7865 
7866 
7868 
7869  /*************************************************************************************************************************
7870  * ELF String Tables
7871  *************************************************************************************************************************/
7872 
7874 
7875  DECLARE_LEAF_CLASS(AsmElfStringSection);
7876  IS_SERIALIZABLE(AsmElfStringSection);
7877  AsmElfStringSection.setAutomaticGenerationOfDestructor(false);
7878 
7879 #ifdef DOCUMENTATION
7880 
7884  public:
7885 #endif
7886 
7887 #ifdef DOCUMENTATION
7888 
7893  SgAsmElfStrtab* get_strtab() const;
7894  void set_strtab(SgAsmElfStrtab*);
7896 #else
7897  AsmElfStringSection.setDataPrototype("SgAsmElfStrtab*", "strtab", "= NULL",
7898  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7899 #endif
7900 
7901  DECLARE_OTHERS(AsmElfStringSection);
7902 #if defined(SgAsmElfStringSection_OTHERS) || defined(DOCUMENTATION)
7903 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7904  private:
7905  friend class boost::serialization::access;
7906 
7907  template<class S>
7908  void serialize(S &s, const unsigned /*version*/) {
7909  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7910  s & BOOST_SERIALIZATION_NVP(p_strtab);
7911  }
7912 #endif
7913 
7914  public:
7917  : SgAsmElfSection(fhdr), p_strtab(NULL) {
7918  ctor();
7919  }
7920 
7922  virtual SgAsmElfStringSection *parse() $ROSE_OVERRIDE;
7923 
7925  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7926 
7931  virtual void set_size(rose_addr_t newsize) $ROSE_OVERRIDE;
7932 
7939  virtual bool reallocate() $ROSE_OVERRIDE;
7940 
7942  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7943 
7944  private:
7945  void ctor();
7946  void ctor(SgAsmElfSectionTable*);
7947 #endif // SgAsmElfStringSection_OTHERS
7948 
7949 #ifdef DOCUMENTATION
7950  };
7951 #endif
7952 
7954 
7955  DECLARE_LEAF_CLASS(AsmElfStrtab);
7956  IS_SERIALIZABLE(AsmElfStrtab);
7957  AsmElfStrtab.setAutomaticGenerationOfDestructor(false);
7958 
7959 #ifdef DOCUMENTATION
7960 
7961  class SgAsmElfStrtab: public SgAsmGenericStrtab {
7962  public:
7963 #endif
7964 
7965  DECLARE_OTHERS(AsmElfStrtab);
7966 #if defined(SgAsmElfStrtab_OTHERS) || defined(DOCUMENTATION)
7967 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7968  private:
7969  friend class boost::serialization::access;
7970 
7971  template<class S>
7972  void serialize(S &s, const unsigned /*version*/) {
7973  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericStrtab);
7974  }
7975 #endif
7976 
7977  public:
7981  explicit SgAsmElfStrtab(class SgAsmElfSection *containing_section)
7982  : SgAsmGenericStrtab(containing_section) {
7983  ctor();
7984  }
7985 
7992  virtual ~SgAsmElfStrtab();
7993 
7997  virtual SgAsmElfStrtab *parse() $ROSE_OVERRIDE;
7998 
8002  virtual void unparse(std::ostream&) const;
8003 
8009  virtual SgAsmStringStorage *create_storage(rose_addr_t offset, bool shared) $ROSE_OVERRIDE;
8010 
8014  virtual rose_addr_t get_storage_size(const SgAsmStringStorage*) $ROSE_OVERRIDE;
8015 
8025  virtual void allocate_overlap(SgAsmStringStorage*) $ROSE_OVERRIDE;
8026 
8028  virtual void rebind(SgAsmStringStorage*, rose_addr_t) $ROSE_OVERRIDE;
8029 
8030  private:
8031  void ctor();
8032 #endif // SgAsmElfStrtab_OTHERS
8033 
8034 #ifdef DOCUMENTATION
8035  };
8036 #endif
8037 
8038 
8039 
8040 
8042 
8043  /*************************************************************************************************************************
8044  * ELF Notes
8045  *************************************************************************************************************************/
8046 
8048 
8049  DECLARE_LEAF_CLASS(AsmElfNoteSection);
8050  IS_SERIALIZABLE(AsmElfNoteSection);
8051 
8052 #ifdef DOCUMENTATION
8054  public:
8055 #endif
8056 
8057 #ifdef DOCUMENTATION
8058 
8067 #else
8068  AsmElfNoteSection.setDataPrototype("SgAsmElfNoteEntryList*", "entries", "= NULL",
8069  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8070 #endif
8071 
8072  DECLARE_OTHERS(AsmElfNoteSection);
8073 #if defined(SgAsmElfNoteSection_OTHERS) || defined(DOCUMENTATION)
8074 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8075  private:
8076  friend class boost::serialization::access;
8077 
8078  template<class S>
8079  void serialize(S &s, const unsigned /*version*/) {
8080  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8081  s & BOOST_SERIALIZATION_NVP(p_entries);
8082  }
8083 #endif
8084 
8085  public:
8088  : SgAsmElfSection(fhdr) {
8089  ctor();
8090  }
8091  virtual SgAsmElfNoteSection *parse() $ROSE_OVERRIDE;
8092 
8094  virtual bool reallocate() $ROSE_OVERRIDE;
8095 
8097  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8098 
8100  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8101 
8102  private:
8103  void ctor();
8104 #endif // SgAsmElfNoteSection_OTHERS
8105 
8106 #ifdef DOCUMENTATION
8107  };
8108 #endif
8109 
8111 
8112  DECLARE_LEAF_CLASS(AsmElfNoteEntryList);
8113  IS_SERIALIZABLE(AsmElfNoteEntryList);
8114 
8115 #ifdef DOCUMENTATION
8116 
8121  public:
8122 #endif
8123 
8124 #ifdef DOCUMENTATION
8125 
8128  const SgAsmElfNoteEntryPtrList& get_entries() const;
8129  void set_entries(const SgAsmElfNoteEntryPtrList&);
8131 #else
8132  AsmElfNoteEntryList.setDataPrototype("SgAsmElfNoteEntryPtrList", "entries", "",
8133  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8134 #endif
8135 
8136  DECLARE_OTHERS(AsmElfNoteEntryList);
8137 #if defined(SgAsmElfNoteEntryList_OTHERS) || defined(DOCUMENTATION)
8138 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8139  private:
8140  friend class boost::serialization::access;
8141 
8142  template<class S>
8143  void serialize(S &s, const unsigned /*version*/) {
8144  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8145  s & BOOST_SERIALIZATION_NVP(p_entries);
8146  }
8147 #endif
8148 #endif // SgAsmElfNoteEntryList_OTHERS
8149 
8150 #ifdef DOCUMENTATION
8151  };
8152 #endif
8153 
8155 
8156  DECLARE_LEAF_CLASS(AsmElfNoteEntry);
8157  IS_SERIALIZABLE(AsmElfNoteEntry);
8158 
8159 #ifdef DOCUMENTATION
8160 
8162  public:
8163 #endif
8164 
8165 #ifdef DOCUMENTATION
8166 
8171  unsigned get_type() const;
8172  void set_type(unsigned);
8174 #else
8175  AsmElfNoteEntry.setDataPrototype("unsigned", "type", "= 0",
8176  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8177 #endif
8178 
8179 #ifdef DOCUMENTATION
8180  // documented below
8181 #else
8182  AsmElfNoteEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
8183  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8184 #endif
8185 
8186 #ifdef DOCUMENTATION
8187 
8192  const SgUnsignedCharList& get_payload() const;
8193  void set_payload(const SgUnsignedCharList&);
8195 #else
8196  AsmElfNoteEntry.setDataPrototype("SgUnsignedCharList", "payload", "",
8197  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8198 #endif
8199 
8200  DECLARE_OTHERS(AsmElfNoteEntry);
8201 #if defined(SgAsmElfNoteEntry_OTHERS) || defined(DOCUMENTATION)
8202 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8203  private:
8204  friend class boost::serialization::access;
8205 
8206  template<class S>
8207  void serialize(S &s, const unsigned /*version*/) {
8208  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8209  s & BOOST_SERIALIZATION_NVP(p_type);
8210  s & BOOST_SERIALIZATION_NVP(p_name);
8211&