ROSE  0.9.10.91
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  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
488  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
489  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
490  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
491  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
492  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
493 #endif // SgAsmPowerpcInstruction_OTHERS
494 #ifdef DOCUMENTATION
495  };
496 #endif
497 
498 
500 
501  DECLARE_LEAF_CLASS(AsmMipsInstruction);
502  IS_SERIALIZABLE(AsmMipsInstruction);
503  DECLARE_HEADERS(AsmMipsInstruction);
504 #if defined(SgAsmMipsInstruction_HEADERS) || defined(DOCUMENTATION)
505  #include <InstructionEnumsMips.h>
506 #endif // SgAsmMipsInstruction_HEADERS
507 
508 #ifdef DOCUMENTATION
509 
511  public:
512 #endif
513 
514 #ifdef DOCUMENTATION
515 
521  MipsInstructionKind get_kind() const;
522  void set_kind(MipsInstructionKind);
524 #else
525  AsmMipsInstruction.setDataPrototype("MipsInstructionKind", "kind", "= mips_unknown_instruction",
526  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
527  COPY_DATA);
528 #endif
529 
530  DECLARE_OTHERS(AsmMipsInstruction);
531 #if defined(SgAsmMipsInstruction_OTHERS) || defined(DOCUMENTATION)
532 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
533  private:
534  friend class boost::serialization::access;
535 
536  template<class S>
537  void serialize(S &s, const unsigned /*version*/) {
538  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
539  s & BOOST_SERIALIZATION_NVP(p_kind);
540  }
541 #endif
542 
543  public:
544  // Overrides are documented in the base class
545  virtual std::string description() const $ROSE_OVERRIDE;
546  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
547  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
548  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
549  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
550  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
551  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
552  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
553  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
554  virtual bool isUnknown() const $ROSE_OVERRIDE;
555  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
556  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
557 #endif // SgAsmMipsInstruction_OTHERS
558 #ifdef DOCUMENTATION
559  };
560 #endif
561 
563 
564  DECLARE_LEAF_CLASS(AsmM68kInstruction);
565  IS_SERIALIZABLE(AsmM68kInstruction);
566  DECLARE_HEADERS(AsmM68kInstruction);
567 #if defined(SgAsmM68kInstruction_HEADERS) || defined(DOCUMENTATION)
568  #include "InstructionEnumsM68k.h"
569 #endif // SgAsmM68kInstruction_HEADERS
570 
571 #ifdef DOCUMENTATION
573  public:
574 #endif
575 
576 #ifdef DOCUMENTATION
577 
583  M68kInstructionKind get_kind() const;
584  void set_kind(M68kInstructionKind);
586 #else
587  AsmM68kInstruction.setDataPrototype("M68kInstructionKind", "kind", " = m68k_unknown_instruction",
588  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
589  COPY_DATA);
590 #endif
591 
592  DECLARE_OTHERS(AsmM68kInstruction);
593 #if defined(SgAsmM68kInstruction_OTHERS) || defined(DOCUMENTATION)
594 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
595  private:
596  friend class boost::serialization::access;
597 
598  template<class S>
599  void serialize(S &s, const unsigned /*version*/) {
600  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
601  s & BOOST_SERIALIZATION_NVP(p_kind);
602  }
603 #endif
604 
605  public:
606  // Overrides are documented in the base class
607  virtual std::string description() const $ROSE_OVERRIDE;
608  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
609  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
610  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
611  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
612  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
613  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
614  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
615  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
616  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
617  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*>&,
618  bool* complete,
619  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
620  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
621  virtual bool isUnknown() const $ROSE_OVERRIDE;
622  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
623 #endif // SgAsmM68kInstruction_OTHERS
624 #ifdef DOCUMENTATION
625  };
626 #endif
627 
629 
630  NEW_NONTERMINAL_MACRO(AsmInstruction,
631  AsmX86Instruction | AsmArmInstruction | AsmPowerpcInstruction | AsmMipsInstruction |
632  AsmM68kInstruction,
633  "AsmInstruction", "AsmInstructionTag", true);
634  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
635  IS_SERIALIZABLE(AsmInstruction);
636 
637  DECLARE_HEADERS(AsmInstruction);
638 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
639  #include <MemoryMap.h>
640 #endif // SgAsmInstruction_HEADERS
641 
642 #ifdef DOCUMENTATION
643 
665  public:
666 #endif
667 
668 #ifdef DOCUMENTATION
669 
677  const std::string& get_mnemonic() const;
678  void set_mnemonic(const std::string&);
680 #else
681  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
682  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
683 #endif
684 
685 #ifdef DOCUMENTATION
686 
691  const SgUnsignedList& get_raw_bytes() const;
692  void set_raw_bytes(const SgUnsignedList&);
694 #else
695  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
696  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
697 #endif
698 
699 #ifdef DOCUMENTATION
700 
709 #else
710  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
711  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
712 #endif
713 
714 #ifdef DOCUMENTATION
715  // FIXME[Robb P Matzke 2017-02-13]: unused?
716 #else
717  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
718  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
719 #endif
720 
721 #ifdef DOCUMENTATION
722 
728  int64_t get_stackDeltaIn() const;
729  void set_stackDeltaIn(int64_t);
731 #else
732  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
733  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
734 #endif
735 
736 #ifdef DOCUMENTATION
737  // FIXME[Robb P Matzke 2017-02-13]: unused?
738 #else
739  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
740  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
741 #endif
742 
743  DECLARE_OTHERS(AsmInstruction);
744 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
745 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
746  private:
747  friend class boost::serialization::access;
748 
749  template<class S>
750  void serialize(S &s, const unsigned /*version*/) {
751  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
752  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
753  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
754  s & BOOST_SERIALIZATION_NVP(p_operandList);
755  s & BOOST_SERIALIZATION_NVP(p_sources);
756  }
757 #endif
758 
759  public:
764  static const int64_t INVALID_STACK_DELTA;
765 
771  virtual std::string description() const { return ""; }
772 
773  // FIXME[Robb P Matzke 2017-02-13]: unused?
774  void appendSources( SgAsmInstruction* instruction );
775 
777  size_t nOperands() const;
778 
782  SgAsmExpression* operand(size_t) const;
783 
790  virtual bool terminatesBasicBlock();
791 
805  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
806  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
818  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
819  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
825  bool isFirstInBlock();
826 
830  bool isLastInBlock();
831 
836  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
837 
972  virtual bool hasEffect();
973 
982  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
983  bool relax_stack_semantics=false);
984 
994  virtual std::vector<std::pair<size_t,size_t> >
995  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
996  bool relax_stack_semantics=false);
997 
1004  virtual std::set<rose_addr_t> getSuccessors(bool* complete); /*subclasses must redefine*/
1005 
1014  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1015  bool *complete,
1016  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1018 
1024  virtual size_t get_size() const;
1025 
1031  virtual bool isUnknown() const;
1032 
1066  virtual unsigned get_anyKind() const;
1067 
1071  virtual std::string toString() const;
1072 
1073 #endif // SgAsmInstruction_OTHERS
1074 
1075 #ifdef DOCUMENTATION
1076  };
1077 #endif
1078 
1079 
1080 
1082 
1083  /**************************************************************************************************************************
1084  * Instruction Expressions
1085  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1086  **************************************************************************************************************************/
1087 
1089 
1090  DECLARE_LEAF_CLASS(AsmOperandList);
1091  IS_SERIALIZABLE(AsmOperandList);
1092 
1093 #ifdef DOCUMENTATION
1094 
1095  class SgAsmOperandList: public SgAsmNode {
1096  public:
1097 #endif
1098 
1099 #ifdef DOCUMENTATION
1100 
1106  const SgAsmExpressionPtrList& get_operands() const;
1107  void set_oerands(const SgAsmExpressionPtrList&);
1109 #else
1110  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1111  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1112 #endif
1113 
1114  DECLARE_OTHERS(AsmOperandList);
1115 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1116 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1117  private:
1118  friend class boost::serialization::access;
1119 
1120  template<class S>
1121  void serialize(S &s, const unsigned /*version*/) {
1122  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1123  s & BOOST_SERIALIZATION_NVP(p_operands);
1124  }
1125 #endif
1126 
1127  public:
1129  void append_operand(SgAsmExpression* operand);
1130 #endif // SgAsmOperandList_OTHERS
1131 
1132 #ifdef DOCUMENTATION
1133  };
1134 #endif
1135 
1136  // FIXME[Robb P Matzke 2016-10-31]
1137  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1138 
1140 
1141  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1142  IS_SERIALIZABLE(AsmBinaryAdd);
1143 
1144 #ifdef DOCUMENTATION
1145 
1147  public:
1148 #endif
1149 
1150  DECLARE_OTHERS(AsmBinaryAdd);
1151 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1152 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1153  private:
1154  friend class boost::serialization::access;
1155 
1156  template<class S>
1157  void serialize(S &s, const unsigned /*version*/) {
1158  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1159  }
1160 #endif
1161 #endif // SgAsmBinaryAdd_OTHERS
1162 
1163 #ifdef DOCUMENTATION
1164  };
1165 #endif
1166 
1168 
1169  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1170  IS_SERIALIZABLE(AsmBinarySubtract);
1171 
1172 #ifdef DOCUMENTATION
1173 
1175  public:
1176 #endif
1177 
1178  DECLARE_OTHERS(AsmBinarySubtract);
1179 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1180 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1181  private:
1182  friend class boost::serialization::access;
1183 
1184  template<class S>
1185  void serialize(S &s, const unsigned /*version*/) {
1186  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1187  }
1188 #endif
1189 #endif // SgAsmBinarySubtract_OTHERS
1190 
1191 #ifdef DOCUMENTATION
1192  };
1193 #endif
1194 
1196 
1197  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1198  IS_SERIALIZABLE(AsmBinaryMultiply);
1199 
1200 #ifdef DOCUMENTATION
1201 
1203  public:
1204 #endif
1205 
1206  DECLARE_OTHERS(AsmBinaryMultiply);
1207 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1208 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1209  private:
1210  friend class boost::serialization::access;
1211 
1212  template<class S>
1213  void serialize(S &s, const unsigned /*version*/) {
1214  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1215  }
1216 #endif
1217 #endif // SgAsmBinaryMultiply_OTHERS
1218 
1219 #ifdef DOCUMENTATION
1220  };
1221 #endif
1222 
1224 
1225  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1226  IS_SERIALIZABLE(AsmBinaryDivide);
1227 
1228 #ifdef DOCUMENTATION
1229 
1231  public:
1232 #endif
1233 
1234  DECLARE_OTHERS(AsmBinaryDivide);
1235 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1236 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1237  private:
1238  friend class boost::serialization::access;
1239 
1240  template<class S>
1241  void serialize(S &s, const unsigned /*version*/) {
1242  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1243  }
1244 #endif
1245 #endif // SgAsmBinaryDivide_OTHERS
1246 
1247 #ifdef DOCUMENTATION
1248  };
1249 #endif
1250 
1252 
1253  DECLARE_LEAF_CLASS(AsmBinaryMod);
1254  IS_SERIALIZABLE(AsmBinaryMod);
1255 
1256 #ifdef DOCUMENTATION
1257 
1259  public:
1260 #endif
1261 
1262  DECLARE_OTHERS(AsmBinaryMod);
1263 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1264 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1265  private:
1266  friend class boost::serialization::access;
1267 
1268  template<class S>
1269  void serialize(S &s, const unsigned /*version*/) {
1270  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1271  }
1272 #endif
1273 #endif // SgAsmBinaryMod_OTHERS
1274 
1275 #ifdef DOCUMENTATION
1276  };
1277 #endif
1278 
1280 
1281  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1282  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1283 
1284 #ifdef DOCUMENTATION
1285 
1287  public:
1288 #endif
1289 
1290  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1291 #if defined(SgAsmBinaryAddPreupdate_OTHERS) || defined(DOCUMENTATION)
1292 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1293  private:
1294  friend class boost::serialization::access;
1295 
1296  template<class S>
1297  void serialize(S &s, const unsigned /*version*/) {
1298  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1299  }
1300 #endif
1301 #endif // SgAsmBinaryAddPreupdate_OTHERS
1302 
1303 #ifdef DOCUMENTATION
1304  };
1305 #endif
1306 
1308 
1309  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1310  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1311 
1312 #ifdef DOCUMENTATION
1313 
1315  public:
1316 #endif
1317 
1318  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1319 #if defined(SgAsmBinarySubtractPreupdate_OTHERS) || defined(DOCUMENTATION)
1320 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1321  private:
1322  friend class boost::serialization::access;
1323 
1324  template<class S>
1325  void serialize(S &s, const unsigned /*version*/) {
1326  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1327  }
1328 #endif
1329 #endif // SgAsmBinarySubtractPreupdate_OTHERS
1330 
1331 #ifdef DOCUMENTATION
1332  };
1333 #endif
1334 
1336 
1337  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1338  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1339 
1340 #ifdef DOCUMENTATION
1341 
1343  public:
1344 #endif
1345 
1346  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1347 #if defined(SgAsmBinaryAddPostupdate_OTHERS) || defined(DOCUMENTATION)
1348 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1349  private:
1350  friend class boost::serialization::access;
1351 
1352  template<class S>
1353  void serialize(S &s, const unsigned /*version*/) {
1354  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1355  }
1356 #endif
1357 #endif // SgAsmBinaryAddPostupdate_OTHERS
1358 
1359 #ifdef DOCUMENTATION
1360  };
1361 #endif
1362 
1364 
1365  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1366  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1367 
1368 #ifdef DOCUMENTATION
1369 
1371  public:
1372 #endif
1373 
1374  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1375 #if defined(SgAsmBinarySubtractPostupdate_OTHERS) || defined(DOCUMENTATION)
1376 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1377  private:
1378  friend class boost::serialization::access;
1379 
1380  template<class S>
1381  void serialize(S &s, const unsigned /*version*/) {
1382  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1383  }
1384 #endif
1385 #endif // SgAsmBinarySubtractPostupdate_OTHERS
1386 
1387 #ifdef DOCUMENTATION
1388  };
1389 #endif
1390 
1392 
1393  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1394  IS_SERIALIZABLE(AsmBinaryLsl);
1395 
1396 #ifdef DOCUMENTATION
1397 
1399  public:
1400 #endif
1401 
1402  DECLARE_OTHERS(AsmBinaryLsl);
1403 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1404 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1405  private:
1406  friend class boost::serialization::access;
1407 
1408  template<class S>
1409  void serialize(S &s, const unsigned /*version*/) {
1410  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1411  }
1412 #endif
1413 #endif // SgAsmBinaryLsl_OTHERS
1414 
1415 #ifdef DOCUMENTATION
1416  };
1417 #endif
1418 
1420 
1421  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1422  IS_SERIALIZABLE(AsmBinaryLsr);
1423 
1424 #ifdef DOCUMENTATION
1425 
1427  public:
1428 #endif
1429 
1430  DECLARE_OTHERS(AsmBinaryLsr);
1431 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1432 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1433  private:
1434  friend class boost::serialization::access;
1435 
1436  template<class S>
1437  void serialize(S &s, const unsigned /*version*/) {
1438  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1439  }
1440 #endif
1441 #endif // SgAsmBinaryLsr_OTHERS
1442 
1443 #ifdef DOCUMENTATION
1444  };
1445 #endif
1446 
1448 
1449  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1450  IS_SERIALIZABLE(AsmBinaryAsr);
1451 
1452 #ifdef DOCUMENTATION
1453 
1455  public:
1456 #endif
1457 
1458  DECLARE_OTHERS(AsmBinaryAsr);
1459 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1460 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1461  private:
1462  friend class boost::serialization::access;
1463 
1464  template<class S>
1465  void serialize(S &s, const unsigned /*version*/) {
1466  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1467  }
1468 #endif
1469 #endif // SgAsmBinaryAsr_OTHERS
1470 
1471 #ifdef DOCUMENTATION
1472  };
1473 #endif
1474 
1476 
1477  DECLARE_LEAF_CLASS(AsmBinaryRor);
1478  IS_SERIALIZABLE(AsmBinaryRor);
1479 
1480 #ifdef DOCUMENTATION
1481 
1483  public:
1484 #endif
1485 
1486  DECLARE_OTHERS(AsmBinaryRor);
1487 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1488 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1489  private:
1490  friend class boost::serialization::access;
1491 
1492  template<class S>
1493  void serialize(S &s, const unsigned /*version*/) {
1494  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1495  }
1496 #endif
1497 #endif // SgAsmBinaryRor_OTHERS
1498 
1499 #ifdef DOCUMENTATION
1500  };
1501 #endif
1502 
1504 
1505  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1506  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1507  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1508  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1509  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1510  AsmBinaryRor,
1511  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1512  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1513  IS_SERIALIZABLE(AsmBinaryExpression);
1514 
1515 #ifdef DOCUMENTATION
1516 
1518  public:
1519 #endif
1520 
1521 #ifdef DOCUMENTATION
1522 
1525  SgAsmExpression* get_lhs() const;
1526  void set_lhs(SgAsmExpression*);
1528 #else
1529  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1530  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1531 #endif
1532 
1533 #ifdef DOCUMENTATION
1534 
1537  SgAsmExpression* get_rhs() const;
1538  void set_rhs(SgAsmExpression*);
1540 #else
1541  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1542  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1543 #endif
1544 
1545  DECLARE_OTHERS(AsmBinaryExpression);
1546 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1547 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1548  private:
1549  friend class boost::serialization::access;
1550 
1551  template<class S>
1552  void serialize(S &s, const unsigned /*version*/) {
1553  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1554  s & BOOST_SERIALIZATION_NVP(p_lhs);
1555  s & BOOST_SERIALIZATION_NVP(p_rhs);
1556  }
1557 #endif
1558 #endif // SgAsmBinaryExpression_OTHERS
1559 
1560 #ifdef DOCUMENTATION
1561  };
1562 #endif
1563 
1565 
1566  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1567  IS_SERIALIZABLE(AsmUnaryPlus);
1568 
1569 #ifdef DOCUMENTATION
1570 
1572  public:
1573 #endif
1574 
1575  DECLARE_OTHERS(AsmUnaryPlus);
1576 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1577 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1578  private:
1579  friend class boost::serialization::access;
1580 
1581  template<class S>
1582  void serialize(S &s, const unsigned /*version*/) {
1583  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1584  }
1585 #endif
1586 #endif // SgAsmUnaryPlus_OTHERS
1587 
1588 #ifdef DOCUMENTATION
1589  };
1590 #endif
1591 
1593 
1594  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1595  IS_SERIALIZABLE(AsmUnaryMinus);
1596 
1597 #ifdef DOCUMENTATION
1598 
1600  public:
1601 #endif
1602 
1603  DECLARE_OTHERS(AsmUnaryMinus);
1604 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1605 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1606  private:
1607  friend class boost::serialization::access;
1608 
1609  template<class S>
1610  void serialize(S &s, const unsigned /*version*/) {
1611  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1612  }
1613 #endif
1614 #endif // SgAsmUnaryMinus_OTHERS
1615 
1616 #ifdef DOCUMENTATION
1617  };
1618 #endif
1619 
1621 
1622  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1623  IS_SERIALIZABLE(AsmUnaryRrx);
1624 
1625 #ifdef DOCUMENTATION
1626  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1628  public:
1629 #endif
1630 
1631  DECLARE_OTHERS(AsmUnaryRrx);
1632 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1633 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1634  private:
1635  friend class boost::serialization::access;
1636 
1637  template<class S>
1638  void serialize(S &s, const unsigned /*version*/) {
1639  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1640  }
1641 #endif
1642 #endif // SgAsmUnaryRrx_OTHERS
1643 
1644 #ifdef DOCUMENTATION
1645  };
1646 #endif
1647 
1649 
1650  DECLARE_LEAF_CLASS(AsmUnaryArmSpecialRegisterList);
1651  IS_SERIALIZABLE(AsmUnaryArmSpecialRegisterList);
1652 
1653 #ifdef DOCUMENTATION
1654  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1656  public:
1657 #endif
1658 
1659  DECLARE_OTHERS(AsmUnaryArmSpecialRegisterList);
1660 #if defined(SgAsmUnaryArmSpecialRegisterList_OTHERS) || defined(DOCUMENTATION)
1661 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1662  private:
1663  friend class boost::serialization::access;
1664 
1665  template<class S>
1666  void serialize(S &s, const unsigned /*version*/) {
1667  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1668  }
1669 #endif
1670 #endif // SgAsmUnaryArmSpecialRegisterList_OTHERS
1671 
1672 #ifdef DOCUMENTATION
1673  };
1674 #endif
1675 
1677 
1678  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
1679  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryArmSpecialRegisterList,
1680  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
1681  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1682  IS_SERIALIZABLE(AsmUnaryExpression);
1683 
1684 #ifdef DOCUMENTATION
1685 
1687  public:
1688 #endif
1689 
1690 #ifdef DOCUMENTATION
1691 
1694  SgAsmExpression* get_operand() const;
1697 #else
1698  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
1699  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1700 #endif
1701 
1702  DECLARE_OTHERS(AsmUnaryExpression);
1703 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
1704 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1705  private:
1706  friend class boost::serialization::access;
1707 
1708  template<class S>
1709  void serialize(S &s, const unsigned /*version*/) {
1710  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1711  s & BOOST_SERIALIZATION_NVP(p_operand);
1712  }
1713 #endif
1714 #endif // SgAsmUnaryExpression_OTHERS
1715 
1716 #ifdef DOCUMENTATION
1717  };
1718 #endif
1719 
1721 
1722  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
1723  IS_SERIALIZABLE(AsmDirectRegisterExpression);
1724 
1725 #ifdef DOCUMENTATION
1726 
1728  public:
1729 #endif
1730 
1731 #ifdef DOCUMENTATION
1732 
1735  unsigned get_psr_mask() const;
1736  void set_psr_mask(unsigned);
1738 #else
1739  AsmDirectRegisterExpression.setDataPrototype("unsigned", "psr_mask", "=0", // for ARM
1740  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1741  NO_DELETE);
1742 #endif
1743 
1744  DECLARE_OTHERS(AsmDirectRegisterExpression);
1745 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1746 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1747  private:
1748  friend class boost::serialization::access;
1749 
1750  template<class S>
1751  void serialize(S &s, const unsigned /*version*/) {
1752  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1753  s & BOOST_SERIALIZATION_NVP(p_psr_mask);
1754  }
1755 #endif
1756 
1757  private:
1758  // Default c'tor needed for serialization
1760  : p_psr_mask(0) {}
1761 #endif // SgAsmDirectRegisterExpression_OTHERS
1762 
1763 #ifdef DOCUMENTATION
1764  };
1765 #endif
1766 
1768 
1769  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
1770  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
1771 
1772 #ifdef DOCUMENTATION
1773 
1790  public:
1791 #endif
1792 
1793 #ifdef DOCUMENTATION
1794 
1802 #else
1803  AsmIndirectRegisterExpression.setDataPrototype("RegisterDescriptor", "stride", "",
1804  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1805 #endif
1806 
1807 #ifdef DOCUMENTATION
1808 
1816 #else
1817  AsmIndirectRegisterExpression.setDataPrototype("RegisterDescriptor", "offset", "",
1818  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1819 #endif
1820 
1821 #ifdef DOCUMENTATION
1822 
1827  size_t get_index() const;
1828  void set_index(size_t);
1830 #else
1831  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
1832  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1833 #endif
1834 
1835 #ifdef DOCUMENTATION
1836 
1841  size_t get_modulus() const;
1842  void set_modulus(size_t);
1844 #else
1845  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
1846  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1847 #endif
1848 
1849  DECLARE_OTHERS(AsmIndirectRegisterExpression);
1850 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1851 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1852  private:
1853  friend class boost::serialization::access;
1854 
1855  template<class S>
1856  void serialize(S &s, const unsigned /*version*/) {
1857  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1858  s & BOOST_SERIALIZATION_NVP(p_stride);
1859  s & BOOST_SERIALIZATION_NVP(p_offset);
1860  s & BOOST_SERIALIZATION_NVP(p_index);
1861  s & BOOST_SERIALIZATION_NVP(p_modulus);
1862  }
1863 #endif
1864 
1865  private:
1866  // Default c'tor needed for serialization
1868  : p_index(0), p_modulus(0) {}
1869 #endif // SgAsmIndirectRegisterExpression_OTHERS
1870 
1871 #ifdef DOCUMENTATION
1872  };
1873 #endif
1874 
1876 
1877  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
1878  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
1879  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
1880  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
1881 
1882 #ifdef DOCUMENTATION
1883 
1885  public:
1886 #endif
1887 
1888 #ifdef DOCUMENTATION
1889 
1895 #else
1896  AsmRegisterReferenceExpression.setDataPrototype("RegisterDescriptor", "descriptor", "",
1897  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1898 #endif
1899 
1900 #ifdef DOCUMENTATION
1901 
1906  int get_adjustment() const;
1907  void set_adjustment(int);
1909 #else
1910  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
1911  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1912  NO_DELETE);
1913 #endif
1914 
1915  DECLARE_OTHERS(AsmRegisterReferenceExpression);
1916 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
1917 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1918  private:
1919  friend class boost::serialization::access;
1920 
1921  template<class S>
1922  void serialize(S &s, const unsigned /*version*/) {
1923  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1924  s & BOOST_SERIALIZATION_NVP(p_descriptor);
1925  s & BOOST_SERIALIZATION_NVP(p_adjustment);
1926  }
1927 #endif
1928 
1929  protected:
1930  // Default c'tor needed for serialization
1932  : p_adjustment(0) {}
1933 #endif // SgAsmRegisterReferenceExpression_OTHERS
1934 
1935 #ifdef DOCUMENTATION
1936  };
1937 #endif
1938 
1940 
1941  DECLARE_LEAF_CLASS(AsmRegisterNames);
1942  IS_SERIALIZABLE(AsmRegisterNames);
1943 
1944 #ifdef DOCUMENTATION
1945 
1947  public:
1948 #endif
1949 
1950 #ifdef DOCUMENTATION
1951 
1957  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
1958  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
1960 #else
1961  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
1962  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1963 #endif
1964 
1965 #ifdef DOCUMENTATION
1966 
1972  unsigned get_mask() const;
1973  void set_mask(unsigned);
1975 #else
1976  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
1977  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1978 #endif
1979 
1980  DECLARE_OTHERS(AsmRegisterNames);
1981 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
1982 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1983  private:
1984  friend class boost::serialization::access;
1985 
1986  template<class S>
1987  void serialize(S &s, const unsigned /*version*/) {
1988  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1989  s & BOOST_SERIALIZATION_NVP(p_registers);
1990  s & BOOST_SERIALIZATION_NVP(p_mask);
1991  }
1992 #endif
1993 #endif // SgAsmRegisterNames_OTHERS
1994 
1995 #ifdef DOCUMENTATION
1996  };
1997 #endif
1998 
2000 
2001  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2002  IS_SERIALIZABLE(AsmIntegerValueExpression);
2003 
2004 #ifdef DOCUMENTATION
2005 
2021  public:
2022 #endif
2023 
2024 #ifdef DOCUMENTATION
2025 
2035  SgNode* get_baseNode() const;
2036  void set_baseNode(SgNode*);
2038 #else
2039  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2040  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2041 #endif
2042 
2043  DECLARE_OTHERS(AsmIntegerValueExpression);
2044 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2045 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2046  private:
2047  friend class boost::serialization::access;
2048 
2049  template<class S>
2050  void serialize(S &s, const unsigned /*version*/) {
2051  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2052  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2053  }
2054 #endif
2055 
2056  public:
2061  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2062 
2069 
2071  static uint64_t virtualAddress(SgNode*);
2072 
2092  std::string get_label(bool quiet=false) const;
2093 
2095  size_t get_significantBits() const;
2096 
2102  void makeRelativeTo(SgNode *baseNode);
2103 
2108  uint64_t get_baseAddress() const;
2109 
2115  uint64_t get_absoluteValue(size_t nbits=0) const;
2116 
2120  void set_absoluteValue(uint64_t);
2121 
2123  int64_t get_signedValue() const;
2124 
2128  int64_t get_relativeValue() const;
2129 
2134  void set_relativeValue(int64_t v, size_t nbits=64);
2135 
2136  uint64_t get_value() const { return get_absoluteValue(); }
2137 
2138  // These are deprecated; use CamelCase versions instead [Robb P. Matzke 2014-07-21]
2139  size_t get_significant_bits() const ROSE_DEPRECATED("use get_significantBits");
2140  void make_relative_to(SgNode*) ROSE_DEPRECATED("use makeRelativeTo");
2141  uint64_t get_base_address() const ROSE_DEPRECATED("use get_baseAddress");
2142  uint64_t get_absolute_value(size_t nbits=0) const ROSE_DEPRECATED("use get_absoluteValue");
2143  void set_absolute_value(uint64_t) ROSE_DEPRECATED("use set_absoluteValue");
2144  int64_t get_signed_value() const ROSE_DEPRECATED("use set_signedValue");
2145  int64_t get_relative_value() const ROSE_DEPRECATED("use get_relativeValue");
2146  void set_relative_value(int64_t, size_t nbits=64) ROSE_DEPRECATED("use set_relativeValue");
2147 #endif // SgAsmIntegerValueExpression_OTHERS
2148 
2149 #ifdef DOCUMENTATION
2150  };
2151 #endif
2152 
2154 
2155  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2156  IS_SERIALIZABLE(AsmFloatValueExpression);
2157 
2158 #ifdef DOCUMENTATION
2159 
2164  public:
2165 #endif
2166 
2167  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2168 
2169  DECLARE_OTHERS(AsmFloatValueExpression);
2170 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2171  private:
2172  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2173  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2174  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2175  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2176  // understand "mutable".
2177  mutable double p_nativeValue;
2178  mutable bool p_nativeValueIsValid;
2179 
2180 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2181  private:
2182  friend class boost::serialization::access;
2183 
2184  template<class S>
2185  void serialize(S &s, const unsigned /*version*/) {
2186  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2187  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2188  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2189  }
2190 #endif
2191 
2192  public:
2197  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2198 
2204  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2205 
2212 
2214  void set_nativeValue(double);
2215 
2217  double get_nativeValue() const;
2218 
2223  void updateBitVector();
2224 
2229  void updateNativeValue() const;
2230 #endif // SgAsmFloatValueExpression_OTHERS
2231 
2232 #ifdef DOCUMENTATION
2233  };
2234 #endif
2235 
2237 
2238  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2239  AsmIntegerValueExpression | AsmFloatValueExpression,
2240  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2241  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2242  IS_SERIALIZABLE(AsmConstantExpression);
2243 
2244  DECLARE_HEADERS(AsmConstantExpression);
2245 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2246  #include <Sawyer/BitVector.h>
2247 #endif // SgAsmConstantExpression_HEADERS
2248 
2249 #ifdef DOCUMENTATION
2250 
2255  public:
2256 #endif
2257 
2258 #ifndef DOCUMENTATION
2259  // Documented below. Implemented below due to ROSETTA limitations.
2260  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2261  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2262 #endif
2263 
2264  DECLARE_OTHERS(AsmConstantExpression);
2265 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2266 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2267  private:
2268  friend class boost::serialization::access;
2269 
2270  template<class S>
2271  void serialize(S &s, const unsigned /*version*/) {
2272  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2273  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2274  }
2275 #endif
2276 
2277  public:
2283  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2284  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2285  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2287 #endif // SgAsmConstantExpression_OTHERS
2288 
2289 #ifdef DOCUMENTATION
2290  };
2291 #endif
2292 
2294 
2295  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2296  AsmConstantExpression,
2297  "AsmValueExpression", "AsmValueExpressionTag", false);
2298  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2299  IS_SERIALIZABLE(AsmValueExpression);
2300 
2301 #ifdef DOCUMENTATION
2302 
2310  public:
2311 #endif
2312 
2313 #ifdef DOCUMENTATION
2314 
2324 #else
2325  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
2326  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2327 #endif
2328 
2329 #ifdef DOCUMENTATION
2330 
2338  unsigned short get_bit_offset() const;
2339  void set_bit_offset(unsigned short);
2341 #else
2342  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
2343  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2344 #endif
2345 
2346 #ifdef DOCUMENTATION
2347 
2353  unsigned short get_bit_size() const;
2354  void set_bit_size(unsigned short);
2356 #else
2357  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
2358  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2359 #endif
2360 
2361 #ifdef DOCUMENTATION
2362 
2368  SgSymbol* get_symbol() const;
2369  void set_symbol(SgSymbol*);
2371 #else
2372  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
2373  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2374 #endif
2375 
2376  DECLARE_OTHERS(AsmValueExpression);
2377 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
2378 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2379  private:
2380  friend class boost::serialization::access;
2381 
2382  template<class S>
2383  void serialize(S &s, const unsigned /*version*/) {
2384  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2385  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
2386  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
2387  s & BOOST_SERIALIZATION_NVP(p_bit_size);
2388 #if 1
2389  ASSERT_require2(p_symbol == NULL, "not implemented yet");
2390 #else
2391  s & BOOST_SERIALIZATION_NVP(p_symbol);
2392 #endif
2393  }
2394 #endif
2395 #endif // SgAsmValueExpression_OTHERS
2396 
2397 #ifdef DOCUMENTATION
2398  };
2399 #endif
2400 
2402 
2403  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
2404  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
2405 
2406 #ifdef DOCUMENTATION
2407 
2409  public:
2410 #endif
2411 
2412 #ifdef DOCUMENTATION
2413 
2420  SgAsmExpression* get_address() const;
2423 #else
2424  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
2425  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2426 #endif
2427 
2428 #ifdef DOCUMENTATION
2429 
2436  SgAsmExpression* get_segment() const;
2439 #else
2440  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
2441  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2442 #endif
2443 
2444  DECLARE_OTHERS(AsmMemoryReferenceExpression);
2445 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2446 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2447  private:
2448  friend class boost::serialization::access;
2449 
2450  template<class S>
2451  void serialize(S &s, const unsigned /*version*/) {
2452  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2453  s & BOOST_SERIALIZATION_NVP(p_address);
2454  s & BOOST_SERIALIZATION_NVP(p_segment);
2455  }
2456 #endif
2457 #endif // SgAsmMemoryReferenceExpression_OTHERS
2458 
2459 #ifdef DOCUMENTATION
2460  };
2461 #endif
2462 
2464 
2465  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
2466  IS_SERIALIZABLE(AsmControlFlagsExpression);
2467 
2468 #ifdef DOCUMENTATION
2469  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2471  public:
2472 #endif
2473 
2474 #ifndef DOCUMENTATION
2475  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
2476  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2477 #endif
2478 
2479  DECLARE_OTHERS(AsmControlFlagsExpression);
2480 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
2481 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2482  private:
2483  friend class boost::serialization::access;
2484 
2485  template<class S>
2486  void serialize(S &s, const unsigned /*version*/) {
2487  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2488  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
2489  }
2490 #endif
2491 #endif // SgAsmControlFlagsExpression_OTHERS
2492 
2493 #ifdef DOCUMENTATION
2494  };
2495 #endif
2496 
2498 
2499  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
2500  IS_SERIALIZABLE(AsmCommonSubExpression);
2501 
2502 #ifdef DOCUMENTATION
2503  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2505  public:
2506 #endif
2507 
2508 #ifndef DOCUMENTATION
2509  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
2510  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2511 #endif
2512 
2513  DECLARE_OTHERS(AsmCommonSubExpression);
2514 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
2515 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2516  private:
2517  friend class boost::serialization::access;
2518 
2519  template<class S>
2520  void serialize(S &s, const unsigned /*version*/) {
2521  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2522  s & BOOST_SERIALIZATION_NVP(p_subexpression);
2523  }
2524 #endif
2525 #endif // SgAsmCommonSubExpression_OTHERS
2526 
2527 #ifdef DOCUMENTATION
2528  };
2529 #endif
2530 
2532 
2533  DECLARE_LEAF_CLASS(AsmRiscOperation);
2534  IS_SERIALIZABLE(AsmRiscOperation);
2535 
2536 #ifdef DOCUMENTATION
2537 
2546  public:
2547 #endif
2548 
2549 #ifdef DOCUMENTATION
2550 
2559 #else
2560  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
2561  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
2562 #endif
2563 
2564 #ifdef DOCUMENTATION
2565 
2571  SgAsmExprListExp* get_operands() const;
2574 #else
2575  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
2576  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2577 #endif
2578 
2579  DECLARE_OTHERS(AsmRiscOperation);
2580 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
2581  public:
2588  OP_NONE,
2589  OP_bottom,
2590  OP_undefined,
2591  OP_unspecified,
2592  OP_filterCallTarget,
2593  OP_filterReturnTarget,
2594  OP_filterIndirectJumpTarget,
2595  OP_hlt,
2596  OP_cpuid,
2597  OP_rdtsc,
2598  OP_and_,
2599  OP_or_,
2600  OP_xor_,
2601  OP_invert,
2602  OP_extract,
2603  OP_concat,
2604  OP_leastSignificantSetBit,
2605  OP_mostSignificantSetBit,
2606  OP_rotateLeft,
2607  OP_rotateRight,
2608  OP_shiftLeft,
2609  OP_shiftRight,
2610  OP_shiftRightArithmetic,
2611  OP_equalToZero,
2612  OP_ite,
2613  OP_isEqual,
2614  OP_isNotEqual,
2615  OP_isUnsignedLessThan,
2616  OP_isUnsignedLessThanOrEqual,
2617  OP_isUnsignedGreaterThan,
2618  OP_isUnsignedGreaterThanOrEqual,
2619  OP_isSignedLessThan,
2620  OP_isSignedLessThanOrEqual,
2621  OP_isSignedGreaterThan,
2622  OP_isSignedGreaterThanOrEqual,
2623  OP_unsignedExtend,
2624  OP_signExtend,
2627  OP_subtract,
2628  OP_negate,
2629  OP_signedDivide,
2630  OP_signedModulo,
2631  OP_signedMultiply,
2632  OP_unsignedDivide,
2633  OP_unsignedModulo,
2634  OP_unsignedMultiply,
2635  OP_interrupt,
2636  OP_readRegister,
2637  OP_peekRegister,
2638  OP_writeRegister,
2640  OP_peekMemory,
2642  OP_N_OPERATORS // MUST BE LAST!
2643  };
2644 
2645 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2646  private:
2647  friend class boost::serialization::access;
2648 
2649  template<class S>
2650  void serialize(S &s, const unsigned /*version*/) {
2651  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2652  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
2653  s & BOOST_SERIALIZATION_NVP(p_operands);
2654  }
2655 #endif
2656 #endif // SgAsmRiscOperation_OTHERS
2657 
2658 #ifdef DOCUMENTATION
2659  };
2660 #endif
2661 
2663 
2664  DECLARE_LEAF_CLASS(AsmExprListExp);
2665  IS_SERIALIZABLE(AsmExprListExp);
2666 
2667 #ifdef DOCUMENTATION
2668 
2670  public:
2671 #endif
2672 
2673 #ifdef DOCUMENTATION
2674 
2680  const SgAsmExpressionPtrList& get_expressions() const;
2681  void set_expressions(const SgAsmExpressionPtrList&);
2683 #else
2684  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
2685  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2686 #endif
2687 
2688  DECLARE_OTHERS(AsmExprListExp);
2689 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
2690 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2691  private:
2692  friend class boost::serialization::access;
2693 
2694  template<class S>
2695  void serialize(S &s, const unsigned /*version*/) {
2696  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2697  s & BOOST_SERIALIZATION_NVP(p_expressions);
2698  }
2699 #endif
2700 #endif // SgAsmExprListExp_OTHERS
2701 
2702 #ifdef DOCUMENTATION
2703  };
2704 #endif
2705 
2707 
2708  NEW_NONTERMINAL_MACRO(AsmExpression,
2709  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
2710  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
2711  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
2712  AsmRiscOperation,
2713  "AsmExpression", "AsmExpressionTag", false);
2714  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
2715  IS_SERIALIZABLE(AsmExpression);
2716 
2717 #ifdef DOCUMENTATION
2718 
2719  class SgAsmExpression: public SgAsmNode {
2720  public:
2721 #endif
2722 
2723 #ifdef DOCUMENTATION
2724 
2729  SgAsmType* get_type() const;
2730  void set_type(SgAsmType*);
2732 #else
2733  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
2734  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2735 #endif
2736 
2737 #ifdef DOCUMENTATION
2738 
2743  const std::string& get_comment() const;
2744  void set_comment(const std::string&);
2746 #else
2747  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
2748  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2749 #endif
2750 
2751  DECLARE_OTHERS(AsmExpression);
2752 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
2753 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2754  private:
2755  friend class boost::serialization::access;
2756 
2757  template<class S>
2758  void serialize(S &s, const unsigned /*version*/) {
2759  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
2760  s & BOOST_SERIALIZATION_NVP(p_type);
2761  s & BOOST_SERIALIZATION_NVP(p_comment);
2762  }
2763 #endif
2764 
2765  public:
2769  size_t get_nBits() const;
2770 
2776 
2782 
2783 #endif // SgAsmExpression_OTHERS
2784 
2785 #ifdef DOCUMENTATION
2786  };
2787 #endif
2788 
2789 
2790 
2791 
2793 
2794  /***************************************************************************************************************************
2795  * Data Types (new interface 2014-07)
2796  *
2797  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
2798  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
2799  * 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
2800  * don't allow types to be modified after they're created.
2801  ***************************************************************************************************************************/
2802 
2804 
2805  DECLARE_LEAF_CLASS(AsmIntegerType);
2806  IS_SERIALIZABLE(AsmIntegerType);
2807 
2808 #ifdef DOCUMENTATION
2809 
2811  public:
2812 #endif
2813 
2814 #ifndef DOCUMENTATION
2815  // Documented below due to ROSETTA limitations
2816  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
2817  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2818 #endif
2819 
2820  DECLARE_OTHERS(AsmIntegerType);
2821 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
2822 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2823  private:
2824  friend class boost::serialization::access;
2825 
2826  template<class S>
2827  void serialize(S &s, const unsigned /*version*/) {
2828  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2829  s & BOOST_SERIALIZATION_NVP(p_isSigned);
2830  }
2831 #endif
2832 
2833  public:
2837  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
2838 
2842  bool get_isSigned() const;
2843 
2844  // Overrides documented in base class
2845  virtual void check() const $ROSE_OVERRIDE;
2846  virtual std::string toString() const $ROSE_OVERRIDE;
2847 #endif // SgAsmIntegerType_OTHERS
2848 
2849 #ifdef DOCUMENTATION
2850  };
2851 #endif
2852 
2854 
2855  DECLARE_LEAF_CLASS(AsmFloatType);
2856  IS_SERIALIZABLE(AsmFloatType);
2857 
2858  DECLARE_HEADERS(AsmFloatType);
2859 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
2860  #include <Sawyer/BitVector.h>
2861 #endif // SgAsmFloatType_HEADERS
2862 
2863 #ifdef DOCUMENTATION
2864 
2866  public:
2867 #endif
2868 
2869 #ifndef DOCUMENTATION
2870  // Documented below because of ROSETTA limitations (they're read-only)
2871  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
2872  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2873  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
2874  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2875  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
2876  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2877  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
2878  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2879  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
2880  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2881  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
2882  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2883  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
2884  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2885 #endif
2886 
2887  DECLARE_OTHERS(AsmFloatType);
2888 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
2889 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2890  private:
2891  friend class boost::serialization::access;
2892 
2893  template<class S>
2894  void serialize(S &s, const unsigned /*version*/) {
2895  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2896  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
2897  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
2898  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
2899  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
2900  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
2901  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
2902  s & BOOST_SERIALIZATION_NVP(p_flags);
2903  }
2904 #endif
2905 
2906  public:
2907  enum {
2908  GRADUAL_UNDERFLOW = 0x00000001,
2909  NORMALIZED_SIGNIFICAND = 0x00000002
2910  };
2911 
2913 
2915  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
2916  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
2917  uint64_t exponentBias, unsigned flags);
2918 
2920  BitRange significandBits() const;
2921 
2923  BitRange exponentBits() const;
2924 
2926  size_t signBit() const;
2927 
2929  uint64_t exponentBias() const;
2930 
2932  unsigned flags() const;
2933 
2935  bool gradualUnderflow() const;
2936 
2938  bool normalizedSignificand() const;
2939 
2940  // Overrides documented in base class
2941  virtual void check() const $ROSE_OVERRIDE;
2942  virtual std::string toString() const $ROSE_OVERRIDE;
2943 #endif // SgAsmFloatType_OTHERS
2944 
2945 #ifdef DOCUMENTATION
2946  };
2947 #endif
2948 
2950 
2951  NEW_NONTERMINAL_MACRO(AsmScalarType,
2952  AsmIntegerType | AsmFloatType,
2953  "AsmScalarType", "AsmScalarTypeTag", false);
2954  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
2955  IS_SERIALIZABLE(AsmScalarType);
2956 
2957 #ifdef DOCUMENTATION
2958 
2959  class SgAsmScalarType: public SgAsmType {
2960  public:
2961 #endif
2962 
2963 #ifndef DOCUMENTATION
2964  // Documented below due to ROSETTA limitations (read-only)
2965  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2966  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2967  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2968  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2969  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
2970  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2971  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
2972  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2973 #endif
2974 
2975  DECLARE_OTHERS(AsmScalarType);
2976 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
2977 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2978  private:
2979  friend class boost::serialization::access;
2980 
2981  template<class S>
2982  void serialize(S &s, const unsigned /*version*/) {
2983  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
2984  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
2985  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
2986  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
2987  s & BOOST_SERIALIZATION_NVP(p_nBits);
2988  }
2989 #endif
2990 
2991  protected:
2996  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
2997 
2998  public:
3000  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3001 
3003  ByteOrder::Endianness get_minorOrder() const;
3004 
3006  ByteOrder::Endianness get_majorOrder() const;
3007 
3009  size_t get_majorNBytes() const;
3010 
3011  // Overrides documented in base class
3012  virtual void check() const $ROSE_OVERRIDE;
3013  virtual std::string toString() const $ROSE_OVERRIDE;
3014 #endif // SgAsmScalarType_OTHERS
3015 
3016 #ifdef DOCUMENTATION
3017  };
3018 #endif
3019 
3021 
3022  DECLARE_LEAF_CLASS(AsmVectorType);
3023  IS_SERIALIZABLE(AsmVectorType);
3024 
3025 #ifdef DOCUMENTATION
3026 
3027  class SgAsmVectorType: public SgAsmType {
3028  public:
3029 #endif
3030 
3031 #ifndef DOCUMENTATION
3032  // Documented below due to ROSETTA limitations (read-only)
3033  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3034  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3035  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3036  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3037 #endif
3038 
3039  DECLARE_OTHERS(AsmVectorType);
3040 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3041 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3042  private:
3043  friend class boost::serialization::access;
3044 
3045  template<class S>
3046  void serialize(S &s, const unsigned /*version*/) {
3047  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3048  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3049  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3050  }
3051 #endif
3052 
3053  public:
3055  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3056 
3058  size_t get_nElmts() const;
3059 
3061  SgAsmType* get_elmtType() const;
3062 
3063  // Overrides documented in base class
3064  virtual void check() const $ROSE_OVERRIDE;
3065  virtual std::string toString() const $ROSE_OVERRIDE;
3066  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3067 #endif // SgAsmVectorType_OTHERS
3068 
3069 #ifdef DOCUMENTATION
3070  };
3071 #endif
3072 
3074 
3075  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3076  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3077  IS_SERIALIZABLE(AsmType);
3078 
3079 #ifdef DOCUMENTATION
3080 
3081  class SgAsmType: public SgAsmNode {
3082  public:
3083 #endif
3084 
3085  DECLARE_OTHERS(AsmType);
3086 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3087  private:
3089 
3090 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3091  private:
3092  friend class boost::serialization::access;
3093 
3094  template<class S>
3095  void serialize(S &s, const unsigned /*version*/) {
3096  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3097  }
3098 #endif
3099 
3100  public:
3108  virtual void check() const;
3109 
3115  virtual std::string toString() const {
3116  abort(); // ROSETTA limitation: intended pure virtual
3117  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3118  }
3119 
3121  virtual size_t get_nBits() const {
3122  abort(); // ROSETTA limitation: intended pure virtual
3123  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3124  }
3125 
3127  virtual size_t get_nBytes() const;
3128 
3134  template<class Type> // Type is a subclass of SgAsmType
3135  static Type* registerOrDelete(Type *toInsert) {
3136  ASSERT_not_null(toInsert);
3137  std::string key = toInsert->toString();
3138  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3139  ASSERT_not_null(retval);
3140  if (retval!=toInsert)
3141  delete toInsert;
3142  return retval;
3143  }
3144 #endif // SgAsmType_OTHERS
3145 
3146 #ifdef DOCUMENTATION
3147  };
3148 #endif
3149 
3150 
3151 
3153 
3154  /**************************************************************************************************************************
3155  * Collections of Instructions
3156  **************************************************************************************************************************/
3157 
3159 
3160  DECLARE_LEAF_CLASS(AsmFunction);
3161  IS_SERIALIZABLE(AsmFunction);
3162 
3163 #ifdef DOCUMENTATION
3164 
3180  public:
3181 #endif
3182 
3183 #ifdef DOCUMENTATION
3184 
3189  const std::string& get_name() const;
3190  void set_name(const std::string&);
3192 #else
3193  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3194  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3195 #endif
3196 
3197 #ifdef DOCUMENTATION
3198 
3204  unsigned get_reason() const;
3205  void set_reason(unsigned);
3207 #else
3208  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3209  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3210 #endif
3211 
3212 #ifdef DOCUMENTATION
3213 
3220  const std::string& get_reasonComment() const;
3221  void set_reasonComment(const std::string&);
3223 #else
3224  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
3225  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3226 #endif
3227 
3228 #ifdef DOCUMENTATION
3229 
3237 #else
3238  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3239  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3240 #endif
3241 
3242 #ifdef DOCUMENTATION
3243 
3246  MayReturn get_may_return() const;
3247  void set_may_return(MayReturn);
3249 #else
3250  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3251  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3252 #endif
3253 
3254 #ifdef DOCUMENTATION
3255 
3260  const std::string& get_name_md5() const;
3261  void set_name_md5(const std::string&);
3263 #else
3264  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3265  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3266 #endif
3267 
3268 #ifdef DOCUMENTATION
3269 
3274  const SgAsmStatementPtrList& get_statementList() const;
3275  void set_statementList(const SgAsmStatementPtrList&);
3277 #else
3278  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3279  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3280 #endif
3281 
3282 #ifdef DOCUMENTATION
3283  // FIXME[Robb P Matzke 2017-02-13]: unused?
3284 #else
3285  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3286  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3287 #endif
3288 
3289 #ifdef DOCUMENTATION
3290 
3296  rose_addr_t get_entry_va() const;
3297  void set_entry_va(rose_addr_t);
3299 #else
3300  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3301  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3302 #endif
3303 
3304 #ifdef DOCUMENTATION
3305 
3314 #else
3315  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3316  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3317 #endif
3318 
3319 #ifdef DOCUMENTATION
3320  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3321 #else
3322  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3323  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3324 #endif
3325 
3326 #ifdef DOCUMENTATION
3327 
3336  int64_t get_stackDelta() const;
3337  void set_stackDelta(int64_t);
3339 #else
3340  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3341  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3342 #endif
3343 
3344 #ifdef DOCUMENTATION
3345 
3353  const std::string& get_callingConvention() const;
3354  void set_callingConvention(const std::string&);
3356 #else
3357  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3358  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3359 #endif
3360 
3361  DECLARE_OTHERS(AsmFunction);
3362 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3363 
3364 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3365  private:
3366  friend class boost::serialization::access;
3367 
3368  template<class S>
3369  void serialize(S &s, const unsigned /*version*/) {
3370  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3371  s & BOOST_SERIALIZATION_NVP(p_name);
3372  s & BOOST_SERIALIZATION_NVP(p_reason);
3373  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
3374  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3375  s & BOOST_SERIALIZATION_NVP(p_may_return);
3376  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3377  s & BOOST_SERIALIZATION_NVP(p_statementList);
3378  s & BOOST_SERIALIZATION_NVP(p_dest);
3379  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3380  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3381  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3382  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3383  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3384  }
3385 #endif
3386 
3387  public:
3388  // [Robb P Matzke 2017-02-13]: Deprecated because it uses a very old CFG implementation
3389  int nrOfValidInstructions(std::vector<SgNode*>& succs) ROSE_DEPRECATED("use modern CFG classes instead");
3390 
3393 
3397  void remove_statement(SgAsmStatement* statement);
3398 
3399  // [Robb P Matzke 2017-02-13]: I don't think this is used anywhere. It appends to the poorly named "dest" property.
3400  void append_dest(SgAsmStatement* instruction) ROSE_DEPRECATED("apparently not used anywhere");
3401 
3402  // FIXME[Robb P Matzke 2017-02-13]: This is a bad name--it removes only statements, not all AST children.
3406  void remove_children();
3407 
3412  SgAsmBlock* get_entry_block() const;
3413 
3415  enum MayReturn {
3420  };
3421 
3426  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3427  // Also fix SgAsmFunction::reason_key()
3428  FUNC_NONE = 0x00000000,
3430  = 0x00008000,
3431  FUNC_ENTRY_POINT = 0x00010000,
3432  FUNC_CALL_TARGET = 0x00020000,
3435  FUNC_CALL_INSN = 0x00040000,
3441  FUNC_EH_FRAME = 0x00080000,
3442  FUNC_SYMBOL = 0x00100000,
3443  FUNC_PATTERN = 0x00200000,
3448  FUNC_GRAPH = 0x00400000,
3452  FUNC_USERDEF = 0x00800000,
3453  FUNC_PADDING = 0x01000000,
3458  FUNC_DISCONT = 0x02000000,
3461  FUNC_INSNHEAD = 0x04000000,
3462  FUNC_IMPORT = 0x08000000,
3465  FUNC_LEFTOVERS = 0x10000000,
3469  FUNC_INTRABLOCK = 0x20000000,
3477  FUNC_THUNK = 0x40000000,
3486  FUNC_EXPORT = 0x80000000,
3488  FUNC_DEFAULT = 0xefff80ff,
3490  /*========= Miscellaneous Reasons ===========================================================================
3491  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3492  * availalble for users to use as they see fit. */
3493  FUNC_MISCMASK = 0x000000ff,
3508  };
3509 
3513  static std::string reason_key(const std::string &prefix="");
3514 
3516  std::string reason_str(bool pad) const;
3517 
3521  static std::string reason_str(bool pad, unsigned reason);
3522 
3525  public:
3526  virtual ~NodeSelector() {}
3527  virtual bool operator()(SgNode*) = 0;
3528  };
3529 
3569  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
3570  NodeSelector *selector=NULL);
3571 
3577  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
3578 
3581  e_unknown = 0,
3582  e_standard = 1,
3583  e_library = 2,
3584  e_imported = 3,
3585  e_thunk = 4,
3586  e_last
3587  };
3588 
3589  // Computes the offset of the stack at the end of the call relative the the start of the call (in a perfect function
3590  // this would be zero, this is used to score properly formed functions).
3591  // [Robb P Matzke 2017-02-13]: deprecated
3592  int get_stackNutralityMetric() const ROSE_DEPRECATED("use get_stackDelta instead");
3593 #endif // SgAsmFunction_OTHERS
3594 
3595 
3596 #ifdef DOCUMENTATION
3597  };
3598 #endif
3599 
3600 
3602 
3603  DECLARE_LEAF_CLASS(AsmBlock);
3604  IS_SERIALIZABLE(AsmBlock);
3605 
3606 #ifdef DOCUMENTATION
3607 
3627  class SgAsmBlock: public SgAsmStatement {
3628  public:
3629 #endif
3630 
3631 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3632  // [tps 05Apr07] needed for the control_flow_graph
3633  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
3634  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3635 #endif
3636 
3637 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3638  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
3639  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3640 #endif
3641 
3642 #ifdef DOCUMENTATION
3643 
3648  rose_addr_t get_id() const;
3649  void set_id(rose_addr_t);
3651 #else
3652  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
3653  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3654 #endif
3655 
3656 #ifdef DOCUMENTATION
3657 
3662  unsigned get_reason() const;
3663  void set_reason(unsigned);
3665 #else
3666  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
3667  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3668 #endif
3669 
3670 #ifdef DOCUMENTATION
3671  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3672  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3673  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3674  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3681  const SgAsmStatementPtrList& get_statementList() const;
3682  void set_statementList(const SgAsmStatementPtrList&);
3684 #else
3685  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3686  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3687 #endif
3688 
3689 #ifdef DOCUMENTATION
3690  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3691  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3692  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3693  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3701  const SgAsmIntegerValuePtrList& get_successors() const;
3702  void set_successors(const SgAsmIntegerValuePtrList&);
3704 #else
3705  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
3706  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3707 #endif
3708 
3709 #ifdef DOCUMENTATION
3710 
3720  bool get_successors_complete() const;
3721  void set_successors_complete(bool);
3723 #else
3724  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
3725  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3726 #endif
3727 
3728 #ifdef DOCUMENTATION
3729 
3741 #else
3742  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
3743  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3744 #endif
3745 
3746 #ifdef DOCUMENTATION
3747 
3755  size_t get_cached_vertex() const;
3756  void set_cached_vertex(size_t);
3758 #else
3759  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
3760  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3761 #endif
3762 
3763 #ifdef DOCUMENTATION
3764 
3770  double get_code_likelihood() const;
3771  void set_code_likelihood(double);
3773 #else
3774  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
3775  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3776 #endif
3777 
3778 #ifdef DOCUMENTATION
3779 
3787  int64_t get_stackDeltaOut() const;
3788  void set_stackDeltaOut(int64_t);
3790 #else
3791  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
3792  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3793 #endif
3794 
3795  DECLARE_OTHERS(AsmBlock);
3796 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
3797 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3798  private:
3799  friend class boost::serialization::access;
3800 
3801  template<class S>
3802  void serialize(S &s, const unsigned /*version*/) {
3803  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3804  s & BOOST_SERIALIZATION_NVP(p_reason);
3805  s & BOOST_SERIALIZATION_NVP(p_statementList);
3806  s & BOOST_SERIALIZATION_NVP(p_successors);
3807  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
3808  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
3809  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3810  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
3811  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
3812  }
3813 #endif
3814 
3815  public:
3817  enum Reason {
3818  // Please update SgAsmBlock::reason_str() if you change this enum!
3819  BLK_NONE = 0x00000000,
3820  BLK_ENTRY_POINT = 0x00010000,
3821  BLK_PADDING = 0x00020000,
3822  BLK_FRAGMENT = 0x00080000,
3824  BLK_CFGHEAD = 0x00100000,
3825  BLK_USERDEF = 0x00200000,
3826  BLK_LEFTOVERS = 0x00400000,
3828  BLK_JUMPTABLE = 0x00800000,
3829  BLK_GRAPH1 = 0x01000000,
3830  BLK_GRAPH2 = 0x02000000,
3831  BLK_GRAPH3 = 0x04000000,
3833  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
3834 
3835  // ========= Miscellaneous Reasons ===========================================================================
3836  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3837  // availalble for users to use as they see fit.
3838  BLK_MISCMASK = 0x000000ff,
3840  BLK_FINDDATA = 0x00000001,
3842  BLK_POSTFUNC = 0x00000002
3844  };
3845 
3850 
3855 
3856  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
3861  void remove_children();
3862 
3867  rose_addr_t get_fallthrough_va();
3868 
3873 
3879  bool has_instructions() const;
3880 
3886  bool is_basic_block() const { return has_instructions(); }
3887 
3897  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
3898 
3902  static std::string reason_key(const std::string &prefix="");
3903 
3907  std::string reason_str(bool pad) const;
3908 
3914  static std::string reason_str(bool pad, unsigned reason);
3915 #endif // SgAsmBlock_OTHERS
3916 
3917 #ifdef DOCUMENTATION
3918  };
3919 #endif
3920 
3921 
3923 
3924  DECLARE_LEAF_CLASS(AsmStaticData);
3925  IS_SERIALIZABLE(AsmStaticData);
3926 
3927 #ifdef DOCUMENTATION
3928 
3936  public:
3937 #endif
3938 
3939 #ifdef DOCUMENTATION
3940 
3946  const SgUnsignedCharList& get_raw_bytes() const;
3947  void set_raw_bytes(const SgUnsignedCharList&);
3949 #else
3950  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
3951  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3952 #endif
3953 
3954  DECLARE_OTHERS(AsmStaticData);
3955 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
3956 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3957  private:
3958  friend class boost::serialization::access;
3959 
3960  template<class S>
3961  void serialize(S &s, const unsigned /*version*/) {
3962  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3963  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
3964  }
3965 #endif
3966 
3967  public:
3971  size_t get_size() const { return p_raw_bytes.size(); }
3972 #endif // SgAsmStaticData_OTHERS
3973 
3974 #ifdef DOCUMENTATION
3975  };
3976 #endif
3977 
3978 
3980 
3981  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
3982  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
3983 
3984 #ifdef DOCUMENTATION
3985 
3996  public:
3997 #endif
3998 
3999  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4000 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4001 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4002  private:
4003  friend class boost::serialization::access;
4004 
4005  template<class S>
4006  void serialize(S & s, const unsigned /*version*/) {
4007  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4008  }
4009 #endif
4010  protected:
4011  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4012 
4013  public:
4016  p_declarationList.push_back(declaration);
4017  }
4018 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4019 
4020 #ifdef DOCUMENTATION
4021  };
4022 #endif
4023 
4024 
4026 
4027  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4028  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4029 
4030 #ifdef DOCUMENTATION
4031  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4033  public:
4034 #endif
4035 
4036 #ifdef DOCUMENTATION
4037 
4040  const std::string& get_name() const;
4041  void set_name(const std::string&);
4043 #else
4044  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4045  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4046  NO_DELETE);
4047 #endif
4048 
4049 #ifdef DOCUMENTATION
4050  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4054  uint64_t get_offset() const;
4055  void set_ofset(uint64_t);
4057 #else
4058  // Not clear if we want to store the offset explicitly
4059  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4060  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4061  NO_DELETE);
4062 #endif
4063 
4064  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4065 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4066 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4067  private:
4068  friend class boost::serialization::access;
4069 
4070  template<class S>
4071  void serialize(S &s, const unsigned /*version*/) {
4072  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4073  }
4074 #endif
4075 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4076 
4077 #ifdef DOCUMENTATION
4078  };
4079 #endif
4080 
4081 
4083 
4084  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4085  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4086  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4087  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4088  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4089 
4090 #ifdef DOCUMENTATION
4091 
4098  public:
4099 #endif
4100 
4101  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4102 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4103 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4104  private:
4105  friend class boost::serialization::access;
4106 
4107  template<class S>
4108  void serialize(S &s, const unsigned /*version*/) {
4109  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4110  };
4111 #endif
4112 #endif // SgAsmSynthesizedDeclaration_OTHERS
4113 
4114 #ifdef DOCUMENTATION
4115  };
4116 #endif
4117 
4118 
4120 
4121  NEW_NONTERMINAL_MACRO(AsmStatement,
4122  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4123  "AsmStatement", "AsmStatementTag", false);
4124  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4125  IS_SERIALIZABLE(AsmStatement);
4126 
4127 #ifdef DOCUMENTATION
4128 
4132  class SgAsmStatement: public SgAsmNode {
4133  public:
4134 #endif
4135 
4136 #ifdef DOCUMENTATION
4137 
4142  rose_addr_t get_address() const;
4143  void set_address(rose_addr_t);
4145 #else
4146  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4147  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4148 #endif
4149 
4150 
4151 #ifdef DOCUMENTATION
4152 
4155  const std::string& get_comment() const;
4156  void set_comment(const std::string&);
4158 #else
4159  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4160  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4161 #endif
4162 
4163  DECLARE_OTHERS(AsmStatement);
4164 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4165 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4166  private:
4167  friend class boost::serialization::access;
4168 
4169  template<class S>
4170  void serialize(S &s, const unsigned /*version*/) {
4171  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4172  s & BOOST_SERIALIZATION_NVP(p_address);
4173  s & BOOST_SERIALIZATION_NVP(p_comment);
4174  }
4175 #endif
4176 #endif // SgAsmStatement_OTHERS
4177 
4178 #ifdef DOCUMENTATION
4179  };
4180 #endif
4181 
4182 
4183 
4184 
4186 
4187  /*************************************************************************************************************************
4188  * Binary Interpretations
4189  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4190  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4191  * an AST that represents a single, coherent sub-part of the file.
4192  *************************************************************************************************************************/
4193 
4195 
4196  DECLARE_LEAF_CLASS(AsmInterpretationList);
4197  IS_SERIALIZABLE(AsmInterpretationList);
4198 
4199 #ifdef DOCUMENTATION
4200 
4202  public:
4203 #endif
4204 
4205 #ifdef DOCUMENTATION
4206 
4215 #else
4216  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4217  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4218  NO_DELETE);
4219 #endif
4220 
4221  DECLARE_OTHERS(AsmInterpretationList);
4222 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4223 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4224  private:
4225  friend class boost::serialization::access;
4226 
4227  template<class S>
4228  void serialize(S &s, const unsigned /*version*/) {
4229  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4230  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4231  }
4232 #endif
4233 #endif // SgAsmInterpretationList_OTHERS
4234 
4235 #ifdef DOCUMENTATION
4236  };
4237 #endif
4238 
4240 
4241  DECLARE_LEAF_CLASS(AsmInterpretation);
4242  IS_SERIALIZABLE(AsmInterpretation);
4243 
4244  DECLARE_HEADERS(AsmInterpretation);
4245 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4246  #include <MemoryMap.h>
4247  class RegisterDictionary;
4248 #endif // SgAsmInterpretation_HEADERS
4249 
4250 #ifdef DOCUMENTATION
4251 
4258  public:
4259 #endif
4260 
4261 #ifdef DOCUMENTATION
4262  // documentation and definition are below
4263 #else
4264  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4265 #endif
4266 
4267 #ifdef DOCUMENTATION
4268 
4279 #else
4280  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4281  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4282 #endif
4283 
4284 #ifdef DOCUMENTATION
4285 
4290  SgAsmBlock* get_global_block() const;
4293 #else
4294  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4295  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4296 #endif
4297 
4298  DECLARE_OTHERS(AsmInterpretation);
4299 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4300  private:
4302  const RegisterDictionary *p_registers;
4303  bool coverageComputed; // true iff percentageCoverage has been computed
4304  mutable InstructionMap instruction_map; // cached instruction map
4305 
4307  // disassembly into instructions.
4308  double percentageCoverage;
4309 
4310 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4311  private:
4312  friend class boost::serialization::access;
4313 
4314  template<class S>
4315  void serialize(S &s, const unsigned /*version*/) {
4316  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4317  s & BOOST_SERIALIZATION_NVP(p_headers);
4318  s & BOOST_SERIALIZATION_NVP(p_global_block);
4319  s & BOOST_SERIALIZATION_NVP(p_map);
4320  s & BOOST_SERIALIZATION_NVP(p_registers);
4321  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4322  s & BOOST_SERIALIZATION_NVP(instruction_map);
4323  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4324  }
4325 #endif
4326 
4327  public:
4330  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4331  ctor();
4332  }
4333 
4338  SgAsmGenericFilePtrList get_files() const;
4339 
4355  const RegisterDictionary *get_registers() const;
4356  void set_registers(const RegisterDictionary*);
4366  InstructionMap& get_instruction_map(bool recompute=false);
4367  void set_instruction_map(const InstructionMap&);
4374  void insert_instructions(InstructionMap&/*in,out*/);
4375 
4380  void erase_instructions(InstructionMap&/*in,out*/);
4381 
4387  void set_coverageComputed(bool x) { coverageComputed = x; }
4388  void set_percentageCoverage(double x) { percentageCoverage = x; }
4391  private:
4392  void ctor(); // finalize construction
4393 #endif // SgAsmInterpretation_OTHERS
4394 
4395 #ifdef DOCUMENTATION
4396  };
4397 #endif
4398 
4399 
4400 
4402 
4403  /*************************************************************************************************************************
4404  * ELF File Header
4405  *************************************************************************************************************************/
4406 
4408 
4409  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4410  IS_SERIALIZABLE(AsmElfFileHeader);
4411 
4412 #ifdef DOCUMENTATION
4413 
4422  public:
4423 #endif
4424 
4425 #ifdef DOCUMENTATION
4426 
4431  unsigned char get_e_ident_file_class() const;
4432  void set_e_ident_file_class(unsigned char);
4434 #else
4435  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4436  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4437 #endif
4438 
4439 #ifdef DOCUMENTATION
4440 
4445  unsigned char get_e_ident_data_encoding() const;
4446  void set_e_ident_data_encoding(unsigned char);
4448 #else
4449  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4450  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4451 #endif
4452 
4453 #ifdef DOCUMENTATION
4454 
4459  unsigned char get_e_ident_file_version() const;
4460  void set_e_ident_file_version(unsigned char*);
4462 #else
4463  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4464  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4465 #endif
4466 
4467 #ifdef DOCUMENTATION
4468 
4473  const SgUnsignedCharList& get_e_ident_padding() const;
4474  void set_e_ident_padding(const SgUnsignedCharList&);
4476 #else
4477  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4478  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4479 #endif
4480 
4481 #ifdef DOCUMENTATION
4482 
4487  unsigned long get_e_type() const;
4488  void set_e_type(unsigned long);
4490 #else
4491  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4492  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4493 #endif
4494 
4495 #ifdef DOCUMENTATION
4496 
4501  unsigned long get_e_machine() const;
4502  void set_e_machine(unsigned long);
4504 #else
4505  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4506  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4507 #endif
4508 
4509 #ifdef DOCUMENTATION
4510 
4515  unsigned long get_e_flags() const;
4516  void set_e_flags(unsigned long);
4518 #else
4519  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4520  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4521 #endif
4522 
4523 #ifdef DOCUMENTATION
4524 
4529  unsigned long get_e_ehsize() const;
4530  void set_e_ehsize(unsigned long);
4532 #else
4533  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4534  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4535 #endif
4536 
4537 #ifdef DOCUMENTATION
4538 
4543  unsigned long get_phextrasz() const;
4544  void set_phextrasz(unsigned long);
4546 #else
4547  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4548  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4549 #endif
4550 
4551 #ifdef DOCUMENTATION
4552 
4557  unsigned long get_e_phnum() const;
4558  void set_e_phnum(unsigned long);
4560 #else
4561  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
4562  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4563 #endif
4564 
4565 #ifdef DOCUMENTATION
4566 
4571  unsigned long get_shextrasz() const;
4572  void set_shextrasz(unsigned long);
4574 #else
4575  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
4576  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4577 #endif
4578 
4579 #ifdef DOCUMENTATION
4580 
4585  unsigned long get_e_shnum() const;
4586  void set_e_shnum(unsigned long);
4588 #else
4589  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
4590  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4591 #endif
4592 
4593 #ifdef DOCUMENTATION
4594 
4599  unsigned long get_e_shstrndx() const;
4600  void set_e_shstrndx(unsigned long);
4602 #else
4603  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
4604  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4605 #endif
4606 
4607 #ifdef DOCUMENTATION
4608 
4618 #else
4619  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
4620  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4621 #endif
4622 
4623 #ifdef DOCUMENTATION
4624 
4633 #else
4634  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
4635  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4636 #endif
4637 
4638  DECLARE_OTHERS(AsmElfFileHeader);
4639 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
4640 
4641 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4642  private:
4643  friend class boost::serialization::access;
4644 
4645  template<class S>
4646  void serialize(S &s, const unsigned /*version*/) {
4647  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
4648  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
4649  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
4650  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
4651  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
4652  s & BOOST_SERIALIZATION_NVP(p_e_type);
4653  s & BOOST_SERIALIZATION_NVP(p_e_machine);
4654  s & BOOST_SERIALIZATION_NVP(p_e_flags);
4655  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
4656  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
4657  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
4658  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
4659  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
4660  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
4661  s & BOOST_SERIALIZATION_NVP(p_section_table);
4662  s & BOOST_SERIALIZATION_NVP(p_segment_table);
4663  }
4664 #endif
4665 
4666  public:
4668  enum ObjectType {
4669  ET_NONE = 0
4670  ,ET_REL = 1
4671  ,ET_EXEC = 2
4672  ,ET_DYN = 3
4673  ,ET_CORE = 4
4675  ,ET_LOOS = 0xfe00
4676  ,ET_HIOS = 0xfeff
4677  ,ET_LOPROC = 0xff00
4678  ,ET_HIPROC = 0xffff
4679  };
4680 
4681  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
4682  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
4683  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
4684  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
4685  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
4686 #ifdef _MSC_VER
4687 # pragma pack (1)
4688 #endif
4689 
4696  unsigned char e_ident_magic[4];
4697  unsigned char e_ident_file_class;
4698  unsigned char e_ident_data_encoding;
4699  unsigned char e_ident_file_version;
4700  unsigned char e_ident_padding[9];
4701  uint16_t e_type;
4702  uint16_t e_machine;
4703  uint32_t e_version;
4704  uint32_t e_entry;
4705  uint32_t e_phoff;
4706  uint32_t e_shoff;
4707  uint32_t e_flags;
4708  uint16_t e_ehsize;
4709  uint16_t e_phentsize;
4710  uint16_t e_phnum;
4711  uint16_t e_shentsize;
4712  uint16_t e_shnum;
4713  uint16_t e_shstrndx;
4714  }
4715 #if !defined(SWIG) && !defined(_MSC_VER)
4716  __attribute__((packed))
4717 #endif
4718  ;
4719 
4721  unsigned char e_ident_magic[4];
4722  unsigned char e_ident_file_class;
4723  unsigned char e_ident_data_encoding;
4724  unsigned char e_ident_file_version;
4725  unsigned char e_ident_padding[9];
4726  uint16_t e_type;
4727  uint16_t e_machine;
4728  uint32_t e_version;
4729  uint64_t e_entry;
4730  uint64_t e_phoff;
4731  uint64_t e_shoff;
4732  uint32_t e_flags;
4733  uint16_t e_ehsize;
4734  uint16_t e_phentsize;
4735  uint16_t e_phnum;
4736  uint16_t e_shentsize;
4737  uint16_t e_shnum;
4738  uint16_t e_shstrndx;
4739  }
4740 #if !defined(SWIG) && !defined(_MSC_VER)
4741  __attribute__((packed))
4742 #endif
4743  ;
4744 
4745 #ifdef _MSC_VER
4746 # pragma pack ()
4747 #endif
4748 
4756  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
4757  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
4758  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
4759  ctor();
4760  }
4761 
4767  uint64_t max_page_size();
4768 
4771 
4774 
4780  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
4781 
4783  virtual bool reallocate() $ROSE_OVERRIDE;
4784 
4786  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4787 
4789  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4790 
4792  static bool is_ELF(SgAsmGenericFile*);
4793 
4795  SgAsmGenericSectionPtrList get_sectab_sections();
4796 
4798  SgAsmGenericSectionPtrList get_segtab_sections();
4799 
4800  // Overrides documented in base class
4801  virtual const char *format_name() const $ROSE_OVERRIDE;
4802 
4803  private:
4804  void ctor(); // called by constructors
4805  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
4806  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
4807 #endif // SgAsmElfFileHeader_OTHERS
4808 
4809 #ifdef DOCUMENTATION
4810  };
4811 #endif
4812 
4813 
4814 
4816 
4817  /*************************************************************************************************************************
4818  * ELF Section Tables
4819  *************************************************************************************************************************/
4820 
4822 
4823  DECLARE_LEAF_CLASS(AsmElfSectionTable);
4824  IS_SERIALIZABLE(AsmElfSectionTable);
4825 
4826 #ifdef DOCUMENTATION
4827 
4833  public:
4834 #endif
4835 
4836  DECLARE_OTHERS(AsmElfSectionTable);
4837 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
4838 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4839  private:
4840  friend class boost::serialization::access;
4841 
4842  template<class S>
4843  void serialize(S &s, const unsigned /*version*/) {
4844  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
4845  }
4846 #endif
4847 
4848  public:
4851  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
4852  ctor();
4853  }
4854 
4860  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
4861 
4873 
4877  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
4878 
4880  virtual bool reallocate() $ROSE_OVERRIDE;
4881 
4883  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4884 
4886  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4887 
4888  private:
4889  void ctor();
4890 #endif // SgAsmElfSectionTable_OTHERS
4891 
4892 #ifdef DOCUMENTATION
4893  };
4894 #endif
4895 
4896 
4898 
4899  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
4900  IS_SERIALIZABLE(AsmElfSectionTableEntry);
4901 
4902 #ifdef DOCUMENTATION
4903 
4905  public:
4906 #endif
4907 
4908 #ifdef DOCUMENTATION
4909 
4914  unsigned get_sh_name() const;
4915  void set_sh_name(unsigned);
4917 #else
4918  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
4919  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4920 #endif
4921 
4922 #ifdef DOCUMENTATION
4923 
4928  SectionType get_sh_type() const;
4929  void set_sh_type(SectionType);
4931 #else
4932  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
4933  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4934 #endif
4935 
4936 #ifdef DOCUMENTATION
4937 
4942  unsigned long get_sh_link() const;
4943  void set_sh_link(unsigned long);
4945 #else
4946  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
4947  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4948 #endif
4949 
4950 #ifdef DOCUMENTATION
4951 
4956  unsigned long get_sh_info() const;
4957  void set_sh_info(unsigned long);
4959 #else
4960  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
4961  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4962 #endif
4963 
4964 #ifdef DOCUMENTATION
4965 
4970  uint64_t get_sh_flags() const;
4971  void set_sh_flags(uint64_t);
4973 #else
4974  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
4975  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4976 #endif
4977 
4978 #ifdef DOCUMENTATION
4979 
4984  rose_addr_t get_sh_addr() const;
4985  void set_sh_addr(rose_addr_t);
4987 #else
4988  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
4989  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4990 #endif
4991 
4992 #ifdef DOCUMENTATION
4993 
4998  rose_addr_t get_sh_offset() const;
4999  void set_sh_offset(rose_addr_t);
5001 #else
5002  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
5003  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5004 #endif
5005 
5006 #ifdef DOCUMENTATION
5007 
5012  rose_addr_t get_sh_size() const;
5013  void set_sh_size(rose_addr_t);
5015 #else
5016  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
5017  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5018 #endif
5019 
5020 #ifdef DOCUMENTATION
5021 
5026  rose_addr_t get_sh_addralign() const;
5027  void set_sh_addralign(rose_addr_t);
5029 #else
5030  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
5031  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5032 #endif
5033 
5034 #ifdef DOCUMENTATION
5035 
5040  rose_addr_t get_sh_entsize() const;
5041  void set_sh_entsize(rose_addr_t);
5043 #else
5044  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
5045  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5046 #endif
5047 
5048 #ifdef DOCUMENTATION
5049 
5054  const SgUnsignedCharList& get_extra() const;
5055  void set_extra(const SgUnsignedCharLit&);
5057 #else
5058  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5059  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5060  NO_DELETE);
5061 #endif
5062 
5063  DECLARE_OTHERS(AsmElfSectionTableEntry);
5064 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5065 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5066  private:
5067  friend class boost::serialization::access;
5068 
5069  template<class S>
5070  void serialize(S &s, const unsigned /*version*/) {
5071  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5072  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5073  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5074  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5075  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5076  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5077  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5078  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5079  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5080  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5081  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5082  s & BOOST_SERIALIZATION_NVP(p_extra);
5083  }
5084 #endif
5085 
5086  public:
5089  SHT_NULL = 0,
5093  SHT_RELA = 4,
5094  SHT_HASH = 5,
5096  SHT_NOTE = 7,
5098  SHT_REL = 9,
5099  SHT_SHLIB = 10,
5100  SHT_DYNSYM = 11,
5102  SHT_LOOS = 0x60000000,
5103  SHT_GNU_verdef = 0x6ffffffd,
5104  SHT_GNU_verneed = 0x6ffffffe,
5105  SHT_GNU_versym = 0x6fffffff,
5106  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5107 
5108  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5109  SHT_HIPROC = 0x7fffffff,
5110  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5111  SHT_HIUSER = 0xffffffff
5112  };
5113 
5117  SHF_WRITE= (1 << 0),
5118  SHF_ALLOC= (1 << 1),
5119  SHF_EXECINSTR= (1 << 2),
5120  SHF_MERGE= (1 << 4),
5121  SHF_STRINGS= (1 << 5),
5122  SHF_INFO_LINK= (1 << 6),
5123  SHF_LINK_ORDER= (1 << 7),
5125  SHF_GROUP= (1 << 9),
5126  SHF_TLS= (1 << 10),
5127  SHF_MASKOS= 0x0ff00000,
5128  SHF_MASKPROC= 0xf0000000
5129  };
5130 
5137 #ifdef _MSC_VER
5138 # pragma pack (1)
5139 #endif
5141  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5142  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5143  uint32_t sh_flags; /* 0x08 Bit flags */
5144  uint32_t sh_addr; /* 0x0c Desired mapped address */
5145  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5146  uint32_t sh_size; /* 0x14 Section size in bytes */
5147  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5148  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5149  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5150  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5151  } /* 0x28 */
5152 #if !defined(SWIG) && !defined(_MSC_VER)
5153  __attribute__((packed))
5154 #endif
5155  ;
5156 
5158  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5159  uint32_t sh_type; /* 0x04 */
5160  uint64_t sh_flags; /* 0x08 */
5161  uint64_t sh_addr; /* 0x10 */
5162  uint64_t sh_offset; /* 0x18 */
5163  uint64_t sh_size; /* 0x20 */
5164  uint32_t sh_link; /* 0x28 */
5165  uint32_t sh_info; /* 0x2c */
5166  uint64_t sh_addralign; /* 0x30 */
5167  uint64_t sh_entsize; /* 0x38 */
5168  } /* 0x40 */
5169 #if !defined(SWIG) && !defined(_MSC_VER)
5170  __attribute__((packed))
5171 #endif
5172  ;
5173 #ifdef _MSC_VER
5174 # pragma pack ()
5175 #endif
5176 
5178  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5180 
5182  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5184 
5188  void *encode(ByteOrder::Endianness sex,
5190  void *encode(ByteOrder::Endianness sex,
5196 
5198  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5199 
5200  // Use Rose::stringify... function instead.
5201  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5202  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5203 
5204  private:
5205  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5206  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5207 #endif // SgAsmElfSectionTableEntry_OTHERS
5208 
5209 #ifdef DOCUMENTATION
5210  };
5211 #endif
5212 
5213 
5214 
5216 
5217  /*************************************************************************************************************************
5218  * ELF Segment Tables
5219  *************************************************************************************************************************/
5220 
5222 
5223  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5224  IS_SERIALIZABLE(AsmElfSegmentTable);
5225 
5226 #ifdef DOCUMENTATION
5227 
5234  public:
5235 #endif
5236 
5237  DECLARE_OTHERS(AsmElfSegmentTable);
5238 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5239 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5240  private:
5241  friend class boost::serialization::access;
5242 
5243  template<class S>
5244  void serialize(S &s, const unsigned /*version*/) {
5245  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5246  }
5247 #endif
5248 
5249  public:
5252  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5253  ctor();
5254  }
5255 
5260  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5261 
5276 
5280  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5281 
5283  virtual bool reallocate() $ROSE_OVERRIDE;
5284 
5286  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5287 
5289  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5290 
5291  private:
5292  void ctor();
5293 #endif // SgAsmElfSegmentTable_OTHERS
5294 
5295 #ifdef DOCUMENTATION
5296  };
5297 #endif
5298 
5300 
5301  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5302  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5303 
5304 #ifdef DOCUMENTATION
5306  public:
5307 #endif
5308 
5309 #ifdef DOCUMENTATION
5310 
5316  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5317  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5319 #else
5320  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5321  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5322  NO_DELETE);
5323 #endif
5324 
5325  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5326 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5327 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5328  private:
5329  friend class boost::serialization::access;
5330 
5331  template<class S>
5332  void serialize(S &s, const unsigned /*version*/) {
5333  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5334  }
5335 #endif
5336 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5337 
5338 #ifdef DOCUMENTATION
5339  };
5340 #endif
5341 
5342 
5344 
5345  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5346  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5347 
5348 #ifdef DOCUMENTATION
5349 
5351  public:
5352 #endif
5353 
5354 #ifdef DOCUMENTATION
5355 
5360  size_t get_index() const;
5361  void set_index(size_t);
5363 #else
5364  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5365  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5366 #endif
5367 
5368 #ifdef DOCUMENTATION
5369 
5372  SegmentType get_type() const;
5373  void set_type(SegmentType);
5375 #else
5376  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5377  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5378  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5379 #endif
5380 
5381 #ifdef DOCUMENTATION
5382 
5385  SegmentFlags get_flags() const;
5386  void set_flags(SegmentFlags);
5388 #else
5389  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5390  "= SgAsmElfSegmentTableEntry::PF_NONE",
5391  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5392 #endif
5393 
5394 #ifdef DOCUMENTATION
5395 
5400  rose_addr_t get_offset() const;
5401  void set_offset(rose_addr_t);
5403 #else
5404  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5405  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5406 #endif
5407 
5408 #ifdef DOCUMENTATION
5409 
5415  rose_addr_t get_vaddr() const;
5416  void set_vaddr(rose_addr_t);
5418 #else
5419  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5420  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5421 #endif
5422 
5423 #ifdef DOCUMENTATION
5424 
5429  rose_addr_t get_paddr() const;
5430  void set_paddr(rose_addr_t);
5432 #else
5433  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5434  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5435 #endif
5436 
5437 #ifdef DOCUMENTATION
5438 
5443  rose_addr_t get_filesz() const;
5444  void set_filesz(rose_addr_t);
5446 #else
5447  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5448  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5449 #endif
5450 
5451 #ifdef DOCUMENTATION
5452 
5457  rose_addr_t get_memsz() const;
5458  void set_memsz(rose_addr_t);
5460 #else
5461  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5462  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5463 #endif
5464 
5465 #ifdef DOCUMENTATION
5466 
5471  rose_addr_t get_align() const;
5472  void set_align(rose_addr_t);
5474 #else
5475  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5476  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5477 #endif
5478 
5479 #ifdef DOCUMENTATION
5480 
5485  const SgUnsignedCharList& get_extra() const;
5486  void set_extra(const SgUnsignedCharList&);
5488 #else
5489  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5490  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5491 #endif
5492 
5493  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5494 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
5495 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5496  private:
5497  friend class boost::serialization::access;
5498 
5499  template<class S>
5500  void serialize(S &s, const unsigned /*version*/) {
5501  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5502  s & BOOST_SERIALIZATION_NVP(p_index);
5503  s & BOOST_SERIALIZATION_NVP(p_type);
5504  s & BOOST_SERIALIZATION_NVP(p_flags);
5505  s & BOOST_SERIALIZATION_NVP(p_offset);
5506  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5507  s & BOOST_SERIALIZATION_NVP(p_paddr);
5508  s & BOOST_SERIALIZATION_NVP(p_filesz);
5509  s & BOOST_SERIALIZATION_NVP(p_memsz);
5510  s & BOOST_SERIALIZATION_NVP(p_align);
5511  s & BOOST_SERIALIZATION_NVP(p_extra);
5512  }
5513 #endif
5514 
5515  public:
5518  PT_NULL = 0,
5519  PT_LOAD = 1,
5522  PT_NOTE = 4,
5523  PT_SHLIB = 5,
5524  PT_PHDR = 6,
5525  PT_TLS = 7,
5527  // OS- and Processor-specific ranges
5528  PT_LOOS = 0x60000000,
5529  PT_HIOS = 0x6fffffff,
5530  PT_LOPROC = 0x70000000,
5531  PT_HIPROC = 0x7fffffff,
5532 
5533  // OS-specific values for GNU/Linux
5534  PT_GNU_EH_FRAME = 0x6474e550,
5535  PT_GNU_STACK = 0x6474e551,
5536  PT_GNU_RELRO = 0x6474e552,
5537  PT_PAX_FLAGS = 0x65041580,
5539  // OS-specific values for Sun
5540  PT_SUNWBSS = 0x6ffffffa,
5541  PT_SUNWSTACK = 0x6ffffffb
5542  };
5543 
5546  PF_NONE = 0,
5547  PF_RESERVED = 0x000ffff8,
5548  PF_XPERM = 0x00000001,
5549  PF_WPERM = 0x00000002,
5550  PF_RPERM = 0x00000004,
5551  PF_OS_MASK = 0x0ff00000,
5552  PF_PROC_MASK = 0xf0000000
5553  };
5554 
5555 #ifdef _MSC_VER
5556 # pragma pack (1)
5557 #endif
5558 
5566  uint32_t p_type;
5567  uint32_t p_offset;
5568  uint32_t p_vaddr;
5569  uint32_t p_paddr;
5570  uint32_t p_filesz;
5571  uint32_t p_memsz;
5572  uint32_t p_flags;
5573  uint32_t p_align;
5574  } /* 0x30 */
5575 #if !defined(SWIG) && !defined(_MSC_VER)
5576  __attribute__((packed))
5577 #endif
5578  ;
5579 
5581  uint32_t p_type; /* 0x00 */
5582  uint32_t p_flags; /* 0x04 */
5583  uint64_t p_offset; /* 0x08 */
5584  uint64_t p_vaddr; /* 0x10 */
5585  uint64_t p_paddr; /* 0x18 */
5586  uint64_t p_filesz; /* 0x20 */
5587  uint64_t p_memsz; /* 0x28 */
5588  uint64_t p_align; /* 0x30 */
5589  } /* 0x38 */
5590 #if !defined(SWIG) && !defined(_MSC_VER)
5591  __attribute__((packed))
5592 #endif
5593  ;
5594 #ifdef _MSC_VER
5595 # pragma pack ()
5596 #endif
5597 
5599  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5601 
5603  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5605 
5609  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
5610  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
5615 
5617  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5618 
5621 
5624 
5625  private:
5626  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
5627  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
5628 #endif // SgAsmElfSegmentTableEntry_OTHERS
5629 
5630 #ifdef DOCUMENTATION
5631  };
5632 #endif
5633 
5634 
5635 
5637 
5638  /*************************************************************************************************************************
5639  * ELF Symbol Tables
5640  *************************************************************************************************************************/
5641 
5643 
5644  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
5645  IS_SERIALIZABLE(AsmElfSymbolSection);
5646 
5647 #ifdef DOCUMENTATION
5648 
5650  public:
5651 #endif
5652 
5653 #ifdef DOCUMENTATION
5654 
5657  bool get_is_dynamic() const;
5658  void set_is_dynamic(bool);
5660 #else
5661  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
5662  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5663 #endif
5664 
5665 #ifdef DOCUMENTATION
5666 
5675 #else
5676  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
5677  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5678 #endif
5679 
5680  DECLARE_OTHERS(AsmElfSymbolSection);
5681 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
5682 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5683  private:
5684  friend class boost::serialization::access;
5685 
5686  template<class S>
5687  void serialize(S &s, const unsigned /*version*/) {
5688  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5689  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
5690  s & BOOST_SERIALIZATION_NVP(p_symbols);
5691  }
5692 #endif
5693 
5694  public:
5697  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
5698  ctor(strsec);
5699  }
5700 
5702  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
5703 
5716  virtual void finish_parsing() $ROSE_OVERRIDE;
5717 
5719  size_t index_of(SgAsmElfSymbol*);
5720 
5725  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5726 
5730  virtual bool reallocate() $ROSE_OVERRIDE;
5731 
5733  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5734 
5736  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5737 
5738  private:
5739  void ctor(SgAsmElfStringSection*);
5740 #endif // SgAsmElfSymbolSection_OTHERS
5741 
5742 #ifdef DOCUMENTATION
5743  };
5744 #endif
5745 
5747 
5748  DECLARE_LEAF_CLASS(AsmElfSymbolList);
5749  IS_SERIALIZABLE(AsmElfSymbolList);
5750 
5751 #ifdef DOCUMENTATION
5753  public:
5754 #endif
5755 
5756 #ifdef DOCUMENTATION
5757 
5763  const SgAsmElfSymbolPtrList& get_symbols() const;
5764  void set_symbols(const SgAsmElfSymbolPtrList&);
5766 #else
5767  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
5768  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5769 #endif
5770 
5771  DECLARE_OTHERS(AsmElfSymbolList);
5772 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
5773 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5774  private:
5775  friend class boost::serialization::access;
5776 
5777  template<class S>
5778  void serialize(S &s, const unsigned /*version*/) {
5779  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5780  s & BOOST_SERIALIZATION_NVP(p_symbols);
5781  }
5782 #endif
5783 #endif // SgAsmElfSymbolList_OTHERS
5784 
5785 #ifdef DOCUMENTATION
5786  };
5787 #endif
5788 
5790 
5791  DECLARE_LEAF_CLASS(AsmElfSymbol);
5792  IS_SERIALIZABLE(AsmElfSymbol);
5793 
5794 #ifdef DOCUMENTATION
5795 
5800  public:
5801 #endif
5802 
5803 #ifdef DOCUMENTATION
5804 
5809  unsigned char get_st_info() const;
5810  void set_st_info(unsigned char);
5812 #else
5813  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
5814  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5815 #endif
5816 
5817 #ifdef DOCUMENTATION
5818 
5823  unsigned char get_st_res1() const;
5824  void set_st_res1(unsigned char);
5826 #else
5827  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
5828  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5829 #endif
5830 
5831 #ifdef DOCUMENTATION
5832 
5837  unsigned get_st_shndx() const;
5838  void set_st_shndx(unsigned);
5840 #else
5841  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
5842  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5843 #endif
5844 
5845 #ifdef DOCUMENTATION
5846 
5851  rose_addr_t get_st_size() const;
5852  void set_st_size(rose_addr_t);
5854 #else
5855  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
5856  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5857 #endif
5858 
5859 #ifdef DOCUMENTATION
5860 
5865  const SgUnsignedCharList& get_extra() const;
5866  void set_extra(const SgUnsignedCharList&);
5868 #else
5869  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
5870  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5871 #endif
5872 
5873  DECLARE_OTHERS(AsmElfSymbol);
5874 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
5875 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5876  private:
5877  friend class boost::serialization::access;
5878 
5879  template<class S>
5880  void serialize(S &s, const unsigned /*version*/) {
5881  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
5882  s & BOOST_SERIALIZATION_NVP(p_st_info);
5883  s & BOOST_SERIALIZATION_NVP(p_st_res1);
5884  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
5885  s & BOOST_SERIALIZATION_NVP(p_st_size);
5886  s & BOOST_SERIALIZATION_NVP(p_extra);
5887  }
5888 #endif
5889 
5890  public:
5891  enum ElfSymBinding {
5892  STB_LOCAL=0,
5893  STB_GLOBAL=1,
5894  STB_WEAK=2
5895  };
5896 
5897  enum ElfSymType {
5900  STT_FUNC = 2,
5902  STT_FILE = 4,
5904  STT_TLS = 6,
5906  };
5907 
5908 #ifdef _MSC_VER
5909 # pragma pack (1)
5910 #endif
5911 
5914  uint32_t st_name;
5915  uint32_t st_value;
5916  uint32_t st_size;
5917  unsigned char st_info;
5918  unsigned char st_res1;
5919  uint16_t st_shndx;
5920  }
5921 #if !defined(SWIG) && !defined(_MSC_VER)
5922  __attribute__((packed))
5923 #endif
5924  ;
5925 
5927  uint32_t st_name;
5928  unsigned char st_info;
5929  unsigned char st_res1;
5930  uint16_t st_shndx;
5931  uint64_t st_value;
5932  uint64_t st_size;
5933  }
5934 #if !defined(SWIG) && !defined(_MSC_VER)
5935  __attribute__((packed))
5936 #endif
5937  ;
5938 
5939 #ifdef _MSC_VER
5940 # pragma pack ()
5941 #endif
5942 
5944  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
5945 
5949  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
5950 
5954  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
5955 
5959  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
5960  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
5968  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5969  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
5973  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
5974 
5977 
5979  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
5980 
5982  static std::string to_string(SgAsmElfSymbol::ElfSymType);
5983 
5984  private:
5985  void ctor(SgAsmElfSymbolSection*);
5986  void parse_common(); // initialization common to all parse() methods
5987 #endif // SgAsmElfSymbol_OTHERS
5988 
5989 #ifdef DOCUMENTATION
5990  };
5991 #endif
5992 
5993 
5994 
5996 
5997  /*************************************************************************************************************************
5998  * ELF Symbol Version Tables
5999  *************************************************************************************************************************/
6000 
6002 
6003  DECLARE_LEAF_CLASS(AsmElfSymverSection);
6004  IS_SERIALIZABLE(AsmElfSymverSection);
6005 
6006 #ifdef DOCUMENTATION
6007 
6012  public:
6013 #endif
6014 
6015 #ifdef DOCUMENTATION
6016 
6025 #else
6026  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
6027  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6028 #endif
6029 
6030  DECLARE_OTHERS(AsmElfSymverSection);
6031 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
6032 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6033  private:
6034  friend class boost::serialization::access;
6035 
6036  template<class S>
6037  void serialize(S &s, const unsigned /*version*/) {
6038  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6039  s & BOOST_SERIALIZATION_NVP(p_entries);
6040  }
6041 #endif
6042 
6043  public:
6046  : SgAsmElfSection(fhdr) {
6047  ctor();
6048  }
6049 
6051  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
6052 
6057  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6058 
6060  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6061 
6063  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6064  private:
6065  void ctor();
6066 #endif // SgAsmElfSymverSection_OTHERS
6067 
6068 #ifdef DOCUMENTATION
6069  };
6070 #endif
6071 
6073 
6074  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6075  IS_SERIALIZABLE(AsmElfSymverEntry);
6076 
6077 #ifdef DOCUMENTATION
6078 
6080  public:
6081 #endif
6082 
6083 #ifdef DOCUMENTATION
6084 
6089  size_t get_value() const;
6090  void set_value(size_t);
6092 #else
6093  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6094  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6095 #endif
6096 
6097  DECLARE_OTHERS(AsmElfSymverEntry);
6098 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6099 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6100  private:
6101  friend class boost::serialization::access;
6102 
6103  template<class S>
6104  void serialize(S &s, const unsigned /*version*/) {
6105  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6106  s & BOOST_SERIALIZATION_NVP(p_value);
6107  }
6108 #endif
6109 
6110  public:
6113  : p_value(0) {
6114  ctor(symver);
6115  }
6116 
6118  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6119 
6120  private:
6121  void ctor(SgAsmElfSymverSection*);
6122 #endif // SgAsmElfSymverEntry_OTHERS
6123 
6124 #ifdef DOCUMENTATION
6125  };
6126 #endif
6127 
6129 
6130 
6131  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6132  IS_SERIALIZABLE(AsmElfSymverEntryList);
6133 
6134 #ifdef DOCUMENTATION
6135 
6140  public:
6141 #endif
6142 
6143 #ifdef DOCUMENTATION
6144 
6147  const SgAsmElfSymverEntryPtrList& get_entries() const;
6148  void set_entries(const SgAsmElfSymverEntryPtrList&);
6150 #else
6151  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6152  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6153  NO_DELETE);
6154 #endif
6155 
6156  DECLARE_OTHERS(AsmElfSymverEntryList);
6157 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6158 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6159  private:
6160  friend class boost::serialization::access;
6161 
6162  template<class S>
6163  void serialize(S &s, const unsigned /*version*/) {
6164  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6165  s & BOOST_SERIALIZATION_NVP(p_entries);
6166  }
6167 #endif
6168 #endif // SgAsmElfSymverEntryList_OTHERS
6169 
6170 #ifdef DOCUMENTATION
6171  };
6172 #endif
6173 
6175 
6176  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6177  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6178 
6179 #ifdef DOCUMENTATION
6180 
6186  public:
6187 #endif
6188 
6189 #ifdef DOCUMENTATION
6190 
6199 #else
6200  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6201  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6202  NO_DELETE);
6203 #endif
6204 
6205  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6206 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6207 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6208  private:
6209  friend class boost::serialization::access;
6210 
6211  template<class S>
6212  void serialize(S &s, const unsigned /*version*/) {
6213  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6214  s & BOOST_SERIALIZATION_NVP(p_entries);
6215  }
6216 #endif
6217 
6218  public:
6221  : SgAsmElfSection(fhdr) {
6222  ctor(strsec);
6223  }
6224 
6293  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6294 
6297  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6298 
6302  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6303 
6305  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6306 
6307  private:
6308  void ctor(SgAsmElfStringSection*);
6309 #endif // SgAsmElfSymverDefinedSection_OTHERS
6310 
6311 #ifdef DOCUMENTATION
6312  };
6313 #endif
6314 
6316 
6317  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6318  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6319 
6320 #ifdef DOCUMENTATION
6321 
6326  public:
6327 #endif
6328 
6329 #ifdef DOCUMENTATION
6330 
6333  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6334  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6336 #else
6337  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6338  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6339  NO_DELETE);
6340 #endif
6341 
6342  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6343 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6344 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6345  private:
6346  friend class boost::serialization::access;
6347 
6348  template<class S>
6349  void serialize(S &s, const unsigned /*version*/) {
6350  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6351  s & BOOST_SERIALIZATION_NVP(p_entries);
6352  }
6353 #endif
6354 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6355 
6356 #ifdef DOCUMENTATION
6357  };
6358 #endif
6359 
6361 
6362  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6363  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6364 
6365 #ifdef DOCUMENTATION
6366 
6368  public:
6369 #endif
6370 
6371 #ifdef DOCUMENTATION
6372 
6377  size_t get_version() const;
6378  void set_version(size_t);
6380 #else
6381  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6382  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6383 #endif
6384 
6385 #ifdef DOCUMENTATION
6386 
6391  int get_flags() const;
6392  void set_flags(int);
6394 #else
6395  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6396  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6397 #endif
6398 
6399 #ifdef DOCUMENTATION
6400 
6405  size_t get_index() const;
6406  void set_index(size_t);
6408 #else
6409  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6410  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6411 #endif
6412 
6413 #ifdef DOCUMENTATION
6414 
6419  uint32_t get_hash() const;
6420  void set_hash(uint32_t);
6422 #else
6423  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6424  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6425 #endif
6426 
6427 #ifdef DOCUMENTATION
6428 
6437 #else
6438  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6439  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6440 #endif
6441 
6442  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6443 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6444 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6445  private:
6446  friend class boost::serialization::access;
6447 
6448  template<class S>
6449  void serialize(S &s, const unsigned /*version*/) {
6450  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6451  s & BOOST_SERIALIZATION_NVP(p_version);
6452  s & BOOST_SERIALIZATION_NVP(p_flags);
6453  s & BOOST_SERIALIZATION_NVP(p_index);
6454  s & BOOST_SERIALIZATION_NVP(p_hash);
6455  s & BOOST_SERIALIZATION_NVP(p_entries);
6456  }
6457 #endif
6458 
6459  public:
6460 #ifdef _MSC_VER
6461 # pragma pack (1)
6462 #endif
6463 
6465  uint16_t vd_version;
6466  uint16_t vd_flags;
6467  uint16_t vd_ndx;
6468  uint16_t vd_cnt;
6469  uint32_t vd_hash;
6470  uint32_t vd_aux;
6471  uint32_t vd_next;
6472  }
6473 #if !defined(SWIG) && !defined(_MSC_VER)
6474  __attribute__((packed))
6475 #endif
6476  ;
6477 
6478 #ifdef _MSC_VER
6479 # pragma pack ()
6480 #endif
6481 
6484  ctor(symver_defined);
6485  }
6486 
6488  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6489 
6491  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6492 
6494  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6495 
6496  private:
6497  void ctor(SgAsmElfSymverDefinedSection*);
6498 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6499 
6500 #ifdef DOCUMENTATION
6501  };
6502 #endif
6503 
6505 
6506  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6507  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6508 
6509 #ifdef DOCUMENTATION
6510 
6515  pbulic:
6516 #endif
6517 
6518 #ifdef DOCUMENTATION
6519 
6522  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6523  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6525 #else
6526  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6527  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6528  NO_DELETE);
6529 #endif
6530 
6531  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6532 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6533 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6534  private:
6535  friend class boost::serialization::access;
6536 
6537  template<class S>
6538  void serialize(S &s, const unsigned /*version*/) {
6539  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6540  s & BOOST_SERIALIZATION_NVP(p_entries);
6541  }
6542 #endif
6543 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6544 
6545 #ifdef DOCUMENTATION
6546  };
6547 #endif
6548 
6550 
6551  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
6552  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
6553 
6554 #ifdef DOCUMENTATION
6556  public:
6557 #endif
6558 
6559 #ifdef DOCUMENTATION
6560 
6563  SgAsmGenericString* get_name() const;
6566 #else
6567  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6568  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6569 #endif
6570 
6571  DECLARE_OTHERS(AsmElfSymverDefinedAux);
6572 #if defined(SgAsmElfSymverDefinedAux_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(SgAsmExecutableFileFormat);
6580  s & BOOST_SERIALIZATION_NVP(p_name);
6581  }
6582 #endif
6583 
6584  public:
6585 #ifdef _MSC_VER
6586 # pragma pack (1)
6587 #endif
6588 
6591  uint32_t vda_name;
6592  uint32_t vda_next;
6593  }
6594 #if !defined(SWIG) && !defined(_MSC_VER)
6595  __attribute__((packed))
6596 #endif
6597  ;
6598 
6599 #ifdef _MSC_VER
6600 # pragma pack ()
6601 #endif
6602 
6607  SgAsmElfSymverDefinedSection *symver_def_sec)
6608  : p_name(NULL) {
6609  ctor(symver_def_entry,symver_def_sec);
6610  }
6611 
6613  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
6614 
6616  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
6617 
6623  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6624 
6625  private:
6626  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
6627 #endif // SgAsmElfSymverDefinedAux_OTHERS
6628 
6629 #ifdef DOCUMENTATION
6630  };
6631 #endif
6632 
6634 
6635  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
6636  IS_SERIALIZABLE(AsmElfSymverNeededSection);
6637 
6638 #ifdef DOCUMENTATION
6639 
6645  public:
6646 #endif
6647 
6648 #ifdef DOCUMENTATION
6649 
6658 #else
6659  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
6660  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6661 #endif
6662 
6663  DECLARE_OTHERS(AsmElfSymverNeededSection);
6664 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
6665 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6666  private:
6667  friend class boost::serialization::access;
6668 
6669  template<class S>
6670  void serialize(S &s, const unsigned /*version*/) {
6671  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6672  s & BOOST_SERIALIZATION_NVP(p_entries);
6673  }
6674 #endif
6675 
6676  public:
6681  : SgAsmElfSection(fhdr) {
6682  ctor(strsec);
6683  }
6684 
6694  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
6695 
6700  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6701 
6705  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6706 
6708  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6709 
6710  private:
6711  void ctor(SgAsmElfStringSection*);
6712 #endif // SgAsmElfSymverNeededSection_OTHERS
6713 
6714 #ifdef DOCUMENTATION
6715  };
6716 #endif
6717 
6719 
6720  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
6721  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
6722 
6723 #ifdef DOCUMENTATION
6724 
6729  public:
6730 #endif
6731 
6732 #ifdef DOCUMENTATION
6733 
6736  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
6737  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
6739 #else
6740  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
6741  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6742  NO_DELETE);
6743 #endif
6744 
6745  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
6746 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
6747 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6748  private:
6749  friend class boost::serialization::access;
6750 
6751  template<class S>
6752  void serialize(S &s, const unsigned /*version*/) {
6753  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6754  s & BOOST_SERIALIZATION_NVP(p_entries);
6755  }
6756 #endif
6757 #endif // SgAsmElfSymverNeededEntryList_OTHERS
6758 
6759 #ifdef DOCUMENTATION
6760  };
6761 #endif
6762 
6764 
6765  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
6766  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
6767 
6768 #ifdef DOCUMENTATION
6769 
6771  public:
6772 #endif
6773 
6774 #ifdef DOCUMENTATION
6775 
6780  size_t get_version() const;
6781  void set_version(size_t);
6783 #else
6784  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
6785  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6786 #endif
6787 
6788 #ifdef DOCUMENTATION
6789 
6795 #else
6796  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
6797  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6798 #endif
6799 
6800 #ifdef DOCUMENTATION
6801 
6810 #else
6811  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
6812  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6813 #endif
6814 
6815  DECLARE_OTHERS(AsmElfSymverNeededEntry);
6816 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
6817 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6818  private:
6819  friend class boost::serialization::access;
6820 
6821  template<class S>
6822  void serialize(S &s, const unsigned /*version*/) {
6823  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6824  s & BOOST_SERIALIZATION_NVP(p_version);
6825  s & BOOST_SERIALIZATION_NVP(p_file_name);
6826  s & BOOST_SERIALIZATION_NVP(p_entries);
6827  }
6828 #endif
6829 
6830  public:
6831 #ifdef _MSC_VER
6832 # pragma pack (1)
6833 #endif
6834 
6837  uint16_t vn_version;
6838  uint16_t vn_cnt;
6839  uint32_t vn_file;
6840  uint32_t vn_aux;
6841  uint32_t vn_next;
6842  }
6843 #if !defined(SWIG) && !defined(_MSC_VER)
6844  __attribute__((packed))
6845 #endif
6846  ;
6847 
6848 #ifdef _MSC_VER
6849 # pragma pack ()
6850 #endif
6851 
6854  : p_file_name(NULL) {
6855  ctor(symver_needed);
6856  }
6857 
6859  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
6860 
6862  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
6863 
6865  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6866 
6867  private:
6868  void ctor(SgAsmElfSymverNeededSection*);
6869 #endif // SgAsmElfSymverNeededEntry_OTHERS
6870 
6871 #ifdef DOCUMENTATION
6872  };
6873 #endif
6874 
6876 
6877  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
6878  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
6879 
6880 #ifdef DOCUMENTATION
6881 
6886  public:
6887 #endif
6888 
6889 #ifdef DOCUMENTATION
6890 
6893  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
6894  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
6896 #else
6897  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
6898  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6899  NO_DELETE);
6900 #endif
6901 
6902  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
6903 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
6904 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6905  private:
6906  friend class boost::serialization::access;
6907 
6908  template<class S>
6909  void serialize(S &s, const unsigned /*version*/) {
6910  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6911  s & BOOST_SERIALIZATION_NVP(p_entries);
6912  }
6913 #endif
6914 #endif // SgAsmElfSymverNeededAuxList_OTHERS
6915 
6916 #ifdef DOCUMENTATION
6917  };
6918 #endif
6919 
6921 
6922  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
6923  IS_SERIALIZABLE(AsmElfSymverNeededAux);
6924 
6925 #ifdef DOCUMENTATION
6926 
6928  public:
6929 #endif
6930 
6931 #ifdef DOCUMENTATION
6932 
6937  uint32_t get_hash() const;
6938  void set_hash(uint32_t);
6940 #else
6941  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
6942  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6943 #endif
6944 
6945 #ifdef DOCUMENTATION
6946 
6951  int get_flags() const;
6952  void set_flags(int);
6954 #else
6955  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
6956  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6957 #endif
6958 
6959 #ifdef DOCUMENTATION
6960 
6965  size_t get_other() const;
6966  void set_other(size_t);
6968 #else
6969  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
6970  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6971 #endif
6972 
6973 #ifdef DOCUMENTATION
6974 
6977  SgAsmGenericString* get_name() const;
6980 #else
6981  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6982  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6983 #endif
6984 
6985  DECLARE_OTHERS(AsmElfSymverNeededAux);
6986 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
6987 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6988  private:
6989  friend class boost::serialization::access;
6990 
6991  template<class S>
6992  void serialize(S &s, const unsigned /*version*/) {
6993  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6994  s & BOOST_SERIALIZATION_NVP(p_hash);
6995  s & BOOST_SERIALIZATION_NVP(p_flags);
6996  s & BOOST_SERIALIZATION_NVP(p_other);
6997  s & BOOST_SERIALIZATION_NVP(p_name);
6998  }
6999 #endif
7000 
7001  public:
7002 #ifdef _MSC_VER
7003 # pragma pack (1)
7004 #endif
7005 
7008  uint32_t vna_hash;
7009  uint16_t vna_flags;
7010  uint16_t vna_other;
7011  uint32_t vna_name;
7012  uint32_t vna_next;
7013  }
7014 #if !defined(SWIG) && !defined(_MSC_VER)
7015  __attribute__((packed))
7016 #endif
7017  ;
7018 
7019 #ifdef _MSC_VER
7020 # pragma pack ()
7021 #endif
7022 
7028  : p_name(NULL) {
7029  ctor(symver_needed_entry,symver_needed_sec);
7030  }
7031 
7033  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
7034 
7036  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
7037 
7043  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7044 
7045  private:
7047 #endif // SgAsmElfSymverNeededAux_OTHERS
7048 
7049 #ifdef DOCUMENTATION
7050  };
7051 #endif
7052 
7053 
7054 
7055 
7057 
7058  /*************************************************************************************************************************
7059  * ELF Relocation Tables
7060  *************************************************************************************************************************/
7061 
7063 
7064  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7065  IS_SERIALIZABLE(AsmElfRelocSection);
7066 
7067 #ifdef DOCUMENTATION
7068 
7070  public:
7071 #endif
7072 
7073 #ifdef DOCUMENTATION
7074 
7077  bool get_uses_addend() const;
7078  void set_uses_addend(bool);
7080 #else
7081  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7082  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7083 #endif
7084 
7085 #ifdef DOCUMENTATION
7086 
7092 #else
7093  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7094  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7095 #endif
7096 
7097 #ifdef DOCUMENTATION
7098 
7106 #else
7107  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7108  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7109 #endif
7110 
7111  DECLARE_OTHERS(AsmElfRelocSection);
7112 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7113 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7114  private:
7115  friend class boost::serialization::access;
7116 
7117  template<class S>
7118  void serialize(S &s, const unsigned /*version*/) {
7119  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7120  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7121  s & BOOST_SERIALIZATION_NVP(p_target_section);
7122  s & BOOST_SERIALIZATION_NVP(p_entries);
7123  }
7124 #endif
7125 
7126  public:
7128  : SgAsmElfSection(fhdr) {
7129  ctor(symsec,targetsec);
7130  }
7131 
7134  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7135 
7137  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7138 
7140  virtual bool reallocate() $ROSE_OVERRIDE;
7141 
7143  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7144 
7146  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7147 
7148  private:
7150 #endif // SgAsmElfRelocSection_OTHERS
7151 
7152 #ifdef DOCUMENTATION
7153  };
7154 #endif
7155 
7157 
7158  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7159  IS_SERIALIZABLE(AsmElfRelocEntryList);
7160 
7161 #ifdef DOCUMENTATION
7162 
7167  public:
7168 #endif
7169 
7170 #ifdef DOCUMENTATION
7171 
7174  const SgAsmElfRelocEntryPtrList& get_entries() const;
7175  void set_entries(const SgAsmElfRelocEntryPtrList&);
7177 #else
7178  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7179  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7180  NO_DELETE);
7181 #endif
7182 
7183  DECLARE_OTHERS(AsmElfRelocEntryList);
7184 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7185 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7186  private:
7187  friend class boost::serialization::access;
7188 
7189  template<class S>
7190  void serialize(S &s, const unsigned /*version*/) {
7191  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7192  s & BOOST_SERIALIZATION_NVP(p_entries);
7193  }
7194 #endif
7195 #endif // SgAsmElfRelocEntryList_OTHERS
7196 
7197 #ifdef DOCUMENTATION
7198  };
7199 #endif
7200 
7202 
7203  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7204  IS_SERIALIZABLE(AsmElfRelocEntry);
7205 
7206 #ifdef DOCUMENTATION
7207 
7209  public:
7210 #endif
7211 
7212 #ifdef DOCUMENTATION
7213 
7218  rose_addr_t get_r_offset() const;
7219  void set_r_offset(rose_addr_t);
7221 #else
7222  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7223  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7224 #endif
7225 
7226 #ifdef DOCUMENTATION
7227 
7232  rose_addr_t get_r_addend() const;
7233  void set_r_addend(rose_addr_t);
7235 #else
7236  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7237  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7238 #endif
7239 
7240 #ifdef DOCUMENTATION
7241 
7246  unsigned long get_sym() const;
7247  void set_sym(unsigned long);
7249 #else
7250  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7251  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7252 #endif
7253 
7254 #ifdef DOCUMENTATION
7255 
7260  RelocType get_type() const;
7261  void set_type(RelocType);
7263 #else
7264  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7265  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7266 #endif
7267 
7268 #ifdef DOCUMENTATION
7269 
7272  const SgUnsignedCharList& get_extra() const;
7273  void set_extra(const SgUnsignedCharList&);
7275 #else
7276  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7277  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7278 #endif
7279 
7280  DECLARE_OTHERS(AsmElfRelocEntry);
7281 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7282 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7283  private:
7284  friend class boost::serialization::access;
7285 
7286  template<class S>
7287  void serialize(S &s, const unsigned /*version*/) {
7288  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7289  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7290  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7291  s & BOOST_SERIALIZATION_NVP(p_sym);
7292  s & BOOST_SERIALIZATION_NVP(p_type);
7293  s & BOOST_SERIALIZATION_NVP(p_extra);
7294  }
7295 #endif
7296 
7297  public:
7300  // Intel 80386 specific definitions.
7312  R_386_32PLT =11,
7319  R_386_16 =20,
7320  R_386_PC16 =21,
7321  R_386_8 =22,
7322  R_386_PC8 =23,
7338  // First Entry for X86-64
7353  R_X86_64_8 =114,
7363  };
7364 
7365 #ifdef _MSC_VER
7366 # pragma pack (1)
7367 #endif
7368 
7370  uint32_t r_offset;
7371  uint32_t r_info;
7372  uint32_t r_addend;
7373  }
7374 #if !defined(SWIG) && !defined(_MSC_VER)
7375  __attribute__((packed))
7376 #endif
7377  ;
7378 
7380  uint64_t r_offset;
7381  uint64_t r_info;
7382  uint64_t r_addend;
7383  }
7384 #if !defined(SWIG) && !defined(_MSC_VER)
7385  __attribute__((packed))
7386 #endif
7387  ;
7388 
7390  uint32_t r_offset;
7391  uint32_t r_info;
7392  }
7393 #if !defined(SWIG) && !defined(_MSC_VER)
7394  __attribute__((packed))
7395 #endif
7396  ;
7397 
7399  uint64_t r_offset;
7400  uint64_t r_info;
7401  }
7402 #if !defined(SWIG) && !defined(_MSC_VER)
7403  __attribute__((packed))
7404 #endif
7405  ;
7406 
7407 #ifdef _MSC_VER
7408 # pragma pack ()
7409 #endif
7410 
7413  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7414  ctor(section);
7415  }
7416 
7420  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7421  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7422  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7423  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7429  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7430  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7431  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7432  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7438  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7439  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7440  dump(f, prefix, idx, NULL);
7441  }
7445  std::string reloc_name() const;
7446 
7447  private:
7448  void ctor(SgAsmElfRelocSection*);
7449 #endif // SgAsmElfRelocEntry_OTHERS
7450 
7451 #ifdef DOCUMENTATION
7452  };
7453 #endif
7454 
7455 
7456 
7458 
7459  /*************************************************************************************************************************
7460  * ELF Dynamic Linking
7461  *************************************************************************************************************************/
7462 
7464 
7465  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7466  IS_SERIALIZABLE(AsmElfDynamicSection);
7467 
7468 #ifdef DOCUMENTATION
7469 
7471  public:
7472 #endif
7473 
7474 #ifdef DOCUMENTATION
7475 
7484 #else
7485  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7486  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7487 #endif
7488 
7489  DECLARE_OTHERS(AsmElfDynamicSection);
7490 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7491 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7492  private:
7493  friend class boost::serialization::access;
7494 
7495  template<class S>
7496  void serialize(S &s, const unsigned /*version*/) {
7497  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7498  s & BOOST_SERIALIZATION_NVP(p_entries);
7499  }
7500 #endif
7501 
7502  public:
7505  : SgAsmElfSection(fhdr) {
7506  ctor(strsec);
7507  }
7508 
7510  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7511 
7513  virtual void finish_parsing() $ROSE_OVERRIDE;
7514 
7517  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7518 
7520  virtual bool reallocate() $ROSE_OVERRIDE;
7521 
7523  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7524 
7526  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7527 
7528  private:
7529  void ctor(SgAsmElfStringSection*);
7530 #endif // SgAsmElfDynamicSection_OTHERS
7531 
7532 #ifdef DOCUMENTATION
7533  };
7534 #endif
7535 
7537 
7538  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7539  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7540 
7541 #ifdef DOCUMENTATION
7542 
7547  public:
7548 #endif
7549 
7550 #ifdef DOCUMENTATION
7551 
7554  const SgAsmElfDynamicEntryPtrList& get_entries() const;
7555  void set_entries(const SgAsmElfDynamicEntryPtrList&);
7557 #else
7558  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
7559  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
7560  NO_DELETE);
7561 #endif
7562 
7563  DECLARE_OTHERS(AsmElfDynamicEntryList);
7564 #if defined(SgAsmElfDynamicEntryList_OTHERS) || defined(DOCUMENTATION)
7565 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7566  private:
7567  friend class boost::serialization::access;
7568 
7569  template<class S>
7570  void serialize(S &s, const unsigned /*version*/) {
7571  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7572  s & BOOST_SERIALIZATION_NVP(p_entries);
7573  }
7574 #endif
7575 #endif // SgAsmElfDynamicEntryList_OTHERS
7576 
7577 #ifdef DOCUMENTATION
7578  };
7579 #endif
7580 
7582 
7583  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
7584  IS_SERIALIZABLE(AsmElfDynamicEntry);
7585 
7586 #ifdef DOCUMENTATION
7587 
7589  public:
7590 #endif
7591 
7592 #ifdef DOCUMENTATION
7593 
7598  EntryType get_d_tag() const;
7599  void set_d_tag(EntryType);
7601 #else
7602  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
7603  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7604 #endif
7605 
7606 #ifdef DOCUMENTATION
7607 
7612  rose_rva_t get_d_val() const;
7613  void set_d_val(rose_rva_t);
7615 #else
7616  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
7617  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7618 #endif
7619 
7620 #ifdef DOCUMENTATION
7621  // declared and documented below
7622 #else
7623  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
7624  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7625 #endif
7626 
7627 #ifdef DOCUMENTATION
7628 
7631  const SgUnsignedCharList& get_extra() const;
7632  void set_extra(const SgUnsignedCharList&);
7634 #else
7635  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7636  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7637 #endif
7638 
7639  DECLARE_OTHERS(AsmElfDynamicEntry);
7640 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
7641 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7642  private:
7643  friend class boost::serialization::access;
7644 
7645  template<class S>
7646  void serialize(S &s, const unsigned /*version*/) {
7647  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7648  s & BOOST_SERIALIZATION_NVP(p_d_tag);
7649  s & BOOST_SERIALIZATION_NVP(p_d_val);
7650  s & BOOST_SERIALIZATION_NVP(p_name);
7651  s & BOOST_SERIALIZATION_NVP(p_extra);
7652  }
7653 #endif
7654 
7655  public:
7656  enum EntryType { /* Type Executable SharedObj Purpose */
7657  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
7658  DT_NEEDED = 1, /* value optional optional Name of needed library */
7659  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
7660  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
7661  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
7662  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
7663  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
7664  DT_RELA = 7, /* pointer mandatory optional Relocation table */
7665  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
7666  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
7667  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
7668  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
7669  DT_INIT = 12, /* pointer optional optional Initialization function */
7670  DT_FINI = 13, /* pointer optional optional Termination function */
7671  DT_SONAME = 14, /* value ignored optional Name of shared object */
7672  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
7673  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
7674  DT_REL = 17, /* pointer mandatory optional Relocation table */
7675  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
7676  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
7677  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
7678  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
7679  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
7680  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
7681  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
7682  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
7683  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
7684  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
7685  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
7686  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
7687  DT_FLAGS = 30, /* value optional ? Bit flags */
7688  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
7689  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
7690  DT_NUM = 34, /* ? ? ? "number used"? */
7691 
7692  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
7693  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
7694  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
7695  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
7696  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
7697  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
7698  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
7699  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
7700  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
7701  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
7702  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
7703 
7704  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
7705  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
7706  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
7707  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
7708  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
7709  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
7710  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
7711  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
7712  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
7713  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
7714  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
7715 
7716  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
7717  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
7718  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
7719  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
7720  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
7721  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
7722  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
7723  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
7724 
7725  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
7726  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
7727  };
7728 
7729 #ifdef _MSC_VER
7730 # pragma pack (1)
7731 #endif
7732 
7735  uint32_t d_tag;
7736  uint32_t d_val;
7737  }
7738 #if !defined(SWIG) && !defined(_MSC_VER)
7739  __attribute__((packed))
7740 #endif
7741  ;
7742 
7744  uint64_t d_tag;
7745  uint64_t d_val;
7746  }
7747 #if !defined(SWIG) && !defined(_MSC_VER)
7748  __attribute__((packed))
7749 #endif
7750  ;
7751 
7752 #ifdef _MSC_VER
7753 # pragma pack ()
7754 #endif
7755 
7758  : p_d_tag(DT_NULL), p_name(NULL) {
7759  ctor(dynsec);
7760  }
7761 
7765  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);
7766  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*);
7772  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*) const;
7773  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*) const;
7777  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
7778 
7780  static std::string to_string(SgAsmElfDynamicEntry::EntryType);
7781 
7785  SgAsmGenericString* get_name() const { return p_name; }
7789  private:
7790  void ctor(SgAsmElfDynamicSection*);
7791 #endif // SgAsmElfDynamicEntry_OTHERS
7792 
7793 #ifdef DOCUMENTATION
7794  };
7795 #endif
7796 
7797 
7798 
7799 
7801 
7802  /*************************************************************************************************************************
7803  * ELF String Tables
7804  *************************************************************************************************************************/
7805 
7807 
7808  DECLARE_LEAF_CLASS(AsmElfStringSection);
7809  IS_SERIALIZABLE(AsmElfStringSection);
7810  AsmElfStringSection.setAutomaticGenerationOfDestructor(false);
7811 
7812 #ifdef DOCUMENTATION
7813 
7817  public:
7818 #endif
7819 
7820 #ifdef DOCUMENTATION
7821 
7826  SgAsmElfStrtab* get_strtab() const;
7827  void set_strtab(SgAsmElfStrtab*);
7829 #else
7830  AsmElfStringSection.setDataPrototype("SgAsmElfStrtab*", "strtab", "= NULL",
7831  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7832 #endif
7833 
7834  DECLARE_OTHERS(AsmElfStringSection);
7835 #if defined(SgAsmElfStringSection_OTHERS) || defined(DOCUMENTATION)
7836 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7837  private:
7838  friend class boost::serialization::access;
7839 
7840  template<class S>
7841  void serialize(S &s, const unsigned /*version*/) {
7842  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7843  s & BOOST_SERIALIZATION_NVP(p_strtab);
7844  }
7845 #endif
7846 
7847  public:
7850  : SgAsmElfSection(fhdr), p_strtab(NULL) {
7851  ctor();
7852  }
7853 
7855  virtual SgAsmElfStringSection *parse() $ROSE_OVERRIDE;
7856 
7858  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7859 
7864  virtual void set_size(rose_addr_t newsize) $ROSE_OVERRIDE;
7865 
7872  virtual bool reallocate() $ROSE_OVERRIDE;
7873 
7875  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7876 
7877  private:
7878  void ctor();
7879  void ctor(SgAsmElfSectionTable*);
7880 #endif // SgAsmElfStringSection_OTHERS
7881 
7882 #ifdef DOCUMENTATION
7883  };
7884 #endif
7885 
7887 
7888  DECLARE_LEAF_CLASS(AsmElfStrtab);
7889  IS_SERIALIZABLE(AsmElfStrtab);
7890  AsmElfStrtab.setAutomaticGenerationOfDestructor(false);
7891 
7892 #ifdef DOCUMENTATION
7893 
7894  class SgAsmElfStrtab: public SgAsmGenericStrtab {
7895  public:
7896 #endif
7897 
7898  DECLARE_OTHERS(AsmElfStrtab);
7899 #if defined(SgAsmElfStrtab_OTHERS) || defined(DOCUMENTATION)
7900 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7901  private:
7902  friend class boost::serialization::access;
7903 
7904  template<class S>
7905  void serialize(S &s, const unsigned /*version*/) {
7906  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericStrtab);
7907  }
7908 #endif
7909 
7910  public:
7914  explicit SgAsmElfStrtab(class SgAsmElfSection *containing_section)
7915  : SgAsmGenericStrtab(containing_section) {
7916  ctor();
7917  }
7918 
7925  virtual ~SgAsmElfStrtab();
7926 
7930  virtual SgAsmElfStrtab *parse() $ROSE_OVERRIDE;
7931 
7935  virtual void unparse(std::ostream&) const;
7936 
7942  virtual SgAsmStringStorage *create_storage(rose_addr_t offset, bool shared) $ROSE_OVERRIDE;
7943 
7947  virtual rose_addr_t get_storage_size(const SgAsmStringStorage*) $ROSE_OVERRIDE;
7948 
7958  virtual void allocate_overlap(SgAsmStringStorage*) $ROSE_OVERRIDE;
7959 
7961  virtual void rebind(SgAsmStringStorage*, rose_addr_t) $ROSE_OVERRIDE;
7962 
7963  private:
7964  void ctor();
7965 #endif // SgAsmElfStrtab_OTHERS
7966 
7967 #ifdef DOCUMENTATION
7968  };
7969 #endif
7970 
7971 
7972 
7973 
7975 
7976  /*************************************************************************************************************************
7977  * ELF Notes
7978  *************************************************************************************************************************/
7979 
7981 
7982  DECLARE_LEAF_CLASS(AsmElfNoteSection);
7983  IS_SERIALIZABLE(AsmElfNoteSection);
7984 
7985 #ifdef DOCUMENTATION
7987  public:
7988 #endif
7989 
7990 #ifdef DOCUMENTATION
7991 
8000 #else
8001  AsmElfNoteSection.setDataPrototype("SgAsmElfNoteEntryList*", "entries", "= NULL",
8002  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8003 #endif
8004 
8005  DECLARE_OTHERS(AsmElfNoteSection);
8006 #if defined(SgAsmElfNoteSection_OTHERS) || defined(DOCUMENTATION)
8007 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8008  private:
8009  friend class boost::serialization::access;
8010 
8011  template<class S>
8012  void serialize(S &s, const unsigned /*version*/) {
8013  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8014  s & BOOST_SERIALIZATION_NVP(p_entries);
8015  }
8016 #endif
8017 
8018  public:
8021  : SgAsmElfSection(fhdr) {
8022  ctor();
8023  }
8024  virtual SgAsmElfNoteSection *parse() $ROSE_OVERRIDE;
8025 
8027  virtual bool reallocate() $ROSE_OVERRIDE;
8028 
8030  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8031 
8033  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8034 
8035  private:
8036  void ctor();
8037 #endif // SgAsmElfNoteSection_OTHERS
8038 
8039 #ifdef DOCUMENTATION
8040  };
8041 #endif
8042 
8044 
8045  DECLARE_LEAF_CLASS(AsmElfNoteEntryList);
8046  IS_SERIALIZABLE(AsmElfNoteEntryList);
8047 
8048 #ifdef DOCUMENTATION
8049 
8054  public:
8055 #endif
8056 
8057 #ifdef DOCUMENTATION
8058 
8061  const SgAsmElfNoteEntryPtrList& get_entries() const;
8062  void set_entries(const SgAsmElfNoteEntryPtrList&);
8064 #else
8065  AsmElfNoteEntryList.setDataPrototype("SgAsmElfNoteEntryPtrList", "entries", "",
8066  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8067 #endif
8068 
8069  DECLARE_OTHERS(AsmElfNoteEntryList);
8070 #if defined(SgAsmElfNoteEntryList_OTHERS) || defined(DOCUMENTATION)
8071 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8072  private:
8073  friend class boost::serialization::access;
8074 
8075  template<class S>
8076  void serialize(S &s, const unsigned /*version*/) {
8077  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8078  s & BOOST_SERIALIZATION_NVP(p_entries);
8079  }
8080 #endif
8081 #endif // SgAsmElfNoteEntryList_OTHERS
8082 
8083 #ifdef DOCUMENTATION
8084  };
8085 #endif
8086 
8088 
8089  DECLARE_LEAF_CLASS(AsmElfNoteEntry);
8090  IS_SERIALIZABLE(AsmElfNoteEntry);
8091 
8092 #ifdef DOCUMENTATION
8093 
8095  public:
8096 #endif
8097 
8098 #ifdef DOCUMENTATION
8099 
8104  unsigned get_type() const;
8105  void set_type(unsigned);
8107 #else
8108  AsmElfNoteEntry.setDataPrototype("unsigned", "type", "= 0",
8109  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8110 #endif
8111 
8112 #ifdef DOCUMENTATION
8113  // documented below
8114 #else
8115  AsmElfNoteEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
8116  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8117 #endif
8118 
8119 #ifdef DOCUMENTATION
8120 
8125  const SgUnsignedCharList& get_payload() const;
8126  void set_payload(const SgUnsignedCharList&);
8128 #else
8129  AsmElfNoteEntry.setDataPrototype("SgUnsignedCharList", "payload", "",
8130  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8131 #endif
8132 
8133  DECLARE_OTHERS(AsmElfNoteEntry);
8134 #if defined(SgAsmElfNoteEntry_OTHERS) || defined(DOCUMENTATION)
8135 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8136  private:
8137  friend class boost::serialization::access;
8138 
8139  template<class S>
8140  void serialize(S &s, const unsigned /*version*/) {
8141  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8142  s & BOOST_SERIALIZATION_NVP(p_type);
8143  s & BOOST_SERIALIZATION_NVP(p_name);
8144  s & BOOST_SERIALIZATION_NVP(p_payload);
8145  }
8146 #endif
8147 
8148  public:
8151  : p_type(0), p_name(NULL) {
8152  ctor(section);
8153  }
8154 
8161  SgAsmGenericString *get_name() const;
8162  void set_name(SgAsmGenericString *name);
8168  rose_addr_t parse(rose_addr_t starting_offset);
8169 
8173  rose_addr_t unparse(std::ostream &f, rose_addr_t starting_offset);
8174 
8176  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
8177 
8181  void set_payload(const void*, size_t nbytes);
8182 
8184  rose_addr_t calculate_size() const;
8185 
8186  private:
8187  void ctor(SgAsmElfNoteSection *section);
8188 #endif // SgAsmElfNoteEntry_OTHERS
8189 
8190 #ifdef DOCUMENTATION
8191  };
8192 #endif
8193 
8194 
8195 
8197 
8198  /*************************************************************************************************************************
8199  * ELF Exception Handling
8200  *************************************************************************************************************************/
8201 
8203 
8204  DECLARE_LEAF_CLASS(AsmElfEHFrameSection);
8205  IS_SERIALIZABLE(AsmElfEHFrameSection);
8206 
8207 #ifdef DOCUMENTATION
8208 
8210  public:
8211 #endif
8212 
8213 #ifdef DOCUMENTATION
8214 
8223 #else
8224  AsmElfEHFrameSection.setDataPrototype("SgAsmElfEHFrameEntryCIList*", "ci_entries", "= NULL"