ROSE  0.9.9.199
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,
2600  OP_peekMemory,
2602  OP_N_OPERATORS // MUST BE LAST!
2603  };
2604 
2605 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2606  private:
2607  friend class boost::serialization::access;
2608 
2609  template<class S>
2610  void serialize(S &s, const unsigned version) {
2611  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2612  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
2613  s & BOOST_SERIALIZATION_NVP(p_operands);
2614  }
2615 #endif
2616 #endif // SgAsmRiscOperation_OTHERS
2617 
2618 #ifdef DOCUMENTATION
2619  };
2620 #endif
2621 
2623 
2624  DECLARE_LEAF_CLASS(AsmExprListExp);
2625  IS_SERIALIZABLE(AsmExprListExp);
2626 
2627 #ifdef DOCUMENTATION
2628 
2630  public:
2631 #endif
2632 
2633 #ifdef DOCUMENTATION
2634 
2640  const SgAsmExpressionPtrList& get_expressions() const;
2641  void set_expressions(const SgAsmExpressionPtrList&);
2643 #else
2644  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
2645  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2646 #endif
2647 
2648  DECLARE_OTHERS(AsmExprListExp);
2649 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
2650 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2651  private:
2652  friend class boost::serialization::access;
2653 
2654  template<class S>
2655  void serialize(S &s, const unsigned version) {
2656  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2657  s & BOOST_SERIALIZATION_NVP(p_expressions);
2658  }
2659 #endif
2660 #endif // SgAsmExprListExp_OTHERS
2661 
2662 #ifdef DOCUMENTATION
2663  };
2664 #endif
2665 
2667 
2668  NEW_NONTERMINAL_MACRO(AsmExpression,
2669  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
2670  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
2671  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
2672  AsmRiscOperation,
2673  "AsmExpression", "AsmExpressionTag", false);
2674  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
2675  IS_SERIALIZABLE(AsmExpression);
2676 
2677 #ifdef DOCUMENTATION
2678 
2679  class SgAsmExpression: public SgAsmNode {
2680  public:
2681 #endif
2682 
2683 #ifdef DOCUMENTATION
2684 
2689  SgAsmType* get_type() const;
2690  void set_type(SgAsmType*);
2692 #else
2693  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
2694  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2695 #endif
2696 
2697 #ifdef DOCUMENTATION
2698 
2703  const std::string& get_comment() const;
2704  void set_comment(const std::string&);
2706 #else
2707  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
2708  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2709 #endif
2710 
2711  DECLARE_OTHERS(AsmExpression);
2712 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
2713 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2714  private:
2715  friend class boost::serialization::access;
2716 
2717  template<class S>
2718  void serialize(S &s, const unsigned version) {
2719  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
2720  s & BOOST_SERIALIZATION_NVP(p_type);
2721  s & BOOST_SERIALIZATION_NVP(p_comment);
2722  }
2723 #endif
2724 
2725  public:
2729  size_t get_nBits() const;
2730 #endif // SgAsmExpression_OTHERS
2731 
2732 #ifdef DOCUMENTATION
2733  };
2734 #endif
2735 
2736 
2737 
2738 
2740 
2741  /***************************************************************************************************************************
2742  * Data Types (new interface 2014-07)
2743  *
2744  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
2745  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
2746  * 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
2747  * don't allow types to be modified after they're created.
2748  ***************************************************************************************************************************/
2749 
2751 
2752  DECLARE_LEAF_CLASS(AsmIntegerType);
2753  IS_SERIALIZABLE(AsmIntegerType);
2754 
2755 #ifdef DOCUMENTATION
2756 
2758  public:
2759 #endif
2760 
2761 #ifndef DOCUMENTATION
2762  // Documented below due to ROSETTA limitations
2763  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
2764  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2765 #endif
2766 
2767  DECLARE_OTHERS(AsmIntegerType);
2768 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
2769 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2770  private:
2771  friend class boost::serialization::access;
2772 
2773  template<class S>
2774  void serialize(S &s, const unsigned version) {
2775  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2776  s & BOOST_SERIALIZATION_NVP(p_isSigned);
2777  }
2778 #endif
2779 
2780  public:
2784  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
2785 
2789  bool get_isSigned() const;
2790 
2791  // Overrides documented in base class
2792  virtual void check() const $ROSE_OVERRIDE;
2793  virtual std::string toString() const $ROSE_OVERRIDE;
2794 #endif // SgAsmIntegerType_OTHERS
2795 
2796 #ifdef DOCUMENTATION
2797  };
2798 #endif
2799 
2801 
2802  DECLARE_LEAF_CLASS(AsmFloatType);
2803  IS_SERIALIZABLE(AsmFloatType);
2804 
2805  DECLARE_HEADERS(AsmFloatType);
2806 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
2807  #include <Sawyer/BitVector.h>
2808 #endif // SgAsmFloatType_HEADERS
2809 
2810 #ifdef DOCUMENTATION
2811 
2813  public:
2814 #endif
2815 
2816 #ifndef DOCUMENTATION
2817  // Documented below because of ROSETTA limitations (they're read-only)
2818  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
2819  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2820  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
2821  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2822  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
2823  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2824  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
2825  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2826  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
2827  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2828  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
2829  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2830  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
2831  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2832 #endif
2833 
2834  DECLARE_OTHERS(AsmFloatType);
2835 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
2836 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2837  private:
2838  friend class boost::serialization::access;
2839 
2840  template<class S>
2841  void serialize(S &s, const unsigned version) {
2842  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2843  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
2844  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
2845  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
2846  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
2847  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
2848  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
2849  s & BOOST_SERIALIZATION_NVP(p_flags);
2850  }
2851 #endif
2852 
2853  public:
2854  enum {
2855  GRADUAL_UNDERFLOW = 0x00000001,
2856  NORMALIZED_SIGNIFICAND = 0x00000002
2857  };
2858 
2860 
2862  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
2863  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
2864  uint64_t exponentBias, unsigned flags);
2865 
2867  BitRange significandBits() const;
2868 
2870  BitRange exponentBits() const;
2871 
2873  size_t signBit() const;
2874 
2876  uint64_t exponentBias() const;
2877 
2879  unsigned flags() const;
2880 
2882  bool gradualUnderflow() const;
2883 
2885  bool normalizedSignificand() const;
2886 
2887  // Overrides documented in base class
2888  virtual void check() const $ROSE_OVERRIDE;
2889  virtual std::string toString() const $ROSE_OVERRIDE;
2890 #endif // SgAsmFloatType_OTHERS
2891 
2892 #ifdef DOCUMENTATION
2893  };
2894 #endif
2895 
2897 
2898  NEW_NONTERMINAL_MACRO(AsmScalarType,
2899  AsmIntegerType | AsmFloatType,
2900  "AsmScalarType", "AsmScalarTypeTag", false);
2901  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
2902  IS_SERIALIZABLE(AsmScalarType);
2903 
2904 #ifdef DOCUMENTATION
2905 
2906  class SgAsmScalarType: public SgAsmType {
2907  public:
2908 #endif
2909 
2910 #ifndef DOCUMENTATION
2911  // Documented below due to ROSETTA limitations (read-only)
2912  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2913  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2914  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2915  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2916  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
2917  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2918  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
2919  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2920 #endif
2921 
2922  DECLARE_OTHERS(AsmScalarType);
2923 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
2924 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2925  private:
2926  friend class boost::serialization::access;
2927 
2928  template<class S>
2929  void serialize(S &s, const unsigned version) {
2930  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
2931  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
2932  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
2933  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
2934  s & BOOST_SERIALIZATION_NVP(p_nBits);
2935  }
2936 #endif
2937 
2938  protected:
2943  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
2944 
2945  public:
2947  virtual size_t get_nBits() const $ROSE_OVERRIDE;
2948 
2950  ByteOrder::Endianness get_minorOrder() const;
2951 
2953  ByteOrder::Endianness get_majorOrder() const;
2954 
2956  size_t get_majorNBytes() const;
2957 
2958  // Overrides documented in base class
2959  virtual void check() const $ROSE_OVERRIDE;
2960  virtual std::string toString() const $ROSE_OVERRIDE;
2961 #endif // SgAsmScalarType_OTHERS
2962 
2963 #ifdef DOCUMENTATION
2964  };
2965 #endif
2966 
2968 
2969  DECLARE_LEAF_CLASS(AsmVectorType);
2970  IS_SERIALIZABLE(AsmVectorType);
2971 
2972 #ifdef DOCUMENTATION
2973 
2974  class SgAsmVectorType: public SgAsmType {
2975  public:
2976 #endif
2977 
2978 #ifndef DOCUMENTATION
2979  // Documented below due to ROSETTA limitations (read-only)
2980  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
2981  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2982  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
2983  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2984 #endif
2985 
2986  DECLARE_OTHERS(AsmVectorType);
2987 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
2988 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2989  private:
2990  friend class boost::serialization::access;
2991 
2992  template<class S>
2993  void serialize(S &s, const unsigned version) {
2994  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
2995  s & BOOST_SERIALIZATION_NVP(p_nElmts);
2996  s & BOOST_SERIALIZATION_NVP(p_elmtType);
2997  }
2998 #endif
2999 
3000  public:
3002  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3003 
3005  size_t get_nElmts() const;
3006 
3008  SgAsmType* get_elmtType() const;
3009 
3010  // Overrides documented in base class
3011  virtual void check() const $ROSE_OVERRIDE;
3012  virtual std::string toString() const $ROSE_OVERRIDE;
3013  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3014 #endif // SgAsmVectorType_OTHERS
3015 
3016 #ifdef DOCUMENTATION
3017  };
3018 #endif
3019 
3021 
3022  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3023  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3024  IS_SERIALIZABLE(AsmType);
3025 
3026 #ifdef DOCUMENTATION
3027 
3028  class SgAsmType: public SgAsmNode {
3029  public:
3030 #endif
3031 
3032  DECLARE_OTHERS(AsmType);
3033 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3034  private:
3036 
3037 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3038  private:
3039  friend class boost::serialization::access;
3040 
3041  template<class S>
3042  void serialize(S &s, const unsigned version) {
3043  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3044  }
3045 #endif
3046 
3047  public:
3055  virtual void check() const;
3056 
3062  virtual std::string toString() const {
3063  abort(); // ROSETTA limitation: intended pure virtual
3064  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3065  }
3066 
3068  virtual size_t get_nBits() const {
3069  abort(); // ROSETTA limitation: intended pure virtual
3070  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3071  }
3072 
3074  virtual size_t get_nBytes() const;
3075 
3081  template<class Type> // Type is a subclass of SgAsmType
3082  static Type* registerOrDelete(Type *toInsert) {
3083  ASSERT_not_null(toInsert);
3084  std::string key = toInsert->toString();
3085  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3086  ASSERT_not_null(retval);
3087  if (retval!=toInsert)
3088  delete toInsert;
3089  return retval;
3090  }
3091 #endif // SgAsmType_OTHERS
3092 
3093 #ifdef DOCUMENTATION
3094  };
3095 #endif
3096 
3097 
3098 
3100 
3101  /**************************************************************************************************************************
3102  * Collections of Instructions
3103  **************************************************************************************************************************/
3104 
3106 
3107  DECLARE_LEAF_CLASS(AsmFunction);
3108  IS_SERIALIZABLE(AsmFunction);
3109 
3110 #ifdef DOCUMENTATION
3111 
3127  public:
3128 #endif
3129 
3130 #ifdef DOCUMENTATION
3131 
3136  const std::string& get_name() const;
3137  void set_name(const std::string&);
3139 #else
3140  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3141  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3142 #endif
3143 
3144 #ifdef DOCUMENTATION
3145 
3151  unsigned get_reason() const;
3152  void set_reason(unsigned);
3154 #else
3155  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3156  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3157 #endif
3158 
3159 #ifdef DOCUMENTATION
3160 
3168 #else
3169  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3170  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3171 #endif
3172 
3173 #ifdef DOCUMENTATION
3174 
3177  MayReturn get_may_return() const;
3178  void set_may_return(MayReturn);
3180 #else
3181  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3182  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3183 #endif
3184 
3185 #ifdef DOCUMENTATION
3186 
3191  const std::string& get_name_md5() const;
3192  void set_name_md5(const std::string&);
3194 #else
3195  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3196  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3197 #endif
3198 
3199 #ifdef DOCUMENTATION
3200 
3205  const SgAsmStatementPtrList& get_statementList() const;
3206  void set_statementList(const SgAsmStatementPtrList&);
3208 #else
3209  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3210  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3211 #endif
3212 
3213 #ifdef DOCUMENTATION
3214  // FIXME[Robb P Matzke 2017-02-13]: unused?
3215 #else
3216  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3217  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3218 #endif
3219 
3220 #ifdef DOCUMENTATION
3221 
3227  rose_addr_t get_entry_va() const;
3228  void set_entry_va(rose_addr_t);
3230 #else
3231  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3232  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3233 #endif
3234 
3235 #ifdef DOCUMENTATION
3236 
3245 #else
3246  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3247  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3248 #endif
3249 
3250 #ifdef DOCUMENTATION
3251  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3252 #else
3253  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3254  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3255 #endif
3256 
3257 #ifdef DOCUMENTATION
3258 
3267  int64_t get_stackDelta() const;
3268  void set_stackDelta(int64_t);
3270 #else
3271  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3272  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3273 #endif
3274 
3275 #ifdef DOCUMENTATION
3276 
3284  const std::string& get_callingConvention() const;
3285  void set_callingConvention(const std::string&);
3287 #else
3288  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3289  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3290 #endif
3291 
3292  DECLARE_OTHERS(AsmFunction);
3293 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3294 
3295 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3296  private:
3297  friend class boost::serialization::access;
3298 
3299  template<class S>
3300  void serialize(S &s, const unsigned version) {
3301  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3302  s & BOOST_SERIALIZATION_NVP(p_name);
3303  s & BOOST_SERIALIZATION_NVP(p_reason);
3304  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3305  s & BOOST_SERIALIZATION_NVP(p_may_return);
3306  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3307  s & BOOST_SERIALIZATION_NVP(p_statementList);
3308  s & BOOST_SERIALIZATION_NVP(p_dest);
3309  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3310  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3311  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3312  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3313  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3314  }
3315 #endif
3316 
3317  public:
3318  // [Robb P Matzke 2017-02-13]: Deprecated because it uses a very old CFG implementation
3319  int nrOfValidInstructions(std::vector<SgNode*>& succs) ROSE_DEPRECATED("use modern CFG classes instead");
3320 
3323 
3327  void remove_statement(SgAsmStatement* statement);
3328 
3329  // [Robb P Matzke 2017-02-13]: I don't think this is used anywhere. It appends to the poorly named "dest" property.
3330  void append_dest(SgAsmStatement* instruction) ROSE_DEPRECATED("apparently not used anywhere");
3331 
3332  // FIXME[Robb P Matzke 2017-02-13]: This is a bad name--it removes only statements, not all AST children.
3336  void remove_children();
3337 
3342  SgAsmBlock* get_entry_block() const;
3343 
3345  enum MayReturn {
3350  };
3351 
3356  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3357  // Also fix SgAsmFunction::reason_key()
3358  FUNC_NONE = 0x00000000,
3360  = 0x00008000,
3361  FUNC_ENTRY_POINT = 0x00010000,
3362  FUNC_CALL_TARGET = 0x00020000,
3365  FUNC_CALL_INSN = 0x00040000,
3371  FUNC_EH_FRAME = 0x00080000,
3372  FUNC_SYMBOL = 0x00100000,
3373  FUNC_PATTERN = 0x00200000,
3378  FUNC_GRAPH = 0x00400000,
3382  FUNC_USERDEF = 0x00800000,
3383  FUNC_PADDING = 0x01000000,
3388  FUNC_DISCONT = 0x02000000,
3391  FUNC_INSNHEAD = 0x04000000,
3392  FUNC_IMPORT = 0x08000000,
3395  FUNC_LEFTOVERS = 0x10000000,
3399  FUNC_INTRABLOCK = 0x20000000,
3407  FUNC_THUNK = 0x40000000,
3416  FUNC_EXPORT = 0x80000000,
3418  FUNC_DEFAULT = 0xefff80ff,
3420  /*========= Miscellaneous Reasons ===========================================================================
3421  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3422  * availalble for users to use as they see fit. */
3423  FUNC_MISCMASK = 0x000000ff,
3429  FUNC_INTERPADFUNC = 0x00000001
3432  };
3433 
3437  static std::string reason_key(const std::string &prefix="");
3438 
3440  std::string reason_str(bool pad) const;
3441 
3445  static std::string reason_str(bool pad, unsigned reason);
3446 
3449  public:
3450  virtual ~NodeSelector() {}
3451  virtual bool operator()(SgNode*) = 0;
3452  };
3453 
3493  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
3494  NodeSelector *selector=NULL);
3495 
3501  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
3502 
3505  e_unknown = 0,
3506  e_standard = 1,
3507  e_library = 2,
3508  e_imported = 3,
3509  e_thunk = 4,
3510  e_last
3511  };
3512 
3513  // Computes the offset of the stack at the end of the call relative the the start of the call (in a perfect function
3514  // this would be zero, this is used to score properly formed functions).
3515  // [Robb P Matzke 2017-02-13]: deprecated
3516  int get_stackNutralityMetric() const ROSE_DEPRECATED("use get_stackDelta instead");
3517 #endif // SgAsmFunction_OTHERS
3518 
3519 
3520 #ifdef DOCUMENTATION
3521  };
3522 #endif
3523 
3524 
3526 
3527  DECLARE_LEAF_CLASS(AsmBlock);
3528  IS_SERIALIZABLE(AsmBlock);
3529 
3530 #ifdef DOCUMENTATION
3531 
3535  class SgAsmBlock: public SgAsmStatement {
3536  public:
3537 #endif
3538 
3539 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3540  // [tps 05Apr07] needed for the control_flow_graph
3541  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
3542  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3543 #endif
3544 
3545 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3546  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
3547  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3548 #endif
3549 
3550 #ifdef DOCUMENTATION
3551 
3556  rose_addr_t get_id() const;
3557  void set_id(rose_addr_t);
3559 #else
3560  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
3561  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3562 #endif
3563 
3564 #ifdef DOCUMENTATION
3565 
3570  unsigned get_reason() const;
3571  void set_reason(unsigned);
3573 #else
3574  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
3575  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3576 #endif
3577 
3578 #ifdef DOCUMENTATION
3579  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3580  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3581  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3582  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3589  const SgAsmStatementPtrList& get_statementList() const;
3590  void set_statementList(const SgAsmStatementPtrList&);
3592 #else
3593  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3594  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3595 #endif
3596 
3597 #ifdef DOCUMENTATION
3598  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3599  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3600  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3601  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3609  const SgAsmIntegerValuePtrList& get_successors() const;
3610  void set_successors(const SgAsmIntegerValuePtrList&);
3612 #else
3613  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
3614  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3615 #endif
3616 
3617 #ifdef DOCUMENTATION
3618 
3628  bool get_successors_complete() const;
3629  void set_successors_complete(bool);
3631 #else
3632  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
3633  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3634 #endif
3635 
3636 #ifdef DOCUMENTATION
3637 
3649 #else
3650  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
3651  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3652 #endif
3653 
3654 #ifdef DOCUMENTATION
3655 
3663  size_t get_cached_vertex() const;
3664  void set_cached_vertex(size_t);
3666 #else
3667  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
3668  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3669 #endif
3670 
3671 #ifdef DOCUMENTATION
3672 
3678  double get_code_likelihood() const;
3679  void set_code_likelihood(double);
3681 #else
3682  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
3683  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3684 #endif
3685 
3686 #ifdef DOCUMENTATION
3687 
3695  int64_t get_stackDeltaOut() const;
3696  void set_stackDeltaOut(int64_t);
3698 #else
3699  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
3700  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3701 #endif
3702 
3703  DECLARE_OTHERS(AsmBlock);
3704 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
3705 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3706  private:
3707  friend class boost::serialization::access;
3708 
3709  template<class S>
3710  void serialize(S &s, const unsigned version) {
3711  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3712  s & BOOST_SERIALIZATION_NVP(p_reason);
3713  s & BOOST_SERIALIZATION_NVP(p_statementList);
3714  s & BOOST_SERIALIZATION_NVP(p_successors);
3715  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
3716  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
3717  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3718  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
3719  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
3720  }
3721 #endif
3722 
3723  public:
3725  enum Reason {
3726  // Please update SgAsmBlock::reason_str() if you change this enum!
3727  BLK_NONE = 0x00000000,
3728  BLK_ENTRY_POINT = 0x00010000,
3729  BLK_PADDING = 0x00020000,
3730  BLK_FRAGMENT = 0x00080000,
3732  BLK_CFGHEAD = 0x00100000,
3733  BLK_USERDEF = 0x00200000,
3734  BLK_LEFTOVERS = 0x00400000,
3736  BLK_JUMPTABLE = 0x00800000,
3737  BLK_GRAPH1 = 0x01000000,
3738  BLK_GRAPH2 = 0x02000000,
3739  BLK_GRAPH3 = 0x04000000,
3741  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
3742 
3743  // ========= Miscellaneous Reasons ===========================================================================
3744  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3745  // availalble for users to use as they see fit.
3746  BLK_MISCMASK = 0x000000ff,
3748  BLK_FINDDATA = 0x00000001,
3750  BLK_POSTFUNC = 0x00000002
3752  };
3753 
3758 
3763 
3764  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
3769  void remove_children();
3770 
3775  rose_addr_t get_fallthrough_va();
3776 
3781 
3787  bool has_instructions() const;
3788 
3794  bool is_basic_block() const { return has_instructions(); }
3795 
3805  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
3806 
3810  static std::string reason_key(const std::string &prefix="");
3811 
3815  std::string reason_str(bool pad) const;
3816 
3822  static std::string reason_str(bool pad, unsigned reason);
3823 #endif // SgAsmBlock_OTHERS
3824 
3825 #ifdef DOCUMENTATION
3826  };
3827 #endif
3828 
3829 
3831 
3832  DECLARE_LEAF_CLASS(AsmStaticData);
3833  IS_SERIALIZABLE(AsmStaticData);
3834 
3835 #ifdef DOCUMENTATION
3836 
3844  public:
3845 #endif
3846 
3847 #ifdef DOCUMENTATION
3848 
3854  const SgUnsignedCharList& get_raw_bytes() const;
3855  void set_raw_bytes(const SgUnsignedCharList&);
3857 #else
3858  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
3859  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3860 #endif
3861 
3862  DECLARE_OTHERS(AsmStaticData);
3863 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
3864 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3865  private:
3866  friend class boost::serialization::access;
3867 
3868  template<class S>
3869  void serialize(S &s, const unsigned version) {
3870  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3871  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
3872  }
3873 #endif
3874 
3875  public:
3879  size_t get_size() const { return p_raw_bytes.size(); }
3880 #endif // SgAsmStaticData_OTHERS
3881 
3882 #ifdef DOCUMENTATION
3883  };
3884 #endif
3885 
3886 
3888 
3889  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
3890  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
3891 
3892 #ifdef DOCUMENTATION
3893 
3904  public:
3905 #endif
3906 
3907  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
3908 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
3909 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3910  private:
3911  friend class boost::serialization::access;
3912 
3913  template<class S>
3914  void serialize(S & s, const unsigned version) {
3915  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3916  }
3917 #endif
3918  protected:
3919  SgAsmSynthesizedDeclarationPtrList p_declarationList;
3920 
3921  public:
3924  p_declarationList.push_back(declaration);
3925  }
3926 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
3927 
3928 #ifdef DOCUMENTATION
3929  };
3930 #endif
3931 
3932 
3934 
3935  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
3936  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
3937 
3938 #ifdef DOCUMENTATION
3939  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3941  public:
3942 #endif
3943 
3944 #ifdef DOCUMENTATION
3945 
3948  const std::string& get_name() const;
3949  void set_name(const std::string&);
3951 #else
3952  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
3953  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
3954  NO_DELETE);
3955 #endif
3956 
3957 #ifdef DOCUMENTATION
3958  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
3962  uint64_t get_offset() const;
3963  void set_ofset(uint64_t);
3965 #else
3966  // Not clear if we want to store the offset explicitly
3967  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
3968  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
3969  NO_DELETE);
3970 #endif
3971 
3972  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
3973 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
3974 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3975  private:
3976  friend class boost::serialization::access;
3977 
3978  template<class S>
3979  void serialize(S &s, const unsigned version) {
3980  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3981  }
3982 #endif
3983 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
3984 
3985 #ifdef DOCUMENTATION
3986  };
3987 #endif
3988 
3989 
3991 
3992  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
3993  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
3994  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
3995  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
3996  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
3997 
3998 #ifdef DOCUMENTATION
3999 
4006  public:
4007 #endif
4008 
4009  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4010 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4011 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4012  private:
4013  friend class boost::serialization::access;
4014 
4015  template<class S>
4016  void serialize(S &s, const unsigned version) {
4017  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4018  };
4019 #endif
4020 #endif // SgAsmSynthesizedDeclaration_OTHERS
4021 
4022 #ifdef DOCUMENTATION
4023  };
4024 #endif
4025 
4026 
4028 
4029  NEW_NONTERMINAL_MACRO(AsmStatement,
4030  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4031  "AsmStatement", "AsmStatementTag", false);
4032  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4033  IS_SERIALIZABLE(AsmStatement);
4034 
4035 #ifdef DOCUMENTATION
4036 
4040  class SgAsmStatement: public SgAsmNode {
4041  public:
4042 #endif
4043 
4044 #ifdef DOCUMENTATION
4045 
4050  rose_addr_t get_address() const;
4051  void set_address(rose_addr_t);
4053 #else
4054  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4055  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4056 #endif
4057 
4058 
4059 #ifdef DOCUMENTATION
4060 
4063  const std::string& get_comment() const;
4064  void set_comment(const std::string&);
4066 #else
4067  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4068  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4069 #endif
4070 
4071  DECLARE_OTHERS(AsmStatement);
4072 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4073 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4074  private:
4075  friend class boost::serialization::access;
4076 
4077  template<class S>
4078  void serialize(S &s, const unsigned version) {
4079  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4080  s & BOOST_SERIALIZATION_NVP(p_address);
4081  s & BOOST_SERIALIZATION_NVP(p_comment);
4082  }
4083 #endif
4084 #endif // SgAsmStatement_OTHERS
4085 
4086 #ifdef DOCUMENTATION
4087  };
4088 #endif
4089 
4090 
4091 
4092 
4094 
4095  /*************************************************************************************************************************
4096  * Binary Interpretations
4097  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4098  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4099  * an AST that represents a single, coherent sub-part of the file.
4100  *************************************************************************************************************************/
4101 
4103 
4104  DECLARE_LEAF_CLASS(AsmInterpretationList);
4105  IS_SERIALIZABLE(AsmInterpretationList);
4106 
4107 #ifdef DOCUMENTATION
4108 
4110  public:
4111 #endif
4112 
4113 #ifdef DOCUMENTATION
4114 
4123 #else
4124  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4125  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4126  NO_DELETE);
4127 #endif
4128 
4129  DECLARE_OTHERS(AsmInterpretationList);
4130 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4131 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4132  private:
4133  friend class boost::serialization::access;
4134 
4135  template<class S>
4136  void serialize(S &s, const unsigned version) {
4137  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4138  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4139  }
4140 #endif
4141 #endif // SgAsmInterpretationList_OTHERS
4142 
4143 #ifdef DOCUMENTATION
4144  };
4145 #endif
4146 
4148 
4149  DECLARE_LEAF_CLASS(AsmInterpretation);
4150  IS_SERIALIZABLE(AsmInterpretation);
4151 
4152  DECLARE_HEADERS(AsmInterpretation);
4153 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4154  #include <MemoryMap.h>
4155  class RegisterDictionary;
4156 #endif // SgAsmInterpretation_HEADERS
4157 
4158 #ifdef DOCUMENTATION
4159 
4166  public:
4167 #endif
4168 
4169 #ifdef DOCUMENTATION
4170  // documentation and definition are below
4171 #else
4172  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4173 #endif
4174 
4175 #ifdef DOCUMENTATION
4176 
4187 #else
4188  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4189  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4190 #endif
4191 
4192 #ifdef DOCUMENTATION
4193 
4198  SgAsmBlock* get_global_block() const;
4201 #else
4202  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4203  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4204 #endif
4205 
4206  DECLARE_OTHERS(AsmInterpretation);
4207 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4208  private:
4210  const RegisterDictionary *p_registers;
4211  bool coverageComputed; // true iff percentageCoverage has been computed
4212  mutable InstructionMap instruction_map; // cached instruction map
4213 
4215  // disassembly into instructions.
4216  double percentageCoverage;
4217 
4218 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4219  private:
4220  friend class boost::serialization::access;
4221 
4222  template<class S>
4223  void serialize(S &s, const unsigned version) {
4224  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4225  s & BOOST_SERIALIZATION_NVP(p_headers);
4226  s & BOOST_SERIALIZATION_NVP(p_global_block);
4227  s & BOOST_SERIALIZATION_NVP(p_map);
4228  s & BOOST_SERIALIZATION_NVP(p_registers);
4229  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4230  s & BOOST_SERIALIZATION_NVP(instruction_map);
4231  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4232  }
4233 #endif
4234 
4235  public:
4238  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4239  ctor();
4240  }
4241 
4246  SgAsmGenericFilePtrList get_files() const;
4247 
4263  const RegisterDictionary *get_registers() const;
4264  void set_registers(const RegisterDictionary*);
4274  InstructionMap& get_instruction_map(bool recompute=false);
4275  void set_instruction_map(const InstructionMap&);
4282  void insert_instructions(InstructionMap&/*in,out*/);
4283 
4288  void erase_instructions(InstructionMap&/*in,out*/);
4289 
4295  void set_coverageComputed(bool x) { coverageComputed = x; }
4296  void set_percentageCoverage(double x) { percentageCoverage = x; }
4299  private:
4300  void ctor(); // finalize construction
4301 #endif // SgAsmInterpretation_OTHERS
4302 
4303 #ifdef DOCUMENTATION
4304  };
4305 #endif
4306 
4307 
4308 
4310 
4311  /*************************************************************************************************************************
4312  * ELF File Header
4313  *************************************************************************************************************************/
4314 
4316 
4317  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4318  IS_SERIALIZABLE(AsmElfFileHeader);
4319 
4320 #ifdef DOCUMENTATION
4321 
4330  public:
4331 #endif
4332 
4333 #ifdef DOCUMENTATION
4334 
4339  unsigned char get_e_ident_file_class() const;
4340  void set_e_ident_file_class(unsigned char);
4342 #else
4343  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4344  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4345 #endif
4346 
4347 #ifdef DOCUMENTATION
4348 
4353  unsigned char get_e_ident_data_encoding() const;
4354  void set_e_ident_data_encoding(unsigned char);
4356 #else
4357  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4358  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4359 #endif
4360 
4361 #ifdef DOCUMENTATION
4362 
4367  unsigned char get_e_ident_file_version() const;
4368  void set_e_ident_file_version(unsigned char*);
4370 #else
4371  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4372  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4373 #endif
4374 
4375 #ifdef DOCUMENTATION
4376 
4381  const SgUnsignedCharList& get_e_ident_padding() const;
4382  void set_e_ident_padding(const SgUnsignedCharList&);
4384 #else
4385  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4386  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4387 #endif
4388 
4389 #ifdef DOCUMENTATION
4390 
4395  unsigned long get_e_type() const;
4396  void set_e_type(unsigned long);
4398 #else
4399  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4400  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4401 #endif
4402 
4403 #ifdef DOCUMENTATION
4404 
4409  unsigned long get_e_machine() const;
4410  void set_e_machine(unsigned long);
4412 #else
4413  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4414  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4415 #endif
4416 
4417 #ifdef DOCUMENTATION
4418 
4423  unsigned long get_e_flags() const;
4424  void set_e_flags(unsigned long);
4426 #else
4427  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4428  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4429 #endif
4430 
4431 #ifdef DOCUMENTATION
4432 
4437  unsigned long get_e_ehsize() const;
4438  void set_e_ehsize(unsigned long);
4440 #else
4441  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4442  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4443 #endif
4444 
4445 #ifdef DOCUMENTATION
4446 
4451  unsigned long get_phextrasz() const;
4452  void set_phextrasz(unsigned long);
4454 #else
4455  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4456  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4457 #endif
4458 
4459 #ifdef DOCUMENTATION
4460 
4465  unsigned long get_e_phnum() const;
4466  void set_e_phnum(unsigned long);
4468 #else
4469  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
4470  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4471 #endif
4472 
4473 #ifdef DOCUMENTATION
4474 
4479  unsigned long get_shextrasz() const;
4480  void set_shextrasz(unsigned long);
4482 #else
4483  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
4484  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4485 #endif
4486 
4487 #ifdef DOCUMENTATION
4488 
4493  unsigned long get_e_shnum() const;
4494  void set_e_shnum(unsigned long);
4496 #else
4497  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
4498  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4499 #endif
4500 
4501 #ifdef DOCUMENTATION
4502 
4507  unsigned long get_e_shstrndx() const;
4508  void set_e_shstrndx(unsigned long);
4510 #else
4511  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
4512  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4513 #endif
4514 
4515 #ifdef DOCUMENTATION
4516 
4526 #else
4527  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
4528  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4529 #endif
4530 
4531 #ifdef DOCUMENTATION
4532 
4541 #else
4542  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
4543  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4544 #endif
4545 
4546  DECLARE_OTHERS(AsmElfFileHeader);
4547 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
4548 
4549 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4550  private:
4551  friend class boost::serialization::access;
4552 
4553  template<class S>
4554  void serialize(S &s, const unsigned version) {
4555  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
4556  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
4557  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
4558  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
4559  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
4560  s & BOOST_SERIALIZATION_NVP(p_e_type);
4561  s & BOOST_SERIALIZATION_NVP(p_e_machine);
4562  s & BOOST_SERIALIZATION_NVP(p_e_flags);
4563  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
4564  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
4565  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
4566  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
4567  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
4568  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
4569  s & BOOST_SERIALIZATION_NVP(p_section_table);
4570  s & BOOST_SERIALIZATION_NVP(p_segment_table);
4571  }
4572 #endif
4573 
4574  public:
4576  enum ObjectType {
4577  ET_NONE = 0
4578  ,ET_REL = 1
4579  ,ET_EXEC = 2
4580  ,ET_DYN = 3
4581  ,ET_CORE = 4
4583  ,ET_LOOS = 0xfe00
4584  ,ET_HIOS = 0xfeff
4585  ,ET_LOPROC = 0xff00
4586  ,ET_HIPROC = 0xffff
4587  };
4588 
4589  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
4590  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
4591  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
4592  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
4593  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
4594 #ifdef _MSC_VER
4595 # pragma pack (1)
4596 #endif
4597 
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  uint32_t e_entry;
4613  uint32_t e_phoff;
4614  uint32_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 
4629  unsigned char e_ident_magic[4];
4630  unsigned char e_ident_file_class;
4631  unsigned char e_ident_data_encoding;
4632  unsigned char e_ident_file_version;
4633  unsigned char e_ident_padding[9];
4634  uint16_t e_type;
4635  uint16_t e_machine;
4636  uint32_t e_version;
4637  uint64_t e_entry;
4638  uint64_t e_phoff;
4639  uint64_t e_shoff;
4640  uint32_t e_flags;
4641  uint16_t e_ehsize;
4642  uint16_t e_phentsize;
4643  uint16_t e_phnum;
4644  uint16_t e_shentsize;
4645  uint16_t e_shnum;
4646  uint16_t e_shstrndx;
4647  }
4648 #if !defined(SWIG) && !defined(_MSC_VER)
4649  __attribute__((packed))
4650 #endif
4651  ;
4652 
4653 #ifdef _MSC_VER
4654 # pragma pack ()
4655 #endif
4656 
4664  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
4665  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
4666  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
4667  ctor();
4668  }
4669 
4675  uint64_t max_page_size();
4676 
4679 
4682 
4688  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
4689 
4691  virtual bool reallocate() $ROSE_OVERRIDE;
4692 
4694  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4695 
4697  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4698 
4700  static bool is_ELF(SgAsmGenericFile*);
4701 
4703  SgAsmGenericSectionPtrList get_sectab_sections();
4704 
4706  SgAsmGenericSectionPtrList get_segtab_sections();
4707 
4708  // Overrides documented in base class
4709  virtual const char *format_name() const $ROSE_OVERRIDE;
4710 
4711  private:
4712  void ctor(); // called by constructors
4713  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
4714  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
4715 #endif // SgAsmElfFileHeader_OTHERS
4716 
4717 #ifdef DOCUMENTATION
4718  };
4719 #endif
4720 
4721 
4722 
4724 
4725  /*************************************************************************************************************************
4726  * ELF Section Tables
4727  *************************************************************************************************************************/
4728 
4730 
4731  DECLARE_LEAF_CLASS(AsmElfSectionTable);
4732  IS_SERIALIZABLE(AsmElfSectionTable);
4733 
4734 #ifdef DOCUMENTATION
4735 
4741  public:
4742 #endif
4743 
4744  DECLARE_OTHERS(AsmElfSectionTable);
4745 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
4746 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4747  private:
4748  friend class boost::serialization::access;
4749 
4750  template<class S>
4751  void serialize(S &s, const unsigned version) {
4752  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
4753  }
4754 #endif
4755 
4756  public:
4759  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
4760  ctor();
4761  }
4762 
4768  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
4769 
4781 
4785  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
4786 
4788  virtual bool reallocate() $ROSE_OVERRIDE;
4789 
4791  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4792 
4794  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4795 
4796  private:
4797  void ctor();
4798 #endif // SgAsmElfSectionTable_OTHERS
4799 
4800 #ifdef DOCUMENTATION
4801  };
4802 #endif
4803 
4804 
4806 
4807  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
4808  IS_SERIALIZABLE(AsmElfSectionTableEntry);
4809 
4810 #ifdef DOCUMENTATION
4811 
4813  public:
4814 #endif
4815 
4816 #ifdef DOCUMENTATION
4817 
4822  unsigned get_sh_name() const;
4823  void set_sh_name(unsigned);
4825 #else
4826  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
4827  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4828 #endif
4829 
4830 #ifdef DOCUMENTATION
4831 
4836  SectionType get_sh_type() const;
4837  void set_sh_type(SectionType);
4839 #else
4840  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
4841  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4842 #endif
4843 
4844 #ifdef DOCUMENTATION
4845 
4850  unsigned long get_sh_link() const;
4851  void set_sh_link(unsigned long);
4853 #else
4854  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
4855  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4856 #endif
4857 
4858 #ifdef DOCUMENTATION
4859 
4864  unsigned long get_sh_info() const;
4865  void set_sh_info(unsigned long);
4867 #else
4868  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
4869  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4870 #endif
4871 
4872 #ifdef DOCUMENTATION
4873 
4878  uint64_t get_sh_flags() const;
4879  void set_sh_flags(uint64_t);
4881 #else
4882  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
4883  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4884 #endif
4885 
4886 #ifdef DOCUMENTATION
4887 
4892  rose_addr_t get_sh_addr() const;
4893  void set_sh_addr(rose_addr_t);
4895 #else
4896  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
4897  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4898 #endif
4899 
4900 #ifdef DOCUMENTATION
4901 
4906  rose_addr_t get_sh_offset() const;
4907  void set_sh_offset(rose_addr_t);
4909 #else
4910  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
4911  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4912 #endif
4913 
4914 #ifdef DOCUMENTATION
4915 
4920  rose_addr_t get_sh_size() const;
4921  void set_sh_size(rose_addr_t);
4923 #else
4924  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
4925  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4926 #endif
4927 
4928 #ifdef DOCUMENTATION
4929 
4934  rose_addr_t get_sh_addralign() const;
4935  void set_sh_addralign(rose_addr_t);
4937 #else
4938  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
4939  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4940 #endif
4941 
4942 #ifdef DOCUMENTATION
4943 
4948  rose_addr_t get_sh_entsize() const;
4949  void set_sh_entsize(rose_addr_t);
4951 #else
4952  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
4953  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4954 #endif
4955 
4956 #ifdef DOCUMENTATION
4957 
4962  const SgUnsignedCharList& get_extra() const;
4963  void set_extra(const SgUnsignedCharLit&);
4965 #else
4966  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
4967  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4968  NO_DELETE);
4969 #endif
4970 
4971  DECLARE_OTHERS(AsmElfSectionTableEntry);
4972 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
4973 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4974  private:
4975  friend class boost::serialization::access;
4976 
4977  template<class S>
4978  void serialize(S &s, const unsigned version) {
4979  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
4980  s & BOOST_SERIALIZATION_NVP(p_sh_name);
4981  s & BOOST_SERIALIZATION_NVP(p_sh_type);
4982  s & BOOST_SERIALIZATION_NVP(p_sh_link);
4983  s & BOOST_SERIALIZATION_NVP(p_sh_info);
4984  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
4985  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
4986  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
4987  s & BOOST_SERIALIZATION_NVP(p_sh_size);
4988  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
4989  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
4990  s & BOOST_SERIALIZATION_NVP(p_extra);
4991  }
4992 #endif
4993 
4994  public:
4997  SHT_NULL = 0,
5001  SHT_RELA = 4,
5002  SHT_HASH = 5,
5004  SHT_NOTE = 7,
5006  SHT_REL = 9,
5007  SHT_SHLIB = 10,
5008  SHT_DYNSYM = 11,
5010  SHT_LOOS = 0x60000000,
5011  SHT_GNU_verdef = 0x6ffffffd,
5012  SHT_GNU_verneed = 0x6ffffffe,
5013  SHT_GNU_versym = 0x6fffffff,
5014  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5015 
5016  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5017  SHT_HIPROC = 0x7fffffff,
5018  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5019  SHT_HIUSER = 0xffffffff
5020  };
5021 
5025  SHF_WRITE= (1 << 0),
5026  SHF_ALLOC= (1 << 1),
5027  SHF_EXECINSTR= (1 << 2),
5028  SHF_MERGE= (1 << 4),
5029  SHF_STRINGS= (1 << 5),
5030  SHF_INFO_LINK= (1 << 6),
5031  SHF_LINK_ORDER= (1 << 7),
5033  SHF_GROUP= (1 << 9),
5034  SHF_TLS= (1 << 10),
5035  SHF_MASKOS= 0x0ff00000,
5036  SHF_MASKPROC= 0xf0000000
5037  };
5038 
5045 #ifdef _MSC_VER
5046 # pragma pack (1)
5047 #endif
5049  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5050  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5051  uint32_t sh_flags; /* 0x08 Bit flags */
5052  uint32_t sh_addr; /* 0x0c Desired mapped address */
5053  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5054  uint32_t sh_size; /* 0x14 Section size in bytes */
5055  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5056  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5057  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5058  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5059  } /* 0x28 */
5060 #if !defined(SWIG) && !defined(_MSC_VER)
5061  __attribute__((packed))
5062 #endif
5063  ;
5064 
5066  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5067  uint32_t sh_type; /* 0x04 */
5068  uint64_t sh_flags; /* 0x08 */
5069  uint64_t sh_addr; /* 0x10 */
5070  uint64_t sh_offset; /* 0x18 */
5071  uint64_t sh_size; /* 0x20 */
5072  uint32_t sh_link; /* 0x28 */
5073  uint32_t sh_info; /* 0x2c */
5074  uint64_t sh_addralign; /* 0x30 */
5075  uint64_t sh_entsize; /* 0x38 */
5076  } /* 0x40 */
5077 #if !defined(SWIG) && !defined(_MSC_VER)
5078  __attribute__((packed))
5079 #endif
5080  ;
5081 #ifdef _MSC_VER
5082 # pragma pack ()
5083 #endif
5084 
5086  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5088 
5090  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5092 
5096  void *encode(ByteOrder::Endianness sex,
5098  void *encode(ByteOrder::Endianness sex,
5104 
5106  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5107 
5108  // Use Rose::stringify... function instead.
5109  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5110  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5111 
5112  private:
5113  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5114  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5115 #endif // SgAsmElfSectionTableEntry_OTHERS
5116 
5117 #ifdef DOCUMENTATION
5118  };
5119 #endif
5120 
5121 
5122 
5124 
5125  /*************************************************************************************************************************
5126  * ELF Segment Tables
5127  *************************************************************************************************************************/
5128 
5130 
5131  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5132  IS_SERIALIZABLE(AsmElfSegmentTable);
5133 
5134 #ifdef DOCUMENTATION
5135 
5142  public:
5143 #endif
5144 
5145  DECLARE_OTHERS(AsmElfSegmentTable);
5146 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5147 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5148  private:
5149  friend class boost::serialization::access;
5150 
5151  template<class S>
5152  void serialize(S &s, const unsigned version) {
5153  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5154  }
5155 #endif
5156 
5157  public:
5160  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5161  ctor();
5162  }
5163 
5168  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5169 
5184 
5188  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5189 
5191  virtual bool reallocate() $ROSE_OVERRIDE;
5192 
5194  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5195 
5197  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5198 
5199  private:
5200  void ctor();
5201 #endif // SgAsmElfSegmentTable_OTHERS
5202 
5203 #ifdef DOCUMENTATION
5204  };
5205 #endif
5206 
5208 
5209  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5210  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5211 
5212 #ifdef DOCUMENTATION
5214  public:
5215 #endif
5216 
5217 #ifdef DOCUMENTATION
5218 
5224  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5225  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5227 #else
5228  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5229  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5230  NO_DELETE);
5231 #endif
5232 
5233  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5234 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5235 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5236  private:
5237  friend class boost::serialization::access;
5238 
5239  template<class S>
5240  void serialize(S &s, const unsigned version) {
5241  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5242  }
5243 #endif
5244 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5245 
5246 #ifdef DOCUMENTATION
5247  };
5248 #endif
5249 
5250 
5252 
5253  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5254  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5255 
5256 #ifdef DOCUMENTATION
5257 
5259  public:
5260 #endif
5261 
5262 #ifdef DOCUMENTATION
5263 
5268  size_t get_index() const;
5269  void set_index(size_t);
5271 #else
5272  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5273  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5274 #endif
5275 
5276 #ifdef DOCUMENTATION
5277 
5280  SegmentType get_type() const;
5281  void set_type(SegmentType);
5283 #else
5284  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5285  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5286  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5287 #endif
5288 
5289 #ifdef DOCUMENTATION
5290 
5293  SegmentFlags get_flags() const;
5294  void set_flags(SegmentFlags);
5296 #else
5297  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5298  "= SgAsmElfSegmentTableEntry::PF_NONE",
5299  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5300 #endif
5301 
5302 #ifdef DOCUMENTATION
5303 
5308  rose_addr_t get_offset() const;
5309  void set_offset(rose_addr_t);
5311 #else
5312  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5313  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5314 #endif
5315 
5316 #ifdef DOCUMENTATION
5317 
5323  rose_addr_t get_vaddr() const;
5324  void set_vaddr(rose_addr_t);
5326 #else
5327  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5328  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5329 #endif
5330 
5331 #ifdef DOCUMENTATION
5332 
5337  rose_addr_t get_paddr() const;
5338  void set_paddr(rose_addr_t);
5340 #else
5341  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5342  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5343 #endif
5344 
5345 #ifdef DOCUMENTATION
5346 
5351  rose_addr_t get_filesz() const;
5352  void set_filesz(rose_addr_t);
5354 #else
5355  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5356  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5357 #endif
5358 
5359 #ifdef DOCUMENTATION
5360 
5365  rose_addr_t get_memsz() const;
5366  void set_memsz(rose_addr_t);
5368 #else
5369  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5370  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5371 #endif
5372 
5373 #ifdef DOCUMENTATION
5374 
5379  rose_addr_t get_align() const;
5380  void set_align(rose_addr_t);
5382 #else
5383  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5384  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5385 #endif
5386 
5387 #ifdef DOCUMENTATION
5388 
5393  const SgUnsignedCharList& get_extra() const;
5394  void set_extra(const SgUnsignedCharList&);
5396 #else
5397  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5398  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5399 #endif
5400 
5401  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5402 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
5403 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5404  private:
5405  friend class boost::serialization::access;
5406 
5407  template<class S>
5408  void serialize(S &s, const unsigned version) {
5409  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5410  s & BOOST_SERIALIZATION_NVP(p_index);
5411  s & BOOST_SERIALIZATION_NVP(p_type);
5412  s & BOOST_SERIALIZATION_NVP(p_flags);
5413  s & BOOST_SERIALIZATION_NVP(p_offset);
5414  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5415  s & BOOST_SERIALIZATION_NVP(p_paddr);
5416  s & BOOST_SERIALIZATION_NVP(p_filesz);
5417  s & BOOST_SERIALIZATION_NVP(p_memsz);
5418  s & BOOST_SERIALIZATION_NVP(p_align);
5419  s & BOOST_SERIALIZATION_NVP(p_extra);
5420  }
5421 #endif
5422 
5423  public:
5426  PT_NULL = 0,
5427  PT_LOAD = 1,
5430  PT_NOTE = 4,
5431  PT_SHLIB = 5,
5432  PT_PHDR = 6,
5433  PT_TLS = 7,
5435  // OS- and Processor-specific ranges
5436  PT_LOOS = 0x60000000,
5437  PT_HIOS = 0x6fffffff,
5438  PT_LOPROC = 0x70000000,
5439  PT_HIPROC = 0x7fffffff,
5440 
5441  // OS-specific values for GNU/Linux
5442  PT_GNU_EH_FRAME = 0x6474e550,
5443  PT_GNU_STACK = 0x6474e551,
5444  PT_GNU_RELRO = 0x6474e552,
5445  PT_PAX_FLAGS = 0x65041580,
5447  // OS-specific values for Sun
5448  PT_SUNWBSS = 0x6ffffffa,
5449  PT_SUNWSTACK = 0x6ffffffb
5450  };
5451 
5454  PF_NONE = 0,
5455  PF_RESERVED = 0x000ffff8,
5456  PF_XPERM = 0x00000001,
5457  PF_WPERM = 0x00000002,
5458  PF_RPERM = 0x00000004,
5459  PF_OS_MASK = 0x0ff00000,
5460  PF_PROC_MASK = 0xf0000000
5461  };
5462 
5463 #ifdef _MSC_VER
5464 # pragma pack (1)
5465 #endif
5466 
5474  uint32_t p_type;
5475  uint32_t p_offset;
5476  uint32_t p_vaddr;
5477  uint32_t p_paddr;
5478  uint32_t p_filesz;
5479  uint32_t p_memsz;
5480  uint32_t p_flags;
5481  uint32_t p_align;
5482  } /* 0x30 */
5483 #if !defined(SWIG) && !defined(_MSC_VER)
5484  __attribute__((packed))
5485 #endif
5486  ;
5487 
5489  uint32_t p_type; /* 0x00 */
5490  uint32_t p_flags; /* 0x04 */
5491  uint64_t p_offset; /* 0x08 */
5492  uint64_t p_vaddr; /* 0x10 */
5493  uint64_t p_paddr; /* 0x18 */
5494  uint64_t p_filesz; /* 0x20 */
5495  uint64_t p_memsz; /* 0x28 */
5496  uint64_t p_align; /* 0x30 */
5497  } /* 0x38 */
5498 #if !defined(SWIG) && !defined(_MSC_VER)
5499  __attribute__((packed))
5500 #endif
5501  ;
5502 #ifdef _MSC_VER
5503 # pragma pack ()
5504 #endif
5505 
5507  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5509 
5511  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5513 
5517  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
5518  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
5523 
5525  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5526 
5529 
5532 
5533  private:
5534  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
5535  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
5536 #endif // SgAsmElfSegmentTableEntry_OTHERS
5537 
5538 #ifdef DOCUMENTATION
5539  };
5540 #endif
5541 
5542 
5543 
5545 
5546  /*************************************************************************************************************************
5547  * ELF Symbol Tables
5548  *************************************************************************************************************************/
5549 
5551 
5552  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
5553  IS_SERIALIZABLE(AsmElfSymbolSection);
5554 
5555 #ifdef DOCUMENTATION
5556 
5558  public:
5559 #endif
5560 
5561 #ifdef DOCUMENTATION
5562 
5565  bool get_is_dynamic() const;
5566  void set_is_dynamic(bool);
5568 #else
5569  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
5570  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5571 #endif
5572 
5573 #ifdef DOCUMENTATION
5574 
5583 #else
5584  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
5585  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5586 #endif
5587 
5588  DECLARE_OTHERS(AsmElfSymbolSection);
5589 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
5590 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5591  private:
5592  friend class boost::serialization::access;
5593 
5594  template<class S>
5595  void serialize(S &s, const unsigned version) {
5596  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5597  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
5598  s & BOOST_SERIALIZATION_NVP(p_symbols);
5599  }
5600 #endif
5601 
5602  public:
5605  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
5606  ctor(strsec);
5607  }
5608 
5610  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
5611 
5624  virtual void finish_parsing() $ROSE_OVERRIDE;
5625 
5627  size_t index_of(SgAsmElfSymbol*);
5628 
5633  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5634 
5638  virtual bool reallocate() $ROSE_OVERRIDE;
5639 
5641  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5642 
5644  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5645 
5646  private:
5647  void ctor(SgAsmElfStringSection*);
5648 #endif // SgAsmElfSymbolSection_OTHERS
5649 
5650 #ifdef DOCUMENTATION
5651  };
5652 #endif
5653 
5655 
5656  DECLARE_LEAF_CLASS(AsmElfSymbolList);
5657  IS_SERIALIZABLE(AsmElfSymbolList);
5658 
5659 #ifdef DOCUMENTATION
5661  public:
5662 #endif
5663 
5664 #ifdef DOCUMENTATION
5665 
5671  const SgAsmElfSymbolPtrList& get_symbols() const;
5672  void set_symbols(const SgAsmElfSymbolPtrList&);
5674 #else
5675  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
5676  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5677 #endif
5678 
5679  DECLARE_OTHERS(AsmElfSymbolList);
5680 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
5681 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5682  private:
5683  friend class boost::serialization::access;
5684 
5685  template<class S>
5686  void serialize(S &s, const unsigned version) {
5687  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5688  s & BOOST_SERIALIZATION_NVP(p_symbols);
5689  }
5690 #endif
5691 #endif // SgAsmElfSymbolList_OTHERS
5692 
5693 #ifdef DOCUMENTATION
5694  };
5695 #endif
5696 
5698 
5699  DECLARE_LEAF_CLASS(AsmElfSymbol);
5700  IS_SERIALIZABLE(AsmElfSymbol);
5701 
5702 #ifdef DOCUMENTATION
5703 
5708  public:
5709 #endif
5710 
5711 #ifdef DOCUMENTATION
5712 
5717  unsigned char get_st_info() const;
5718  void set_st_info(unsigned char);
5720 #else
5721  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
5722  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5723 #endif
5724 
5725 #ifdef DOCUMENTATION
5726 
5731  unsigned char get_st_res1() const;
5732  void set_st_res1(unsigned char);
5734 #else
5735  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
5736  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5737 #endif
5738 
5739 #ifdef DOCUMENTATION
5740 
5745  unsigned get_st_shndx() const;
5746  void set_st_shndx(unsigned);
5748 #else
5749  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
5750  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5751 #endif
5752 
5753 #ifdef DOCUMENTATION
5754 
5759  rose_addr_t get_st_size() const;
5760  void set_st_size(rose_addr_t);
5762 #else
5763  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
5764  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5765 #endif
5766 
5767 #ifdef DOCUMENTATION
5768 
5773  const SgUnsignedCharList& get_extra() const;
5774  void set_extra(const SgUnsignedCharList&);
5776 #else
5777  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
5778  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5779 #endif
5780 
5781  DECLARE_OTHERS(AsmElfSymbol);
5782 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
5783 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5784  private:
5785  friend class boost::serialization::access;
5786 
5787  template<class S>
5788  void serialize(S &s, const unsigned version) {
5789  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
5790  s & BOOST_SERIALIZATION_NVP(p_st_info);
5791  s & BOOST_SERIALIZATION_NVP(p_st_res1);
5792  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
5793  s & BOOST_SERIALIZATION_NVP(p_st_size);
5794  s & BOOST_SERIALIZATION_NVP(p_extra);
5795  }
5796 #endif
5797 
5798  public:
5799  enum ElfSymBinding {
5800  STB_LOCAL=0,
5801  STB_GLOBAL=1,
5802  STB_WEAK=2
5803  };
5804 
5805  enum ElfSymType {
5808  STT_FUNC = 2,
5810  STT_FILE = 4,
5812  STT_TLS = 6,
5814  };
5815 
5816 #ifdef _MSC_VER
5817 # pragma pack (1)
5818 #endif
5819 
5822  uint32_t st_name;
5823  uint32_t st_value;
5824  uint32_t st_size;
5825  unsigned char st_info;
5826  unsigned char st_res1;
5827  uint16_t st_shndx;
5828  }
5829 #if !defined(SWIG) && !defined(_MSC_VER)
5830  __attribute__((packed))
5831 #endif
5832  ;
5833 
5835  uint32_t st_name;
5836  unsigned char st_info;
5837  unsigned char st_res1;
5838  uint16_t st_shndx;
5839  uint64_t st_value;
5840  uint64_t st_size;
5841  }
5842 #if !defined(SWIG) && !defined(_MSC_VER)
5843  __attribute__((packed))
5844 #endif
5845  ;
5846 
5847 #ifdef _MSC_VER
5848 # pragma pack ()
5849 #endif
5850 
5852  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
5853 
5857  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
5858 
5862  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
5863 
5867  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
5868  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
5876  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5877  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
5881  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
5882 
5885 
5887  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
5888 
5890  static std::string to_string(SgAsmElfSymbol::ElfSymType);
5891 
5892  private:
5893  void ctor(SgAsmElfSymbolSection*);
5894  void parse_common(); // initialization common to all parse() methods
5895 #endif // SgAsmElfSymbol_OTHERS
5896 
5897 #ifdef DOCUMENTATION
5898  };
5899 #endif
5900 
5901 
5902 
5904 
5905  /*************************************************************************************************************************
5906  * ELF Symbol Version Tables
5907  *************************************************************************************************************************/
5908 
5910 
5911  DECLARE_LEAF_CLASS(AsmElfSymverSection);
5912  IS_SERIALIZABLE(AsmElfSymverSection);
5913 
5914 #ifdef DOCUMENTATION
5915 
5920  public:
5921 #endif
5922 
5923 #ifdef DOCUMENTATION
5924 
5933 #else
5934  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
5935  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5936 #endif
5937 
5938  DECLARE_OTHERS(AsmElfSymverSection);
5939 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
5940 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5941  private:
5942  friend class boost::serialization::access;
5943 
5944  template<class S>
5945  void serialize(S &s, const unsigned version) {
5946  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5947  s & BOOST_SERIALIZATION_NVP(p_entries);
5948  }
5949 #endif
5950 
5951  public:
5954  : SgAsmElfSection(fhdr) {
5955  ctor();
5956  }
5957 
5959  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
5960 
5965  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5966 
5968  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5969 
5971  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5972  private:
5973  void ctor();
5974 #endif // SgAsmElfSymverSection_OTHERS
5975 
5976 #ifdef DOCUMENTATION
5977  };
5978 #endif
5979 
5981 
5982  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
5983  IS_SERIALIZABLE(AsmElfSymverEntry);
5984 
5985 #ifdef DOCUMENTATION
5986 
5988  public:
5989 #endif
5990 
5991 #ifdef DOCUMENTATION
5992 
5997  size_t get_value() const;
5998  void set_value(size_t);
6000 #else
6001  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6002  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6003 #endif
6004 
6005  DECLARE_OTHERS(AsmElfSymverEntry);
6006 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6007 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6008  private:
6009  friend class boost::serialization::access;
6010 
6011  template<class S>
6012  void serialize(S &s, const unsigned version) {
6013  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6014  s & BOOST_SERIALIZATION_NVP(p_value);
6015  }
6016 #endif
6017 
6018  public:
6021  : p_value(0) {
6022  ctor(symver);
6023  }
6024 
6026  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6027 
6028  private:
6029  void ctor(SgAsmElfSymverSection*);
6030 #endif // SgAsmElfSymverEntry_OTHERS
6031 
6032 #ifdef DOCUMENTATION
6033  };
6034 #endif
6035 
6037 
6038 
6039  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6040  IS_SERIALIZABLE(AsmElfSymverEntryList);
6041 
6042 #ifdef DOCUMENTATION
6043 
6048  public:
6049 #endif
6050 
6051 #ifdef DOCUMENTATION
6052 
6055  const SgAsmElfSymverEntryPtrList& get_entries() const;
6056  void set_entries(const SgAsmElfSymverEntryPtrList&);
6058 #else
6059  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6060  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6061  NO_DELETE);
6062 #endif
6063 
6064  DECLARE_OTHERS(AsmElfSymverEntryList);
6065 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6066 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6067  private:
6068  friend class boost::serialization::access;
6069 
6070  template<class S>
6071  void serialize(S &s, const unsigned version) {
6072  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6073  s & BOOST_SERIALIZATION_NVP(p_entries);
6074  }
6075 #endif
6076 #endif // SgAsmElfSymverEntryList_OTHERS
6077 
6078 #ifdef DOCUMENTATION
6079  };
6080 #endif
6081 
6083 
6084  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6085  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6086 
6087 #ifdef DOCUMENTATION
6088 
6094  public:
6095 #endif
6096 
6097 #ifdef DOCUMENTATION
6098 
6107 #else
6108  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6109  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6110  NO_DELETE);
6111 #endif
6112 
6113  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6114 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6115 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6116  private:
6117  friend class boost::serialization::access;
6118 
6119  template<class S>
6120  void serialize(S &s, const unsigned version) {
6121  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6122  s & BOOST_SERIALIZATION_NVP(p_entries);
6123  }
6124 #endif
6125 
6126  public:
6129  : SgAsmElfSection(fhdr) {
6130  ctor(strsec);
6131  }
6132 
6201  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6202 
6205  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6206 
6210  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6211 
6213  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6214 
6215  private:
6216  void ctor(SgAsmElfStringSection*);
6217 #endif // SgAsmElfSymverDefinedSection_OTHERS
6218 
6219 #ifdef DOCUMENTATION
6220  };
6221 #endif
6222 
6224 
6225  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6226  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6227 
6228 #ifdef DOCUMENTATION
6229 
6234  public:
6235 #endif
6236 
6237 #ifdef DOCUMENTATION
6238 
6241  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6242  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6244 #else
6245  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6246  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6247  NO_DELETE);
6248 #endif
6249 
6250  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6251 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6252 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6253  private:
6254  friend class boost::serialization::access;
6255 
6256  template<class S>
6257  void serialize(S &s, const unsigned version) {
6258  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6259  s & BOOST_SERIALIZATION_NVP(p_entries);
6260  }
6261 #endif
6262 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6263 
6264 #ifdef DOCUMENTATION
6265  };
6266 #endif
6267 
6269 
6270  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6271  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6272 
6273 #ifdef DOCUMENTATION
6274 
6276  public:
6277 #endif
6278 
6279 #ifdef DOCUMENTATION
6280 
6285  size_t get_version() const;
6286  void set_version(size_t);
6288 #else
6289  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6290  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6291 #endif
6292 
6293 #ifdef DOCUMENTATION
6294 
6299  int get_flags() const;
6300  void set_flags(int);
6302 #else
6303  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6304  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6305 #endif
6306 
6307 #ifdef DOCUMENTATION
6308 
6313  size_t get_index() const;
6314  void set_index(size_t);
6316 #else
6317  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6318  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6319 #endif
6320 
6321 #ifdef DOCUMENTATION
6322 
6327  uint32_t get_hash() const;
6328  void set_hash(uint32_t);
6330 #else
6331  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6332  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6333 #endif
6334 
6335 #ifdef DOCUMENTATION
6336 
6345 #else
6346  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6347  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6348 #endif
6349 
6350  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6351 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6352 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6353  private:
6354  friend class boost::serialization::access;
6355 
6356  template<class S>
6357  void serialize(S &s, const unsigned version) {
6358  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6359  s & BOOST_SERIALIZATION_NVP(p_version);
6360  s & BOOST_SERIALIZATION_NVP(p_flags);
6361  s & BOOST_SERIALIZATION_NVP(p_index);
6362  s & BOOST_SERIALIZATION_NVP(p_hash);
6363  s & BOOST_SERIALIZATION_NVP(p_entries);
6364  }
6365 #endif
6366 
6367  public:
6368 #ifdef _MSC_VER
6369 # pragma pack (1)
6370 #endif
6371 
6373  uint16_t vd_version;
6374  uint16_t vd_flags;
6375  uint16_t vd_ndx;
6376  uint16_t vd_cnt;
6377  uint32_t vd_hash;
6378  uint32_t vd_aux;
6379  uint32_t vd_next;
6380  }
6381 #if !defined(SWIG) && !defined(_MSC_VER)
6382  __attribute__((packed))
6383 #endif
6384  ;
6385 
6386 #ifdef _MSC_VER
6387 # pragma pack ()
6388 #endif
6389 
6392  ctor(symver_defined);
6393  }
6394 
6396  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6397 
6399  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6400 
6402  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6403 
6404  private:
6405  void ctor(SgAsmElfSymverDefinedSection*);
6406 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6407 
6408 #ifdef DOCUMENTATION
6409  };
6410 #endif
6411 
6413 
6414  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6415  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6416 
6417 #ifdef DOCUMENTATION
6418 
6423  pbulic:
6424 #endif
6425 
6426 #ifdef DOCUMENTATION
6427 
6430  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6431  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6433 #else
6434  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6435  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6436  NO_DELETE);
6437 #endif
6438 
6439  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6440 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6441 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6442  private:
6443  friend class boost::serialization::access;
6444 
6445  template<class S>
6446  void serialize(S &s, const unsigned version) {
6447  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6448  s & BOOST_SERIALIZATION_NVP(p_entries);
6449  }
6450 #endif
6451 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6452 
6453 #ifdef DOCUMENTATION
6454  };
6455 #endif
6456 
6458 
6459  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
6460  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
6461 
6462 #ifdef DOCUMENTATION
6464  public:
6465 #endif
6466 
6467 #ifdef DOCUMENTATION
6468 
6471  SgAsmGenericString* get_name() const;
6474 #else
6475  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6476  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6477 #endif
6478 
6479  DECLARE_OTHERS(AsmElfSymverDefinedAux);
6480 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
6481 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6482  private:
6483  friend class boost::serialization::access;
6484 
6485  template<class S>
6486  void serialize(S &s, const unsigned version) {
6487  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6488  s & BOOST_SERIALIZATION_NVP(p_name);
6489  }
6490 #endif
6491 
6492  public:
6493 #ifdef _MSC_VER
6494 # pragma pack (1)
6495 #endif
6496 
6499  uint32_t vda_name;
6500  uint32_t vda_next;
6501  }
6502 #if !defined(SWIG) && !defined(_MSC_VER)
6503  __attribute__((packed))
6504 #endif
6505  ;
6506 
6507 #ifdef _MSC_VER
6508 # pragma pack ()
6509 #endif
6510 
6515  SgAsmElfSymverDefinedSection *symver_def_sec)
6516  : p_name(NULL) {
6517  ctor(symver_def_entry,symver_def_sec);
6518  }
6519 
6521  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
6522 
6524  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
6525 
6531  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6532 
6533  private:
6534  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
6535 #endif // SgAsmElfSymverDefinedAux_OTHERS
6536 
6537 #ifdef DOCUMENTATION
6538  };
6539 #endif
6540 
6542 
6543  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
6544  IS_SERIALIZABLE(AsmElfSymverNeededSection);
6545 
6546 #ifdef DOCUMENTATION
6547 
6553  public:
6554 #endif
6555 
6556 #ifdef DOCUMENTATION
6557 
6566 #else
6567  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
6568  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6569 #endif
6570 
6571  DECLARE_OTHERS(AsmElfSymverNeededSection);
6572 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
6573 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6574  private:
6575  friend class boost::serialization::access;
6576 
6577  template<class S>
6578  void serialize(S &s, const unsigned version) {
6579  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6580  s & BOOST_SERIALIZATION_NVP(p_entries);
6581  }
6582 #endif
6583 
6584  public:
6589  : SgAsmElfSection(fhdr) {
6590  ctor(strsec);
6591  }
6592 
6602  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
6603 
6608  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6609 
6613  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6614 
6616  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6617 
6618  private:
6619  void ctor(SgAsmElfStringSection*);
6620 #endif // SgAsmElfSymverNeededSection_OTHERS
6621 
6622 #ifdef DOCUMENTATION
6623  };
6624 #endif
6625 
6627 
6628  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
6629  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
6630 
6631 #ifdef DOCUMENTATION
6632 
6637  public:
6638 #endif
6639 
6640 #ifdef DOCUMENTATION
6641 
6644  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
6645  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
6647 #else
6648  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
6649  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6650  NO_DELETE);
6651 #endif
6652 
6653  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
6654 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
6655 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6656  private:
6657  friend class boost::serialization::access;
6658 
6659  template<class S>
6660  void serialize(S &s, const unsigned version) {
6661  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6662  s & BOOST_SERIALIZATION_NVP(p_entries);
6663  }
6664 #endif
6665 #endif // SgAsmElfSymverNeededEntryList_OTHERS
6666 
6667 #ifdef DOCUMENTATION
6668  };
6669 #endif
6670 
6672 
6673  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
6674  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
6675 
6676 #ifdef DOCUMENTATION
6677 
6679  public:
6680 #endif
6681 
6682 #ifdef DOCUMENTATION
6683 
6688  size_t get_version() const;
6689  void set_version(size_t);
6691 #else
6692  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
6693  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6694 #endif
6695 
6696 #ifdef DOCUMENTATION
6697 
6703 #else
6704  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
6705  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6706 #endif
6707 
6708 #ifdef DOCUMENTATION
6709 
6718 #else
6719  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
6720  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6721 #endif
6722 
6723  DECLARE_OTHERS(AsmElfSymverNeededEntry);
6724 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
6725 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6726  private:
6727  friend class boost::serialization::access;
6728 
6729  template<class S>
6730  void serialize(S &s, const unsigned version) {
6731  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6732  s & BOOST_SERIALIZATION_NVP(p_entries);
6733  }
6734 #endif
6735 
6736  public:
6737 #ifdef _MSC_VER
6738 # pragma pack (1)
6739 #endif
6740 
6743  uint16_t vn_version;
6744  uint16_t vn_cnt;
6745  uint32_t vn_file;
6746  uint32_t vn_aux;
6747  uint32_t vn_next;
6748  }
6749 #if !defined(SWIG) && !defined(_MSC_VER)
6750  __attribute__((packed))
6751 #endif
6752  ;
6753 
6754 #ifdef _MSC_VER
6755 # pragma pack ()
6756 #endif
6757 
6760  : p_file_name(NULL) {
6761  ctor(symver_needed);
6762  }
6763 
6765  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
6766 
6768  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
6769 
6771  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6772 
6773  private:
6774  void ctor(SgAsmElfSymverNeededSection*);
6775 #endif // SgAsmElfSymverNeededEntry_OTHERS
6776 
6777 #ifdef DOCUMENTATION
6778  };
6779 #endif
6780 
6782 
6783  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
6784  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
6785 
6786 #ifdef DOCUMENTATION
6787 
6792  public:
6793 #endif
6794 
6795 #ifdef DOCUMENTATION
6796 
6799  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
6800  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
6802 #else
6803  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
6804  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6805  NO_DELETE);
6806 #endif
6807 
6808  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
6809 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
6810 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6811  private:
6812  friend class boost::serialization::access;
6813 
6814  template<class S>
6815  void serialize(S &s, const unsigned version) {
6816  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6817  s & BOOST_SERIALIZATION_NVP(p_entries);
6818  }
6819 #endif
6820 #endif // SgAsmElfSymverNeededAuxList_OTHERS
6821 
6822 #ifdef DOCUMENTATION
6823  };
6824 #endif
6825 
6827 
6828  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
6829  IS_SERIALIZABLE(AsmElfSymverNeededAux);
6830 
6831 #ifdef DOCUMENTATION
6832 
6834  public:
6835 #endif
6836 
6837 #ifdef DOCUMENTATION
6838 
6843  uint32_t get_hash() const;
6844  void set_hash(uint32_t);
6846 #else
6847  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
6848  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6849 #endif
6850 
6851 #ifdef DOCUMENTATION
6852 
6857  int get_flags() const;
6858  void set_flags(int);
6860 #else
6861  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
6862  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6863 #endif
6864 
6865 #ifdef DOCUMENTATION
6866 
6871  size_t get_other() const;
6872  void set_other(size_t);
6874 #else
6875  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
6876  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6877 #endif
6878 
6879 #ifdef DOCUMENTATION
6880 
6883  SgAsmGenericString* get_name() const;
6886 #else
6887  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6888  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6889 #endif
6890 
6891  DECLARE_OTHERS(AsmElfSymverNeededAux);
6892 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
6893 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6894  private:
6895  friend class boost::serialization::access;
6896 
6897  template<class S>
6898  void serialize(S &s, const unsigned version) {
6899  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6900  s & BOOST_SERIALIZATION_NVP(p_hash);
6901  s & BOOST_SERIALIZATION_NVP(p_flags);
6902  s & BOOST_SERIALIZATION_NVP(p_other);
6903  s & BOOST_SERIALIZATION_NVP(p_name);
6904  }
6905 #endif
6906 
6907  public:
6908 #ifdef _MSC_VER
6909 # pragma pack (1)
6910 #endif
6911 
6914  uint32_t vna_hash;
6915  uint16_t vna_flags;
6916  uint16_t vna_other;
6917  uint32_t vna_name;
6918  uint32_t vna_next;
6919  }
6920 #if !defined(SWIG) && !defined(_MSC_VER)
6921  __attribute__((packed))
6922 #endif
6923  ;
6924 
6925 #ifdef _MSC_VER
6926 # pragma pack ()
6927 #endif
6928 
6934  : p_name(NULL) {
6935  ctor(symver_needed_entry,symver_needed_sec);
6936  }
6937 
6939  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
6940 
6942  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
6943 
6949  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6950 
6951  private:
6953 #endif // SgAsmElfSymverNeededAux_OTHERS
6954 
6955 #ifdef DOCUMENTATION
6956  };
6957 #endif
6958 
6959 
6960 
6961 
6963 
6964  /*************************************************************************************************************************
6965  * ELF Relocation Tables
6966  *************************************************************************************************************************/
6967 
6969 
6970  DECLARE_LEAF_CLASS(AsmElfRelocSection);
6971  IS_SERIALIZABLE(AsmElfRelocSection);
6972 
6973 #ifdef DOCUMENTATION
6974 
6976  public:
6977 #endif
6978 
6979 #ifdef DOCUMENTATION
6980 
6983  bool get_uses_addend() const;
6984  void set_uses_addend(bool);
6986 #else
6987  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
6988  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6989 #endif
6990 
6991 #ifdef DOCUMENTATION
6992 
6998 #else
6999  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7000  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7001 #endif
7002 
7003 #ifdef DOCUMENTATION
7004 
7012 #else
7013  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7014  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7015 #endif
7016 
7017  DECLARE_OTHERS(AsmElfRelocSection);
7018 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7019 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7020  private:
7021  friend class boost::serialization::access;
7022 
7023  template<class S>
7024  void serialize(S &s, const unsigned version) {
7025  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7026  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7027  s & BOOST_SERIALIZATION_NVP(p_target_section);
7028  s & BOOST_SERIALIZATION_NVP(p_entries);
7029  }
7030 #endif
7031 
7032  public:
7034  : SgAsmElfSection(fhdr) {
7035  ctor(symsec,targetsec);
7036  }
7037 
7040  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7041 
7043  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7044 
7046  virtual bool reallocate() $ROSE_OVERRIDE;
7047 
7049  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7050 
7052  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7053 
7054  private:
7056 #endif // SgAsmElfRelocSection_OTHERS
7057 
7058 #ifdef DOCUMENTATION
7059  };
7060 #endif
7061 
7063 
7064  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7065  IS_SERIALIZABLE(AsmElfRelocEntryList);
7066 
7067 #ifdef DOCUMENTATION
7068 
7073  public:
7074 #endif
7075 
7076 #ifdef DOCUMENTATION
7077 
7080  const SgAsmElfRelocEntryPtrList& get_entries() const;
7081  void set_entries(const SgAsmElfRelocEntryPtrList&);
7083 #else
7084  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7085  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7086  NO_DELETE);
7087 #endif
7088 
7089  DECLARE_OTHERS(AsmElfRelocEntryList);
7090 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7091 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7092  private:
7093  friend class boost::serialization::access;
7094 
7095  template<class S>
7096  void serialize(S &s, const unsigned version) {
7097  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7098  s & BOOST_SERIALIZATION_NVP(p_entries);
7099  }
7100 #endif
7101 #endif // SgAsmElfRelocEntryList_OTHERS
7102 
7103 #ifdef DOCUMENTATION
7104  };
7105 #endif
7106 
7108 
7109  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7110  IS_SERIALIZABLE(AsmElfRelocEntry);
7111 
7112 #ifdef DOCUMENTATION
7113 
7115  public:
7116 #endif
7117 
7118 #ifdef DOCUMENTATION
7119 
7124  rose_addr_t get_r_offset() const;
7125  void set_r_offset(rose_addr_t);
7127 #else
7128  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7129  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7130 #endif
7131 
7132 #ifdef DOCUMENTATION
7133 
7138  rose_addr_t get_r_addend() const;
7139  void set_r_addend(rose_addr_t);
7141 #else
7142  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7143  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7144 #endif
7145 
7146 #ifdef DOCUMENTATION
7147 
7152  unsigned long get_sym() const;
7153  void set_sym(unsigned long);
7155 #else
7156  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7157  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7158 #endif
7159 
7160 #ifdef DOCUMENTATION
7161 
7166  RelocType get_type() const;
7167  void set_type(RelocType);
7169 #else
7170  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7171  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7172 #endif
7173 
7174 #ifdef DOCUMENTATION
7175 
7178  const SgUnsignedCharList& get_extra() const;
7179  void set_extra(const SgUnsignedCharList&);
7181 #else
7182  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7183  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7184 #endif
7185 
7186  DECLARE_OTHERS(AsmElfRelocEntry);
7187 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7188 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7189  private:
7190  friend class boost::serialization::access;
7191 
7192  template<class S>
7193  void serialize(S &s, const unsigned version) {
7194  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7195  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7196  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7197  s & BOOST_SERIALIZATION_NVP(p_sym);
7198  s & BOOST_SERIALIZATION_NVP(p_type);
7199  s & BOOST_SERIALIZATION_NVP(p_extra);
7200  }
7201 #endif
7202 
7203  public:
7206  // Intel 80386 specific definitions.
7218  R_386_32PLT =11,
7225  R_386_16 =20,
7226  R_386_PC16 =21,
7227  R_386_8 =22,
7228  R_386_PC8 =23,
7244  // First Entry for X86-64
7259  R_X86_64_8 =114,
7269  };
7270 
7271 #ifdef _MSC_VER
7272 # pragma pack (1)
7273 #endif
7274 
7276  uint32_t r_offset;
7277  uint32_t r_info;
7278  uint32_t r_addend;
7279  }
7280 #if !defined(SWIG) && !defined(_MSC_VER)
7281  __attribute__((packed))
7282 #endif
7283  ;
7284 
7286  uint64_t r_offset;
7287  uint64_t r_info;
7288  uint64_t r_addend;
7289  }
7290 #if !defined(SWIG) && !defined(_MSC_VER)
7291  __attribute__((packed))
7292 #endif
7293  ;
7294 
7296  uint32_t r_offset;
7297  uint32_t r_info;
7298  }
7299 #if !defined(SWIG) && !defined(_MSC_VER)
7300  __attribute__((packed))
7301 #endif
7302  ;
7303 
7305  uint64_t r_offset;
7306  uint64_t r_info;
7307  }
7308 #if !defined(SWIG) && !defined(_MSC_VER)
7309  __attribute__((packed))
7310 #endif
7311  ;
7312 
7313 #ifdef _MSC_VER
7314 # pragma pack ()
7315 #endif
7316 
7319  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7320  ctor(section);
7321  }
7322 
7326  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7327  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7328  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7329  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7335  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7336  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7337  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7338  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7344  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7345  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7346  dump(f, prefix, idx, NULL);
7347  }
7351  std::string reloc_name() const;
7352 
7353  private:
7354  void ctor(SgAsmElfRelocSection*);
7355 #endif // SgAsmElfRelocEntry_OTHERS
7356 
7357 #ifdef DOCUMENTATION
7358  };
7359 #endif
7360 
7361 
7362 
7364 
7365  /*************************************************************************************************************************
7366  * ELF Dynamic Linking
7367  *************************************************************************************************************************/
7368 
7370 
7371  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7372  IS_SERIALIZABLE(AsmElfDynamicSection);
7373 
7374 #ifdef DOCUMENTATION
7375 
7377  public:
7378 #endif
7379 
7380 #ifdef DOCUMENTATION
7381 
7390 #else
7391  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7392  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7393 #endif
7394 
7395  DECLARE_OTHERS(AsmElfDynamicSection);
7396 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7397 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7398  private:
7399  friend class boost::serialization::access;
7400 
7401  template<class S>
7402  void serialize(S &s, const unsigned version) {
7403  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7404  s & BOOST_SERIALIZATION_NVP(p_entries);
7405  }
7406 #endif
7407 
7408  public:
7411  : SgAsmElfSection(fhdr) {
7412  ctor(strsec);
7413  }
7414 
7416  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7417 
7419  virtual void finish_parsing() $ROSE_OVERRIDE;
7420 
7423  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7424 
7426  virtual bool reallocate() $ROSE_OVERRIDE;
7427 
7429  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7430 
7432  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7433 
7434  private:
7435  void ctor(SgAsmElfStringSection*);
7436 #endif // SgAsmElfDynamicSection_OTHERS
7437 
7438 #ifdef DOCUMENTATION
7439  };
7440 #endif
7441 
7443 
7444  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7445  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7446 
7447 #ifdef DOCUMENTATION
7448 
7453  public:
7454 #endif
7455 
7456 #ifdef DOCUMENTATION
7457 
7460  const SgAsmElfDynamicEntryPtrList& get_entries() const;
7461  void set_entries(const SgAsmElfDynamicEntryPtrList&);
7463 #else
7464  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
7465  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
7466  NO_DELETE);
7467 #endif
7468 
7469  DECLARE_OTHERS(AsmElfDynamicEntryList);
7470 #if defined(SgAsmElfDynamicEntryList_OTHERS) || defined(DOCUMENTATION)
7471 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7472  private:
7473  friend class boost::serialization::access;
7474 
7475  template<class S>
7476  void serialize(S &s, const unsigned version) {
7477  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7478  s & BOOST_SERIALIZATION_NVP(p_entries);
7479  }
7480 #endif
7481 #endif // SgAsmElfDynamicEntryList_OTHERS
7482 
7483 #ifdef DOCUMENTATION
7484  };
7485 #endif
7486 
7488 
7489  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
7490  IS_SERIALIZABLE(AsmElfDynamicEntry);
7491 
7492 #ifdef DOCUMENTATION
7493 
7495  public:
7496 #endif
7497 
7498 #ifdef DOCUMENTATION
7499 
7504  EntryType get_d_tag() const;
7505  void set_d_tag(EntryType);
7507 #else
7508  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
7509  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7510 #endif
7511 
7512 #ifdef DOCUMENTATION
7513 
7518  rose_rva_t get_d_val() const;
7519  void set_d_val(rose_rva_t);
7521 #else
7522  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
7523  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7524 #endif
7525 
7526 #ifdef DOCUMENTATION
7527  // declared and documented below
7528 #else
7529  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
7530  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7531 #endif
7532 
7533 #ifdef DOCUMENTATION
7534 
7537  const SgUnsignedCharList& get_extra() const;
7538  void set_extra(const SgUnsignedCharList&);
7540 #else
7541  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7542  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7543 #endif
7544 
7545  DECLARE_OTHERS(AsmElfDynamicEntry);
7546 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
7547 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7548  private:
7549  friend class boost::serialization::access;
7550 
7551  template<class S>
7552  void serialize(S &s, const unsigned version) {
7553  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7554  s & BOOST_SERIALIZATION_NVP(p_d_tag);
7555  s & BOOST_SERIALIZATION_NVP(p_d_val);
7556  s & BOOST_SERIALIZATION_NVP(p_name);
7557  s & BOOST_SERIALIZATION_NVP(p_extra);
7558  }
7559 #endif
7560 
7561  public:
7562  enum EntryType { /* Type Executable SharedObj Purpose */
7563  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
7564  DT_NEEDED = 1, /* value optional optional Name of needed library */
7565  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
7566  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
7567  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
7568  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
7569  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
7570  DT_RELA = 7, /* pointer mandatory optional Relocation table */
7571  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
7572  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
7573  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
7574  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
7575  DT_INIT = 12, /* pointer optional optional Initialization function */
7576  DT_FINI = 13, /* pointer optional optional Termination function */
7577  DT_SONAME = 14, /* value ignored optional Name of shared object */
7578  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
7579  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
7580  DT_REL = 17, /* pointer mandatory optional Relocation table */
7581  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
7582  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
7583  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
7584  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
7585  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
7586  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
7587  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
7588  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
7589  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
7590  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
7591  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
7592  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
7593  DT_FLAGS = 30, /* value optional ? Bit flags */
7594  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
7595  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
7596  DT_NUM = 34, /* ? ? ? "number used"? */
7597 
7598  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
7599  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
7600  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
7601  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
7602  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
7603  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
7604  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
7605  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
7606  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
7607  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
7608  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
7609 
7610  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
7611  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
7612  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
7613  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
7614  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
7615  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
7616  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
7617  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
7618  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
7619  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
7620  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
7621 
7622  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
7623  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
7624  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
7625  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
7626  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
7627  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
7628  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
7629  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
7630 
7631  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
7632  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
7633  };
7634 
7635 #ifdef _MSC_VER
7636 # pragma pack (1)
7637 #endif
7638 
7641  uint32_t d_tag;
7642  uint32_t d_val;
7643  }
7644 #if !defined(SWIG) && !defined(_MSC_VER)
7645  __attribute__((packed))
7646 #endif
7647  ;
7648 
7650  uint64_t d_tag;
7651  uint64_t d_val;
7652  }
7653 #if !defined(SWIG) && !defined(_MSC_VER)
7654  __attribute__((packed))
7655 #endif
7656  ;
7657 
7658 #ifdef _MSC_VER
7659 # pragma pack ()
7660 #endif
7661 
7664  : p_d_tag(DT_NULL), p_name(NULL) {
7665  ctor(dynsec);
7666  }
7667 
7671  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);
7672  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*);
7678  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*) const;
7679  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*) const;
7683  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
7684 
7686  static std::string to_string(SgAsmElfDynamicEntry::EntryType);
7687 
7691  SgAsmGenericString* get_name() const { return p_name; }
7695  private:
7696  void ctor(SgAsmElfDynamicSection*);
7697 #endif // SgAsmElfDynamicEntry_OTHERS
7698 
7699 #ifdef DOCUMENTATION
7700  };
7701 #endif
7702 
7703 
7704 
7705 
7707 
7708  /*************************************************************************************************************************
7709  * ELF String Tables
7710  *************************************************************************************************************************/
7711 
7713 
7714  DECLARE_LEAF_CLASS(AsmElfStringSection);
7715  IS_SERIALIZABLE(AsmElfStringSection);
7716  AsmElfStringSection.setAutomaticGenerationOfDestructor(false);
7717 
7718 #ifdef DOCUMENTATION
7719 
7723  public:
7724 #endif
7725 
7726 #ifdef DOCUMENTATION
7727 
7732  SgAsmElfStrtab* get_strtab() const;
7733  void set_strtab(SgAsmElfStrtab*);
7735 #else
7736  AsmElfStringSection.setDataPrototype("SgAsmElfStrtab*", "strtab", "= NULL",
7737  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7738 #endif
7739 
7740  DECLARE_OTHERS(AsmElfStringSection);
7741 #if defined(SgAsmElfStringSection_OTHERS) || defined(DOCUMENTATION)
7742 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7743  private:
7744  friend class boost::serialization::access;
7745 
7746  template<class S>
7747  void serialize(S &s, const unsigned version) {
7748  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7749  s & BOOST_SERIALIZATION_NVP(p_strtab);
7750  }
7751 #endif
7752 
7753  public:
7756  : SgAsmElfSection(fhdr), p_strtab(NULL) {
7757  ctor();
7758  }
7759 
7761  virtual SgAsmElfStringSection *parse() $ROSE_OVERRIDE;
7762 
7764  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7765 
7770  virtual void set_size(rose_addr_t newsize) $ROSE_OVERRIDE;
7771 
7778  virtual bool reallocate() $ROSE_OVERRIDE;
7779 
7781  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7782 
7783  private:
7784  void ctor();
7785  void ctor(SgAsmElfSectionTable*);
7786 #endif // SgAsmElfStringSection_OTHERS
7787 
7788 #ifdef DOCUMENTATION
7789  };
7790 #endif
7791 
7793 
7794  DECLARE_LEAF_CLASS(AsmElfStrtab);
7795  IS_SERIALIZABLE(AsmElfStrtab);
7796  AsmElfStrtab.setAutomaticGenerationOfDestructor(false);
7797 
7798 #ifdef DOCUMENTATION
7799 
7800  class SgAsmElfStrtab: public SgAsmGenericStrtab {
7801  public:
7802 #endif
7803 
7804  DECLARE_OTHERS(AsmElfStrtab);
7805 #if defined(SgAsmElfStrtab_OTHERS) || defined(DOCUMENTATION)
7806 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7807  private:
7808  friend class boost::serialization::access;
7809 
7810  template<class S>
7811  void serialize(S &s, const unsigned version) {
7812  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericStrtab);
7813  }
7814 #endif
7815 
7816  public:
7820  explicit SgAsmElfStrtab(class SgAsmElfSection *containing_section)
7821  : SgAsmGenericStrtab(containing_section) {
7822  ctor();
7823  }
7824 
7831  virtual ~SgAsmElfStrtab();
7832 
7836  virtual SgAsmElfStrtab *parse() $ROSE_OVERRIDE;
7837 
7841  virtual void unparse(std::ostream&) const;
7842 
7848  virtual SgAsmStringStorage *create_storage(rose_addr_t offset, bool shared) $ROSE_OVERRIDE;
7849 
7853  virtual rose_addr_t get_storage_size(const SgAsmStringStorage*) $ROSE_OVERRIDE;
7854 
7864  virtual void allocate_overlap(SgAsmStringStorage*) $ROSE_OVERRIDE;
7865 
7867  virtual void rebind(SgAsmStringStorage*, rose_addr_t) $ROSE_OVERRIDE;
7868 
7869  private:
7870  void ctor();
7871 #endif // SgAsmElfStrtab_OTHERS
7872 
7873 #ifdef DOCUMENTATION
7874  };
7875 #endif
7876 
7877 
7878 
7879 
7881 
7882  /*************************************************************************************************************************
7883  * ELF Notes
7884  *************************************************************************************************************************/
7885 
7887 
7888  DECLARE_LEAF_CLASS(AsmElfNoteSection);
7889  IS_SERIALIZABLE(AsmElfNoteSection);
7890 
7891 #ifdef DOCUMENTATION
7893  public:
7894 #endif
7895 
7896 #ifdef DOCUMENTATION
7897 
7906 #else
7907  AsmElfNoteSection.setDataPrototype("SgAsmElfNoteEntryList*", "entries", "= NULL",
7908  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7909 #endif
7910 
7911  DECLARE_OTHERS(AsmElfNoteSection);
7912 #if defined(SgAsmElfNoteSection_OTHERS) || defined(DOCUMENTATION)
7913 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7914  private:
7915  friend class boost::serialization::access;
7916 
7917  template<class S>
7918  void serialize(S &s, const unsigned version) {
7919  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7920  s & BOOST_SERIALIZATION_NVP(p_entries);
7921  }
7922 #endif
7923 
7924  public:
7927  : SgAsmElfSection(fhdr) {
7928  ctor();
7929  }
7930  virtual SgAsmElfNoteSection *parse() $ROSE_OVERRIDE;
7931 
7933  virtual bool reallocate() $ROSE_OVERRIDE;
7934 
7936  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7937 
7939  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7940 
7941  private:
7942  void ctor();
7943 #endif // SgAsmElfNoteSection_OTHERS
7944 
7945 #ifdef DOCUMENTATION
7946  };
7947 #endif
7948 
7950 
7951  DECLARE_LEAF_CLASS(AsmElfNoteEntryList);
7952  IS_SERIALIZABLE(AsmElfNoteEntryList);
7953 
7954 #ifdef DOCUMENTATION
7955 
7960  public:
7961 #endif
7962 
7963 #ifdef DOCUMENTATION
7964 
7967  const SgAsmElfNoteEntryPtrList& get_entries() const;
7968  void set_entries(const SgAsmElfNoteEntryPtrList&);
7970 #else
7971  AsmElfNoteEntryList.setDataPrototype("SgAsmElfNoteEntryPtrList", "entries", "",
7972  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7973 #endif
7974 
7975  DECLARE_OTHERS(AsmElfNoteEntryList);
7976 #if defined(SgAsmElfNoteEntryList_OTHERS) || defined(DOCUMENTATION)
7977 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7978  private:
7979  friend class boost::serialization::access;
7980 
7981  template<class S>
7982  void serialize(S &s, const unsigned version) {
7983  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7984  s & BOOST_SERIALIZATION_NVP(p_entries);
7985  }
7986 #endif
7987 #endif // SgAsmElfNoteEntryList_OTHERS
7988 
7989 #ifdef DOCUMENTATION
7990  };
7991 #endif
7992 
7994 
7995  DECLARE_LEAF_CLASS(AsmElfNoteEntry);
7996  IS_SERIALIZABLE(AsmElfNoteEntry);
7997 
7998 #ifdef DOCUMENTATION
7999 
8001  public:
8002 #endif
8003 
8004 #ifdef DOCUMENTATION
8005 
8010  unsigned get_type() const;
8011  void set_type(unsigned);
8013 #else
8014  AsmElfNoteEntry.setDataPrototype("unsigned", "type", "= 0",
8015  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8016 #endif
8017 
8018 #ifdef DOCUMENTATION
8019  // documented below
8020 #else
8021  AsmElfNoteEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
8022  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8023 #endif
8024 
8025 #ifdef DOCUMENTATION
8026 
8031  const SgUnsignedCharList& get_payload() const;
8032  void set_payload(const SgUnsignedCharList&);
8034 #else
8035  AsmElfNoteEntry.setDataPrototype("SgUnsignedCharList", "payload", "",
8036  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8037 #endif
8038 
8039  DECLARE_OTHERS(AsmElfNoteEntry);
8040 #if defined(SgAsmElfNoteEntry_OTHERS) || defined(DOCUMENTATION)
8041 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8042  private:
8043  friend class boost::serialization::access;
8044 
8045  template<class S>
8046  void serialize(S &s, const unsigned version) {
8047  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8048  s & BOOST_SERIALIZATION_NVP(p_type);
8049  s & BOOST_SERIALIZATION_NVP(p_name);
8050  s & BOOST_SERIALIZATION_NVP(p_payload);
8051  }
8052 #endif
8053 
8054  public:
8057  : p_type(0), p_name(NULL) {
8058  ctor(section);
8059  }
8060 
8067  SgAsmGenericString *get_name() const;
8068  void set_name(SgAsmGenericString *name);
8074  rose_addr_t parse(rose_addr_t starting_offset);
8075 
8079  rose_addr_t unparse(std::ostream &f, rose_addr_t starting_offset);
8080 
8082  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
8083 
8087  void set_payload(const void*, size_t nbytes);
8088 
8090  rose_addr_t calculate_size() const;
8091 
8092  private:
8093  void ctor(SgAsmElfNoteSection *section);
8094 #endif // SgAsmElfNoteEntry_OTHERS
8095 
8096 #ifdef DOCUMENTATION
8097  };
8098 #endif
8099 
8100 
8101 
8103 
8104  /*************************************************************************************************************************
8105  * ELF Exception Handling
8106  *************************************************************************************************************************/
8107 
8109 
8110  DECLARE_LEAF_CLASS(AsmElfEHFrameSection);
8111  IS_SERIALIZABLE(AsmElfEHFrameSection);
8112 
8113 #ifdef DOCUMENTATION
8114 
8116  public:
8117 #endif
8118 
8119 #ifdef DOCUMENTATION
8120 
8129 #else
8130  AsmElfEHFrameSection.setDataPrototype("SgAsmElfEHFrameEntryCIList*", "ci_entries", "= NULL",
8131  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8132 #endif
8133 
8134  DECLARE_OTHERS(AsmElfEHFrameSection);
8135 #if defined(SgAsmElfEHFrameSection_OTHERS) || defined(DOCUMENTATION)
8136 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8137  private:
8138  friend class boost::serialization::access;
8139 
8140  template<class S>
8141  void serialize(S &s, const unsigned version) {
8142  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8143  s & BOOST_SERIALIZATION_NVP(p_ci_entries);
8144  }
8145 #endif
8146 
8147  public:
8150  : SgAsmElfSection(fhdr), p_ci_entries(NULL) {
8151  ctor();
8152  }
8153 
8155  virtual SgAsmElfEHFrameSection *parse() $ROSE_OVERRIDE;
8156 
8161  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
8162 
8164  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8165 
8170  rose_addr_t unparse(std::ostream*) const;
8171 
8173  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8174 
8175  private:
8176  void ctor();
8177 #endif // SgAsmElfEHFrameSection_OTHERS
8178 
8179 #ifdef DOCUMENTATION
8180  };
8181 #endif
8182 
8184 
8185  DECLARE_LEAF_CLASS(AsmElfEHFrameEntryCIList);
8186  IS_SERIALIZABLE(AsmElfEHFrameEntryCIList);
8187 
8188 #ifdef DOCUMENTATION
8189 
8194  public:
8195 #endif
8196 
8197 #ifdef DOCUMENTATION
8198 
8201  const SgAsmElfEHFrameEntryCIPtrList& get_entries() const;
8202  void set_entries(const SgAsmElfEHFrameEntryCIPtrList&);
8204 #else
8205  AsmElfEHFrameEntryCIList.setDataPrototype("SgAsmElfEHFrameEntryCIPtrList", "entries", "",
8206  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
8207  NO_DELETE);
8208 #endif
8209 
8210  DECLARE_OTHERS(AsmElfEHFrameEntryCIList);
8211 #if defined(SgAsmElfEHFrameEntryCIList_OTHERS) || defined(DOCUMENTATION)
8212 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8213  private:
8214  friend class boost::serialization::access;
8215 
8216  template<class S>