ROSE  0.9.9.139
binaryInstruction.C
1 /******************************************************************************************************************************
2  * NOTE: For any given IR class, please keep all its parts as close together as possible. Its bad enough that we're
3  * defining classes in a non-C-like language -- and it's painful when a definition is scattered all over this file. We
4  * already have four places to look to get the definition of an IR class:
5  * (1) here, in this source file, built with ROSETTA functions
6  * (2) additional declarations between HEADER_* markers in ../Grammar/BinaryInstruction.code (which we can't
7  * even parse as a C++ file, making IDEs useless there).
8  * (3) function definitions between SOURCE_* markers in ../Grammar/BinaryInstruction.code, which for some
9  * reason are not next to the corresponding HEADER_ markers. Please migrate these definitions to *.C files
10  * whenever you have an opportunity, so that IDEs can see the definitions.
11  * (4) Doxygen documentation in ../../../docs/testDoxygen directory since doxygen can't parse the IR classes
12  * from this source file. Documented entities are marked with a "DOXYGEN" comment here to make it more
13  * obvious when documentation is present.
14  *
15  * NOTE: First part of the file is for classes describing instructions. Middle part is for classes describing binary
16  * containers (organized by container type: ELF, DOS, PE, ...) Last part is the base classes. Unlike C++, the classes
17  * defined in this file need to be defined from the most specific (derived classes) to the most general (base class).
18  *
19  * NOTE: Please use three blank lines between IR node definitions to help make this file more readable. Unless those IR
20  * nodes are so closely related to one another that it's better to keep them close.
21  *
22  * UPDATE: Instead of splitting class declarations into four separate places, we can now use the macros defined below to put
23  * everything into one place in this file. My goal is to eventually remove the
24  * src/ROSETTA/Grammar/BinaryInstruction.code file and the related docs/testDoxygen/xxx.docs files and to add
25  * documentation here for all property accessors.
26  *
27  * ROSETTA FAILURE MODES:
28  *
29  * + If you get thousands of compile errors in Cxx_Grammar.h that seem to have absolutely nothing to do with the node
30  * you just added, then double check that the new node type is listed as the descendant of some other node type in a
31  * NEW_NONTERMINAL_MACRO macro expansion.
32  *
33  * + If CxxGrammarMetaProgram uses gigabytes and gigabytes of memory and never terminates then check that all the new
34  * IR node types have a correctly spelled entry in the astNodeList file.
35  *-----------------------------------------------------------------------------------------------------------------------------*/
36 
37 #include "ROSETTA_macros.h"
38 #include "grammar.h"
39 #include "AstNodeClass.h"
40 
41 // 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
42 // of doing things required the class declarations to be split into four places:
43 // (1) The #include files necessary to declare the class were at the top of a src/ROSETTA/Grammar/*.code file
44 // (2) The class declaration and properties were built in src/ROSETTA/src/*.C
45 // (3) The documentation for the class and its properties were in docs/testDoxygen/*.docs files
46 // (4) Additional non-ROSETTA members were in src/ROSETTA/Grammar/*.code files
47 // Implementations were originally also in the src/ROSETTA/Grammar/*.code files but have since been moved to *.C files. The
48 // problem with *.code files is no IDE understands them.
49 //
50 // The following macros take a CLASS_WITHOUT_Sg parameter, which is the name of the Sage node class but without the leading
51 // "Sg". I'm not sure why ROSETTA was written this way. For instance, use "AsmInstruction" instead of "SgAsmInstruction". Most
52 // other things will use the full class name.
53 //
54 // The macros are:
55 // DOCUMENTATION is never defined when compiling, but will be defined when generating documentation and can be used to help
56 // IDE's figure out the indentation and as commentary. We don't use "#if 0" because some IDEs figure out that the code is
57 // never possible and don't indent it properly. For instance, most of the classes are defined like this:
58 // #ifdef DOCUMENTATION
59 // class SgAsmArmInstruction: public SgAsmInstruction {
60 // #endif
61 //
62 // ...
63 //
64 // #ifdef DOCUMENTATION
65 // };
66 // #endif
67 //
68 //
69 // DECLARE_LEAF_CLASS is the simpler way to declare a Sage class that has no subclasses. This must be the first macro
70 // invoked when starting a new class declaration. Example, to declare the SgMyClass node, say:
71 // DECLARE_LEAF_CLASS(MyClass);
72 // #ifdef DOCUMENTATION
73 // class SgMyClass: public ...base-classes... {
74 // #endif
75 //
76 //
77 // DECLARE_HEADERS is used to indicate what header files need to be included. Note that due to limitations of ROSETTA
78 // (specifically, not having any portable regular expression library due to prohibition against using boost), the #ifdef and
79 // #endif lines must be *exactly* as written here -- they are sensitive to white space.
80 // DECLARE_HEADERS(MyClass);
81 // #if defined(SgMyClass_HEADERS) || defined(DOCUMENTATION)
82 // #include <someHeader>
83 // #endif // SgMyClass_HEADERS
84 //
85 //
86 // DECLARE_OTHERS is for declaring other class members that don't need to be processed by ROSETTA. Due to limitations of
87 // ROSETTA (specifically, not having any portable regular expression library due to prohibition against using boost), the
88 // #ifdef and #endif lines must be *exactly* as written here -- they are sensitive to white space.
89 // DECLARE_OTHERS(MyClass);
90 // #if defined(SgMyClass_OTHERS) || defined(DOCUMENTATION)
91 // // other declarations here
92 // #endif // SgMyClass_OTHERS
93 
94 //#undef DOCUMENTATION -- commented out so IDEs can't figure it out
95 #ifdef DOCUMENTATION
96 DOCUMENTATION_should_never_be_defined;
97 #endif
98 
99 #ifdef DOCUMENTATION
100 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) /*void*/
101 #else
102 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) \
103  NEW_TERMINAL_MACRO(CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg "Tag"); \
104  CLASS_WITHOUT_Sg.setCppCondition("!defined(DOCUMENTATION)")
105 #endif
106 
107 #ifdef DOCUMENTATION
108 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) /*void*/
109 #else
110 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) \
111  CLASS_WITHOUT_Sg.setPredeclarationString("Sg" #CLASS_WITHOUT_Sg "_HEADERS", __FILE__)
112 #endif
113 
114 #ifdef DOCUMENTATION
115 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) /*void*/
116 #else
117 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) \
118  CLASS_WITHOUT_Sg.setFunctionPrototype("Sg" #CLASS_WITHOUT_Sg "_OTHERS", __FILE__)
119 #endif
120 
121 #ifdef DOCUMENTATION
122 #define IS_SERIALIZABLE() /*void*/
123 #else
124 #define IS_SERIALIZABLE(CLASS_WITHOUT_Sg) \
125  CLASS_WITHOUT_Sg.isBoostSerializable(true)
126 #endif
127 
128 // Since ROSETTA builds classes from the leaves up to the base, and C++ builds classes from the base down to the leaves, we
129 // need to make sure that doxygen sees the base classes before the derived classes. So just list all the non-leaf classes here.
130 #ifdef DOCUMENTATION
133 class SgAsmDwarfConstruct;
135 class SgAsmElfSection;
137 class SgAsmExpression;
138 class SgAsmGenericHeader;
139 class SgAsmGenericSection;
140 class SgAsmGenericString;
141 class SgAsmGenericStrtab;
142 class SgAsmGenericSymbol;
143 class SgAsmInstruction;
144 class SgAsmNode;
145 class SgAsmPESection;
147 class SgAsmScalarType;
148 class SgAsmStatement;
149 class AsmSynthesizedFieldDeclaration;
150 class SgAsmType;
153 class SgNode;
154 #endif
155 
156 #ifndef DOCUMENTATION
157 void Grammar::setUpBinaryInstructions() {
158 #endif
159 
161 
162  /**************************************************************************************************************************
163  * Instructions.
164  * Base class (SgAsmInstruction) and various subclasses, one per architecture.
165  **************************************************************************************************************************/
166 
168 
169  DECLARE_LEAF_CLASS(AsmArmInstruction);
170  IS_SERIALIZABLE(AsmArmInstruction);
171 
172  DECLARE_HEADERS(AsmArmInstruction);
173 #if defined(SgAsmArmInstruction_HEADERS) || defined(DOCUMENTATION)
174  #include <armInstructionEnum.h>
175 #endif // SgAsmArmInstruction_HEADERS
176 
177 #ifdef DOCUMENTATION
178 
180  public:
181 #endif
182 
183 #ifdef DOCUMENTATION
184 
190  ArmInstructionKind get_kind() const;
191  void set_kind(ArmInstructionKind);
193 #else
194  AsmArmInstruction.setDataPrototype("ArmInstructionKind", "kind", "= arm_unknown_instruction",
195  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
196 #endif
197 
198 #ifdef DOCUMENTATION
199 
202  ArmInstructionCondition get_condition() const;
203  void set_condition(ArmInstructionCondition);
205 #else
206  AsmArmInstruction.setDataPrototype("ArmInstructionCondition", "condition", "= arm_cond_unknown",
207  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
208 #endif
209 
210 #ifdef DOCUMENTATION
211 
217 #else
218  AsmArmInstruction.setDataPrototype("int", "positionOfConditionInMnemonic", "= -1",
219  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
220 #endif
221 
222  DECLARE_OTHERS(AsmArmInstruction);
223 #if defined(SgAsmArmInstruction_OTHERS) || defined(DOCUMENTATION)
224 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
225  private:
226  friend class boost::serialization::access;
227 
228  template<class S>
229  void serialize(S &s, const unsigned version) {
230  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
231  s & BOOST_SERIALIZATION_NVP(p_kind);
232  s & BOOST_SERIALIZATION_NVP(p_condition);
233  s & BOOST_SERIALIZATION_NVP(p_positionOfConditionInMnemonic);
234  }
235 #endif
236 
237  public:
238  // Overrides are documented in the base class
239  virtual std::string description() const $ROSE_OVERRIDE;
240  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
241  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
242  virtual bool isUnknown() const $ROSE_OVERRIDE;
243  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
244 #endif // SgAsmArmInstruction_OTHERS
245 #ifdef DOCUMENTATION
246  };
247 #endif
248 
249 
251 
252  DECLARE_LEAF_CLASS(AsmX86Instruction);
253  IS_SERIALIZABLE(AsmX86Instruction);
254  DECLARE_HEADERS(AsmX86Instruction);
255 #if defined(SgAsmX86Instruction_HEADERS) || defined(DOCUMENTATION)
256  #include <InstructionEnumsX86.h>
257  class RegisterDictionary;
258 #endif // SgAsmX86Instruction_HEADERS
259 
260 #ifdef DOCUMENTATION
261 
263  public:
264 #endif
265 
266 #ifdef DOCUMENTATION
267 
273  X86InstructionKind get_kind() const;
274  void set_kind(X86InstructionSize);
276 #else
277  AsmX86Instruction.setDataPrototype("X86InstructionKind", "kind", "= x86_unknown_instruction",
278  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
279 #endif
280 
281 #ifdef DOCUMENTATION
282 
285  X86InstructionSize get_baseSize() const;
286  void set_baseSize(X86InstructionSize);
288 #else
289  AsmX86Instruction.setDataPrototype("X86InstructionSize", "baseSize", "= x86_insnsize_none",
290  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
291 #endif
292 
293 #ifdef DOCUMENTATION
294 
297  X86InstructionSize get_operandSize() const;
298  void set_operandSize(X86InstructionSize);
300 #else
301  AsmX86Instruction.setDataPrototype("X86InstructionSize", "operandSize", "= x86_insnsize_none",
302  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
303 #endif
304 
305 #ifdef DOCUMENTATION
306 
309  X86InstructionSize get_addressSize() const;
310  void set_addressSize(X86InstructionSize);
312 #else
313  AsmX86Instruction.setDataPrototype("X86InstructionSize", "addressSize", "= x86_insnsize_none",
314  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
315 #endif
316 
317 #ifdef DOCUMENTATION
318 
323  bool get_lockPrefix() const;
324  void set_lockPrefix(bool);
326 #else
327  AsmX86Instruction.setDataPrototype("bool", "lockPrefix", "= false",
328  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
329 #endif
330 
331 #ifdef DOCUMENTATION
332 
335  X86RepeatPrefix get_repeatPrefix() const;
336  void set_repeatPrefix(X86RepeatPrefix);
338 #else
339  AsmX86Instruction.setDataPrototype("X86RepeatPrefix", "repeatPrefix", "= x86_repeat_none",
340  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
341 #endif
342 
343 #ifdef DOCUMENTATION
344 
347  X86BranchPrediction get_branchPrediction() const;
348  void set_branchPrediction(X86BranchPrediction);
350 #else
351  AsmX86Instruction.setDataPrototype("X86BranchPrediction", "branchPrediction", "= x86_branch_prediction_none",
352  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
353 #endif
354 
355 #ifdef DOCUMENTATION
356 
362  X86SegmentRegister get_segmentOverride() const;
363  void set_segmentOverride(X86SegmentRegister);
365 #else
366  AsmX86Instruction.setDataPrototype("X86SegmentRegister", "segmentOverride", "= x86_segreg_none",
367  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
368 #endif
369 
370 
371  DECLARE_OTHERS(AsmX86Instruction);
372 #if defined(SgAsmX86Instruction_OTHERS) || defined(DOCUMENTATION)
373 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
374  private:
375  friend class boost::serialization::access;
376 
377  template<class S>
378  void serialize(S &s, const unsigned version) {
379  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
380  s & BOOST_SERIALIZATION_NVP(p_kind);
381  s & BOOST_SERIALIZATION_NVP(p_baseSize);
382  s & BOOST_SERIALIZATION_NVP(p_operandSize);
383  s & BOOST_SERIALIZATION_NVP(p_addressSize);
384  s & BOOST_SERIALIZATION_NVP(p_lockPrefix);
385  s & BOOST_SERIALIZATION_NVP(p_repeatPrefix);
386  s & BOOST_SERIALIZATION_NVP(p_branchPrediction);
387  s & BOOST_SERIALIZATION_NVP(p_segmentOverride);
388  }
389 #endif
390 
391  public:
395  static X86InstructionSize instructionSizeForWidth(size_t);
396 
400  static size_t widthForInstructionSize(X86InstructionSize);
401 
406  static const RegisterDictionary* registersForInstructionSize(X86InstructionSize);
407 
412  static const RegisterDictionary* registersForWidth(size_t);
413 
414  // Overrides are documented in the base class
415  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
416  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
417  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
418  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
419  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
420  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
421  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
422  virtual bool getBranchTarget(rose_addr_t *target/*out*/) $ROSE_OVERRIDE;
423  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
424  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*>&,
425  bool* complete,
426  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
427  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
428  virtual bool isUnknown() const $ROSE_OVERRIDE;
429  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
430 #endif // SgAsmX86Instruction_OTHERS
431 #ifdef DOCUMENTATION
432  };
433 #endif
434 
436 
437  DECLARE_LEAF_CLASS(AsmPowerpcInstruction);
438  IS_SERIALIZABLE(AsmPowerpcInstruction);
439  DECLARE_HEADERS(AsmPowerpcInstruction);
440 #if defined(SgAsmPowerpcInstruction_HEADERS) || defined(DOCUMENTATION)
441  #include <powerpcInstructionEnum.h>
442 #endif // SgAsmPowerpcInstruction_HEADERS
443 
444 #ifdef DOCUMENTATION
445 
447  public:
448 #endif
449 
450 
451 #ifdef DOCUMENTATION
452 
458  PowerpcInstructionKind get_kind() const;
459  void set_kind(PowerpcInstructionKind);
461 #else
462  AsmPowerpcInstruction.setDataPrototype("PowerpcInstructionKind", "kind", "= powerpc_unknown_instruction",
463  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
464  COPY_DATA);
465 #endif
466 
467  DECLARE_OTHERS(AsmPowerpcInstruction);
468 #if defined(SgAsmPowerpcInstruction_OTHERS) || defined(DOCUMENTATION)
469 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
470  private:
471  friend class boost::serialization::access;
472 
473  template<class S>
474  void serialize(S &s, const unsigned version) {
475  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
476  s & BOOST_SERIALIZATION_NVP(p_kind);
477  }
478 #endif
479 
480  public:
481  // Overrides are documented in the base class
482  virtual std::string description() const $ROSE_OVERRIDE;
483  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
484  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
485  virtual bool isUnknown() const $ROSE_OVERRIDE;
486  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
487 #endif // SgAsmPowerpcInstruction_OTHERS
488 #ifdef DOCUMENTATION
489  };
490 #endif
491 
492 
494 
495  DECLARE_LEAF_CLASS(AsmMipsInstruction);
496  IS_SERIALIZABLE(AsmMipsInstruction);
497  DECLARE_HEADERS(AsmMipsInstruction);
498 #if defined(SgAsmMipsInstruction_HEADERS) || defined(DOCUMENTATION)
499  #include <InstructionEnumsMips.h>
500 #endif // SgAsmMipsInstruction_HEADERS
501 
502 #ifdef DOCUMENTATION
503 
505  public:
506 #endif
507 
508 #ifdef DOCUMENTATION
509 
515  MipsInstructionKind get_kind() const;
516  void set_kind(MipsInstructionKind);
518 #else
519  AsmMipsInstruction.setDataPrototype("MipsInstructionKind", "kind", "= mips_unknown_instruction",
520  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
521  COPY_DATA);
522 #endif
523 
524  DECLARE_OTHERS(AsmMipsInstruction);
525 #if defined(SgAsmMipsInstruction_OTHERS) || defined(DOCUMENTATION)
526 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
527  private:
528  friend class boost::serialization::access;
529 
530  template<class S>
531  void serialize(S &s, const unsigned version) {
532  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
533  s & BOOST_SERIALIZATION_NVP(p_kind);
534  }
535 #endif
536 
537  public:
538  // Overrides are documented in the base class
539  virtual std::string description() const $ROSE_OVERRIDE;
540  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
541  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
542  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
543  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
544  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
545  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
546  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
547  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
548  virtual bool isUnknown() const $ROSE_OVERRIDE;
549  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
550  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
551 #endif // SgAsmMipsInstruction_OTHERS
552 #ifdef DOCUMENTATION
553  };
554 #endif
555 
557 
558  DECLARE_LEAF_CLASS(AsmM68kInstruction);
559  IS_SERIALIZABLE(AsmM68kInstruction);
560  DECLARE_HEADERS(AsmM68kInstruction);
561 #if defined(SgAsmM68kInstruction_HEADERS) || defined(DOCUMENTATION)
562  #include "InstructionEnumsM68k.h"
563 #endif // SgAsmM68kInstruction_HEADERS
564 
565 #ifdef DOCUMENTATION
567  public:
568 #endif
569 
570 #ifdef DOCUMENTATION
571 
577  M68kInstructionKind get_kind() const;
578  void set_kind(M68kInstructionKind);
580 #else
581  AsmM68kInstruction.setDataPrototype("M68kInstructionKind", "kind", " = m68k_unknown_instruction",
582  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
583  COPY_DATA);
584 #endif
585 
586  DECLARE_OTHERS(AsmM68kInstruction);
587 #if defined(SgAsmM68kInstruction_OTHERS) || defined(DOCUMENTATION)
588 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
589  private:
590  friend class boost::serialization::access;
591 
592  template<class S>
593  void serialize(S &s, const unsigned version) {
594  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
595  s & BOOST_SERIALIZATION_NVP(p_kind);
596  }
597 #endif
598 
599  public:
600  // Overrides are documented in the base class
601  virtual std::string description() const $ROSE_OVERRIDE;
602  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
603  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
604  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
605  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
606  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
607  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
608  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
609  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
610  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
611  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*>&,
612  bool* complete,
613  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
614  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
615  virtual bool isUnknown() const $ROSE_OVERRIDE;
616  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
617 #endif // SgAsmM68kInstruction_OTHERS
618 #ifdef DOCUMENTATION
619  };
620 #endif
621 
623 
624  NEW_NONTERMINAL_MACRO(AsmInstruction,
625  AsmX86Instruction | AsmArmInstruction | AsmPowerpcInstruction | AsmMipsInstruction |
626  AsmM68kInstruction,
627  "AsmInstruction", "AsmInstructionTag", true);
628  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
629  IS_SERIALIZABLE(AsmInstruction);
630 
631  DECLARE_HEADERS(AsmInstruction);
632 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
633  #include <MemoryMap.h>
634 #endif // SgAsmInstruction_HEADERS
635 
636 #ifdef DOCUMENTATION
637 
639  public:
640 #endif
641 
642 #ifdef DOCUMENTATION
643 
651  const std::string& get_mnemonic() const;
652  void set_mnemonic(const std::string&);
654 #else
655  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
656  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
657 #endif
658 
659 #ifdef DOCUMENTATION
660 
665  const SgUnsignedList& get_raw_bytes() const;
666  void set_raw_bytes(const SgUnsignedList&);
668 #else
669  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
670  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
671 #endif
672 
673 #ifdef DOCUMENTATION
674 
683 #else
684  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
685  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
686 #endif
687 
688 #ifdef DOCUMENTATION
689  // FIXME[Robb P Matzke 2017-02-13]: unused?
690 #else
691  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
692  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
693 #endif
694 
695 #ifdef DOCUMENTATION
696 
702  int64_t get_stackDeltaIn() const;
703  void set_stackDeltaIn(int64_t);
705 #else
706  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
707  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
708 #endif
709 
710 #ifdef DOCUMENTATION
711  // FIXME[Robb P Matzke 2017-02-13]: unused?
712 #else
713  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
714  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
715 #endif
716 
717  DECLARE_OTHERS(AsmInstruction);
718 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
719 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
720  private:
721  friend class boost::serialization::access;
722 
723  template<class S>
724  void serialize(S &s, const unsigned version) {
725  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
726  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
727  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
728  s & BOOST_SERIALIZATION_NVP(p_operandList);
729  s & BOOST_SERIALIZATION_NVP(p_sources);
730  }
731 #endif
732 
733  public:
738  static const int64_t INVALID_STACK_DELTA;
739 
745  virtual std::string description() const { return ""; }
746 
747  // FIXME[Robb P Matzke 2017-02-13]: unused?
748  void appendSources( SgAsmInstruction* instruction );
749 
756  virtual bool terminatesBasicBlock();
757 
771  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
772  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
784  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
785  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
791  bool isFirstInBlock();
792 
796  bool isLastInBlock();
797 
802  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
803 
938  virtual bool hasEffect();
939 
948  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
949  bool relax_stack_semantics=false);
950 
960  virtual std::vector<std::pair<size_t,size_t> >
961  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
962  bool relax_stack_semantics=false);
963 
970  virtual std::set<rose_addr_t> getSuccessors(bool* complete); /*subclasses must redefine*/
971 
980  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
981  bool *complete,
982  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
984 
990  virtual size_t get_size() const;
991 
997  virtual bool isUnknown() const;
998 
1032  virtual unsigned get_anyKind() const;
1033 #endif // SgAsmInstruction_OTHERS
1034 
1035 #ifdef DOCUMENTATION
1036  };
1037 #endif
1038 
1039 
1040 
1042 
1043  /**************************************************************************************************************************
1044  * Instruction Expressions
1045  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1046  **************************************************************************************************************************/
1047 
1049 
1050  DECLARE_LEAF_CLASS(AsmOperandList);
1051  IS_SERIALIZABLE(AsmOperandList);
1052 
1053 #ifdef DOCUMENTATION
1054 
1055  class SgAsmOperandList: public SgAsmNode {
1056  public:
1057 #endif
1058 
1059 #ifdef DOCUMENTATION
1060 
1066  const SgAsmExpressionPtrList& get_operands() const;
1067  void set_oerands(const SgAsmExpressionPtrList&);
1069 #else
1070  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1071  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1072 #endif
1073 
1074  DECLARE_OTHERS(AsmOperandList);
1075 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1076 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1077  private:
1078  friend class boost::serialization::access;
1079 
1080  template<class S>
1081  void serialize(S &s, const unsigned version) {
1082  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1083  s & BOOST_SERIALIZATION_NVP(p_operands);
1084  }
1085 #endif
1086 
1087  public:
1089  void append_operand(SgAsmExpression* operand);
1090 #endif // SgAsmOperandList_OTHERS
1091 
1092 #ifdef DOCUMENTATION
1093  };
1094 #endif
1095 
1096  // FIXME[Robb P Matzke 2016-10-31]
1097  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1098 
1100 
1101  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1102  IS_SERIALIZABLE(AsmBinaryAdd);
1103 
1104 #ifdef DOCUMENTATION
1105 
1107  public:
1108 #endif
1109 
1110  DECLARE_OTHERS(AsmBinaryAdd);
1111 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1112 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1113  private:
1114  friend class boost::serialization::access;
1115 
1116  template<class S>
1117  void serialize(S &s, const unsigned version) {
1118  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1119  }
1120 #endif
1121 #endif // SgAsmBinaryAdd_OTHERS
1122 
1123 #ifdef DOCUMENTATION
1124  };
1125 #endif
1126 
1128 
1129  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1130  IS_SERIALIZABLE(AsmBinarySubtract);
1131 
1132 #ifdef DOCUMENTATION
1133 
1135  public:
1136 #endif
1137 
1138  DECLARE_OTHERS(AsmBinarySubtract);
1139 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1140 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1141  private:
1142  friend class boost::serialization::access;
1143 
1144  template<class S>
1145  void serialize(S &s, const unsigned version) {
1146  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1147  }
1148 #endif
1149 #endif // SgAsmBinarySubtract_OTHERS
1150 
1151 #ifdef DOCUMENTATION
1152  };
1153 #endif
1154 
1156 
1157  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1158  IS_SERIALIZABLE(AsmBinaryMultiply);
1159 
1160 #ifdef DOCUMENTATION
1161 
1163  public:
1164 #endif
1165 
1166  DECLARE_OTHERS(AsmBinaryMultiply);
1167 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1168 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1169  private:
1170  friend class boost::serialization::access;
1171 
1172  template<class S>
1173  void serialize(S &s, const unsigned version) {
1174  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1175  }
1176 #endif
1177 #endif // SgAsmBinaryMultiply_OTHERS
1178 
1179 #ifdef DOCUMENTATION
1180  };
1181 #endif
1182 
1184 
1185  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1186  IS_SERIALIZABLE(AsmBinaryDivide);
1187 
1188 #ifdef DOCUMENTATION
1189 
1191  public:
1192 #endif
1193 
1194  DECLARE_OTHERS(AsmBinaryDivide);
1195 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1196 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1197  private:
1198  friend class boost::serialization::access;
1199 
1200  template<class S>
1201  void serialize(S &s, const unsigned version) {
1202  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1203  }
1204 #endif
1205 #endif // SgAsmBinaryDivide_OTHERS
1206 
1207 #ifdef DOCUMENTATION
1208  };
1209 #endif
1210 
1212 
1213  DECLARE_LEAF_CLASS(AsmBinaryMod);
1214  IS_SERIALIZABLE(AsmBinaryMod);
1215 
1216 #ifdef DOCUMENTATION
1217 
1219  public:
1220 #endif
1221 
1222  DECLARE_OTHERS(AsmBinaryMod);
1223 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1224 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1225  private:
1226  friend class boost::serialization::access;
1227 
1228  template<class S>
1229  void serialize(S &s, const unsigned version) {
1230  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1231  }
1232 #endif
1233 #endif // SgAsmBinaryMod_OTHERS
1234 
1235 #ifdef DOCUMENTATION
1236  };
1237 #endif
1238 
1240 
1241  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1242  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1243 
1244 #ifdef DOCUMENTATION
1245 
1247  public:
1248 #endif
1249 
1250  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1251 #if defined(SgAsmBinaryAddPreupdate_OTHERS) || defined(DOCUMENTATION)
1252 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1253  private:
1254  friend class boost::serialization::access;
1255 
1256  template<class S>
1257  void serialize(S &s, const unsigned version) {
1258  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1259  }
1260 #endif
1261 #endif // SgAsmBinaryAddPreupdate_OTHERS
1262 
1263 #ifdef DOCUMENTATION
1264  };
1265 #endif
1266 
1268 
1269  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1270  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1271 
1272 #ifdef DOCUMENTATION
1273 
1275  public:
1276 #endif
1277 
1278  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1279 #if defined(SgAsmBinarySubtractPreupdate_OTHERS) || defined(DOCUMENTATION)
1280 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1281  private:
1282  friend class boost::serialization::access;
1283 
1284  template<class S>
1285  void serialize(S &s, const unsigned version) {
1286  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1287  }
1288 #endif
1289 #endif // SgAsmBinarySubtractPreupdate_OTHERS
1290 
1291 #ifdef DOCUMENTATION
1292  };
1293 #endif
1294 
1296 
1297  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1298  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1299 
1300 #ifdef DOCUMENTATION
1301 
1303  public:
1304 #endif
1305 
1306  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1307 #if defined(SgAsmBinaryAddPostupdate_OTHERS) || defined(DOCUMENTATION)
1308 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1309  private:
1310  friend class boost::serialization::access;
1311 
1312  template<class S>
1313  void serialize(S &s, const unsigned version) {
1314  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1315  }
1316 #endif
1317 #endif // SgAsmBinaryAddPostupdate_OTHERS
1318 
1319 #ifdef DOCUMENTATION
1320  };
1321 #endif
1322 
1324 
1325  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1326  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1327 
1328 #ifdef DOCUMENTATION
1329 
1331  public:
1332 #endif
1333 
1334  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1335 #if defined(SgAsmBinarySubtractPostupdate_OTHERS) || defined(DOCUMENTATION)
1336 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1337  private:
1338  friend class boost::serialization::access;
1339 
1340  template<class S>
1341  void serialize(S &s, const unsigned version) {
1342  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1343  }
1344 #endif
1345 #endif // SgAsmBinarySubtractPostupdate_OTHERS
1346 
1347 #ifdef DOCUMENTATION
1348  };
1349 #endif
1350 
1352 
1353  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1354  IS_SERIALIZABLE(AsmBinaryLsl);
1355 
1356 #ifdef DOCUMENTATION
1357 
1359  public:
1360 #endif
1361 
1362  DECLARE_OTHERS(AsmBinaryLsl);
1363 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1364 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1365  private:
1366  friend class boost::serialization::access;
1367 
1368  template<class S>
1369  void serialize(S &s, const unsigned version) {
1370  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1371  }
1372 #endif
1373 #endif // SgAsmBinaryLsl_OTHERS
1374 
1375 #ifdef DOCUMENTATION
1376  };
1377 #endif
1378 
1380 
1381  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1382  IS_SERIALIZABLE(AsmBinaryLsr);
1383 
1384 #ifdef DOCUMENTATION
1385 
1387  public:
1388 #endif
1389 
1390  DECLARE_OTHERS(AsmBinaryLsr);
1391 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1392 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1393  private:
1394  friend class boost::serialization::access;
1395 
1396  template<class S>
1397  void serialize(S &s, const unsigned version) {
1398  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1399  }
1400 #endif
1401 #endif // SgAsmBinaryLsr_OTHERS
1402 
1403 #ifdef DOCUMENTATION
1404  };
1405 #endif
1406 
1408 
1409  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1410  IS_SERIALIZABLE(AsmBinaryAsr);
1411 
1412 #ifdef DOCUMENTATION
1413 
1415  public:
1416 #endif
1417 
1418  DECLARE_OTHERS(AsmBinaryAsr);
1419 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1420 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1421  private:
1422  friend class boost::serialization::access;
1423 
1424  template<class S>
1425  void serialize(S &s, const unsigned version) {
1426  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1427  }
1428 #endif
1429 #endif // SgAsmBinaryAsr_OTHERS
1430 
1431 #ifdef DOCUMENTATION
1432  };
1433 #endif
1434 
1436 
1437  DECLARE_LEAF_CLASS(AsmBinaryRor);
1438  IS_SERIALIZABLE(AsmBinaryRor);
1439 
1440 #ifdef DOCUMENTATION
1441 
1443  public:
1444 #endif
1445 
1446  DECLARE_OTHERS(AsmBinaryRor);
1447 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1448 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1449  private:
1450  friend class boost::serialization::access;
1451 
1452  template<class S>
1453  void serialize(S &s, const unsigned version) {
1454  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1455  }
1456 #endif
1457 #endif // SgAsmBinaryRor_OTHERS
1458 
1459 #ifdef DOCUMENTATION
1460  };
1461 #endif
1462 
1464 
1465  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1466  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1467  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1468  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1469  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1470  AsmBinaryRor,
1471  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1472  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1473  IS_SERIALIZABLE(AsmBinaryExpression);
1474 
1475 #ifdef DOCUMENTATION
1476 
1478  public:
1479 #endif
1480 
1481 #ifdef DOCUMENTATION
1482 
1485  SgAsmExpression* get_lhs() const;
1486  void set_lhs(SgAsmExpression*);
1488 #else
1489  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1490  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1491 #endif
1492 
1493 #ifdef DOCUMENTATION
1494 
1497  SgAsmExpression* get_rhs() const;
1498  void set_rhs(SgAsmExpression*);
1500 #else
1501  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1502  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1503 #endif
1504 
1505  DECLARE_OTHERS(AsmBinaryExpression);
1506 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1507 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1508  private:
1509  friend class boost::serialization::access;
1510 
1511  template<class S>
1512  void serialize(S &s, const unsigned version) {
1513  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1514  s & BOOST_SERIALIZATION_NVP(p_lhs);
1515  s & BOOST_SERIALIZATION_NVP(p_rhs);
1516  }
1517 #endif
1518 #endif // SgAsmBinaryExpression_OTHERS
1519 
1520 #ifdef DOCUMENTATION
1521  };
1522 #endif
1523 
1525 
1526  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1527  IS_SERIALIZABLE(AsmUnaryPlus);
1528 
1529 #ifdef DOCUMENTATION
1530 
1532  public:
1533 #endif
1534 
1535  DECLARE_OTHERS(AsmUnaryPlus);
1536 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1537 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1538  private:
1539  friend class boost::serialization::access;
1540 
1541  template<class S>
1542  void serialize(S &s, const unsigned version) {
1543  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1544  }
1545 #endif
1546 #endif // SgAsmUnaryPlus_OTHERS
1547 
1548 #ifdef DOCUMENTATION
1549  };
1550 #endif
1551 
1553 
1554  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1555  IS_SERIALIZABLE(AsmUnaryMinus);
1556 
1557 #ifdef DOCUMENTATION
1558 
1560  public:
1561 #endif
1562 
1563  DECLARE_OTHERS(AsmUnaryMinus);
1564 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1565 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1566  private:
1567  friend class boost::serialization::access;
1568 
1569  template<class S>
1570  void serialize(S &s, const unsigned version) {
1571  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1572  }
1573 #endif
1574 #endif // SgAsmUnaryMinus_OTHERS
1575 
1576 #ifdef DOCUMENTATION
1577  };
1578 #endif
1579 
1581 
1582  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1583  IS_SERIALIZABLE(AsmUnaryRrx);
1584 
1585 #ifdef DOCUMENTATION
1586  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1588  public:
1589 #endif
1590 
1591  DECLARE_OTHERS(AsmUnaryRrx);
1592 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1593 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1594  private:
1595  friend class boost::serialization::access;
1596 
1597  template<class S>
1598  void serialize(S &s, const unsigned version) {
1599  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1600  }
1601 #endif
1602 #endif // SgAsmUnaryRrx_OTHERS
1603 
1604 #ifdef DOCUMENTATION
1605  };
1606 #endif
1607 
1609 
1610  DECLARE_LEAF_CLASS(AsmUnaryArmSpecialRegisterList);
1611  IS_SERIALIZABLE(AsmUnaryArmSpecialRegisterList);
1612 
1613 #ifdef DOCUMENTATION
1614  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1616  public:
1617 #endif
1618 
1619  DECLARE_OTHERS(AsmUnaryArmSpecialRegisterList);
1620 #if defined(SgAsmUnaryArmSpecialRegisterList_OTHERS) || defined(DOCUMENTATION)
1621 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1622  private:
1623  friend class boost::serialization::access;
1624 
1625  template<class S>
1626  void serialize(S &s, const unsigned version) {
1627  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1628  }
1629 #endif
1630 #endif // SgAsmUnaryArmSpecialRegisterList_OTHERS
1631 
1632 #ifdef DOCUMENTATION
1633  };
1634 #endif
1635 
1637 
1638  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
1639  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryArmSpecialRegisterList,
1640  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
1641  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1642  IS_SERIALIZABLE(AsmUnaryExpression);
1643 
1644 #ifdef DOCUMENTATION
1645 
1647  public:
1648 #endif
1649 
1650 #ifdef DOCUMENTATION
1651 
1654  SgAsmExpression* get_operand() const;
1657 #else
1658  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
1659  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1660 #endif
1661 
1662  DECLARE_OTHERS(AsmUnaryExpression);
1663 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
1664 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1665  private:
1666  friend class boost::serialization::access;
1667 
1668  template<class S>
1669  void serialize(S &s, const unsigned version) {
1670  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1671  s & BOOST_SERIALIZATION_NVP(p_operand);
1672  }
1673 #endif
1674 #endif // SgAsmUnaryExpression_OTHERS
1675 
1676 #ifdef DOCUMENTATION
1677  };
1678 #endif
1679 
1681 
1682  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
1683  IS_SERIALIZABLE(AsmDirectRegisterExpression);
1684 
1685 #ifdef DOCUMENTATION
1686 
1688  public:
1689 #endif
1690 
1691 #ifdef DOCUMENTATION
1692 
1695  unsigned get_psr_mask() const;
1696  void set_psr_mask(unsigned);
1698 #else
1699  AsmDirectRegisterExpression.setDataPrototype("unsigned", "psr_mask", "=0", // for ARM
1700  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1701  NO_DELETE);
1702 #endif
1703 
1704  DECLARE_OTHERS(AsmDirectRegisterExpression);
1705 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1706 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1707  private:
1708  friend class boost::serialization::access;
1709 
1710  template<class S>
1711  void serialize(S &s, const unsigned version) {
1712  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1713  s & BOOST_SERIALIZATION_NVP(p_psr_mask);
1714  }
1715 #endif
1716 
1717  private:
1718  // Default c'tor needed for serialization
1720  : p_psr_mask(0) {}
1721 #endif // SgAsmDirectRegisterExpression_OTHERS
1722 
1723 #ifdef DOCUMENTATION
1724  };
1725 #endif
1726 
1728 
1729  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
1730  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
1731 
1732 #ifdef DOCUMENTATION
1733 
1750  public:
1751 #endif
1752 
1753 #ifdef DOCUMENTATION
1754 
1762 #else
1763  AsmIndirectRegisterExpression.setDataPrototype("RegisterDescriptor", "stride", "",
1764  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1765 #endif
1766 
1767 #ifdef DOCUMENTATION
1768 
1776 #else
1777  AsmIndirectRegisterExpression.setDataPrototype("RegisterDescriptor", "offset", "",
1778  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1779 #endif
1780 
1781 #ifdef DOCUMENTATION
1782 
1787  size_t get_index() const;
1788  void set_index(size_t);
1790 #else
1791  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
1792  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1793 #endif
1794 
1795 #ifdef DOCUMENTATION
1796 
1801  size_t get_modulus() const;
1802  void set_modulus(size_t);
1804 #else
1805  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
1806  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1807 #endif
1808 
1809  DECLARE_OTHERS(AsmIndirectRegisterExpression);
1810 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1811 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1812  private:
1813  friend class boost::serialization::access;
1814 
1815  template<class S>
1816  void serialize(S &s, const unsigned version) {
1817  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1818  s & BOOST_SERIALIZATION_NVP(p_stride);
1819  s & BOOST_SERIALIZATION_NVP(p_offset);
1820  s & BOOST_SERIALIZATION_NVP(p_index);
1821  s & BOOST_SERIALIZATION_NVP(p_modulus);
1822  }
1823 #endif
1824 
1825  private:
1826  // Default c'tor needed for serialization
1828  : p_index(0), p_modulus(0) {}
1829 #endif // SgAsmIndirectRegisterExpression_OTHERS
1830 
1831 #ifdef DOCUMENTATION
1832  };
1833 #endif
1834 
1836 
1837  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
1838  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
1839  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
1840  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
1841 
1842 #ifdef DOCUMENTATION
1843 
1845  public:
1846 #endif
1847 
1848 #ifdef DOCUMENTATION
1849 
1855 #else
1856  AsmRegisterReferenceExpression.setDataPrototype("RegisterDescriptor", "descriptor", "",
1857  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1858 #endif
1859 
1860 #ifdef DOCUMENTATION
1861 
1866  int get_adjustment() const;
1867  void set_adjustment(int);
1869 #else
1870  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
1871  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1872  NO_DELETE);
1873 #endif
1874 
1875  DECLARE_OTHERS(AsmRegisterReferenceExpression);
1876 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
1877 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1878  private:
1879  friend class boost::serialization::access;
1880 
1881  template<class S>
1882  void serialize(S &s, const unsigned version) {
1883  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1884  s & BOOST_SERIALIZATION_NVP(p_descriptor);
1885  s & BOOST_SERIALIZATION_NVP(p_adjustment);
1886  }
1887 #endif
1888 
1889  protected:
1890  // Default c'tor needed for serialization
1892  : p_adjustment(0) {}
1893 #endif // SgAsmRegisterReferenceExpression_OTHERS
1894 
1895 #ifdef DOCUMENTATION
1896  };
1897 #endif
1898 
1900 
1901  DECLARE_LEAF_CLASS(AsmRegisterNames);
1902  IS_SERIALIZABLE(AsmRegisterNames);
1903 
1904 #ifdef DOCUMENTATION
1905 
1907  public:
1908 #endif
1909 
1910 #ifdef DOCUMENTATION
1911 
1917  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
1918  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
1920 #else
1921  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
1922  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1923 #endif
1924 
1925 #ifdef DOCUMENTATION
1926 
1932  unsigned get_mask() const;
1933  void set_mask(unsigned);
1935 #else
1936  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
1937  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1938 #endif
1939 
1940  DECLARE_OTHERS(AsmRegisterNames);
1941 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
1942 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1943  private:
1944  friend class boost::serialization::access;
1945 
1946  template<class S>
1947  void serialize(S &s, const unsigned version) {
1948  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1949  s & BOOST_SERIALIZATION_NVP(p_registers);
1950  s & BOOST_SERIALIZATION_NVP(p_mask);
1951  }
1952 #endif
1953 #endif // SgAsmRegisterNames_OTHERS
1954 
1955 #ifdef DOCUMENTATION
1956  };
1957 #endif
1958 
1960 
1961  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
1962  IS_SERIALIZABLE(AsmIntegerValueExpression);
1963 
1964 #ifdef DOCUMENTATION
1965 
1981  public:
1982 #endif
1983 
1984 #ifdef DOCUMENTATION
1985 
1995  SgNode* get_baseNode() const;
1996  void set_baseNode(SgNode*);
1998 #else
1999  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2000  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2001 #endif
2002 
2003  DECLARE_OTHERS(AsmIntegerValueExpression);
2004 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2005 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2006  private:
2007  friend class boost::serialization::access;
2008 
2009  template<class S>
2010  void serialize(S &s, const unsigned version) {
2011  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2012  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2013  }
2014 #endif
2015 
2016  public:
2021  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2022 
2029 
2031  static uint64_t virtualAddress(SgNode*);
2032 
2052  std::string get_label(bool quiet=false) const;
2053 
2055  size_t get_significantBits() const;
2056 
2062  void makeRelativeTo(SgNode *baseNode);
2063 
2068  uint64_t get_baseAddress() const;
2069 
2075  uint64_t get_absoluteValue(size_t nbits=0) const;
2076 
2080  void set_absoluteValue(uint64_t);
2081 
2083  int64_t get_signedValue() const;
2084 
2088  int64_t get_relativeValue() const;
2089 
2094  void set_relativeValue(int64_t v, size_t nbits=64);
2095 
2096  uint64_t get_value() const { return get_absoluteValue(); }
2097 
2098  // These are deprecated; use CamelCase versions instead [Robb P. Matzke 2014-07-21]
2099  size_t get_significant_bits() const ROSE_DEPRECATED("use get_significantBits");
2100  void make_relative_to(SgNode*) ROSE_DEPRECATED("use makeRelativeTo");
2101  uint64_t get_base_address() const ROSE_DEPRECATED("use get_baseAddress");
2102  uint64_t get_absolute_value(size_t nbits=0) const ROSE_DEPRECATED("use get_absoluteValue");
2103  void set_absolute_value(uint64_t) ROSE_DEPRECATED("use set_absoluteValue");
2104  int64_t get_signed_value() const ROSE_DEPRECATED("use set_signedValue");
2105  int64_t get_relative_value() const ROSE_DEPRECATED("use get_relativeValue");
2106  void set_relative_value(int64_t, size_t nbits=64) ROSE_DEPRECATED("use set_relativeValue");
2107 #endif // SgAsmIntegerValueExpression_OTHERS
2108 
2109 #ifdef DOCUMENTATION
2110  };
2111 #endif
2112 
2114 
2115  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2116  IS_SERIALIZABLE(AsmFloatValueExpression);
2117 
2118 #ifdef DOCUMENTATION
2119 
2124  public:
2125 #endif
2126 
2127  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2128 
2129  DECLARE_OTHERS(AsmFloatValueExpression);
2130 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2131  private:
2132  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2133  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2134  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2135  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2136  // understand "mutable".
2137  mutable double p_nativeValue;
2138  mutable bool p_nativeValueIsValid;
2139 
2140 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2141  private:
2142  friend class boost::serialization::access;
2143 
2144  template<class S>
2145  void serialize(S &s, const unsigned version) {
2146  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2147  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2148  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2149  }
2150 #endif
2151 
2152  public:
2157  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2158 
2164  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2165 
2172 
2174  void set_nativeValue(double);
2175 
2177  double get_nativeValue() const;
2178 
2183  void updateBitVector();
2184 
2189  void updateNativeValue() const;
2190 #endif // SgAsmFloatValueExpression_OTHERS
2191 
2192 #ifdef DOCUMENTATION
2193  };
2194 #endif
2195 
2197 
2198  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2199  AsmIntegerValueExpression | AsmFloatValueExpression,
2200  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2201  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2202  IS_SERIALIZABLE(AsmConstantExpression);
2203 
2204  DECLARE_HEADERS(AsmConstantExpression);
2205 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2206  #include <Sawyer/BitVector.h>
2207 #endif // SgAsmConstantExpression_HEADERS
2208 
2209 #ifdef DOCUMENTATION
2210 
2215  public:
2216 #endif
2217 
2218 #ifndef DOCUMENTATION
2219  // Documented below. Implemented below due to ROSETTA limitations.
2220  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2221  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2222 #endif
2223 
2224  DECLARE_OTHERS(AsmConstantExpression);
2225 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2226 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2227  private:
2228  friend class boost::serialization::access;
2229 
2230  template<class S>
2231  void serialize(S &s, const unsigned version) {
2232  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2233  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2234  }
2235 #endif
2236 
2237  public:
2243  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2244  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2245  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2247 #endif // SgAsmConstantExpression_OTHERS
2248 
2249 #ifdef DOCUMENTATION
2250  };
2251 #endif
2252 
2254 
2255  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2256  AsmConstantExpression,
2257  "AsmValueExpression", "AsmValueExpressionTag", false);
2258  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2259  IS_SERIALIZABLE(AsmValueExpression);
2260 
2261 #ifdef DOCUMENTATION
2262 
2270  public:
2271 #endif
2272 
2273 #ifdef DOCUMENTATION
2274 
2284 #else
2285  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
2286  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2287 #endif
2288 
2289 #ifdef DOCUMENTATION
2290 
2298  unsigned short get_bit_offset() const;
2299  void set_bit_offset(unsigned short);
2301 #else
2302  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
2303  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2304 #endif
2305 
2306 #ifdef DOCUMENTATION
2307 
2313  unsigned short get_bit_size() const;
2314  void set_bit_size(unsigned short);
2316 #else
2317  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
2318  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2319 #endif
2320 
2321 #ifdef DOCUMENTATION
2322 
2328  SgSymbol* get_symbol() const;
2329  void set_symbol(SgSymbol*);
2331 #else
2332  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
2333  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2334 #endif
2335 
2336  DECLARE_OTHERS(AsmValueExpression);
2337 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
2338 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2339  private:
2340  friend class boost::serialization::access;
2341 
2342  template<class S>
2343  void serialize(S &s, const unsigned version) {
2344  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2345  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
2346  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
2347  s & BOOST_SERIALIZATION_NVP(p_bit_size);
2348 #if 1
2349  ASSERT_require2(p_symbol == NULL, "not implemented yet");
2350 #else
2351  s & BOOST_SERIALIZATION_NVP(p_symbol);
2352 #endif
2353  }
2354 #endif
2355 #endif // SgAsmValueExpression_OTHERS
2356 
2357 #ifdef DOCUMENTATION
2358  };
2359 #endif
2360 
2362 
2363  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
2364  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
2365 
2366 #ifdef DOCUMENTATION
2367 
2369  public:
2370 #endif
2371 
2372 #ifdef DOCUMENTATION
2373 
2380  SgAsmExpression* get_address() const;
2383 #else
2384  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
2385  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2386 #endif
2387 
2388 #ifdef DOCUMENTATION
2389 
2396  SgAsmExpression* get_segment() const;
2399 #else
2400  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
2401  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2402 #endif
2403 
2404  DECLARE_OTHERS(AsmMemoryReferenceExpression);
2405 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2406 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2407  private:
2408  friend class boost::serialization::access;
2409 
2410  template<class S>
2411  void serialize(S &s, const unsigned version) {
2412  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2413  s & BOOST_SERIALIZATION_NVP(p_address);
2414  s & BOOST_SERIALIZATION_NVP(p_segment);
2415  }
2416 #endif
2417 #endif // SgAsmMemoryReferenceExpression_OTHERS
2418 
2419 #ifdef DOCUMENTATION
2420  };
2421 #endif
2422 
2424 
2425  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
2426  IS_SERIALIZABLE(AsmControlFlagsExpression);
2427 
2428 #ifdef DOCUMENTATION
2429  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2431  public:
2432 #endif
2433 
2434 #ifndef DOCUMENTATION
2435  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
2436  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2437 #endif
2438 
2439  DECLARE_OTHERS(AsmControlFlagsExpression);
2440 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
2441 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2442  private:
2443  friend class boost::serialization::access;
2444 
2445  template<class S>
2446  void serialize(S &s, const unsigned version) {
2447  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2448  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
2449  }
2450 #endif
2451 #endif // SgAsmControlFlagsExpression_OTHERS
2452 
2453 #ifdef DOCUMENTATION
2454  };
2455 #endif
2456 
2458 
2459  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
2460  IS_SERIALIZABLE(AsmCommonSubExpression);
2461 
2462 #ifdef DOCUMENTATION
2463  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2465  public:
2466 #endif
2467 
2468 #ifndef DOCUMENTATION
2469  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
2470  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2471 #endif
2472 
2473  DECLARE_OTHERS(AsmCommonSubExpression);
2474 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
2475 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2476  private:
2477  friend class boost::serialization::access;
2478 
2479  template<class S>
2480  void serialize(S &s, const unsigned version) {
2481  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2482  s & BOOST_SERIALIZATION_NVP(p_subexpression);
2483  }
2484 #endif
2485 #endif // SgAsmCommonSubExpression_OTHERS
2486 
2487 #ifdef DOCUMENTATION
2488  };
2489 #endif
2490 
2492 
2493  DECLARE_LEAF_CLASS(AsmRiscOperation);
2494  IS_SERIALIZABLE(AsmRiscOperation);
2495 
2496 #ifdef DOCUMENTATION
2497 
2506  public:
2507 #endif
2508 
2509 #ifdef DOCUMENTATION
2510 
2519 #else
2520  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
2521  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
2522 #endif
2523 
2524 #ifdef DOCUMENTATION
2525 
2531  SgAsmExprListExp* get_operands() const;
2534 #else
2535  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
2536  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2537 #endif
2538 
2539  DECLARE_OTHERS(AsmRiscOperation);
2540 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
2541  public:
2548  OP_NONE,
2549  OP_bottom,
2550  OP_undefined,
2551  OP_unspecified,
2552  OP_filterCallTarget,
2553  OP_filterReturnTarget,
2554  OP_filterIndirectJumpTarget,
2555  OP_hlt,
2556  OP_cpuid,
2557  OP_rdtsc,
2558  OP_and_,
2559  OP_or_,
2560  OP_xor_,
2561  OP_invert,
2562  OP_extract,
2563  OP_concat,
2564  OP_leastSignificantSetBit,
2565  OP_mostSignificantSetBit,
2566  OP_rotateLeft,
2567  OP_rotateRight,
2568  OP_shiftLeft,
2569  OP_shiftRight,
2570  OP_shiftRightArithmetic,
2571  OP_equalToZero,
2572  OP_ite,
2573  OP_isEqual,
2574  OP_isNotEqual,
2575  OP_isUnsignedLessThan,
2576  OP_isUnsignedLessThanOrEqual,
2577  OP_isUnsignedGreaterThan,
2578  OP_isUnsignedGreaterThanOrEqual,
2579  OP_isSignedLessThan,
2580  OP_isSignedLessThanOrEqual,
2581  OP_isSignedGreaterThan,
2582  OP_isSignedGreaterThanOrEqual,
2583  OP_unsignedExtend,
2584  OP_signExtend,
2587  OP_subtract,
2588  OP_negate,
2589  OP_signedDivide,
2590  OP_signedModulo,
2591  OP_signedMultiply,
2592  OP_unsignedDivide,
2593  OP_unsignedModulo,
2594  OP_unsignedMultiply,
2595  OP_interrupt,
2596  OP_readRegister,
2597  OP_peekRegister,
2598  OP_writeRegister,
2601  OP_N_OPERATORS // MUST BE LAST!
2602  };
2603 
2604 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2605  private:
2606  friend class boost::serialization::access;
2607 
2608  template<class S>
2609  void serialize(S &s, const unsigned version) {
2610  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2611  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
2612  s & BOOST_SERIALIZATION_NVP(p_operands);
2613  }
2614 #endif
2615 #endif // SgAsmRiscOperation_OTHERS
2616 
2617 #ifdef DOCUMENTATION
2618  };
2619 #endif
2620 
2622 
2623  DECLARE_LEAF_CLASS(AsmExprListExp);
2624  IS_SERIALIZABLE(AsmExprListExp);
2625 
2626 #ifdef DOCUMENTATION
2627 
2629  public:
2630 #endif
2631 
2632 #ifdef DOCUMENTATION
2633 
2639  const SgAsmExpressionPtrList& get_expressions() const;
2640  void set_expressions(const SgAsmExpressionPtrList&);
2642 #else
2643  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
2644  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2645 #endif
2646 
2647  DECLARE_OTHERS(AsmExprListExp);
2648 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
2649 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2650  private:
2651  friend class boost::serialization::access;
2652 
2653  template<class S>
2654  void serialize(S &s, const unsigned version) {
2655  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2656  s & BOOST_SERIALIZATION_NVP(p_expressions);
2657  }
2658 #endif
2659 #endif // SgAsmExprListExp_OTHERS
2660 
2661 #ifdef DOCUMENTATION
2662  };
2663 #endif
2664 
2666 
2667  NEW_NONTERMINAL_MACRO(AsmExpression,
2668  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
2669  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
2670  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
2671  AsmRiscOperation,
2672  "AsmExpression", "AsmExpressionTag", false);
2673  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
2674  IS_SERIALIZABLE(AsmExpression);
2675 
2676 #ifdef DOCUMENTATION
2677 
2678  class SgAsmExpression: public SgAsmNode {
2679  public:
2680 #endif
2681 
2682 #ifdef DOCUMENTATION
2683 
2688  SgAsmType* get_type() const;
2689  void set_type(SgAsmType*);
2691 #else
2692  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
2693  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2694 #endif
2695 
2696 #ifdef DOCUMENTATION
2697 
2702  const std::string& get_comment() const;
2703  void set_comment(const std::string&);
2705 #else
2706  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
2707  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2708 #endif
2709 
2710  DECLARE_OTHERS(AsmExpression);
2711 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
2712 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2713  private:
2714  friend class boost::serialization::access;
2715 
2716  template<class S>
2717  void serialize(S &s, const unsigned version) {
2718  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
2719  s & BOOST_SERIALIZATION_NVP(p_type);
2720  s & BOOST_SERIALIZATION_NVP(p_comment);
2721  }
2722 #endif
2723 
2724  public:
2728  size_t get_nBits() const;
2729 #endif // SgAsmExpression_OTHERS
2730 
2731 #ifdef DOCUMENTATION
2732  };
2733 #endif
2734 
2735 
2736 
2737 
2739 
2740  /***************************************************************************************************************************
2741  * Data Types (new interface 2014-07)
2742  *
2743  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
2744  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
2745  * 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
2746  * don't allow types to be modified after they're created.
2747  ***************************************************************************************************************************/
2748 
2750 
2751  DECLARE_LEAF_CLASS(AsmIntegerType);
2752  IS_SERIALIZABLE(AsmIntegerType);
2753 
2754 #ifdef DOCUMENTATION
2755 
2757  public:
2758 #endif
2759 
2760 #ifndef DOCUMENTATION
2761  // Documented below due to ROSETTA limitations
2762  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
2763  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2764 #endif
2765 
2766  DECLARE_OTHERS(AsmIntegerType);
2767 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
2768 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2769  private:
2770  friend class boost::serialization::access;
2771 
2772  template<class S>
2773  void serialize(S &s, const unsigned version) {
2774  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2775  s & BOOST_SERIALIZATION_NVP(p_isSigned);
2776  }
2777 #endif
2778 
2779  public:
2783  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
2784 
2788  bool get_isSigned() const;
2789 
2790  // Overrides documented in base class
2791  virtual void check() const $ROSE_OVERRIDE;
2792  virtual std::string toString() const $ROSE_OVERRIDE;
2793 #endif // SgAsmIntegerType_OTHERS
2794 
2795 #ifdef DOCUMENTATION
2796  };
2797 #endif
2798 
2800 
2801  DECLARE_LEAF_CLASS(AsmFloatType);
2802  IS_SERIALIZABLE(AsmFloatType);
2803 
2804  DECLARE_HEADERS(AsmFloatType);
2805 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
2806  #include <Sawyer/BitVector.h>
2807 #endif // SgAsmFloatType_HEADERS
2808 
2809 #ifdef DOCUMENTATION
2810 
2812  public:
2813 #endif
2814 
2815 #ifndef DOCUMENTATION
2816  // Documented below because of ROSETTA limitations (they're read-only)
2817  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
2818  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2819  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
2820  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2821  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
2822  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2823  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
2824  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2825  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
2826  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2827  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
2828  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2829  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
2830  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2831 #endif
2832 
2833  DECLARE_OTHERS(AsmFloatType);
2834 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
2835 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2836  private:
2837  friend class boost::serialization::access;
2838 
2839  template<class S>
2840  void serialize(S &s, const unsigned version) {
2841  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2842  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
2843  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
2844  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
2845  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
2846  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
2847  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
2848  s & BOOST_SERIALIZATION_NVP(p_flags);
2849  }
2850 #endif
2851 
2852  public:
2853  enum {
2854  GRADUAL_UNDERFLOW = 0x00000001,
2855  NORMALIZED_SIGNIFICAND = 0x00000002
2856  };
2857 
2859 
2861  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
2862  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
2863  uint64_t exponentBias, unsigned flags);
2864 
2866  BitRange significandBits() const;
2867 
2869  BitRange exponentBits() const;
2870 
2872  size_t signBit() const;
2873 
2875  uint64_t exponentBias() const;
2876 
2878  unsigned flags() const;
2879 
2881  bool gradualUnderflow() const;
2882 
2884  bool normalizedSignificand() const;
2885 
2886  // Overrides documented in base class
2887  virtual void check() const $ROSE_OVERRIDE;
2888  virtual std::string toString() const $ROSE_OVERRIDE;
2889 #endif // SgAsmFloatType_OTHERS
2890 
2891 #ifdef DOCUMENTATION
2892  };
2893 #endif
2894 
2896 
2897  NEW_NONTERMINAL_MACRO(AsmScalarType,
2898  AsmIntegerType | AsmFloatType,
2899  "AsmScalarType", "AsmScalarTypeTag", false);
2900  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
2901  IS_SERIALIZABLE(AsmScalarType);
2902 
2903 #ifdef DOCUMENTATION
2904 
2905  class SgAsmScalarType: public SgAsmType {
2906  public:
2907 #endif
2908 
2909 #ifndef DOCUMENTATION
2910  // Documented below due to ROSETTA limitations (read-only)
2911  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2912  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2913  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2914  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2915  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
2916  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2917  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
2918  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2919 #endif
2920 
2921  DECLARE_OTHERS(AsmScalarType);
2922 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
2923 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2924  private:
2925  friend class boost::serialization::access;
2926 
2927  template<class S>
2928  void serialize(S &s, const unsigned version) {
2929  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
2930  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
2931  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
2932  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
2933  s & BOOST_SERIALIZATION_NVP(p_nBits);
2934  }
2935 #endif
2936 
2937  protected:
2942  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
2943 
2944  public:
2946  virtual size_t get_nBits() const $ROSE_OVERRIDE;
2947 
2949  ByteOrder::Endianness get_minorOrder() const;
2950 
2952  ByteOrder::Endianness get_majorOrder() const;
2953 
2955  size_t get_majorNBytes() const;
2956 
2957  // Overrides documented in base class
2958  virtual void check() const $ROSE_OVERRIDE;
2959  virtual std::string toString() const $ROSE_OVERRIDE;
2960 #endif // SgAsmScalarType_OTHERS
2961 
2962 #ifdef DOCUMENTATION
2963  };
2964 #endif
2965 
2967 
2968  DECLARE_LEAF_CLASS(AsmVectorType);
2969  IS_SERIALIZABLE(AsmVectorType);
2970 
2971 #ifdef DOCUMENTATION
2972 
2973  class SgAsmVectorType: public SgAsmType {
2974  public:
2975 #endif
2976 
2977 #ifndef DOCUMENTATION
2978  // Documented below due to ROSETTA limitations (read-only)
2979  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
2980  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2981  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
2982  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2983 #endif
2984 
2985  DECLARE_OTHERS(AsmVectorType);
2986 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
2987 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2988  private:
2989  friend class boost::serialization::access;
2990 
2991  template<class S>
2992  void serialize(S &s, const unsigned version) {
2993  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
2994  s & BOOST_SERIALIZATION_NVP(p_nElmts);
2995  s & BOOST_SERIALIZATION_NVP(p_elmtType);
2996  }
2997 #endif
2998 
2999  public:
3001  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3002 
3004  size_t get_nElmts() const;
3005 
3007  SgAsmType* get_elmtType() const;
3008 
3009  // Overrides documented in base class
3010  virtual void check() const $ROSE_OVERRIDE;
3011  virtual std::string toString() const $ROSE_OVERRIDE;
3012  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3013 #endif // SgAsmVectorType_OTHERS
3014 
3015 #ifdef DOCUMENTATION
3016  };
3017 #endif
3018 
3020 
3021  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3022  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3023  IS_SERIALIZABLE(AsmType);
3024 
3025 #ifdef DOCUMENTATION
3026 
3027  class SgAsmType: public SgAsmNode {
3028  public:
3029 #endif
3030 
3031  DECLARE_OTHERS(AsmType);
3032 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3033  private:
3035 
3036 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3037  private:
3038  friend class boost::serialization::access;
3039 
3040  template<class S>
3041  void serialize(S &s, const unsigned version) {
3042  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3043  }
3044 #endif
3045 
3046  public:
3054  virtual void check() const;
3055 
3061  virtual std::string toString() const {
3062  abort(); // ROSETTA limitation: intended pure virtual
3063  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3064  }
3065 
3067  virtual size_t get_nBits() const {
3068  abort(); // ROSETTA limitation: intended pure virtual
3069  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3070  }
3071 
3073  virtual size_t get_nBytes() const;
3074 
3080  template<class Type> // Type is a subclass of SgAsmType
3081  static Type* registerOrDelete(Type *toInsert) {
3082  ASSERT_not_null(toInsert);
3083  std::string key = toInsert->toString();
3084  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3085  ASSERT_not_null(retval);
3086  if (retval!=toInsert)
3087  delete toInsert;
3088  return retval;
3089  }
3090 #endif // SgAsmType_OTHERS
3091 
3092 #ifdef DOCUMENTATION
3093  };
3094 #endif
3095 
3096 
3097 
3099 
3100  /**************************************************************************************************************************
3101  * Collections of Instructions
3102  **************************************************************************************************************************/
3103 
3105 
3106  DECLARE_LEAF_CLASS(AsmFunction);
3107  IS_SERIALIZABLE(AsmFunction);
3108 
3109 #ifdef DOCUMENTATION
3110 
3126  public:
3127 #endif
3128 
3129 #ifdef DOCUMENTATION
3130 
3135  const std::string& get_name() const;
3136  void set_name(const std::string&);
3138 #else
3139  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3140  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3141 #endif
3142 
3143 #ifdef DOCUMENTATION
3144 
3150  unsigned get_reason() const;
3151  void set_reason(unsigned);
3153 #else
3154  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3155  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3156 #endif
3157 
3158 #ifdef DOCUMENTATION
3159 
3167 #else
3168  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3169  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3170 #endif
3171 
3172 #ifdef DOCUMENTATION
3173 
3176  MayReturn get_may_return() const;
3177  void set_may_return(MayReturn);
3179 #else
3180  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3181  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3182 #endif
3183 
3184 #ifdef DOCUMENTATION
3185 
3190  const std::string& get_name_md5() const;
3191  void set_name_md5(const std::string&);
3193 #else
3194  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3195  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3196 #endif
3197 
3198 #ifdef DOCUMENTATION
3199 
3204  const SgAsmStatementPtrList& get_statementList() const;
3205  void set_statementList(const SgAsmStatementPtrList&);
3207 #else
3208  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3209  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3210 #endif
3211 
3212 #ifdef DOCUMENTATION
3213  // FIXME[Robb P Matzke 2017-02-13]: unused?
3214 #else
3215  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3216  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3217 #endif
3218 
3219 #ifdef DOCUMENTATION
3220 
3226  rose_addr_t get_entry_va() const;
3227  void set_entry_va(rose_addr_t);
3229 #else
3230  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3231  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3232 #endif
3233 
3234 #ifdef DOCUMENTATION
3235 
3244 #else
3245  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3246  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3247 #endif
3248 
3249 #ifdef DOCUMENTATION
3250  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3251 #else
3252  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3253  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3254 #endif
3255 
3256 #ifdef DOCUMENTATION
3257 
3266  int64_t get_stackDelta() const;
3267  void set_stackDelta(int64_t);
3269 #else
3270  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3271  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3272 #endif
3273 
3274 #ifdef DOCUMENTATION
3275 
3283  const std::string& get_callingConvention() const;
3284  void set_callingConvention(const std::string&);
3286 #else
3287  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3288  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3289 #endif
3290 
3291  DECLARE_OTHERS(AsmFunction);
3292 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3293 
3294 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3295  private:
3296  friend class boost::serialization::access;
3297 
3298  template<class S>
3299  void serialize(S &s, const unsigned version) {
3300  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3301  s & BOOST_SERIALIZATION_NVP(p_name);
3302  s & BOOST_SERIALIZATION_NVP(p_reason);
3303  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3304  s & BOOST_SERIALIZATION_NVP(p_may_return);
3305  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3306  s & BOOST_SERIALIZATION_NVP(p_statementList);
3307  s & BOOST_SERIALIZATION_NVP(p_dest);
3308  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3309  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3310  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3311  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3312  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3313  }
3314 #endif
3315 
3316  public:
3317  // [Robb P Matzke 2017-02-13]: Deprecated because it uses a very old CFG implementation
3318  int nrOfValidInstructions(std::vector<SgNode*>& succs) ROSE_DEPRECATED("use modern CFG classes instead");
3319 
3322 
3326  void remove_statement(SgAsmStatement* statement);
3327 
3328  // [Robb P Matzke 2017-02-13]: I don't think this is used anywhere. It appends to the poorly named "dest" property.
3329  void append_dest(SgAsmStatement* instruction) ROSE_DEPRECATED("apparently not used anywhere");
3330 
3331  // FIXME[Robb P Matzke 2017-02-13]: This is a bad name--it removes only statements, not all AST children.
3335  void remove_children();
3336 
3341  SgAsmBlock* get_entry_block() const;
3342 
3344  enum MayReturn {
3349  };
3350 
3355  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3356  // Also fix SgAsmFunction::reason_key()
3357  FUNC_NONE = 0x00000000,
3359  = 0x00008000,
3360  FUNC_ENTRY_POINT = 0x00010000,
3361  FUNC_CALL_TARGET = 0x00020000,
3364  FUNC_CALL_INSN = 0x00040000,
3370  FUNC_EH_FRAME = 0x00080000,
3371  FUNC_SYMBOL = 0x00100000,
3372  FUNC_PATTERN = 0x00200000,
3377  FUNC_GRAPH = 0x00400000,
3381  FUNC_USERDEF = 0x00800000,
3382  FUNC_PADDING = 0x01000000,
3387  FUNC_DISCONT = 0x02000000,
3390  FUNC_INSNHEAD = 0x04000000,
3391  FUNC_IMPORT = 0x08000000,
3394  FUNC_LEFTOVERS = 0x10000000,
3398  FUNC_INTRABLOCK = 0x20000000,
3406  FUNC_THUNK = 0x40000000,
3415  FUNC_EXPORT = 0x80000000,
3417  FUNC_DEFAULT = 0xefff80ff,
3419  /*========= Miscellaneous Reasons ===========================================================================
3420  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3421  * availalble for users to use as they see fit. */
3422  FUNC_MISCMASK = 0x000000ff,
3428  FUNC_INTERPADFUNC = 0x00000001
3431  };
3432 
3436  static std::string reason_key(const std::string &prefix="");
3437 
3439  std::string reason_str(bool pad) const;
3440 
3444  static std::string reason_str(bool pad, unsigned reason);
3445 
3448  public:
3449  virtual ~NodeSelector() {}
3450  virtual bool operator()(SgNode*) = 0;
3451  };
3452 
3492  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
3493  NodeSelector *selector=NULL);
3494 
3500  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
3501 
3504  e_unknown = 0,
3505  e_standard = 1,
3506  e_library = 2,
3507  e_imported = 3,
3508  e_thunk = 4,
3509  e_last
3510  };
3511 
3512  // Computes the offset of the stack at the end of the call relative the the start of the call (in a perfect function
3513  // this would be zero, this is used to score properly formed functions).
3514  // [Robb P Matzke 2017-02-13]: deprecated
3515  int get_stackNutralityMetric() const ROSE_DEPRECATED("use get_stackDelta instead");
3516 #endif // SgAsmFunction_OTHERS
3517 
3518 
3519 #ifdef DOCUMENTATION
3520  };
3521 #endif
3522 
3523 
3525 
3526  DECLARE_LEAF_CLASS(AsmBlock);
3527  IS_SERIALIZABLE(AsmBlock);
3528 
3529 #ifdef DOCUMENTATION
3530 
3534  class SgAsmBlock: public SgAsmStatement {
3535  public:
3536 #endif
3537 
3538 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3539  // [tps 05Apr07] needed for the control_flow_graph
3540  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
3541  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3542 #endif
3543 
3544 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3545  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
3546  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3547 #endif
3548 
3549 #ifdef DOCUMENTATION
3550 
3555  rose_addr_t get_id() const;
3556  void set_id(rose_addr_t);
3558 #else
3559  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
3560  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3561 #endif
3562 
3563 #ifdef DOCUMENTATION
3564 
3569  unsigned get_reason() const;
3570  void set_reason(unsigned);
3572 #else
3573  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
3574  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3575 #endif
3576 
3577 #ifdef DOCUMENTATION
3578  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3579  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3580  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3581  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3588  const SgAsmStatementPtrList& get_statementList() const;
3589  void set_statementList(const SgAsmStatementPtrList&);
3591 #else
3592  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3593  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3594 #endif
3595 
3596 #ifdef DOCUMENTATION
3597  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3598  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3599  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3600  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3608  const SgAsmIntegerValuePtrList& get_successors() const;
3609  void set_successors(const SgAsmIntegerValuePtrList&);
3611 #else
3612  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
3613  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3614 #endif
3615 
3616 #ifdef DOCUMENTATION
3617 
3627  bool get_successors_complete() const;
3628  void set_successors_complete(bool);
3630 #else
3631  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
3632  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3633 #endif
3634 
3635 #ifdef DOCUMENTATION
3636 
3648 #else
3649  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
3650  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3651 #endif
3652 
3653 #ifdef DOCUMENTATION
3654 
3662  size_t get_cached_vertex() const;
3663  void set_cached_vertex(size_t);
3665 #else
3666  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
3667  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3668 #endif
3669 
3670 #ifdef DOCUMENTATION
3671 
3677  double get_code_likelihood() const;
3678  void set_code_likelihood(double);
3680 #else
3681  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
3682  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3683 #endif
3684 
3685 #ifdef DOCUMENTATION
3686 
3694  int64_t get_stackDeltaOut() const;
3695  void set_stackDeltaOut(int64_t);
3697 #else
3698  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
3699  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3700 #endif
3701 
3702  DECLARE_OTHERS(AsmBlock);
3703 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
3704 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3705  private:
3706  friend class boost::serialization::access;
3707 
3708  template<class S>
3709  void serialize(S &s, const unsigned version) {
3710  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3711  s & BOOST_SERIALIZATION_NVP(p_reason);
3712  s & BOOST_SERIALIZATION_NVP(p_statementList);
3713  s & BOOST_SERIALIZATION_NVP(p_successors);
3714  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
3715  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
3716  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3717  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
3718  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
3719  }
3720 #endif
3721 
3722  public:
3724  enum Reason {
3725  // Please update SgAsmBlock::reason_str() if you change this enum!
3726  BLK_NONE = 0x00000000,
3727  BLK_ENTRY_POINT = 0x00010000,
3728  BLK_PADDING = 0x00020000,
3729  BLK_FRAGMENT = 0x00080000,
3731  BLK_CFGHEAD = 0x00100000,
3732  BLK_USERDEF = 0x00200000,
3733  BLK_LEFTOVERS = 0x00400000,
3735  BLK_JUMPTABLE = 0x00800000,
3736  BLK_GRAPH1 = 0x01000000,
3737  BLK_GRAPH2 = 0x02000000,
3738  BLK_GRAPH3 = 0x04000000,
3740  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
3741 
3742  // ========= Miscellaneous Reasons ===========================================================================
3743  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3744  // availalble for users to use as they see fit.
3745  BLK_MISCMASK = 0x000000ff,
3747  BLK_FINDDATA = 0x00000001,
3749  BLK_POSTFUNC = 0x00000002
3751  };
3752 
3757 
3762 
3763  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
3768  void remove_children();
3769 
3774  rose_addr_t get_fallthrough_va();
3775 
3780 
3786  bool has_instructions() const;
3787 
3793  bool is_basic_block() const { return has_instructions(); }
3794 
3804  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
3805 
3809  static std::string reason_key(const std::string &prefix="");
3810 
3814  std::string reason_str(bool pad) const;
3815 
3821  static std::string reason_str(bool pad, unsigned reason);
3822 #endif // SgAsmBlock_OTHERS
3823 
3824 #ifdef DOCUMENTATION
3825  };
3826 #endif
3827 
3828 
3830 
3831  DECLARE_LEAF_CLASS(AsmStaticData);
3832  IS_SERIALIZABLE(AsmStaticData);
3833 
3834 #ifdef DOCUMENTATION
3835 
3843  public:
3844 #endif
3845 
3846 #ifdef DOCUMENTATION
3847 
3853  const SgUnsignedCharList& get_raw_bytes() const;
3854  void set_raw_bytes(const SgUnsignedCharList&);
3856 #else
3857  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
3858  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3859 #endif
3860 
3861  DECLARE_OTHERS(AsmStaticData);
3862 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
3863 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3864  private:
3865  friend class boost::serialization::access;
3866 
3867  template<class S>
3868  void serialize(S &s, const unsigned version) {
3869  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3870  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
3871  }
3872 #endif
3873 
3874  public:
3878  size_t get_size() const { return p_raw_bytes.size(); }
3879 #endif // SgAsmStaticData_OTHERS
3880 
3881 #ifdef DOCUMENTATION
3882  };
3883 #endif
3884 
3885 
3887 
3888  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
3889  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
3890 
3891 #ifdef DOCUMENTATION
3892 
3903  public:
3904 #endif
3905 
3906  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
3907 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
3908 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3909  private:
3910  friend class boost::serialization::access;
3911 
3912  template<class S>
3913  void serialize(S & s, const unsigned version) {
3914  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3915  }
3916 #endif
3917  protected:
3918  SgAsmSynthesizedDeclarationPtrList p_declarationList;
3919 
3920  public:
3923  p_declarationList.push_back(declaration);
3924  }
3925 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
3926 
3927 #ifdef DOCUMENTATION
3928  };
3929 #endif
3930 
3931 
3933 
3934  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
3935  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
3936 
3937 #ifdef DOCUMENTATION
3938  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3940  public:
3941 #endif
3942 
3943 #ifdef DOCUMENTATION
3944 
3947  const std::string& get_name() const;
3948  void set_name(const std::string&);
3950 #else
3951  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
3952  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
3953  NO_DELETE);
3954 #endif
3955 
3956 #ifdef DOCUMENTATION
3957  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
3961  uint64_t get_offset() const;
3962  void set_ofset(uint64_t);
3964 #else
3965  // Not clear if we want to store the offset explicitly
3966  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
3967  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
3968  NO_DELETE);
3969 #endif
3970 
3971  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
3972 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
3973 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3974  private:
3975  friend class boost::serialization::access;
3976 
3977  template<class S>
3978  void serialize(S &s, const unsigned version) {
3979  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3980  }
3981 #endif
3982 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
3983 
3984 #ifdef DOCUMENTATION
3985  };
3986 #endif
3987 
3988 
3990 
3991  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
3992  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
3993  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
3994  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
3995  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
3996 
3997 #ifdef DOCUMENTATION
3998 
4005  public:
4006 #endif
4007 
4008  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4009 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4010 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4011  private:
4012  friend class boost::serialization::access;
4013 
4014  template<class S>
4015  void serialize(S &s, const unsigned version) {
4016  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4017  };
4018 #endif
4019 #endif // SgAsmSynthesizedDeclaration_OTHERS
4020 
4021 #ifdef DOCUMENTATION
4022  };
4023 #endif
4024 
4025 
4027 
4028  NEW_NONTERMINAL_MACRO(AsmStatement,
4029  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4030  "AsmStatement", "AsmStatementTag", false);
4031  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4032  IS_SERIALIZABLE(AsmStatement);
4033 
4034 #ifdef DOCUMENTATION
4035  class SgAsmStatement: public SgAsmNode {
4036  public:
4037 #endif
4038 
4039 #ifndef DOCUMENTATION
4040  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4041  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4042  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4043  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4044 #endif
4045 
4046  DECLARE_OTHERS(AsmStatement);
4047 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4048 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4049  private:
4050  friend class boost::serialization::access;
4051 
4052  template<class S>
4053  void serialize(S &s, const unsigned version) {
4054  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4055  s & BOOST_SERIALIZATION_NVP(p_address);
4056  s & BOOST_SERIALIZATION_NVP(p_comment);
4057  }
4058 #endif
4059 #endif // SgAsmStatement_OTHERS
4060 
4061 #ifdef DOCUMENTATION
4062  };
4063 #endif
4064 
4065 
4066 
4067 
4069 
4070  /*************************************************************************************************************************
4071  * Binary Interpretations
4072  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4073  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4074  * an AST that represents a single, coherent sub-part of the file.
4075  *************************************************************************************************************************/
4076 
4078 
4079  DECLARE_LEAF_CLASS(AsmInterpretationList);
4080  IS_SERIALIZABLE(AsmInterpretationList);
4081 
4082 #ifdef DOCUMENTATION
4083 
4085  public:
4086 #endif
4087 
4088 #ifdef DOCUMENTATION
4089 
4098 #else
4099  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4100  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4101  NO_DELETE);
4102 #endif
4103 
4104  DECLARE_OTHERS(AsmInterpretationList);
4105 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4106 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4107  private:
4108  friend class boost::serialization::access;
4109 
4110  template<class S>
4111  void serialize(S &s, const unsigned version) {
4112  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4113  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4114  }
4115 #endif
4116 #endif // SgAsmInterpretationList_OTHERS
4117 
4118 #ifdef DOCUMENTATION
4119  };
4120 #endif
4121 
4123 
4124  DECLARE_LEAF_CLASS(AsmInterpretation);
4125  IS_SERIALIZABLE(AsmInterpretation);
4126 
4127  DECLARE_HEADERS(AsmInterpretation);
4128 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4129  #include <MemoryMap.h>
4130  class RegisterDictionary;
4131 #endif // SgAsmInterpretation_HEADERS
4132 
4133 #ifdef DOCUMENTATION
4134 
4141  public:
4142 #endif
4143 
4144 #ifdef DOCUMENTATION
4145  // documentation and definition are below
4146 #else
4147  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4148 #endif
4149 
4150 #ifdef DOCUMENTATION
4151 
4162 #else
4163  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4164  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4165 #endif
4166 
4167 #ifdef DOCUMENTATION
4168 
4173  SgAsmBlock* get_global_block() const;
4176 #else
4177  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4178  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4179 #endif
4180 
4181  DECLARE_OTHERS(AsmInterpretation);
4182 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4183  private:
4185  const RegisterDictionary *p_registers;
4186  bool coverageComputed; // true iff percentageCoverage has been computed
4187  mutable InstructionMap instruction_map; // cached instruction map
4188 
4190  // disassembly into instructions.
4191  double percentageCoverage;
4192 
4193 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4194  private:
4195  friend class boost::serialization::access;
4196 
4197  template<class S>
4198  void serialize(S &s, const unsigned version) {
4199  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4200  s & BOOST_SERIALIZATION_NVP(p_headers);
4201  s & BOOST_SERIALIZATION_NVP(p_global_block);
4202  s & BOOST_SERIALIZATION_NVP(p_map);
4203  s & BOOST_SERIALIZATION_NVP(p_registers);
4204  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4205  s & BOOST_SERIALIZATION_NVP(instruction_map);
4206  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4207  }
4208 #endif
4209 
4210  public:
4213  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4214  ctor();
4215  }
4216 
4221  SgAsmGenericFilePtrList get_files() const;
4222 
4238  const RegisterDictionary *get_registers() const;
4239  void set_registers(const RegisterDictionary*);
4249  InstructionMap& get_instruction_map(bool recompute=false);
4250  void set_instruction_map(const InstructionMap&);
4257  void insert_instructions(InstructionMap&/*in,out*/);
4258 
4263  void erase_instructions(InstructionMap&/*in,out*/);
4264 
4270  void set_coverageComputed(bool x) { coverageComputed = x; }
4271  void set_percentageCoverage(double x) { percentageCoverage = x; }
4274  private:
4275  void ctor(); // finalize construction
4276 #endif // SgAsmInterpretation_OTHERS
4277 
4278 #ifdef DOCUMENTATION
4279  };
4280 #endif
4281 
4282 
4283 
4285 
4286  /*************************************************************************************************************************
4287  * ELF File Header
4288  *************************************************************************************************************************/
4289 
4291 
4292  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4293  IS_SERIALIZABLE(AsmElfFileHeader);
4294 
4295 #ifdef DOCUMENTATION
4296 
4305  public:
4306 #endif
4307 
4308 #ifdef DOCUMENTATION
4309 
4314  unsigned char get_e_ident_file_class() const;
4315  void set_e_ident_file_class(unsigned char);
4317 #else
4318  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4319  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4320 #endif
4321 
4322 #ifdef DOCUMENTATION
4323 
4328  unsigned char get_e_ident_data_encoding() const;
4329  void set_e_ident_data_encoding(unsigned char);
4331 #else
4332  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4333  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4334 #endif
4335 
4336 #ifdef DOCUMENTATION
4337 
4342  unsigned char get_e_ident_file_version() const;
4343  void set_e_ident_file_version(unsigned char*);
4345 #else
4346  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4347  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4348 #endif
4349 
4350 #ifdef DOCUMENTATION
4351 
4356  const SgUnsignedCharList& get_e_ident_padding() const;
4357  void set_e_ident_padding(const SgUnsignedCharList&);
4359 #else
4360  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4361  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4362 #endif
4363 
4364 #ifdef DOCUMENTATION
4365 
4370  unsigned long get_e_type() const;
4371  void set_e_type(unsigned long);
4373 #else
4374  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4375  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4376 #endif
4377 
4378 #ifdef DOCUMENTATION
4379 
4384  unsigned long get_e_machine() const;
4385  void set_e_machine(unsigned long);
4387 #else
4388  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4389  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4390 #endif
4391 
4392 #ifdef DOCUMENTATION
4393 
4398  unsigned long get_e_flags() const;
4399  void set_e_flags(unsigned long);
4401 #else
4402  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4403  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4404 #endif
4405 
4406 #ifdef DOCUMENTATION
4407 
4412  unsigned long get_e_ehsize() const;
4413  void set_e_ehsize(unsigned long);
4415 #else
4416  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4417  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4418 #endif
4419 
4420 #ifdef DOCUMENTATION
4421 
4426  unsigned long get_phextrasz() const;
4427  void set_phextrasz(unsigned long);
4429 #else
4430  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4431  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4432 #endif
4433 
4434 #ifdef DOCUMENTATION
4435 
4440  unsigned long get_e_phnum() const;
4441  void set_e_phnum(unsigned long);
4443 #else
4444  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
4445  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4446 #endif
4447 
4448 #ifdef DOCUMENTATION
4449 
4454  unsigned long get_shextrasz() const;
4455  void set_shextrasz(unsigned long);
4457 #else
4458  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
4459  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4460 #endif
4461 
4462 #ifdef DOCUMENTATION
4463 
4468  unsigned long get_e_shnum() const;
4469  void set_e_shnum(unsigned long);
4471 #else
4472  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
4473  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4474 #endif
4475 
4476 #ifdef DOCUMENTATION
4477 
4482  unsigned long get_e_shstrndx() const;
4483  void set_e_shstrndx(unsigned long);
4485 #else
4486  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
4487  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4488 #endif
4489 
4490 #ifdef DOCUMENTATION
4491 
4501 #else
4502  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
4503  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4504 #endif
4505 
4506 #ifdef DOCUMENTATION
4507 
4516 #else
4517  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
4518  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4519 #endif
4520 
4521  DECLARE_OTHERS(AsmElfFileHeader);
4522 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
4523 
4524 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4525  private:
4526  friend class boost::serialization::access;
4527 
4528  template<class S>
4529  void serialize(S &s, const unsigned version) {
4530  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
4531  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
4532  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
4533  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
4534  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
4535  s & BOOST_SERIALIZATION_NVP(p_e_type);
4536  s & BOOST_SERIALIZATION_NVP(p_e_machine);
4537  s & BOOST_SERIALIZATION_NVP(p_e_flags);
4538  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
4539  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
4540  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
4541  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
4542  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
4543  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
4544  s & BOOST_SERIALIZATION_NVP(p_section_table);
4545  s & BOOST_SERIALIZATION_NVP(p_segment_table);
4546  }
4547 #endif
4548 
4549  public:
4551  enum ObjectType {
4552  ET_NONE = 0
4553  ,ET_REL = 1
4554  ,ET_EXEC = 2
4555  ,ET_DYN = 3
4556  ,ET_CORE = 4
4558  ,ET_LOOS = 0xfe00
4559  ,ET_HIOS = 0xfeff
4560  ,ET_LOPROC = 0xff00
4561  ,ET_HIPROC = 0xffff
4562  };
4563 
4564  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
4565  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
4566  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
4567  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
4568  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
4569 #ifdef _MSC_VER
4570 # pragma pack (1)
4571 #endif
4572 
4579  unsigned char e_ident_magic[4];
4580  unsigned char e_ident_file_class;
4581  unsigned char e_ident_data_encoding;
4582  unsigned char e_ident_file_version;
4583  unsigned char e_ident_padding[9];
4584  uint16_t e_type;
4585  uint16_t e_machine;
4586  uint32_t e_version;
4587  uint32_t e_entry;
4588  uint32_t e_phoff;
4589  uint32_t e_shoff;
4590  uint32_t e_flags;
4591  uint16_t e_ehsize;
4592  uint16_t e_phentsize;
4593  uint16_t e_phnum;
4594  uint16_t e_shentsize;
4595  uint16_t e_shnum;
4596  uint16_t e_shstrndx;
4597  }
4598 #if !defined(SWIG) && !defined(_MSC_VER)
4599  __attribute__((packed))
4600 #endif
4601  ;
4602 
4604  unsigned char e_ident_magic[4];
4605  unsigned char e_ident_file_class;
4606  unsigned char e_ident_data_encoding;
4607  unsigned char e_ident_file_version;
4608  unsigned char e_ident_padding[9];
4609  uint16_t e_type;
4610  uint16_t e_machine;
4611  uint32_t e_version;
4612  uint64_t e_entry;
4613  uint64_t e_phoff;
4614  uint64_t e_shoff;
4615  uint32_t e_flags;
4616  uint16_t e_ehsize;
4617  uint16_t e_phentsize;
4618  uint16_t e_phnum;
4619  uint16_t e_shentsize;
4620  uint16_t e_shnum;
4621  uint16_t e_shstrndx;
4622  }
4623 #if !defined(SWIG) && !defined(_MSC_VER)
4624  __attribute__((packed))
4625 #endif
4626  ;
4627 
4628 #ifdef _MSC_VER
4629 # pragma pack ()
4630 #endif
4631 
4639  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
4640  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
4641  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
4642  ctor();
4643  }
4644 
4650  uint64_t max_page_size();
4651 
4654 
4657 
4663  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
4664 
4666  virtual bool reallocate() $ROSE_OVERRIDE;
4667 
4669  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4670 
4672  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4673 
4675  static bool is_ELF(SgAsmGenericFile*);
4676 
4678  SgAsmGenericSectionPtrList get_sectab_sections();
4679 
4681  SgAsmGenericSectionPtrList get_segtab_sections();
4682 
4683  // Overrides documented in base class
4684  virtual const char *format_name() const $ROSE_OVERRIDE;
4685 
4686  private:
4687  void ctor(); // called by constructors
4688  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
4689  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
4690 #endif // SgAsmElfFileHeader_OTHERS
4691 
4692 #ifdef DOCUMENTATION
4693  };
4694 #endif
4695 
4696 
4697 
4699 
4700  /*************************************************************************************************************************
4701  * ELF Section Tables
4702  *************************************************************************************************************************/
4703 
4705 
4706  DECLARE_LEAF_CLASS(AsmElfSectionTable);
4707  IS_SERIALIZABLE(AsmElfSectionTable);
4708 
4709 #ifdef DOCUMENTATION
4710 
4716  public:
4717 #endif
4718 
4719  DECLARE_OTHERS(AsmElfSectionTable);
4720 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
4721 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4722  private:
4723  friend class boost::serialization::access;
4724 
4725  template<class S>
4726  void serialize(S &s, const unsigned version) {
4727  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
4728  }
4729 #endif
4730 
4731  public:
4734  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
4735  ctor();
4736  }
4737 
4743  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
4744 
4756 
4760  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
4761 
4763  virtual bool reallocate() $ROSE_OVERRIDE;
4764 
4766  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4767 
4769  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4770 
4771  private:
4772  void ctor();
4773 #endif // SgAsmElfSectionTable_OTHERS
4774 
4775 #ifdef DOCUMENTATION
4776  };
4777 #endif
4778 
4779 
4781 
4782  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
4783  IS_SERIALIZABLE(AsmElfSectionTableEntry);
4784 
4785 #ifdef DOCUMENTATION
4786 
4788  public:
4789 #endif
4790 
4791 #ifdef DOCUMENTATION
4792 
4797  unsigned get_sh_name() const;
4798  void set_sh_name(unsigned);
4800 #else
4801  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
4802  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4803 #endif
4804 
4805 #ifdef DOCUMENTATION
4806 
4811  SectionType get_sh_type() const;
4812  void set_sh_type(SectionType);
4814 #else
4815  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
4816  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4817 #endif
4818 
4819 #ifdef DOCUMENTATION
4820 
4825  unsigned long get_sh_link() const;
4826  void set_sh_link(unsigned long);
4828 #else
4829  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
4830  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4831 #endif
4832 
4833 #ifdef DOCUMENTATION
4834 
4839  unsigned long get_sh_info() const;
4840  void set_sh_info(unsigned long);
4842 #else
4843  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
4844  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4845 #endif
4846 
4847 #ifdef DOCUMENTATION
4848 
4853  uint64_t get_sh_flags() const;
4854  void set_sh_flags(uint64_t);
4856 #else
4857  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
4858  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4859 #endif
4860 
4861 #ifdef DOCUMENTATION
4862 
4867  rose_addr_t get_sh_addr() const;
4868  void set_sh_addr(rose_addr_t);
4870 #else
4871  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
4872  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4873 #endif
4874 
4875 #ifdef DOCUMENTATION
4876 
4881  rose_addr_t get_sh_offset() const;
4882  void set_sh_offset(rose_addr_t);
4884 #else
4885  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
4886  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4887 #endif
4888 
4889 #ifdef DOCUMENTATION
4890 
4895  rose_addr_t get_sh_size() const;
4896  void set_sh_size(rose_addr_t);
4898 #else
4899  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
4900  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4901 #endif
4902 
4903 #ifdef DOCUMENTATION
4904 
4909  rose_addr_t get_sh_addralign() const;
4910  void set_sh_addralign(rose_addr_t);
4912 #else
4913  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
4914  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4915 #endif
4916 
4917 #ifdef DOCUMENTATION
4918 
4923  rose_addr_t get_sh_entsize() const;
4924  void set_sh_entsize(rose_addr_t);
4926 #else
4927  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
4928  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4929 #endif
4930 
4931 #ifdef DOCUMENTATION
4932 
4937  const SgUnsignedCharList& get_extra() const;
4938  void set_extra(const SgUnsignedCharLit&);
4940 #else
4941  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
4942  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4943  NO_DELETE);
4944 #endif
4945 
4946  DECLARE_OTHERS(AsmElfSectionTableEntry);
4947 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
4948 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4949  private:
4950  friend class boost::serialization::access;
4951 
4952  template<class S>
4953  void serialize(S &s, const unsigned version) {
4954  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
4955  s & BOOST_SERIALIZATION_NVP(p_sh_name);
4956  s & BOOST_SERIALIZATION_NVP(p_sh_type);
4957  s & BOOST_SERIALIZATION_NVP(p_sh_link);
4958  s & BOOST_SERIALIZATION_NVP(p_sh_info);
4959  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
4960  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
4961  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
4962  s & BOOST_SERIALIZATION_NVP(p_sh_size);
4963  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
4964  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
4965  s & BOOST_SERIALIZATION_NVP(p_extra);
4966  }
4967 #endif
4968 
4969  public:
4972  SHT_NULL = 0,
4976  SHT_RELA = 4,
4977  SHT_HASH = 5,
4979  SHT_NOTE = 7,
4981  SHT_REL = 9,
4982  SHT_SHLIB = 10,
4983  SHT_DYNSYM = 11,
4985  SHT_LOOS = 0x60000000,
4986  SHT_GNU_verdef = 0x6ffffffd,
4987  SHT_GNU_verneed = 0x6ffffffe,
4988  SHT_GNU_versym = 0x6fffffff,
4989  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
4990 
4991  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
4992  SHT_HIPROC = 0x7fffffff,
4993  SHT_LOUSER = 0x80000000, /* Application specific semantics */
4994  SHT_HIUSER = 0xffffffff
4995  };
4996 
5000  SHF_WRITE= (1 << 0),
5001  SHF_ALLOC= (1 << 1),
5002  SHF_EXECINSTR= (1 << 2),
5003  SHF_MERGE= (1 << 4),
5004  SHF_STRINGS= (1 << 5),
5005  SHF_INFO_LINK= (1 << 6),
5006  SHF_LINK_ORDER= (1 << 7),
5008  SHF_GROUP= (1 << 9),
5009  SHF_TLS= (1 << 10),
5010  SHF_MASKOS= 0x0ff00000,
5011  SHF_MASKPROC= 0xf0000000
5012  };
5013 
5020 #ifdef _MSC_VER
5021 # pragma pack (1)
5022 #endif
5024  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5025  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5026  uint32_t sh_flags; /* 0x08 Bit flags */
5027  uint32_t sh_addr; /* 0x0c Desired mapped address */
5028  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5029  uint32_t sh_size; /* 0x14 Section size in bytes */
5030  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5031  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5032  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5033  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5034  } /* 0x28 */
5035 #if !defined(SWIG) && !defined(_MSC_VER)
5036  __attribute__((packed))
5037 #endif
5038  ;
5039 
5041  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5042  uint32_t sh_type; /* 0x04 */
5043  uint64_t sh_flags; /* 0x08 */
5044  uint64_t sh_addr; /* 0x10 */
5045  uint64_t sh_offset; /* 0x18 */
5046  uint64_t sh_size; /* 0x20 */
5047  uint32_t sh_link; /* 0x28 */
5048  uint32_t sh_info; /* 0x2c */
5049  uint64_t sh_addralign; /* 0x30 */
5050  uint64_t sh_entsize; /* 0x38 */
5051  } /* 0x40 */
5052 #if !defined(SWIG) && !defined(_MSC_VER)
5053  __attribute__((packed))
5054 #endif
5055  ;
5056 #ifdef _MSC_VER
5057 # pragma pack ()
5058 #endif
5059 
5061  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5063 
5065  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5067 
5071  void *encode(ByteOrder::Endianness sex,
5073  void *encode(ByteOrder::Endianness sex,
5079 
5081  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5082 
5083  // Use Rose::stringify... function instead.
5084  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5085  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5086 
5087  private:
5088  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5089  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5090 #endif // SgAsmElfSectionTableEntry_OTHERS
5091 
5092 #ifdef DOCUMENTATION
5093  };
5094 #endif
5095 
5096 
5097 
5099 
5100  /*************************************************************************************************************************
5101  * ELF Segment Tables
5102  *************************************************************************************************************************/
5103 
5105 
5106  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5107  IS_SERIALIZABLE(AsmElfSegmentTable);
5108 
5109 #ifdef DOCUMENTATION
5110 
5117  public:
5118 #endif
5119 
5120  DECLARE_OTHERS(AsmElfSegmentTable);
5121 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5122 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5123  private:
5124  friend class boost::serialization::access;
5125 
5126  template<class S>
5127  void serialize(S &s, const unsigned version) {
5128  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5129  }
5130 #endif
5131 
5132  public:
5135  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5136  ctor();
5137  }
5138 
5143  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5144 
5159 
5163  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5164 
5166  virtual bool reallocate() $ROSE_OVERRIDE;
5167 
5169  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5170 
5172  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5173 
5174  private:
5175  void ctor();
5176 #endif // SgAsmElfSegmentTable_OTHERS
5177 
5178 #ifdef DOCUMENTATION
5179  };
5180 #endif
5181 
5183 
5184  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5185  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5186 
5187 #ifdef DOCUMENTATION
5189  public:
5190 #endif
5191 
5192 #ifdef DOCUMENTATION
5193 
5199  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5200  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5202 #else
5203  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5204  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5205  NO_DELETE);
5206 #endif
5207 
5208  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5209 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5210 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5211  private:
5212  friend class boost::serialization::access;
5213 
5214  template<class S>
5215  void serialize(S &s, const unsigned version) {
5216  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5217  }
5218 #endif
5219 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5220 
5221 #ifdef DOCUMENTATION
5222  };
5223 #endif
5224 
5225 
5227 
5228  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5229  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5230 
5231 #ifdef DOCUMENTATION
5232 
5234  public:
5235 #endif
5236 
5237 #ifdef DOCUMENTATION
5238 
5243  size_t get_index() const;
5244  void set_index(size_t);
5246 #else
5247  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5248  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5249 #endif
5250 
5251 #ifdef DOCUMENTATION
5252 
5255  SegmentType get_type() const;
5256  void set_type(SegmentType);
5258 #else
5259  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5260  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5261  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5262 #endif
5263 
5264 #ifdef DOCUMENTATION
5265 
5268  SegmentFlags get_flags() const;
5269  void set_flags(SegmentFlags);
5271 #else
5272  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5273  "= SgAsmElfSegmentTableEntry::PF_NONE",
5274  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5275 #endif
5276 
5277 #ifdef DOCUMENTATION
5278 
5283  rose_addr_t get_offset() const;
5284  void set_offset(rose_addr_t);
5286 #else
5287  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5288  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5289 #endif
5290 
5291 #ifdef DOCUMENTATION
5292 
5298  rose_addr_t get_vaddr() const;
5299  void set_vaddr(rose_addr_t);
5301 #else
5302  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5303  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5304 #endif
5305 
5306 #ifdef DOCUMENTATION
5307 
5312  rose_addr_t get_paddr() const;
5313  void set_paddr(rose_addr_t);
5315 #else
5316  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5317  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5318 #endif
5319 
5320 #ifdef DOCUMENTATION
5321 
5326  rose_addr_t get_filesz() const;
5327  void set_filesz(rose_addr_t);
5329 #else
5330  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5331  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5332 #endif
5333 
5334 #ifdef DOCUMENTATION
5335 
5340  rose_addr_t get_memsz() const;
5341  void set_memsz(rose_addr_t);
5343 #else
5344  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5345  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5346 #endif
5347 
5348 #ifdef DOCUMENTATION
5349 
5354  rose_addr_t get_align() const;
5355  void set_align(rose_addr_t);
5357 #else
5358  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5359  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5360 #endif
5361 
5362 #ifdef DOCUMENTATION
5363 
5368  const SgUnsignedCharList& get_extra() const;
5369  void set_extra(const SgUnsignedCharList&);
5371 #else
5372  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5373  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5374 #endif
5375 
5376  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5377 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
5378 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5379  private:
5380  friend class boost::serialization::access;
5381 
5382  template<class S>
5383  void serialize(S &s, const unsigned version) {
5384  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5385  s & BOOST_SERIALIZATION_NVP(p_index);
5386  s & BOOST_SERIALIZATION_NVP(p_type);
5387  s & BOOST_SERIALIZATION_NVP(p_flags);
5388  s & BOOST_SERIALIZATION_NVP(p_offset);
5389  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5390  s & BOOST_SERIALIZATION_NVP(p_paddr);
5391  s & BOOST_SERIALIZATION_NVP(p_filesz);
5392  s & BOOST_SERIALIZATION_NVP(p_memsz);
5393  s & BOOST_SERIALIZATION_NVP(p_align);
5394  s & BOOST_SERIALIZATION_NVP(p_extra);
5395  }
5396 #endif
5397 
5398  public:
5401  PT_NULL = 0,
5402  PT_LOAD = 1,
5405  PT_NOTE = 4,
5406  PT_SHLIB = 5,
5407  PT_PHDR = 6,
5408  PT_TLS = 7,
5410  // OS- and Processor-specific ranges
5411  PT_LOOS = 0x60000000,
5412  PT_HIOS = 0x6fffffff,
5413  PT_LOPROC = 0x70000000,
5414  PT_HIPROC = 0x7fffffff,
5415 
5416  // OS-specific values for GNU/Linux
5417  PT_GNU_EH_FRAME = 0x6474e550,
5418  PT_GNU_STACK = 0x6474e551,
5419  PT_GNU_RELRO = 0x6474e552,
5420  PT_PAX_FLAGS = 0x65041580,
5422  // OS-specific values for Sun
5423  PT_SUNWBSS = 0x6ffffffa,
5424  PT_SUNWSTACK = 0x6ffffffb
5425  };
5426 
5429  PF_NONE = 0,
5430  PF_RESERVED = 0x000ffff8,
5431  PF_XPERM = 0x00000001,
5432  PF_WPERM = 0x00000002,
5433  PF_RPERM = 0x00000004,
5434  PF_OS_MASK = 0x0ff00000,
5435  PF_PROC_MASK = 0xf0000000
5436  };
5437 
5438 #ifdef _MSC_VER
5439 # pragma pack (1)
5440 #endif
5441 
5449  uint32_t p_type;
5450  uint32_t p_offset;
5451  uint32_t p_vaddr;
5452  uint32_t p_paddr;
5453  uint32_t p_filesz;
5454  uint32_t p_memsz;
5455  uint32_t p_flags;
5456  uint32_t p_align;
5457  } /* 0x30 */
5458 #if !defined(SWIG) && !defined(_MSC_VER)
5459  __attribute__((packed))
5460 #endif
5461  ;
5462 
5464  uint32_t p_type; /* 0x00 */
5465  uint32_t p_flags; /* 0x04 */
5466  uint64_t p_offset; /* 0x08 */
5467  uint64_t p_vaddr; /* 0x10 */
5468  uint64_t p_paddr; /* 0x18 */
5469  uint64_t p_filesz; /* 0x20 */
5470  uint64_t p_memsz; /* 0x28 */
5471  uint64_t p_align; /* 0x30 */
5472  } /* 0x38 */
5473 #if !defined(SWIG) && !defined(_MSC_VER)
5474  __attribute__((packed))
5475 #endif
5476  ;
5477 #ifdef _MSC_VER
5478 # pragma pack ()
5479 #endif
5480 
5482  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5484 
5486  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5488 
5492  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
5493  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
5498 
5500  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5501 
5504 
5507 
5508  private:
5509  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
5510  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
5511 #endif // SgAsmElfSegmentTableEntry_OTHERS
5512 
5513 #ifdef DOCUMENTATION
5514  };
5515 #endif
5516 
5517 
5518 
5520 
5521  /*************************************************************************************************************************
5522  * ELF Symbol Tables
5523  *************************************************************************************************************************/
5524 
5526 
5527  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
5528  IS_SERIALIZABLE(AsmElfSymbolSection);
5529 
5530 #ifdef DOCUMENTATION
5531 
5533  public:
5534 #endif
5535 
5536 #ifdef DOCUMENTATION
5537 
5540  bool get_is_dynamic() const;
5541  void set_is_dynamic(bool);
5543 #else
5544  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
5545  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5546 #endif
5547 
5548 #ifdef DOCUMENTATION
5549 
5558 #else
5559  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
5560  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5561 #endif
5562 
5563  DECLARE_OTHERS(AsmElfSymbolSection);
5564 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
5565 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5566  private:
5567  friend class boost::serialization::access;
5568 
5569  template<class S>
5570  void serialize(S &s, const unsigned version) {
5571  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5572  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
5573  s & BOOST_SERIALIZATION_NVP(p_symbols);
5574  }
5575 #endif
5576 
5577  public:
5580  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
5581  ctor(strsec);
5582  }
5583 
5585  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
5586 
5599  virtual void finish_parsing() $ROSE_OVERRIDE;
5600 
5602  size_t index_of(SgAsmElfSymbol*);
5603 
5608  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5609 
5613  virtual bool reallocate() $ROSE_OVERRIDE;
5614 
5616  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5617 
5619  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5620 
5621  private:
5622  void ctor(SgAsmElfStringSection*);
5623 #endif // SgAsmElfSymbolSection_OTHERS
5624 
5625 #ifdef DOCUMENTATION
5626  };
5627 #endif
5628 
5630 
5631  DECLARE_LEAF_CLASS(AsmElfSymbolList);
5632  IS_SERIALIZABLE(AsmElfSymbolList);
5633 
5634 #ifdef DOCUMENTATION
5636  public:
5637 #endif
5638 
5639 #ifdef DOCUMENTATION
5640 
5646  const SgAsmElfSymbolPtrList& get_symbols() const;
5647  void set_symbols(const SgAsmElfSymbolPtrList&);
5649 #else
5650  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
5651  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5652 #endif
5653 
5654  DECLARE_OTHERS(AsmElfSymbolList);
5655 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
5656 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5657  private:
5658  friend class boost::serialization::access;
5659 
5660  template<class S>
5661  void serialize(S &s, const unsigned version) {
5662  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5663  s & BOOST_SERIALIZATION_NVP(p_symbols);
5664  }
5665 #endif
5666 #endif // SgAsmElfSymbolList_OTHERS
5667 
5668 #ifdef DOCUMENTATION
5669  };
5670 #endif
5671 
5673 
5674  DECLARE_LEAF_CLASS(AsmElfSymbol);
5675  IS_SERIALIZABLE(AsmElfSymbol);
5676 
5677 #ifdef DOCUMENTATION
5678 
5683  public:
5684 #endif
5685 
5686 #ifdef DOCUMENTATION
5687 
5692  unsigned char get_st_info() const;
5693  void set_st_info(unsigned char);
5695 #else
5696  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
5697  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5698 #endif
5699 
5700 #ifdef DOCUMENTATION
5701 
5706  unsigned char get_st_res1() const;
5707  void set_st_res1(unsigned char);
5709 #else
5710  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
5711  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5712 #endif
5713 
5714 #ifdef DOCUMENTATION
5715 
5720  unsigned get_st_shndx() const;
5721  void set_st_shndx(unsigned);
5723 #else
5724  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
5725  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5726 #endif
5727 
5728 #ifdef DOCUMENTATION
5729 
5734  rose_addr_t get_st_size() const;
5735  void set_st_size(rose_addr_t);
5737 #else
5738  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
5739  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5740 #endif
5741 
5742 #ifdef DOCUMENTATION
5743 
5748  const SgUnsignedCharList& get_extra() const;
5749  void set_extra(const SgUnsignedCharList&);
5751 #else
5752  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
5753  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5754 #endif
5755 
5756  DECLARE_OTHERS(AsmElfSymbol);
5757 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
5758 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5759  private:
5760  friend class boost::serialization::access;
5761 
5762  template<class S>
5763  void serialize(S &s, const unsigned version) {
5764  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
5765  s & BOOST_SERIALIZATION_NVP(p_st_info);
5766  s & BOOST_SERIALIZATION_NVP(p_st_res1);
5767  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
5768  s & BOOST_SERIALIZATION_NVP(p_st_size);
5769  s & BOOST_SERIALIZATION_NVP(p_extra);
5770  }
5771 #endif
5772 
5773  public:
5774  enum ElfSymBinding {
5775  STB_LOCAL=0,
5776  STB_GLOBAL=1,
5777  STB_WEAK=2
5778  };
5779 
5780  enum ElfSymType {
5783  STT_FUNC = 2,
5785  STT_FILE = 4,
5787  STT_TLS = 6,
5789  };
5790 
5791 #ifdef _MSC_VER
5792 # pragma pack (1)
5793 #endif
5794 
5797  uint32_t st_name;
5798  uint32_t st_value;
5799  uint32_t st_size;
5800  unsigned char st_info;
5801  unsigned char st_res1;
5802  uint16_t st_shndx;
5803  }
5804 #if !defined(SWIG) && !defined(_MSC_VER)
5805  __attribute__((packed))
5806 #endif
5807  ;
5808 
5810  uint32_t st_name;
5811  unsigned char st_info;
5812  unsigned char st_res1;
5813  uint16_t st_shndx;
5814  uint64_t st_value;
5815  uint64_t st_size;
5816  }
5817 #if !defined(SWIG) && !defined(_MSC_VER)
5818  __attribute__((packed))
5819 #endif
5820  ;
5821 
5822 #ifdef _MSC_VER
5823 # pragma pack ()
5824 #endif
5825 
5827  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
5828 
5832  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
5833 
5837  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
5838 
5842  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
5843  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
5851  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5852  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
5856  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
5857 
5860 
5862  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
5863 
5865  static std::string to_string(SgAsmElfSymbol::ElfSymType);
5866 
5867  private:
5868  void ctor(SgAsmElfSymbolSection*);
5869  void parse_common(); // initialization common to all parse() methods
5870 #endif // SgAsmElfSymbol_OTHERS
5871 
5872 #ifdef DOCUMENTATION
5873  };
5874 #endif
5875 
5876 
5877 
5879 
5880  /*************************************************************************************************************************
5881  * ELF Symbol Version Tables
5882  *************************************************************************************************************************/
5883 
5885 
5886  DECLARE_LEAF_CLASS(AsmElfSymverSection);
5887  IS_SERIALIZABLE(AsmElfSymverSection);
5888 
5889 #ifdef DOCUMENTATION
5890 
5895  public:
5896 #endif
5897 
5898 #ifdef DOCUMENTATION
5899 
5908 #else
5909  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
5910  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5911 #endif
5912 
5913  DECLARE_OTHERS(AsmElfSymverSection);
5914 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
5915 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5916  private:
5917  friend class boost::serialization::access;
5918 
5919  template<class S>
5920  void serialize(S &s, const unsigned version) {
5921  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5922  s & BOOST_SERIALIZATION_NVP(p_entries);
5923  }
5924 #endif
5925 
5926  public:
5929  : SgAsmElfSection(fhdr) {
5930  ctor();
5931  }
5932 
5934  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
5935 
5940  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5941 
5943  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5944 
5946  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5947  private:
5948  void ctor();
5949 #endif // SgAsmElfSymverSection_OTHERS
5950 
5951 #ifdef DOCUMENTATION
5952  };
5953 #endif
5954 
5956 
5957  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
5958  IS_SERIALIZABLE(AsmElfSymverEntry);
5959 
5960 #ifdef DOCUMENTATION
5961 
5963  public:
5964 #endif
5965 
5966 #ifdef DOCUMENTATION
5967 
5972  size_t get_value() const;
5973  void set_value(size_t);
5975 #else
5976  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
5977  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5978 #endif
5979 
5980  DECLARE_OTHERS(AsmElfSymverEntry);
5981 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
5982 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5983  private:
5984  friend class boost::serialization::access;
5985 
5986  template<class S>
5987  void serialize(S &s, const unsigned version) {
5988  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5989  s & BOOST_SERIALIZATION_NVP(p_value);
5990  }
5991 #endif
5992 
5993  public:
5996  : p_value(0) {
5997  ctor(symver);
5998  }
5999 
6001  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6002 
6003  private:
6004  void ctor(SgAsmElfSymverSection*);
6005 #endif // SgAsmElfSymverEntry_OTHERS
6006 
6007 #ifdef DOCUMENTATION
6008  };
6009 #endif
6010 
6012 
6013 
6014  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6015  IS_SERIALIZABLE(AsmElfSymverEntryList);
6016 
6017 #ifdef DOCUMENTATION
6018 
6023  public:
6024 #endif
6025 
6026 #ifdef DOCUMENTATION
6027 
6030  const SgAsmElfSymverEntryPtrList& get_entries() const;
6031  void set_entries(const SgAsmElfSymverEntryPtrList&);
6033 #else
6034  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6035  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6036  NO_DELETE);
6037 #endif
6038 
6039  DECLARE_OTHERS(AsmElfSymverEntryList);
6040 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6041 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6042  private:
6043  friend class boost::serialization::access;
6044 
6045  template<class S>
6046  void serialize(S &s, const unsigned version) {
6047  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6048  s & BOOST_SERIALIZATION_NVP(p_entries);
6049  }
6050 #endif
6051 #endif // SgAsmElfSymverEntryList_OTHERS
6052 
6053 #ifdef DOCUMENTATION
6054  };
6055 #endif
6056 
6058 
6059  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6060  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6061 
6062 #ifdef DOCUMENTATION
6063 
6069  public:
6070 #endif
6071 
6072 #ifdef DOCUMENTATION
6073 
6082 #else
6083  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6084  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6085  NO_DELETE);
6086 #endif
6087 
6088  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6089 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6090 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6091  private:
6092  friend class boost::serialization::access;
6093 
6094  template<class S>
6095  void serialize(S &s, const unsigned version) {
6096  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6097  s & BOOST_SERIALIZATION_NVP(p_entries);
6098  }
6099 #endif
6100 
6101  public:
6104  : SgAsmElfSection(fhdr) {
6105  ctor(strsec);
6106  }
6107 
6176  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6177 
6180  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6181 
6185  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6186 
6188  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6189 
6190  private:
6191  void ctor(SgAsmElfStringSection*);
6192 #endif // SgAsmElfSymverDefinedSection_OTHERS
6193 
6194 #ifdef DOCUMENTATION
6195  };
6196 #endif
6197 
6199 
6200  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6201  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6202 
6203 #ifdef DOCUMENTATION
6204 
6209  public:
6210 #endif
6211 
6212 #ifdef DOCUMENTATION
6213 
6216  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6217  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6219 #else
6220  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6221  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6222  NO_DELETE);
6223 #endif
6224 
6225  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6226 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6227 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6228  private:
6229  friend class boost::serialization::access;
6230 
6231  template<class S>
6232  void serialize(S &s, const unsigned version) {
6233  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6234  s & BOOST_SERIALIZATION_NVP(p_entries);
6235  }
6236 #endif
6237 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6238 
6239 #ifdef DOCUMENTATION
6240  };
6241 #endif
6242 
6244 
6245  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6246  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6247 
6248 #ifdef DOCUMENTATION
6249 
6251  public:
6252 #endif
6253 
6254 #ifdef DOCUMENTATION
6255 
6260  size_t get_version() const;
6261  void set_version(size_t);
6263 #else
6264  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6265  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6266 #endif
6267 
6268 #ifdef DOCUMENTATION
6269 
6274  int get_flags() const;
6275  void set_flags(int);
6277 #else
6278  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6279  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6280 #endif
6281 
6282 #ifdef DOCUMENTATION
6283 
6288  size_t get_index() const;
6289  void set_index(size_t);
6291 #else
6292  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6293  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6294 #endif
6295 
6296 #ifdef DOCUMENTATION
6297 
6302  uint32_t get_hash() const;
6303  void set_hash(uint32_t);
6305 #else
6306  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6307  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6308 #endif
6309 
6310 #ifdef DOCUMENTATION
6311 
6320 #else
6321  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6322  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6323 #endif
6324 
6325  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6326 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6327 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6328  private:
6329  friend class boost::serialization::access;
6330 
6331  template<class S>
6332  void serialize(S &s, const unsigned version) {
6333  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6334  s & BOOST_SERIALIZATION_NVP(p_version);
6335  s & BOOST_SERIALIZATION_NVP(p_flags);
6336  s & BOOST_SERIALIZATION_NVP(p_index);
6337  s & BOOST_SERIALIZATION_NVP(p_hash);
6338  s & BOOST_SERIALIZATION_NVP(p_entries);
6339  }
6340 #endif
6341 
6342  public:
6343 #ifdef _MSC_VER
6344 # pragma pack (1)
6345 #endif
6346 
6348  uint16_t vd_version;
6349  uint16_t vd_flags;
6350  uint16_t vd_ndx;
6351  uint16_t vd_cnt;
6352  uint32_t vd_hash;
6353  uint32_t vd_aux;
6354  uint32_t vd_next;
6355  }
6356 #if !defined(SWIG) && !defined(_MSC_VER)
6357  __attribute__((packed))
6358 #endif
6359  ;
6360 
6361 #ifdef _MSC_VER
6362 # pragma pack ()
6363 #endif
6364 
6367  ctor(symver_defined);
6368  }
6369 
6371  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6372 
6374  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6375 
6377  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6378 
6379  private:
6380  void ctor(SgAsmElfSymverDefinedSection*);
6381 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6382 
6383 #ifdef DOCUMENTATION
6384  };
6385 #endif
6386 
6388 
6389  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6390  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6391 
6392 #ifdef DOCUMENTATION
6393 
6398  pbulic:
6399 #endif
6400 
6401 #ifdef DOCUMENTATION
6402 
6405  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6406  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6408 #else
6409  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6410  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6411  NO_DELETE);
6412 #endif
6413 
6414  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6415 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6416 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6417  private:
6418  friend class boost::serialization::access;
6419 
6420  template<class S>
6421  void serialize(S &s, const unsigned version) {
6422  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6423  s & BOOST_SERIALIZATION_NVP(p_entries);
6424  }
6425 #endif
6426 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6427 
6428 #ifdef DOCUMENTATION
6429  };
6430 #endif
6431 
6433 
6434  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
6435  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
6436 
6437 #ifdef DOCUMENTATION
6439  public:
6440 #endif
6441 
6442 #ifdef DOCUMENTATION
6443 
6446  SgAsmGenericString* get_name() const;
6449 #else
6450  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6451  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6452 #endif
6453 
6454  DECLARE_OTHERS(AsmElfSymverDefinedAux);
6455 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
6456 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6457  private:
6458  friend class boost::serialization::access;
6459 
6460  template<class S>
6461  void serialize(S &s, const unsigned version) {
6462  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6463  s & BOOST_SERIALIZATION_NVP(p_name);
6464  }
6465 #endif
6466 
6467  public:
6468 #ifdef _MSC_VER
6469 # pragma pack (1)
6470 #endif
6471 
6474  uint32_t vda_name;
6475  uint32_t vda_next;
6476  }
6477 #if !defined(SWIG) && !defined(_MSC_VER)
6478  __attribute__((packed))
6479 #endif
6480  ;
6481 
6482 #ifdef _MSC_VER
6483 # pragma pack ()
6484 #endif
6485 
6490  SgAsmElfSymverDefinedSection *symver_def_sec)
6491  : p_name(NULL) {
6492  ctor(symver_def_entry,symver_def_sec);
6493  }
6494 
6496  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
6497 
6499  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
6500 
6506  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6507 
6508  private:
6509  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
6510 #endif // SgAsmElfSymverDefinedAux_OTHERS
6511 
6512 #ifdef DOCUMENTATION
6513  };
6514 #endif
6515 
6517 
6518  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
6519  IS_SERIALIZABLE(AsmElfSymverNeededSection);
6520 
6521 #ifdef DOCUMENTATION
6522 
6528  public:
6529 #endif
6530 
6531 #ifdef DOCUMENTATION
6532 
6541 #else
6542  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
6543  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6544 #endif
6545 
6546  DECLARE_OTHERS(AsmElfSymverNeededSection);
6547 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
6548 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6549  private:
6550  friend class boost::serialization::access;
6551 
6552  template<class S>
6553  void serialize(S &s, const unsigned version) {
6554  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6555  s & BOOST_SERIALIZATION_NVP(p_entries);
6556  }
6557 #endif
6558 
6559  public:
6564  : SgAsmElfSection(fhdr) {
6565  ctor(strsec);
6566  }
6567 
6577  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
6578 
6583  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6584 
6588  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6589 
6591  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6592 
6593  private:
6594  void ctor(SgAsmElfStringSection*);
6595 #endif // SgAsmElfSymverNeededSection_OTHERS
6596 
6597 #ifdef DOCUMENTATION
6598  };
6599 #endif
6600 
6602 
6603  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
6604  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
6605 
6606 #ifdef DOCUMENTATION
6607 
6612  public:
6613 #endif
6614 
6615 #ifdef DOCUMENTATION
6616 
6619  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
6620  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
6622 #else
6623  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
6624  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6625  NO_DELETE);
6626 #endif
6627 
6628  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
6629 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
6630 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6631  private:
6632  friend class boost::serialization::access;
6633 
6634  template<class S>
6635  void serialize(S &s, const unsigned version) {
6636  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6637  s & BOOST_SERIALIZATION_NVP(p_entries);
6638  }
6639 #endif
6640 #endif // SgAsmElfSymverNeededEntryList_OTHERS
6641 
6642 #ifdef DOCUMENTATION
6643  };
6644 #endif
6645 
6647 
6648  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
6649  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
6650 
6651 #ifdef DOCUMENTATION
6652 
6654  public:
6655 #endif
6656 
6657 #ifdef DOCUMENTATION
6658 
6663  size_t get_version() const;
6664  void set_version(size_t);
6666 #else
6667  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
6668  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6669 #endif
6670 
6671 #ifdef DOCUMENTATION
6672 
6678 #else
6679  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
6680  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6681 #endif
6682 
6683 #ifdef DOCUMENTATION
6684 
6693 #else
6694  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
6695  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6696 #endif
6697 
6698  DECLARE_OTHERS(AsmElfSymverNeededEntry);
6699 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
6700 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6701  private:
6702  friend class boost::serialization::access;
6703 
6704  template<class S>
6705  void serialize(S &s, const unsigned version) {
6706  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6707  s & BOOST_SERIALIZATION_NVP(p_entries);
6708  }
6709 #endif
6710 
6711  public:
6712 #ifdef _MSC_VER
6713 # pragma pack (1)
6714 #endif
6715 
6718  uint16_t vn_version;
6719  uint16_t vn_cnt;
6720  uint32_t vn_file;
6721  uint32_t vn_aux;
6722  uint32_t vn_next;
6723  }
6724 #if !defined(SWIG) && !defined(_MSC_VER)
6725  __attribute__((packed))
6726 #endif
6727  ;
6728 
6729 #ifdef _MSC_VER
6730 # pragma pack ()
6731 #endif
6732 
6735  : p_file_name(NULL) {
6736  ctor(symver_needed);
6737  }
6738 
6740  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
6741 
6743  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
6744 
6746  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6747 
6748  private:
6749  void ctor(SgAsmElfSymverNeededSection*);
6750 #endif // SgAsmElfSymverNeededEntry_OTHERS
6751 
6752 #ifdef DOCUMENTATION
6753  };
6754 #endif
6755 
6757 
6758  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
6759  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
6760 
6761 #ifdef DOCUMENTATION
6762 
6767  public:
6768 #endif
6769 
6770 #ifdef DOCUMENTATION
6771 
6774  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
6775  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
6777 #else
6778  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
6779  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6780  NO_DELETE);
6781 #endif
6782 
6783  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
6784 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
6785 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6786  private:
6787  friend class boost::serialization::access;
6788 
6789  template<class S>
6790  void serialize(S &s, const unsigned version) {
6791  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6792  s & BOOST_SERIALIZATION_NVP(p_entries);
6793  }
6794 #endif
6795 #endif // SgAsmElfSymverNeededAuxList_OTHERS
6796 
6797 #ifdef DOCUMENTATION
6798  };
6799 #endif
6800 
6802 
6803  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
6804  IS_SERIALIZABLE(AsmElfSymverNeededAux);
6805 
6806 #ifdef DOCUMENTATION
6807 
6809  public:
6810 #endif
6811 
6812 #ifdef DOCUMENTATION
6813 
6818  uint32_t get_hash() const;
6819  void set_hash(uint32_t);
6821 #else
6822  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
6823  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6824 #endif
6825 
6826 #ifdef DOCUMENTATION
6827 
6832  int get_flags() const;
6833  void set_flags(int);
6835 #else
6836  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
6837  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6838 #endif
6839 
6840 #ifdef DOCUMENTATION
6841 
6846  size_t get_other() const;
6847  void set_other(size_t);
6849 #else
6850  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
6851  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6852 #endif
6853 
6854 #ifdef DOCUMENTATION
6855 
6858  SgAsmGenericString* get_name() const;
6861 #else
6862  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6863  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6864 #endif
6865 
6866  DECLARE_OTHERS(AsmElfSymverNeededAux);
6867 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
6868 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6869  private:
6870  friend class boost::serialization::access;
6871 
6872  template<class S>
6873  void serialize(S &s, const unsigned version) {
6874  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6875  s & BOOST_SERIALIZATION_NVP(p_hash);
6876  s & BOOST_SERIALIZATION_NVP(p_flags);
6877  s & BOOST_SERIALIZATION_NVP(p_other);
6878  s & BOOST_SERIALIZATION_NVP(p_name);
6879  }
6880 #endif
6881 
6882  public:
6883 #ifdef _MSC_VER
6884 # pragma pack (1)
6885 #endif
6886 
6889  uint32_t vna_hash;
6890  uint16_t vna_flags;
6891  uint16_t vna_other;
6892  uint32_t vna_name;
6893  uint32_t vna_next;
6894  }
6895 #if !defined(SWIG) && !defined(_MSC_VER)
6896  __attribute__((packed))
6897 #endif
6898  ;
6899 
6900 #ifdef _MSC_VER
6901 # pragma pack ()
6902 #endif
6903 
6909  : p_name(NULL) {
6910  ctor(symver_needed_entry,symver_needed_sec);
6911  }
6912 
6914  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
6915 
6917  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
6918 
6924  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6925 
6926  private:
6928 #endif // SgAsmElfSymverNeededAux_OTHERS
6929 
6930 #ifdef DOCUMENTATION
6931  };
6932 #endif
6933 
6934 
6935 
6936 
6938 
6939  /*************************************************************************************************************************
6940  * ELF Relocation Tables
6941  *************************************************************************************************************************/
6942 
6944 
6945  DECLARE_LEAF_CLASS(AsmElfRelocSection);
6946  IS_SERIALIZABLE(AsmElfRelocSection);
6947 
6948 #ifdef DOCUMENTATION
6949 
6951  public:
6952 #endif
6953 
6954 #ifdef DOCUMENTATION
6955 
6958  bool get_uses_addend() const;
6959  void set_uses_addend(bool);
6961 #else
6962  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
6963  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6964 #endif
6965 
6966 #ifdef DOCUMENTATION
6967 
6973 #else
6974  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
6975  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6976 #endif
6977 
6978 #ifdef DOCUMENTATION
6979 
6987 #else
6988  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
6989  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6990 #endif
6991 
6992  DECLARE_OTHERS(AsmElfRelocSection);
6993 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
6994 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6995  private:
6996  friend class boost::serialization::access;
6997 
6998  template<class S>
6999  void serialize(S &s, const unsigned version) {
7000  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7001  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7002  s & BOOST_SERIALIZATION_NVP(p_target_section);
7003  s & BOOST_SERIALIZATION_NVP(p_entries);
7004  }
7005 #endif
7006 
7007  public:
7009  : SgAsmElfSection(fhdr) {
7010  ctor(symsec,targetsec);
7011  }
7012 
7015  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7016 
7018  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7019 
7021  virtual bool reallocate() $ROSE_OVERRIDE;
7022 
7024  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7025 
7027  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7028 
7029  private:
7031 #endif // SgAsmElfRelocSection_OTHERS
7032 
7033 #ifdef DOCUMENTATION
7034  };
7035 #endif
7036 
7038 
7039  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7040  IS_SERIALIZABLE(AsmElfRelocEntryList);
7041 
7042 #ifdef DOCUMENTATION
7043 
7048  public:
7049 #endif
7050 
7051 #ifdef DOCUMENTATION
7052 
7055  const SgAsmElfRelocEntryPtrList& get_entries() const;
7056  void set_entries(const SgAsmElfRelocEntryPtrList&);
7058 #else
7059  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7060  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7061  NO_DELETE);
7062 #endif
7063 
7064  DECLARE_OTHERS(AsmElfRelocEntryList);
7065 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7066 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7067  private:
7068  friend class boost::serialization::access;
7069 
7070  template<class S>
7071  void serialize(S &s, const unsigned version) {
7072  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7073  s & BOOST_SERIALIZATION_NVP(p_entries);
7074  }
7075 #endif
7076 #endif // SgAsmElfRelocEntryList_OTHERS
7077 
7078 #ifdef DOCUMENTATION
7079  };
7080 #endif
7081 
7083 
7084  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7085  IS_SERIALIZABLE(AsmElfRelocEntry);
7086 
7087 #ifdef DOCUMENTATION
7088 
7090  public:
7091 #endif
7092 
7093 #ifdef DOCUMENTATION
7094 
7099  rose_addr_t get_r_offset() const;
7100  void set_r_offset(rose_addr_t);
7102 #else
7103  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7104  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7105 #endif
7106 
7107 #ifdef DOCUMENTATION
7108 
7113  rose_addr_t get_r_addend() const;
7114  void set_r_addend(rose_addr_t);
7116 #else
7117  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7118  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7119 #endif
7120 
7121 #ifdef DOCUMENTATION
7122 
7127  unsigned long get_sym() const;
7128  void set_sym(unsigned long);
7130 #else
7131  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7132  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7133 #endif
7134 
7135 #ifdef DOCUMENTATION
7136 
7141  RelocType get_type() const;
7142  void set_type(RelocType);
7144 #else
7145  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7146  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7147 #endif
7148 
7149 #ifdef DOCUMENTATION
7150 
7153  const SgUnsignedCharList& get_extra() const;
7154  void set_extra(const SgUnsignedCharList&);
7156 #else
7157  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7158  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7159 #endif
7160 
7161  DECLARE_OTHERS(AsmElfRelocEntry);
7162 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7163 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7164  private:
7165  friend class boost::serialization::access;
7166 
7167  template<class S>
7168  void serialize(S &s, const unsigned version) {
7169  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7170  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7171  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7172  s & BOOST_SERIALIZATION_NVP(p_sym);
7173  s & BOOST_SERIALIZATION_NVP(p_type);
7174  s & BOOST_SERIALIZATION_NVP(p_extra);
7175  }
7176 #endif
7177 
7178  public:
7181  // Intel 80386 specific definitions.
7193  R_386_32PLT =11,
7200  R_386_16 =20,
7201  R_386_PC16 =21,
7202  R_386_8 =22,
7203  R_386_PC8 =23,
7219  // First Entry for X86-64
7234  R_X86_64_8 =114,
7244  };
7245 
7246 #ifdef _MSC_VER
7247 # pragma pack (1)
7248 #endif
7249 
7251  uint32_t r_offset;
7252  uint32_t r_info;
7253  uint32_t r_addend;
7254  }
7255 #if !defined(SWIG) && !defined(_MSC_VER)
7256  __attribute__((packed))
7257 #endif
7258  ;
7259 
7261  uint64_t r_offset;
7262  uint64_t r_info;
7263  uint64_t r_addend;
7264  }
7265 #if !defined(SWIG) && !defined(_MSC_VER)
7266  __attribute__((packed))
7267 #endif
7268  ;
7269 
7271  uint32_t r_offset;
7272  uint32_t r_info;
7273  }
7274 #if !defined(SWIG) && !defined(_MSC_VER)
7275  __attribute__((packed))
7276 #endif
7277  ;
7278 
7280  uint64_t r_offset;
7281  uint64_t r_info;
7282  }
7283 #if !defined(SWIG) && !defined(_MSC_VER)
7284  __attribute__((packed))
7285 #endif
7286  ;
7287 
7288 #ifdef _MSC_VER
7289 # pragma pack ()
7290 #endif
7291 
7294  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7295  ctor(section);
7296  }
7297 
7301  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7302  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7303  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7304  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7310  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7311  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7312  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7313  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7319  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7320  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7321  dump(f, prefix, idx, NULL);
7322  }
7326  std::string reloc_name() const;
7327 
7328  private:
7329  void ctor(SgAsmElfRelocSection*);
7330 #endif // SgAsmElfRelocEntry_OTHERS
7331 
7332 #ifdef DOCUMENTATION
7333  };
7334 #endif
7335 
7336 
7337 
7339 
7340  /*************************************************************************************************************************
7341  * ELF Dynamic Linking
7342  *************************************************************************************************************************/
7343 
7345 
7346  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7347  IS_SERIALIZABLE(AsmElfDynamicSection);
7348 
7349 #ifdef DOCUMENTATION
7350 
7352  public:
7353 #endif
7354 
7355 #ifdef DOCUMENTATION
7356 
7365 #else
7366  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7367  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7368 #endif
7369 
7370  DECLARE_OTHERS(AsmElfDynamicSection);
7371 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7372 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7373  private:
7374  friend class boost::serialization::access;
7375 
7376  template<class S>
7377  void serialize(S &s, const unsigned version) {
7378  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7379  s & BOOST_SERIALIZATION_NVP(p_entries);
7380  }
7381 #endif
7382 
7383  public:
7386  : SgAsmElfSection(fhdr) {
7387  ctor(strsec);
7388  }
7389 
7391  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7392 
7394  virtual void finish_parsing() $ROSE_OVERRIDE;
7395 
7398  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7399 
7401  virtual bool reallocate() $ROSE_OVERRIDE;
7402 
7404  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7405 
7407  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7408 
7409  private:
7410  void ctor(SgAsmElfStringSection*);
7411 #endif // SgAsmElfDynamicSection_OTHERS
7412 
7413 #ifdef DOCUMENTATION
7414  };
7415 #endif
7416 
7418 
7419  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7420  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7421 
7422 #ifdef DOCUMENTATION
7423 
7428  public:
7429 #endif
7430 
7431 #ifdef DOCUMENTATION
7432 
7435  const SgAsmElfDynamicEntryPtrList& get_entries() const;
7436  void set_entries(const SgAsmElfDynamicEntryPtrList&);
7438 #else
7439  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
7440  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
7441  NO_DELETE);
7442 #endif
7443 
7444  DECLARE_OTHERS(AsmElfDynamicEntryList);
7445 #if defined(SgAsmElfDynamicEntryList_OTHERS) || defined(DOCUMENTATION)
7446 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7447  private:
7448  friend class boost::serialization::access;
7449 
7450  template<class S>
7451  void serialize(S &s, const unsigned version) {
7452  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7453  s & BOOST_SERIALIZATION_NVP(p_entries);
7454  }
7455 #endif
7456 #endif // SgAsmElfDynamicEntryList_OTHERS
7457 
7458 #ifdef DOCUMENTATION
7459  };
7460 #endif
7461 
7463 
7464  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
7465  IS_SERIALIZABLE(AsmElfDynamicEntry);
7466 
7467 #ifdef DOCUMENTATION
7468 
7470  public:
7471 #endif
7472 
7473 #ifdef DOCUMENTATION
7474 
7479  EntryType get_d_tag() const;
7480  void set_d_tag(EntryType);
7482 #else
7483  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
7484  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7485 #endif
7486 
7487 #ifdef DOCUMENTATION
7488 
7493  rose_rva_t get_d_val() const;
7494  void set_d_val(rose_rva_t);
7496 #else
7497  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
7498  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7499 #endif
7500 
7501 #ifdef DOCUMENTATION
7502  // declared and documented below
7503 #else
7504  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
7505  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7506 #endif
7507 
7508 #ifdef DOCUMENTATION
7509 
7512  const SgUnsignedCharList& get_extra() const;
7513  void set_extra(const SgUnsignedCharList&);
7515 #else
7516  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7517  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7518 #endif
7519 
7520  DECLARE_OTHERS(AsmElfDynamicEntry);
7521 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
7522 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7523  private:
7524  friend class boost::serialization::access;
7525 
7526  template<class S>
7527  void serialize(S &s, const unsigned version) {
7528  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7529  s & BOOST_SERIALIZATION_NVP(p_d_tag);
7530  s & BOOST_SERIALIZATION_NVP(p_d_val);
7531  s & BOOST_SERIALIZATION_NVP(p_name);
7532  s & BOOST_SERIALIZATION_NVP(p_extra);
7533  }
7534 #endif
7535 
7536  public:
7537  enum EntryType { /* Type Executable SharedObj Purpose */
7538  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
7539  DT_NEEDED = 1, /* value optional optional Name of needed library */
7540  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
7541  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
7542  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
7543  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
7544  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
7545  DT_RELA = 7, /* pointer mandatory optional Relocation table */
7546  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
7547  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
7548  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
7549  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
7550  DT_INIT = 12, /* pointer optional optional Initialization function */
7551  DT_FINI = 13, /* pointer optional optional Termination function */
7552  DT_SONAME = 14, /* value ignored optional Name of shared object */
7553  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
7554  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
7555  DT_REL = 17, /* pointer mandatory optional Relocation table */
7556  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
7557  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
7558  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
7559  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
7560  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
7561  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
7562  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
7563  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
7564  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
7565  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
7566  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
7567  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
7568  DT_FLAGS = 30, /* value optional ? Bit flags */
7569  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
7570  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
7571  DT_NUM = 34, /* ? ? ? "number used"? */
7572 
7573  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
7574  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
7575  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
7576  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
7577  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
7578  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
7579  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
7580  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
7581  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
7582  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
7583  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
7584 
7585  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
7586  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
7587  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
7588  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
7589  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
7590  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
7591  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
7592  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
7593  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
7594  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
7595  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
7596 
7597  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
7598  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
7599  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
7600  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
7601  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
7602  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
7603  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
7604  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
7605 
7606  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
7607  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
7608  };
7609 
7610 #ifdef _MSC_VER
7611 # pragma pack (1)
7612 #endif
7613 
7616  uint32_t d_tag;
7617  uint32_t d_val;
7618  }
7619 #if !defined(SWIG) && !defined(_MSC_VER)
7620  __attribute__((packed))
7621 #endif
7622  ;
7623 
7625  uint64_t d_tag;
7626  uint64_t d_val;
7627  }
7628 #if !defined(SWIG) && !defined(_MSC_VER)
7629  __attribute__((packed))
7630 #endif
7631  ;
7632 
7633 #ifdef _MSC_VER
7634 # pragma pack ()
7635 #endif
7636 
7639  : p_d_tag(DT_NULL), p_name(NULL) {
7640  ctor(dynsec);
7641  }
7642 
7646  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);
7647  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*);
7653  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*) const;
7654  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*) const;
7658  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
7659 
7661  static std::string to_string(SgAsmElfDynamicEntry::EntryType);
7662 
7666  SgAsmGenericString* get_name() const { return p_name; }
7670  private:
7671  void ctor(SgAsmElfDynamicSection*);
7672 #endif // SgAsmElfDynamicEntry_OTHERS
7673 
7674 #ifdef DOCUMENTATION
7675  };
7676 #endif
7677 
7678 
7679 
7680 
7682 
7683  /*************************************************************************************************************************
7684  * ELF String Tables
7685  *************************************************************************************************************************/
7686 
7688 
7689  DECLARE_LEAF_CLASS(AsmElfStringSection);
7690  IS_SERIALIZABLE(AsmElfStringSection);
7691  AsmElfStringSection.setAutomaticGenerationOfDestructor(false);
7692 
7693 #ifdef DOCUMENTATION
7694 
7698  public:
7699 #endif
7700 
7701 #ifdef DOCUMENTATION
7702 
7707  SgAsmElfStrtab* get_strtab() const;
7708  void set_strtab(SgAsmElfStrtab*);
7710 #else
7711  AsmElfStringSection.setDataPrototype("SgAsmElfStrtab*", "strtab", "= NULL",
7712  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7713 #endif
7714 
7715  DECLARE_OTHERS(AsmElfStringSection);
7716 #if defined(SgAsmElfStringSection_OTHERS) || defined(DOCUMENTATION)
7717 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7718  private:
7719  friend class boost::serialization::access;
7720 
7721  template<class S>
7722  void serialize(S &s, const unsigned version) {
7723  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7724  s & BOOST_SERIALIZATION_NVP(p_strtab);
7725  }
7726 #endif
7727 
7728  public:
7731  : SgAsmElfSection(fhdr), p_strtab(NULL) {
7732  ctor();
7733  }
7734 
7736  virtual SgAsmElfStringSection *parse() $ROSE_OVERRIDE;
7737 
7739  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7740 
7745  virtual void set_size(rose_addr_t newsize) $ROSE_OVERRIDE;
7746 
7753  virtual bool reallocate() $ROSE_OVERRIDE;
7754 
7756  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7757 
7758  private:
7759  void ctor();
7760  void ctor(SgAsmElfSectionTable*);
7761 #endif // SgAsmElfStringSection_OTHERS
7762 
7763 #ifdef DOCUMENTATION
7764  };
7765 #endif
7766 
7768 
7769  DECLARE_LEAF_CLASS(AsmElfStrtab);
7770  IS_SERIALIZABLE(AsmElfStrtab);
7771  AsmElfStrtab.setAutomaticGenerationOfDestructor(false);
7772 
7773 #ifdef DOCUMENTATION
7774 
7775  class SgAsmElfStrtab: public SgAsmGenericStrtab {
7776  public:
7777 #endif
7778 
7779  DECLARE_OTHERS(AsmElfStrtab);
7780 #if defined(SgAsmElfStrtab_OTHERS) || defined(DOCUMENTATION)
7781 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7782  private:
7783  friend class boost::serialization::access;
7784 
7785  template<class S>
7786  void serialize(S &s, const unsigned version) {
7787  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericStrtab);
7788  }
7789 #endif
7790 
7791  public:
7795  explicit SgAsmElfStrtab(class SgAsmElfSection *containing_section)
7796  : SgAsmGenericStrtab(containing_section) {
7797  ctor();
7798  }
7799 
7806  virtual ~SgAsmElfStrtab();
7807 
7811  virtual SgAsmElfStrtab *parse() $ROSE_OVERRIDE;
7812 
7816  virtual void unparse(std::ostream&) const;
7817 
7823  virtual SgAsmStringStorage *create_storage(rose_addr_t offset, bool shared) $ROSE_OVERRIDE;
7824 
7828  virtual rose_addr_t get_storage_size(const SgAsmStringStorage*) $ROSE_OVERRIDE;
7829 
7839  virtual void allocate_overlap(SgAsmStringStorage*) $ROSE_OVERRIDE;
7840 
7842  virtual void rebind(SgAsmStringStorage*, rose_addr_t) $ROSE_OVERRIDE;
7843 
7844  private:
7845  void ctor();
7846 #endif // SgAsmElfStrtab_OTHERS
7847 
7848 #ifdef DOCUMENTATION
7849  };
7850 #endif
7851 
7852 
7853 
7854 
7856 
7857  /*************************************************************************************************************************
7858  * ELF Notes
7859  *************************************************************************************************************************/
7860 
7862 
7863  DECLARE_LEAF_CLASS(AsmElfNoteSection);
7864  IS_SERIALIZABLE(AsmElfNoteSection);
7865 
7866 #ifdef DOCUMENTATION
7868  public:
7869 #endif
7870 
7871 #ifdef DOCUMENTATION
7872 
7881 #else
7882  AsmElfNoteSection.setDataPrototype("SgAsmElfNoteEntryList*", "entries", "= NULL",
7883  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7884 #endif
7885 
7886  DECLARE_OTHERS(AsmElfNoteSection);
7887 #if defined(SgAsmElfNoteSection_OTHERS) || defined(DOCUMENTATION)
7888 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7889  private:
7890  friend class boost::serialization::access;
7891 
7892  template<class S>
7893  void serialize(S &s, const unsigned version) {
7894  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7895  s & BOOST_SERIALIZATION_NVP(p_entries);
7896  }
7897 #endif
7898 
7899  public:
7902  : SgAsmElfSection(fhdr) {
7903  ctor();
7904  }
7905  virtual SgAsmElfNoteSection *parse() $ROSE_OVERRIDE;
7906 
7908  virtual bool reallocate() $ROSE_OVERRIDE;
7909 
7911  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7912 
7914  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7915 
7916  private:
7917  void ctor();
7918 #endif // SgAsmElfNoteSection_OTHERS
7919 
7920 #ifdef DOCUMENTATION
7921  };
7922 #endif
7923 
7925 
7926  DECLARE_LEAF_CLASS(AsmElfNoteEntryList);
7927  IS_SERIALIZABLE(AsmElfNoteEntryList);
7928 
7929 #ifdef DOCUMENTATION
7930 
7935  public:
7936 #endif
7937 
7938 #ifdef DOCUMENTATION
7939 
7942  const SgAsmElfNoteEntryPtrList& get_entries() const;
7943  void set_entries(const SgAsmElfNoteEntryPtrList&);
7945 #else
7946  AsmElfNoteEntryList.setDataPrototype("SgAsmElfNoteEntryPtrList", "entries", "",
7947  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7948 #endif
7949 
7950  DECLARE_OTHERS(AsmElfNoteEntryList);
7951 #if defined(SgAsmElfNoteEntryList_OTHERS) || defined(DOCUMENTATION)
7952 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7953  private:
7954  friend class boost::serialization::access;
7955 
7956  template<class S>
7957  void serialize(S &s, const unsigned version) {
7958  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7959  s & BOOST_SERIALIZATION_NVP(p_entries);
7960  }
7961 #endif
7962 #endif // SgAsmElfNoteEntryList_OTHERS
7963 
7964 #ifdef DOCUMENTATION
7965  };
7966 #endif
7967 
7969 
7970  DECLARE_LEAF_CLASS(AsmElfNoteEntry);
7971  IS_SERIALIZABLE(AsmElfNoteEntry);
7972 
7973 #ifdef DOCUMENTATION
7974 
7976  public:
7977 #endif
7978 
7979 #ifdef DOCUMENTATION
7980 
7985  unsigned get_type() const;
7986  void set_type(unsigned);
7988 #else
7989  AsmElfNoteEntry.setDataPrototype("unsigned", "type", "= 0",
7990  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7991 #endif
7992 
7993 #ifdef DOCUMENTATION
7994  // documented below
7995 #else
7996  AsmElfNoteEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
7997  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7998 #endif
7999 
8000 #ifdef DOCUMENTATION
8001 
8006  const SgUnsignedCharList& get_payload() const;
8007  void set_payload(const SgUnsignedCharList&);
8009 #else
8010  AsmElfNoteEntry.setDataPrototype("SgUnsignedCharList", "payload", "",
8011  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8012 #endif
8013 
8014  DECLARE_OTHERS(AsmElfNoteEntry);
8015 #if defined(SgAsmElfNoteEntry_OTHERS) || defined(DOCUMENTATION)
8016 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8017  private:
8018  friend class boost::serialization::access;
8019 
8020  template<class S>
8021  void serialize(S &s, const unsigned version) {
8022  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8023  s & BOOST_SERIALIZATION_NVP(p_type);
8024  s & BOOST_SERIALIZATION_NVP(p_name);
8025  s & BOOST_SERIALIZATION_NVP(p_payload);
8026  }
8027 #endif
8028 
8029  public:
8032  : p_type(0), p_name(NULL) {
8033  ctor(section);
8034  }
8035 
8042  SgAsmGenericString *get_name() const;
8043  void set_name(SgAsmGenericString *name);
8049  rose_addr_t parse(rose_addr_t starting_offset);
8050 
8054  rose_addr_t unparse(std::ostream &f, rose_addr_t starting_offset);
8055 
8057  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
8058 
8062  void set_payload(const void*, size_t nbytes);
8063 
8065  rose_addr_t calculate_size() const;
8066 
8067  private:
8068  void ctor(SgAsmElfNoteSection *section);
8069 #endif // SgAsmElfNoteEntry_OTHERS
8070 
8071 #ifdef DOCUMENTATION
8072  };
8073 #endif
8074 
8075 
8076 
8078 
8079  /*************************************************************************************************************************
8080  * ELF Exception Handling
8081  *************************************************************************************************************************/
8082 
8084 
8085  DECLARE_LEAF_CLASS(AsmElfEHFrameSection);
8086  IS_SERIALIZABLE(AsmElfEHFrameSection);
8087 
8088 #ifdef DOCUMENTATION
8089 
8091  public:
8092 #endif
8093 
8094 #ifdef DOCUMENTATION
8095 
8104 #else
8105  AsmElfEHFrameSection.setDataPrototype("SgAsmElfEHFrameEntryCIList*", "ci_entries", "= NULL",
8106  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8107 #endif
8108 
8109  DECLARE_OTHERS(AsmElfEHFrameSection);
8110 #if defined(SgAsmElfEHFrameSection_OTHERS) || defined(DOCUMENTATION)
8111 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8112  private:
8113  friend class boost::serialization::access;
8114 
8115  template<class S>
8116  void serialize(S &s, const unsigned version) {
8117  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8118  s & BOOST_SERIALIZATION_NVP(p_ci_entries);
8119  }
8120 #endif
8121 
8122  public:
8125  : SgAsmElfSection(fhdr), p_ci_entries(NULL) {
8126  ctor();
8127  }
8128 
8130  virtual SgAsmElfEHFrameSection *parse() $ROSE_OVERRIDE;
8131 
8136  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
8137 
8139  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8140 
8145  rose_addr_t unparse(std::ostream*) const;
8146 
8148  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8149 
8150  private:
8151  void ctor();
8152 #endif // SgAsmElfEHFrameSection_OTHERS
8153 
8154 #ifdef DOCUMENTATION
8155  };
8156 #endif
8157 
8159 
8160  DECLARE_LEAF_CLASS(AsmElfEHFrameEntryCIList);
8161  IS_SERIALIZABLE(AsmElfEHFrameEntryCIList);
8162 
8163 #ifdef DOCUMENTATION
8164 
8169  public:
8170 #endif
8171 
8172 #ifdef DOCUMENTATION
8173 
8176  const SgAsmElfEHFrameEntryCIPtrList& get_entries() const;
8177  void set_entries(const SgAsmElfEHFrameEntryCIPtrList&);
8179 #else
8180  AsmElfEHFrameEntryCIList.setDataPrototype("SgAsmElfEHFrameEntryCIPtrList", "entries", "",
8181  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
8182  NO_DELETE);
8183 #endif
8184 
8185  DECLARE_OTHERS(AsmElfEHFrameEntryCIList);
8186 #if defined(SgAsmElfEHFrameEntryCIList_OTHERS) || defined(DOCUMENTATION)
8187 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8188  private:
8189  friend class boost::serialization::access;
8190 
8191  template<class S>
8192  void serialize(S &s, const unsigned version) {
8193  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8194  s & BOOST_SERIALIZATION_NVP(p_entries);
8195  }
8196 #endif
8197 #endif // SgAsmElfEHFrameEntryCIList_OTHERS
8198 
8199 #ifdef DOCUMENTATION
8200  };
8201 #endif
8202 
8204 
8205  DECLARE_LEAF_CLASS(AsmElfEHFrameEntryCI);
8206  IS_SERIALIZABLE(AsmElfEHFrameEntryCI);
8207 
8208 #ifdef DOCUMENTATION