ROSE  0.9.10.200
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  private:
760  struct SemanticFailure {
761  size_t n;
762  SemanticFailure(): n(0) {}
763  };
764  SemanticFailure semanticFailure_;
765 
766  public:
771  static const int64_t INVALID_STACK_DELTA;
772 
778  virtual std::string description() const { return ""; }
779 
780  // FIXME[Robb P Matzke 2017-02-13]: unused?
781  void appendSources( SgAsmInstruction* instruction );
782 
784  size_t nOperands() const;
785 
789  SgAsmExpression* operand(size_t) const;
790 
797  virtual bool terminatesBasicBlock();
798 
812  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
813  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
825  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
826  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
832  bool isFirstInBlock();
833 
837  bool isLastInBlock();
838 
843  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
844 
979  virtual bool hasEffect();
980 
989  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
990  bool relax_stack_semantics=false);
991 
1001  virtual std::vector<std::pair<size_t,size_t> >
1002  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
1003  bool relax_stack_semantics=false);
1004 
1011  virtual std::set<rose_addr_t> getSuccessors(bool* complete); /*subclasses must redefine*/
1012 
1021  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1022  bool *complete,
1023  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1025 
1031  virtual size_t get_size() const;
1032 
1038  virtual bool isUnknown() const;
1039 
1073  virtual unsigned get_anyKind() const;
1074 
1078  virtual std::string toString() const;
1079 
1084  virtual std::set<rose_addr_t> explicitConstants() const;
1085 
1095  size_t semanticFailure() const;
1096  void semanticFailure(size_t);
1097  void incrementSemanticFailure();
1100 #endif // SgAsmInstruction_OTHERS
1101 
1102 #ifdef DOCUMENTATION
1103  };
1104 #endif
1105 
1106 
1107 
1109 
1110  /**************************************************************************************************************************
1111  * Instruction Expressions
1112  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1113  **************************************************************************************************************************/
1114 
1116 
1117  DECLARE_LEAF_CLASS(AsmOperandList);
1118  IS_SERIALIZABLE(AsmOperandList);
1119 
1120 #ifdef DOCUMENTATION
1121 
1122  class SgAsmOperandList: public SgAsmNode {
1123  public:
1124 #endif
1125 
1126 #ifdef DOCUMENTATION
1127 
1133  const SgAsmExpressionPtrList& get_operands() const;
1134  void set_oerands(const SgAsmExpressionPtrList&);
1136 #else
1137  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1138  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1139 #endif
1140 
1141  DECLARE_OTHERS(AsmOperandList);
1142 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1143 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1144  private:
1145  friend class boost::serialization::access;
1146 
1147  template<class S>
1148  void serialize(S &s, const unsigned /*version*/) {
1149  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1150  s & BOOST_SERIALIZATION_NVP(p_operands);
1151  }
1152 #endif
1153 
1154  public:
1156  void append_operand(SgAsmExpression* operand);
1157 #endif // SgAsmOperandList_OTHERS
1158 
1159 #ifdef DOCUMENTATION
1160  };
1161 #endif
1162 
1163  // FIXME[Robb P Matzke 2016-10-31]
1164  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1165 
1167 
1168  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1169  IS_SERIALIZABLE(AsmBinaryAdd);
1170 
1171 #ifdef DOCUMENTATION
1172 
1174  public:
1175 #endif
1176 
1177  DECLARE_OTHERS(AsmBinaryAdd);
1178 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1179 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1180  private:
1181  friend class boost::serialization::access;
1182 
1183  template<class S>
1184  void serialize(S &s, const unsigned /*version*/) {
1185  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1186  }
1187 #endif
1188 #endif // SgAsmBinaryAdd_OTHERS
1189 
1190 #ifdef DOCUMENTATION
1191  };
1192 #endif
1193 
1195 
1196  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1197  IS_SERIALIZABLE(AsmBinarySubtract);
1198 
1199 #ifdef DOCUMENTATION
1200 
1202  public:
1203 #endif
1204 
1205  DECLARE_OTHERS(AsmBinarySubtract);
1206 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1207 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1208  private:
1209  friend class boost::serialization::access;
1210 
1211  template<class S>
1212  void serialize(S &s, const unsigned /*version*/) {
1213  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1214  }
1215 #endif
1216 #endif // SgAsmBinarySubtract_OTHERS
1217 
1218 #ifdef DOCUMENTATION
1219  };
1220 #endif
1221 
1223 
1224  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1225  IS_SERIALIZABLE(AsmBinaryMultiply);
1226 
1227 #ifdef DOCUMENTATION
1228 
1230  public:
1231 #endif
1232 
1233  DECLARE_OTHERS(AsmBinaryMultiply);
1234 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1235 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1236  private:
1237  friend class boost::serialization::access;
1238 
1239  template<class S>
1240  void serialize(S &s, const unsigned /*version*/) {
1241  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1242  }
1243 #endif
1244 #endif // SgAsmBinaryMultiply_OTHERS
1245 
1246 #ifdef DOCUMENTATION
1247  };
1248 #endif
1249 
1251 
1252  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1253  IS_SERIALIZABLE(AsmBinaryDivide);
1254 
1255 #ifdef DOCUMENTATION
1256 
1258  public:
1259 #endif
1260 
1261  DECLARE_OTHERS(AsmBinaryDivide);
1262 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1263 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1264  private:
1265  friend class boost::serialization::access;
1266 
1267  template<class S>
1268  void serialize(S &s, const unsigned /*version*/) {
1269  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1270  }
1271 #endif
1272 #endif // SgAsmBinaryDivide_OTHERS
1273 
1274 #ifdef DOCUMENTATION
1275  };
1276 #endif
1277 
1279 
1280  DECLARE_LEAF_CLASS(AsmBinaryMod);
1281  IS_SERIALIZABLE(AsmBinaryMod);
1282 
1283 #ifdef DOCUMENTATION
1284 
1286  public:
1287 #endif
1288 
1289  DECLARE_OTHERS(AsmBinaryMod);
1290 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1291 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1292  private:
1293  friend class boost::serialization::access;
1294 
1295  template<class S>
1296  void serialize(S &s, const unsigned /*version*/) {
1297  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1298  }
1299 #endif
1300 #endif // SgAsmBinaryMod_OTHERS
1301 
1302 #ifdef DOCUMENTATION
1303  };
1304 #endif
1305 
1307 
1308  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1309  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1310 
1311 #ifdef DOCUMENTATION
1312 
1314  public:
1315 #endif
1316 
1317  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1318 #if defined(SgAsmBinaryAddPreupdate_OTHERS) || defined(DOCUMENTATION)
1319 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1320  private:
1321  friend class boost::serialization::access;
1322 
1323  template<class S>
1324  void serialize(S &s, const unsigned /*version*/) {
1325  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1326  }
1327 #endif
1328 #endif // SgAsmBinaryAddPreupdate_OTHERS
1329 
1330 #ifdef DOCUMENTATION
1331  };
1332 #endif
1333 
1335 
1336  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1337  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1338 
1339 #ifdef DOCUMENTATION
1340 
1342  public:
1343 #endif
1344 
1345  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1346 #if defined(SgAsmBinarySubtractPreupdate_OTHERS) || defined(DOCUMENTATION)
1347 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1348  private:
1349  friend class boost::serialization::access;
1350 
1351  template<class S>
1352  void serialize(S &s, const unsigned /*version*/) {
1353  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1354  }
1355 #endif
1356 #endif // SgAsmBinarySubtractPreupdate_OTHERS
1357 
1358 #ifdef DOCUMENTATION
1359  };
1360 #endif
1361 
1363 
1364  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1365  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1366 
1367 #ifdef DOCUMENTATION
1368 
1370  public:
1371 #endif
1372 
1373  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1374 #if defined(SgAsmBinaryAddPostupdate_OTHERS) || defined(DOCUMENTATION)
1375 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1376  private:
1377  friend class boost::serialization::access;
1378 
1379  template<class S>
1380  void serialize(S &s, const unsigned /*version*/) {
1381  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1382  }
1383 #endif
1384 #endif // SgAsmBinaryAddPostupdate_OTHERS
1385 
1386 #ifdef DOCUMENTATION
1387  };
1388 #endif
1389 
1391 
1392  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1393  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1394 
1395 #ifdef DOCUMENTATION
1396 
1398  public:
1399 #endif
1400 
1401  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1402 #if defined(SgAsmBinarySubtractPostupdate_OTHERS) || defined(DOCUMENTATION)
1403 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1404  private:
1405  friend class boost::serialization::access;
1406 
1407  template<class S>
1408  void serialize(S &s, const unsigned /*version*/) {
1409  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1410  }
1411 #endif
1412 #endif // SgAsmBinarySubtractPostupdate_OTHERS
1413 
1414 #ifdef DOCUMENTATION
1415  };
1416 #endif
1417 
1419 
1420  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1421  IS_SERIALIZABLE(AsmBinaryLsl);
1422 
1423 #ifdef DOCUMENTATION
1424 
1426  public:
1427 #endif
1428 
1429  DECLARE_OTHERS(AsmBinaryLsl);
1430 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1431 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1432  private:
1433  friend class boost::serialization::access;
1434 
1435  template<class S>
1436  void serialize(S &s, const unsigned /*version*/) {
1437  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1438  }
1439 #endif
1440 #endif // SgAsmBinaryLsl_OTHERS
1441 
1442 #ifdef DOCUMENTATION
1443  };
1444 #endif
1445 
1447 
1448  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1449  IS_SERIALIZABLE(AsmBinaryLsr);
1450 
1451 #ifdef DOCUMENTATION
1452 
1454  public:
1455 #endif
1456 
1457  DECLARE_OTHERS(AsmBinaryLsr);
1458 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1459 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1460  private:
1461  friend class boost::serialization::access;
1462 
1463  template<class S>
1464  void serialize(S &s, const unsigned /*version*/) {
1465  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1466  }
1467 #endif
1468 #endif // SgAsmBinaryLsr_OTHERS
1469 
1470 #ifdef DOCUMENTATION
1471  };
1472 #endif
1473 
1475 
1476  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1477  IS_SERIALIZABLE(AsmBinaryAsr);
1478 
1479 #ifdef DOCUMENTATION
1480 
1482  public:
1483 #endif
1484 
1485  DECLARE_OTHERS(AsmBinaryAsr);
1486 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1487 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1488  private:
1489  friend class boost::serialization::access;
1490 
1491  template<class S>
1492  void serialize(S &s, const unsigned /*version*/) {
1493  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1494  }
1495 #endif
1496 #endif // SgAsmBinaryAsr_OTHERS
1497 
1498 #ifdef DOCUMENTATION
1499  };
1500 #endif
1501 
1503 
1504  DECLARE_LEAF_CLASS(AsmBinaryRor);
1505  IS_SERIALIZABLE(AsmBinaryRor);
1506 
1507 #ifdef DOCUMENTATION
1508 
1510  public:
1511 #endif
1512 
1513  DECLARE_OTHERS(AsmBinaryRor);
1514 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1515 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1516  private:
1517  friend class boost::serialization::access;
1518 
1519  template<class S>
1520  void serialize(S &s, const unsigned /*version*/) {
1521  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1522  }
1523 #endif
1524 #endif // SgAsmBinaryRor_OTHERS
1525 
1526 #ifdef DOCUMENTATION
1527  };
1528 #endif
1529 
1531 
1532  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1533  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1534  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1535  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1536  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1537  AsmBinaryRor,
1538  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1539  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1540  IS_SERIALIZABLE(AsmBinaryExpression);
1541 
1542 #ifdef DOCUMENTATION
1543 
1545  public:
1546 #endif
1547 
1548 #ifdef DOCUMENTATION
1549 
1552  SgAsmExpression* get_lhs() const;
1553  void set_lhs(SgAsmExpression*);
1555 #else
1556  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1557  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1558 #endif
1559 
1560 #ifdef DOCUMENTATION
1561 
1564  SgAsmExpression* get_rhs() const;
1565  void set_rhs(SgAsmExpression*);
1567 #else
1568  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1569  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1570 #endif
1571 
1572  DECLARE_OTHERS(AsmBinaryExpression);
1573 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1574 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1575  private:
1576  friend class boost::serialization::access;
1577 
1578  template<class S>
1579  void serialize(S &s, const unsigned /*version*/) {
1580  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1581  s & BOOST_SERIALIZATION_NVP(p_lhs);
1582  s & BOOST_SERIALIZATION_NVP(p_rhs);
1583  }
1584 #endif
1585 #endif // SgAsmBinaryExpression_OTHERS
1586 
1587 #ifdef DOCUMENTATION
1588  };
1589 #endif
1590 
1592 
1593  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1594  IS_SERIALIZABLE(AsmUnaryPlus);
1595 
1596 #ifdef DOCUMENTATION
1597 
1599  public:
1600 #endif
1601 
1602  DECLARE_OTHERS(AsmUnaryPlus);
1603 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1604 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1605  private:
1606  friend class boost::serialization::access;
1607 
1608  template<class S>
1609  void serialize(S &s, const unsigned /*version*/) {
1610  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1611  }
1612 #endif
1613 #endif // SgAsmUnaryPlus_OTHERS
1614 
1615 #ifdef DOCUMENTATION
1616  };
1617 #endif
1618 
1620 
1621  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1622  IS_SERIALIZABLE(AsmUnaryMinus);
1623 
1624 #ifdef DOCUMENTATION
1625 
1627  public:
1628 #endif
1629 
1630  DECLARE_OTHERS(AsmUnaryMinus);
1631 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1632 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1633  private:
1634  friend class boost::serialization::access;
1635 
1636  template<class S>
1637  void serialize(S &s, const unsigned /*version*/) {
1638  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1639  }
1640 #endif
1641 #endif // SgAsmUnaryMinus_OTHERS
1642 
1643 #ifdef DOCUMENTATION
1644  };
1645 #endif
1646 
1648 
1649  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1650  IS_SERIALIZABLE(AsmUnaryRrx);
1651 
1652 #ifdef DOCUMENTATION
1653  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1655  public:
1656 #endif
1657 
1658  DECLARE_OTHERS(AsmUnaryRrx);
1659 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1660 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1661  private:
1662  friend class boost::serialization::access;
1663 
1664  template<class S>
1665  void serialize(S &s, const unsigned /*version*/) {
1666  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1667  }
1668 #endif
1669 #endif // SgAsmUnaryRrx_OTHERS
1670 
1671 #ifdef DOCUMENTATION
1672  };
1673 #endif
1674 
1676 
1677  DECLARE_LEAF_CLASS(AsmUnaryArmSpecialRegisterList);
1678  IS_SERIALIZABLE(AsmUnaryArmSpecialRegisterList);
1679 
1680 #ifdef DOCUMENTATION
1681  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1683  public:
1684 #endif
1685 
1686  DECLARE_OTHERS(AsmUnaryArmSpecialRegisterList);
1687 #if defined(SgAsmUnaryArmSpecialRegisterList_OTHERS) || defined(DOCUMENTATION)
1688 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1689  private:
1690  friend class boost::serialization::access;
1691 
1692  template<class S>
1693  void serialize(S &s, const unsigned /*version*/) {
1694  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1695  }
1696 #endif
1697 #endif // SgAsmUnaryArmSpecialRegisterList_OTHERS
1698 
1699 #ifdef DOCUMENTATION
1700  };
1701 #endif
1702 
1704 
1705  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
1706  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryArmSpecialRegisterList,
1707  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
1708  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1709  IS_SERIALIZABLE(AsmUnaryExpression);
1710 
1711 #ifdef DOCUMENTATION
1712 
1714  public:
1715 #endif
1716 
1717 #ifdef DOCUMENTATION
1718 
1721  SgAsmExpression* get_operand() const;
1724 #else
1725  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
1726  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1727 #endif
1728 
1729  DECLARE_OTHERS(AsmUnaryExpression);
1730 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
1731 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1732  private:
1733  friend class boost::serialization::access;
1734 
1735  template<class S>
1736  void serialize(S &s, const unsigned /*version*/) {
1737  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1738  s & BOOST_SERIALIZATION_NVP(p_operand);
1739  }
1740 #endif
1741 #endif // SgAsmUnaryExpression_OTHERS
1742 
1743 #ifdef DOCUMENTATION
1744  };
1745 #endif
1746 
1748 
1749  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
1750  IS_SERIALIZABLE(AsmDirectRegisterExpression);
1751 
1752 #ifdef DOCUMENTATION
1753 
1755  public:
1756 #endif
1757 
1758 #ifdef DOCUMENTATION
1759 
1762  unsigned get_psr_mask() const;
1763  void set_psr_mask(unsigned);
1765 #else
1766  AsmDirectRegisterExpression.setDataPrototype("unsigned", "psr_mask", "=0", // for ARM
1767  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1768  NO_DELETE);
1769 #endif
1770 
1771  DECLARE_OTHERS(AsmDirectRegisterExpression);
1772 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1773 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1774  private:
1775  friend class boost::serialization::access;
1776 
1777  template<class S>
1778  void serialize(S &s, const unsigned /*version*/) {
1779  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1780  s & BOOST_SERIALIZATION_NVP(p_psr_mask);
1781  }
1782 #endif
1783 
1784  private:
1785  // Default c'tor needed for serialization
1787  : p_psr_mask(0) {}
1788 #endif // SgAsmDirectRegisterExpression_OTHERS
1789 
1790 #ifdef DOCUMENTATION
1791  };
1792 #endif
1793 
1795 
1796  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
1797  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
1798 
1799 #ifdef DOCUMENTATION
1800 
1817  public:
1818 #endif
1819 
1820 #ifdef DOCUMENTATION
1821 
1829 #else
1830  AsmIndirectRegisterExpression.setDataPrototype("RegisterDescriptor", "stride", "",
1831  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1832 #endif
1833 
1834 #ifdef DOCUMENTATION
1835 
1843 #else
1844  AsmIndirectRegisterExpression.setDataPrototype("RegisterDescriptor", "offset", "",
1845  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1846 #endif
1847 
1848 #ifdef DOCUMENTATION
1849 
1854  size_t get_index() const;
1855  void set_index(size_t);
1857 #else
1858  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
1859  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1860 #endif
1861 
1862 #ifdef DOCUMENTATION
1863 
1868  size_t get_modulus() const;
1869  void set_modulus(size_t);
1871 #else
1872  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
1873  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1874 #endif
1875 
1876  DECLARE_OTHERS(AsmIndirectRegisterExpression);
1877 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1878 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1879  private:
1880  friend class boost::serialization::access;
1881 
1882  template<class S>
1883  void serialize(S &s, const unsigned /*version*/) {
1884  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1885  s & BOOST_SERIALIZATION_NVP(p_stride);
1886  s & BOOST_SERIALIZATION_NVP(p_offset);
1887  s & BOOST_SERIALIZATION_NVP(p_index);
1888  s & BOOST_SERIALIZATION_NVP(p_modulus);
1889  }
1890 #endif
1891 
1892  private:
1893  // Default c'tor needed for serialization
1895  : p_index(0), p_modulus(0) {}
1896 #endif // SgAsmIndirectRegisterExpression_OTHERS
1897 
1898 #ifdef DOCUMENTATION
1899  };
1900 #endif
1901 
1903 
1904  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
1905  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
1906  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
1907  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
1908 
1909 #ifdef DOCUMENTATION
1910 
1912  public:
1913 #endif
1914 
1915 #ifdef DOCUMENTATION
1916 
1922 #else
1923  AsmRegisterReferenceExpression.setDataPrototype("RegisterDescriptor", "descriptor", "",
1924  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1925 #endif
1926 
1927 #ifdef DOCUMENTATION
1928 
1933  int get_adjustment() const;
1934  void set_adjustment(int);
1936 #else
1937  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
1938  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1939  NO_DELETE);
1940 #endif
1941 
1942  DECLARE_OTHERS(AsmRegisterReferenceExpression);
1943 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
1944 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1945  private:
1946  friend class boost::serialization::access;
1947 
1948  template<class S>
1949  void serialize(S &s, const unsigned /*version*/) {
1950  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1951  s & BOOST_SERIALIZATION_NVP(p_descriptor);
1952  s & BOOST_SERIALIZATION_NVP(p_adjustment);
1953  }
1954 #endif
1955 
1956  protected:
1957  // Default c'tor needed for serialization
1959  : p_adjustment(0) {}
1960 #endif // SgAsmRegisterReferenceExpression_OTHERS
1961 
1962 #ifdef DOCUMENTATION
1963  };
1964 #endif
1965 
1967 
1968  DECLARE_LEAF_CLASS(AsmRegisterNames);
1969  IS_SERIALIZABLE(AsmRegisterNames);
1970 
1971 #ifdef DOCUMENTATION
1972 
1974  public:
1975 #endif
1976 
1977 #ifdef DOCUMENTATION
1978 
1984  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
1985  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
1987 #else
1988  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
1989  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1990 #endif
1991 
1992 #ifdef DOCUMENTATION
1993 
1999  unsigned get_mask() const;
2000  void set_mask(unsigned);
2002 #else
2003  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
2004  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2005 #endif
2006 
2007  DECLARE_OTHERS(AsmRegisterNames);
2008 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
2009 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2010  private:
2011  friend class boost::serialization::access;
2012 
2013  template<class S>
2014  void serialize(S &s, const unsigned /*version*/) {
2015  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2016  s & BOOST_SERIALIZATION_NVP(p_registers);
2017  s & BOOST_SERIALIZATION_NVP(p_mask);
2018  }
2019 #endif
2020 #endif // SgAsmRegisterNames_OTHERS
2021 
2022 #ifdef DOCUMENTATION
2023  };
2024 #endif
2025 
2027 
2028  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2029  IS_SERIALIZABLE(AsmIntegerValueExpression);
2030 
2031 #ifdef DOCUMENTATION
2032 
2048  public:
2049 #endif
2050 
2051 #ifdef DOCUMENTATION
2052 
2062  SgNode* get_baseNode() const;
2063  void set_baseNode(SgNode*);
2065 #else
2066  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2067  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2068 #endif
2069 
2070  DECLARE_OTHERS(AsmIntegerValueExpression);
2071 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2072 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2073  private:
2074  friend class boost::serialization::access;
2075 
2076  template<class S>
2077  void serialize(S &s, const unsigned /*version*/) {
2078  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2079  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2080  }
2081 #endif
2082 
2083  public:
2088  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2089 
2096 
2098  static uint64_t virtualAddress(SgNode*);
2099 
2119  std::string get_label(bool quiet=false) const;
2120 
2122  size_t get_significantBits() const;
2123 
2129  void makeRelativeTo(SgNode *baseNode);
2130 
2135  uint64_t get_baseAddress() const;
2136 
2142  uint64_t get_absoluteValue(size_t nbits=0) const;
2143 
2147  void set_absoluteValue(uint64_t);
2148 
2150  int64_t get_signedValue() const;
2151 
2155  int64_t get_relativeValue() const;
2156 
2161  void set_relativeValue(int64_t v, size_t nbits=64);
2162 
2163  uint64_t get_value() const { return get_absoluteValue(); }
2164 
2165 #endif // SgAsmIntegerValueExpression_OTHERS
2166 
2167 #ifdef DOCUMENTATION
2168  };
2169 #endif
2170 
2172 
2173  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2174  IS_SERIALIZABLE(AsmFloatValueExpression);
2175 
2176 #ifdef DOCUMENTATION
2177 
2182  public:
2183 #endif
2184 
2185  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2186 
2187  DECLARE_OTHERS(AsmFloatValueExpression);
2188 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2189  private:
2190  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2191  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2192  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2193  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2194  // understand "mutable".
2195  mutable double p_nativeValue;
2196  mutable bool p_nativeValueIsValid;
2197 
2198 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2199  private:
2200  friend class boost::serialization::access;
2201 
2202  template<class S>
2203  void serialize(S &s, const unsigned /*version*/) {
2204  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2205  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2206  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2207  }
2208 #endif
2209 
2210  public:
2215  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2216 
2222  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2223 
2230 
2232  void set_nativeValue(double);
2233 
2235  double get_nativeValue() const;
2236 
2241  void updateBitVector();
2242 
2247  void updateNativeValue() const;
2248 #endif // SgAsmFloatValueExpression_OTHERS
2249 
2250 #ifdef DOCUMENTATION
2251  };
2252 #endif
2253 
2255 
2256  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2257  AsmIntegerValueExpression | AsmFloatValueExpression,
2258  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2259  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2260  IS_SERIALIZABLE(AsmConstantExpression);
2261 
2262  DECLARE_HEADERS(AsmConstantExpression);
2263 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2264  #include <Sawyer/BitVector.h>
2265 #endif // SgAsmConstantExpression_HEADERS
2266 
2267 #ifdef DOCUMENTATION
2268 
2273  public:
2274 #endif
2275 
2276 #ifndef DOCUMENTATION
2277  // Documented below. Implemented below due to ROSETTA limitations.
2278  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2279  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2280 #endif
2281 
2282  DECLARE_OTHERS(AsmConstantExpression);
2283 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2284 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2285  private:
2286  friend class boost::serialization::access;
2287 
2288  template<class S>
2289  void serialize(S &s, const unsigned /*version*/) {
2290  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2291  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2292  }
2293 #endif
2294 
2295  public:
2301  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2302  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2303  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2305 #endif // SgAsmConstantExpression_OTHERS
2306 
2307 #ifdef DOCUMENTATION
2308  };
2309 #endif
2310 
2312 
2313  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2314  AsmConstantExpression,
2315  "AsmValueExpression", "AsmValueExpressionTag", false);
2316  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2317  IS_SERIALIZABLE(AsmValueExpression);
2318 
2319 #ifdef DOCUMENTATION
2320 
2328  public:
2329 #endif
2330 
2331 #ifdef DOCUMENTATION
2332 
2342 #else
2343  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
2344  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2345 #endif
2346 
2347 #ifdef DOCUMENTATION
2348 
2356  unsigned short get_bit_offset() const;
2357  void set_bit_offset(unsigned short);
2359 #else
2360  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
2361  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2362 #endif
2363 
2364 #ifdef DOCUMENTATION
2365 
2371  unsigned short get_bit_size() const;
2372  void set_bit_size(unsigned short);
2374 #else
2375  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
2376  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2377 #endif
2378 
2379 #ifdef DOCUMENTATION
2380 
2386  SgSymbol* get_symbol() const;
2387  void set_symbol(SgSymbol*);
2389 #else
2390  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
2391  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2392 #endif
2393 
2394  DECLARE_OTHERS(AsmValueExpression);
2395 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
2396 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2397  private:
2398  friend class boost::serialization::access;
2399 
2400  template<class S>
2401  void serialize(S &s, const unsigned /*version*/) {
2402  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2403  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
2404  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
2405  s & BOOST_SERIALIZATION_NVP(p_bit_size);
2406 #if 1
2407  ASSERT_require2(p_symbol == NULL, "not implemented yet");
2408 #else
2409  s & BOOST_SERIALIZATION_NVP(p_symbol);
2410 #endif
2411  }
2412 #endif
2413 #endif // SgAsmValueExpression_OTHERS
2414 
2415 #ifdef DOCUMENTATION
2416  };
2417 #endif
2418 
2420 
2421  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
2422  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
2423 
2424 #ifdef DOCUMENTATION
2425 
2427  public:
2428 #endif
2429 
2430 #ifdef DOCUMENTATION
2431 
2438  SgAsmExpression* get_address() const;
2441 #else
2442  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
2443  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2444 #endif
2445 
2446 #ifdef DOCUMENTATION
2447 
2454  SgAsmExpression* get_segment() const;
2457 #else
2458  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
2459  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2460 #endif
2461 
2462  DECLARE_OTHERS(AsmMemoryReferenceExpression);
2463 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2464 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2465  private:
2466  friend class boost::serialization::access;
2467 
2468  template<class S>
2469  void serialize(S &s, const unsigned /*version*/) {
2470  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2471  s & BOOST_SERIALIZATION_NVP(p_address);
2472  s & BOOST_SERIALIZATION_NVP(p_segment);
2473  }
2474 #endif
2475 #endif // SgAsmMemoryReferenceExpression_OTHERS
2476 
2477 #ifdef DOCUMENTATION
2478  };
2479 #endif
2480 
2482 
2483  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
2484  IS_SERIALIZABLE(AsmControlFlagsExpression);
2485 
2486 #ifdef DOCUMENTATION
2487  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2489  public:
2490 #endif
2491 
2492 #ifndef DOCUMENTATION
2493  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
2494  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2495 #endif
2496 
2497  DECLARE_OTHERS(AsmControlFlagsExpression);
2498 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
2499 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2500  private:
2501  friend class boost::serialization::access;
2502 
2503  template<class S>
2504  void serialize(S &s, const unsigned /*version*/) {
2505  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2506  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
2507  }
2508 #endif
2509 #endif // SgAsmControlFlagsExpression_OTHERS
2510 
2511 #ifdef DOCUMENTATION
2512  };
2513 #endif
2514 
2516 
2517  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
2518  IS_SERIALIZABLE(AsmCommonSubExpression);
2519 
2520 #ifdef DOCUMENTATION
2521  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2523  public:
2524 #endif
2525 
2526 #ifndef DOCUMENTATION
2527  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
2528  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2529 #endif
2530 
2531  DECLARE_OTHERS(AsmCommonSubExpression);
2532 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
2533 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2534  private:
2535  friend class boost::serialization::access;
2536 
2537  template<class S>
2538  void serialize(S &s, const unsigned /*version*/) {
2539  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2540  s & BOOST_SERIALIZATION_NVP(p_subexpression);
2541  }
2542 #endif
2543 #endif // SgAsmCommonSubExpression_OTHERS
2544 
2545 #ifdef DOCUMENTATION
2546  };
2547 #endif
2548 
2550 
2551  DECLARE_LEAF_CLASS(AsmRiscOperation);
2552  IS_SERIALIZABLE(AsmRiscOperation);
2553 
2554 #ifdef DOCUMENTATION
2555 
2564  public:
2565 #endif
2566 
2567 #ifdef DOCUMENTATION
2568 
2577 #else
2578  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
2579  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
2580 #endif
2581 
2582 #ifdef DOCUMENTATION
2583 
2589  SgAsmExprListExp* get_operands() const;
2592 #else
2593  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
2594  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2595 #endif
2596 
2597  DECLARE_OTHERS(AsmRiscOperation);
2598 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
2599  public:
2606  OP_NONE,
2607  OP_bottom,
2608  OP_undefined,
2609  OP_unspecified,
2610  OP_filterCallTarget,
2611  OP_filterReturnTarget,
2612  OP_filterIndirectJumpTarget,
2613  OP_hlt,
2614  OP_cpuid,
2615  OP_rdtsc,
2616  OP_and_,
2617  OP_or_,
2618  OP_xor_,
2619  OP_invert,
2620  OP_extract,
2621  OP_concat,
2622  OP_leastSignificantSetBit,
2623  OP_mostSignificantSetBit,
2624  OP_rotateLeft,
2625  OP_rotateRight,
2626  OP_shiftLeft,
2627  OP_shiftRight,
2628  OP_shiftRightArithmetic,
2629  OP_equalToZero,
2630  OP_ite,
2631  OP_isEqual,
2632  OP_isNotEqual,
2633  OP_isUnsignedLessThan,
2634  OP_isUnsignedLessThanOrEqual,
2635  OP_isUnsignedGreaterThan,
2636  OP_isUnsignedGreaterThanOrEqual,
2637  OP_isSignedLessThan,
2638  OP_isSignedLessThanOrEqual,
2639  OP_isSignedGreaterThan,
2640  OP_isSignedGreaterThanOrEqual,
2641  OP_unsignedExtend,
2642  OP_signExtend,
2645  OP_subtract,
2646  OP_negate,
2647  OP_signedDivide,
2648  OP_signedModulo,
2649  OP_signedMultiply,
2650  OP_unsignedDivide,
2651  OP_unsignedModulo,
2652  OP_unsignedMultiply,
2653  OP_interrupt,
2654  OP_readRegister,
2655  OP_peekRegister,
2656  OP_writeRegister,
2658  OP_peekMemory,
2660  OP_N_OPERATORS // MUST BE LAST!
2661  };
2662 
2663 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2664  private:
2665  friend class boost::serialization::access;
2666 
2667  template<class S>
2668  void serialize(S &s, const unsigned /*version*/) {
2669  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2670  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
2671  s & BOOST_SERIALIZATION_NVP(p_operands);
2672  }
2673 #endif
2674 #endif // SgAsmRiscOperation_OTHERS
2675 
2676 #ifdef DOCUMENTATION
2677  };
2678 #endif
2679 
2681 
2682  DECLARE_LEAF_CLASS(AsmExprListExp);
2683  IS_SERIALIZABLE(AsmExprListExp);
2684 
2685 #ifdef DOCUMENTATION
2686 
2688  public:
2689 #endif
2690 
2691 #ifdef DOCUMENTATION
2692 
2698  const SgAsmExpressionPtrList& get_expressions() const;
2699  void set_expressions(const SgAsmExpressionPtrList&);
2701 #else
2702  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
2703  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2704 #endif
2705 
2706  DECLARE_OTHERS(AsmExprListExp);
2707 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
2708 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2709  private:
2710  friend class boost::serialization::access;
2711 
2712  template<class S>
2713  void serialize(S &s, const unsigned /*version*/) {
2714  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2715  s & BOOST_SERIALIZATION_NVP(p_expressions);
2716  }
2717 #endif
2718 #endif // SgAsmExprListExp_OTHERS
2719 
2720 #ifdef DOCUMENTATION
2721  };
2722 #endif
2723 
2725 
2726  NEW_NONTERMINAL_MACRO(AsmExpression,
2727  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
2728  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
2729  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
2730  AsmRiscOperation,
2731  "AsmExpression", "AsmExpressionTag", false);
2732  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
2733  IS_SERIALIZABLE(AsmExpression);
2734 
2735 #ifdef DOCUMENTATION
2736 
2737  class SgAsmExpression: public SgAsmNode {
2738  public:
2739 #endif
2740 
2741 #ifdef DOCUMENTATION
2742 
2747  SgAsmType* get_type() const;
2748  void set_type(SgAsmType*);
2750 #else
2751  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
2752  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2753 #endif
2754 
2755 #ifdef DOCUMENTATION
2756 
2761  const std::string& get_comment() const;
2762  void set_comment(const std::string&);
2764 #else
2765  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
2766  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2767 #endif
2768 
2769  DECLARE_OTHERS(AsmExpression);
2770 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
2771 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2772  private:
2773  friend class boost::serialization::access;
2774 
2775  template<class S>
2776  void serialize(S &s, const unsigned /*version*/) {
2777  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
2778  s & BOOST_SERIALIZATION_NVP(p_type);
2779  s & BOOST_SERIALIZATION_NVP(p_comment);
2780  }
2781 #endif
2782 
2783  public:
2787  size_t get_nBits() const;
2788 
2794 
2800 
2801 #endif // SgAsmExpression_OTHERS
2802 
2803 #ifdef DOCUMENTATION
2804  };
2805 #endif
2806 
2807 
2808 
2809 
2811 
2812  /***************************************************************************************************************************
2813  * Data Types (new interface 2014-07)
2814  *
2815  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
2816  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
2817  * 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
2818  * don't allow types to be modified after they're created.
2819  ***************************************************************************************************************************/
2820 
2822 
2823  DECLARE_LEAF_CLASS(AsmIntegerType);
2824  IS_SERIALIZABLE(AsmIntegerType);
2825 
2826 #ifdef DOCUMENTATION
2827 
2829  public:
2830 #endif
2831 
2832 #ifndef DOCUMENTATION
2833  // Documented below due to ROSETTA limitations
2834  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
2835  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2836 #endif
2837 
2838  DECLARE_OTHERS(AsmIntegerType);
2839 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
2840 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2841  private:
2842  friend class boost::serialization::access;
2843 
2844  template<class S>
2845  void serialize(S &s, const unsigned /*version*/) {
2846  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2847  s & BOOST_SERIALIZATION_NVP(p_isSigned);
2848  }
2849 #endif
2850 
2851  public:
2855  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
2856 
2860  bool get_isSigned() const;
2861 
2862  // Overrides documented in base class
2863  virtual void check() const $ROSE_OVERRIDE;
2864  virtual std::string toString() const $ROSE_OVERRIDE;
2865 #endif // SgAsmIntegerType_OTHERS
2866 
2867 #ifdef DOCUMENTATION
2868  };
2869 #endif
2870 
2872 
2873  DECLARE_LEAF_CLASS(AsmFloatType);
2874  IS_SERIALIZABLE(AsmFloatType);
2875 
2876  DECLARE_HEADERS(AsmFloatType);
2877 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
2878  #include <Sawyer/BitVector.h>
2879 #endif // SgAsmFloatType_HEADERS
2880 
2881 #ifdef DOCUMENTATION
2882 
2884  public:
2885 #endif
2886 
2887 #ifndef DOCUMENTATION
2888  // Documented below because of ROSETTA limitations (they're read-only)
2889  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
2890  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2891  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
2892  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2893  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
2894  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2895  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
2896  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2897  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
2898  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2899  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
2900  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2901  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
2902  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2903 #endif
2904 
2905  DECLARE_OTHERS(AsmFloatType);
2906 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
2907 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2908  private:
2909  friend class boost::serialization::access;
2910 
2911  template<class S>
2912  void serialize(S &s, const unsigned /*version*/) {
2913  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2914  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
2915  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
2916  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
2917  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
2918  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
2919  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
2920  s & BOOST_SERIALIZATION_NVP(p_flags);
2921  }
2922 #endif
2923 
2924  public:
2925  enum {
2926  GRADUAL_UNDERFLOW = 0x00000001,
2927  NORMALIZED_SIGNIFICAND = 0x00000002
2928  };
2929 
2931 
2933  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
2934  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
2935  uint64_t exponentBias, unsigned flags);
2936 
2938  BitRange significandBits() const;
2939 
2941  BitRange exponentBits() const;
2942 
2944  size_t signBit() const;
2945 
2947  uint64_t exponentBias() const;
2948 
2950  unsigned flags() const;
2951 
2953  bool gradualUnderflow() const;
2954 
2956  bool normalizedSignificand() const;
2957 
2958  // Overrides documented in base class
2959  virtual void check() const $ROSE_OVERRIDE;
2960  virtual std::string toString() const $ROSE_OVERRIDE;
2961 #endif // SgAsmFloatType_OTHERS
2962 
2963 #ifdef DOCUMENTATION
2964  };
2965 #endif
2966 
2968 
2969  NEW_NONTERMINAL_MACRO(AsmScalarType,
2970  AsmIntegerType | AsmFloatType,
2971  "AsmScalarType", "AsmScalarTypeTag", false);
2972  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
2973  IS_SERIALIZABLE(AsmScalarType);
2974 
2975 #ifdef DOCUMENTATION
2976 
2977  class SgAsmScalarType: public SgAsmType {
2978  public:
2979 #endif
2980 
2981 #ifndef DOCUMENTATION
2982  // Documented below due to ROSETTA limitations (read-only)
2983  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2984  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2985  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2986  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2987  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
2988  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2989  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
2990  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2991 #endif
2992 
2993  DECLARE_OTHERS(AsmScalarType);
2994 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
2995 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2996  private:
2997  friend class boost::serialization::access;
2998 
2999  template<class S>
3000  void serialize(S &s, const unsigned /*version*/) {
3001  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3002  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
3003  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
3004  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
3005  s & BOOST_SERIALIZATION_NVP(p_nBits);
3006  }
3007 #endif
3008 
3009  protected:
3014  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
3015 
3016  public:
3018  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3019 
3021  ByteOrder::Endianness get_minorOrder() const;
3022 
3024  ByteOrder::Endianness get_majorOrder() const;
3025 
3027  size_t get_majorNBytes() const;
3028 
3029  // Overrides documented in base class
3030  virtual void check() const $ROSE_OVERRIDE;
3031  virtual std::string toString() const $ROSE_OVERRIDE;
3032 #endif // SgAsmScalarType_OTHERS
3033 
3034 #ifdef DOCUMENTATION
3035  };
3036 #endif
3037 
3039 
3040  DECLARE_LEAF_CLASS(AsmVectorType);
3041  IS_SERIALIZABLE(AsmVectorType);
3042 
3043 #ifdef DOCUMENTATION
3044 
3045  class SgAsmVectorType: public SgAsmType {
3046  public:
3047 #endif
3048 
3049 #ifndef DOCUMENTATION
3050  // Documented below due to ROSETTA limitations (read-only)
3051  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3052  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3053  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3054  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3055 #endif
3056 
3057  DECLARE_OTHERS(AsmVectorType);
3058 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3059 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3060  private:
3061  friend class boost::serialization::access;
3062 
3063  template<class S>
3064  void serialize(S &s, const unsigned /*version*/) {
3065  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3066  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3067  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3068  }
3069 #endif
3070 
3071  public:
3073  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3074 
3076  size_t get_nElmts() const;
3077 
3079  SgAsmType* get_elmtType() const;
3080 
3081  // Overrides documented in base class
3082  virtual void check() const $ROSE_OVERRIDE;
3083  virtual std::string toString() const $ROSE_OVERRIDE;
3084  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3085 #endif // SgAsmVectorType_OTHERS
3086 
3087 #ifdef DOCUMENTATION
3088  };
3089 #endif
3090 
3092 
3093  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3094  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3095  IS_SERIALIZABLE(AsmType);
3096 
3097 #ifdef DOCUMENTATION
3098 
3099  class SgAsmType: public SgAsmNode {
3100  public:
3101 #endif
3102 
3103  DECLARE_OTHERS(AsmType);
3104 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3105  private:
3107 
3108 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3109  private:
3110  friend class boost::serialization::access;
3111 
3112  template<class S>
3113  void serialize(S &s, const unsigned /*version*/) {
3114  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3115  }
3116 #endif
3117 
3118  public:
3126  virtual void check() const;
3127 
3133  virtual std::string toString() const {
3134  abort(); // ROSETTA limitation: intended pure virtual
3135  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3136  }
3137 
3139  virtual size_t get_nBits() const {
3140  abort(); // ROSETTA limitation: intended pure virtual
3141  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3142  }
3143 
3145  virtual size_t get_nBytes() const;
3146 
3152  template<class Type> // Type is a subclass of SgAsmType
3153  static Type* registerOrDelete(Type *toInsert) {
3154  ASSERT_not_null(toInsert);
3155  std::string key = toInsert->toString();
3156  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3157  ASSERT_not_null(retval);
3158  if (retval!=toInsert)
3159  delete toInsert;
3160  return retval;
3161  }
3162 #endif // SgAsmType_OTHERS
3163 
3164 #ifdef DOCUMENTATION
3165  };
3166 #endif
3167 
3168 
3169 
3171 
3172  /**************************************************************************************************************************
3173  * Collections of Instructions
3174  **************************************************************************************************************************/
3175 
3177 
3178  DECLARE_LEAF_CLASS(AsmFunction);
3179  IS_SERIALIZABLE(AsmFunction);
3180 
3181 #ifdef DOCUMENTATION
3182 
3198  public:
3199 #endif
3200 
3201 #ifdef DOCUMENTATION
3202 
3207  const std::string& get_name() const;
3208  void set_name(const std::string&);
3210 #else
3211  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3212  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3213 #endif
3214 
3215 #ifdef DOCUMENTATION
3216 
3222  unsigned get_reason() const;
3223  void set_reason(unsigned);
3225 #else
3226  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3227  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3228 #endif
3229 
3230 #ifdef DOCUMENTATION
3231 
3238  const std::string& get_reasonComment() const;
3239  void set_reasonComment(const std::string&);
3241 #else
3242  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
3243  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3244 #endif
3245 
3246 #ifdef DOCUMENTATION
3247 
3255 #else
3256  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3257  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3258 #endif
3259 
3260 #ifdef DOCUMENTATION
3261 
3264  MayReturn get_may_return() const;
3265  void set_may_return(MayReturn);
3267 #else
3268  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3269  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3270 #endif
3271 
3272 #ifdef DOCUMENTATION
3273 
3278  const std::string& get_name_md5() const;
3279  void set_name_md5(const std::string&);
3281 #else
3282  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3283  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3284 #endif
3285 
3286 #ifdef DOCUMENTATION
3287 
3292  const SgAsmStatementPtrList& get_statementList() const;
3293  void set_statementList(const SgAsmStatementPtrList&);
3295 #else
3296  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3297  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3298 #endif
3299 
3300 #ifdef DOCUMENTATION
3301  // FIXME[Robb P Matzke 2017-02-13]: unused?
3302 #else
3303  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3304  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3305 #endif
3306 
3307 #ifdef DOCUMENTATION
3308 
3314  rose_addr_t get_entry_va() const;
3315  void set_entry_va(rose_addr_t);
3317 #else
3318  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3319  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3320 #endif
3321 
3322 #ifdef DOCUMENTATION
3323 
3332 #else
3333  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3334  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3335 #endif
3336 
3337 #ifdef DOCUMENTATION
3338  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3339 #else
3340  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3341  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3342 #endif
3343 
3344 #ifdef DOCUMENTATION
3345 
3354  int64_t get_stackDelta() const;
3355  void set_stackDelta(int64_t);
3357 #else
3358  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3359  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3360 #endif
3361 
3362 #ifdef DOCUMENTATION
3363 
3371  const std::string& get_callingConvention() const;
3372  void set_callingConvention(const std::string&);
3374 #else
3375  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3376  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3377 #endif
3378 
3379  DECLARE_OTHERS(AsmFunction);
3380 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3381 
3382 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3383  private:
3384  friend class boost::serialization::access;
3385 
3386  template<class S>
3387  void serialize(S &s, const unsigned /*version*/) {
3388  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3389  s & BOOST_SERIALIZATION_NVP(p_name);
3390  s & BOOST_SERIALIZATION_NVP(p_reason);
3391  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
3392  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3393  s & BOOST_SERIALIZATION_NVP(p_may_return);
3394  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3395  s & BOOST_SERIALIZATION_NVP(p_statementList);
3396  s & BOOST_SERIALIZATION_NVP(p_dest);
3397  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3398  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3399  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3400  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3401  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3402  }
3403 #endif
3404 
3405  public:
3408 
3412  void remove_statement(SgAsmStatement* statement);
3413 
3418  SgAsmBlock* get_entry_block() const;
3419 
3421  enum MayReturn {
3426  };
3427 
3432  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3433  // Also fix SgAsmFunction::reason_key()
3434  FUNC_NONE = 0x00000000,
3436  = 0x00008000,
3437  FUNC_ENTRY_POINT = 0x00010000,
3438  FUNC_CALL_TARGET = 0x00020000,
3441  FUNC_CALL_INSN = 0x00040000,
3447  FUNC_EH_FRAME = 0x00080000,
3448  FUNC_SYMBOL = 0x00100000,
3449  FUNC_PATTERN = 0x00200000,
3454  FUNC_GRAPH = 0x00400000,
3458  FUNC_USERDEF = 0x00800000,
3459  FUNC_PADDING = 0x01000000,
3464  FUNC_DISCONT = 0x02000000,
3467  FUNC_INSNHEAD = 0x04000000,
3468  FUNC_IMPORT = 0x08000000,
3471  FUNC_LEFTOVERS = 0x10000000,
3475  FUNC_INTRABLOCK = 0x20000000,
3483  FUNC_THUNK = 0x40000000,
3492  FUNC_EXPORT = 0x80000000,
3494  FUNC_DEFAULT = 0xefff80ff,
3496  /*========= Miscellaneous Reasons ===========================================================================
3497  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3498  * availalble for users to use as they see fit. */
3499  FUNC_MISCMASK = 0x000000ff,
3514  };
3515 
3519  static std::string reason_key(const std::string &prefix="");
3520 
3522  std::string reason_str(bool pad) const;
3523 
3527  static std::string reason_str(bool pad, unsigned reason);
3528 
3531  public:
3532  virtual ~NodeSelector() {}
3533  virtual bool operator()(SgNode*) = 0;
3534  };
3535 
3575  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
3576  NodeSelector *selector=NULL);
3577 
3583  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
3584 
3587  e_unknown = 0,
3588  e_standard = 1,
3589  e_library = 2,
3590  e_imported = 3,
3591  e_thunk = 4,
3592  e_last
3593  };
3594 #endif // SgAsmFunction_OTHERS
3595 
3596 
3597 #ifdef DOCUMENTATION
3598  };
3599 #endif
3600 
3601 
3603 
3604  DECLARE_LEAF_CLASS(AsmBlock);
3605  IS_SERIALIZABLE(AsmBlock);
3606 
3607 #ifdef DOCUMENTATION
3608 
3628  class SgAsmBlock: public SgAsmStatement {
3629  public:
3630 #endif
3631 
3632 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3633  // [tps 05Apr07] needed for the control_flow_graph
3634  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
3635  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3636 #endif
3637 
3638 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3639  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
3640  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3641 #endif
3642 
3643 #ifdef DOCUMENTATION
3644 
3649  rose_addr_t get_id() const;
3650  void set_id(rose_addr_t);
3652 #else
3653  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
3654  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3655 #endif
3656 
3657 #ifdef DOCUMENTATION
3658 
3663  unsigned get_reason() const;
3664  void set_reason(unsigned);
3666 #else
3667  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
3668  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3669 #endif
3670 
3671 #ifdef DOCUMENTATION
3672  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3673  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3674  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3675  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3682  const SgAsmStatementPtrList& get_statementList() const;
3683  void set_statementList(const SgAsmStatementPtrList&);
3685 #else
3686  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3687  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3688 #endif
3689 
3690 #ifdef DOCUMENTATION
3691  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3692  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3693  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3694  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3702  const SgAsmIntegerValuePtrList& get_successors() const;
3703  void set_successors(const SgAsmIntegerValuePtrList&);
3705 #else
3706  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
3707  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3708 #endif
3709 
3710 #ifdef DOCUMENTATION
3711 
3721  bool get_successors_complete() const;
3722  void set_successors_complete(bool);
3724 #else
3725  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
3726  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3727 #endif
3728 
3729 #ifdef DOCUMENTATION
3730 
3742 #else
3743  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
3744  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3745 #endif
3746 
3747 #ifdef DOCUMENTATION
3748 
3756  size_t get_cached_vertex() const;
3757  void set_cached_vertex(size_t);
3759 #else
3760  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
3761  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3762 #endif
3763 
3764 #ifdef DOCUMENTATION
3765 
3771  double get_code_likelihood() const;
3772  void set_code_likelihood(double);
3774 #else
3775  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
3776  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3777 #endif
3778 
3779 #ifdef DOCUMENTATION
3780 
3788  int64_t get_stackDeltaOut() const;
3789  void set_stackDeltaOut(int64_t);
3791 #else
3792  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
3793  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3794 #endif
3795 
3796  DECLARE_OTHERS(AsmBlock);
3797 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
3798 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3799  private:
3800  friend class boost::serialization::access;
3801 
3802  template<class S>
3803  void serialize(S &s, const unsigned /*version*/) {
3804  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3805  s & BOOST_SERIALIZATION_NVP(p_reason);
3806  s & BOOST_SERIALIZATION_NVP(p_statementList);
3807  s & BOOST_SERIALIZATION_NVP(p_successors);
3808  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
3809  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
3810  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3811  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
3812  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
3813  }
3814 #endif
3815 
3816  public:
3818  enum Reason {
3819  // Please update SgAsmBlock::reason_str() if you change this enum!
3820  BLK_NONE = 0x00000000,
3821  BLK_ENTRY_POINT = 0x00010000,
3822  BLK_PADDING = 0x00020000,
3823  BLK_FRAGMENT = 0x00080000,
3825  BLK_CFGHEAD = 0x00100000,
3826  BLK_USERDEF = 0x00200000,
3827  BLK_LEFTOVERS = 0x00400000,
3829  BLK_JUMPTABLE = 0x00800000,
3830  BLK_GRAPH1 = 0x01000000,
3831  BLK_GRAPH2 = 0x02000000,
3832  BLK_GRAPH3 = 0x04000000,
3834  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
3835 
3836  // ========= Miscellaneous Reasons ===========================================================================
3837  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3838  // availalble for users to use as they see fit.
3839  BLK_MISCMASK = 0x000000ff,
3841  BLK_FINDDATA = 0x00000001,
3843  BLK_POSTFUNC = 0x00000002
3845  };
3846 
3851 
3856 
3857  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
3862  void remove_children();
3863 
3868  rose_addr_t get_fallthrough_va();
3869 
3874 
3880  bool has_instructions() const;
3881 
3887  bool is_basic_block() const { return has_instructions(); }
3888 
3898  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
3899 
3903  static std::string reason_key(const std::string &prefix="");
3904 
3908  std::string reason_str(bool pad) const;
3909 
3915  static std::string reason_str(bool pad, unsigned reason);
3916 #endif // SgAsmBlock_OTHERS
3917 
3918 #ifdef DOCUMENTATION
3919  };
3920 #endif
3921 
3922 
3924 
3925  DECLARE_LEAF_CLASS(AsmStaticData);
3926  IS_SERIALIZABLE(AsmStaticData);
3927 
3928 #ifdef DOCUMENTATION
3929 
3937  public:
3938 #endif
3939 
3940 #ifdef DOCUMENTATION
3941 
3947  const SgUnsignedCharList& get_raw_bytes() const;
3948  void set_raw_bytes(const SgUnsignedCharList&);
3950 #else
3951  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
3952  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3953 #endif
3954 
3955  DECLARE_OTHERS(AsmStaticData);
3956 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
3957 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3958  private:
3959  friend class boost::serialization::access;
3960 
3961  template<class S>
3962  void serialize(S &s, const unsigned /*version*/) {
3963  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3964  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
3965  }
3966 #endif
3967 
3968  public:
3972  size_t get_size() const { return p_raw_bytes.size(); }
3973 #endif // SgAsmStaticData_OTHERS
3974 
3975 #ifdef DOCUMENTATION
3976  };
3977 #endif
3978 
3979 
3981 
3982  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
3983  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
3984 
3985 #ifdef DOCUMENTATION
3986 
3997  public:
3998 #endif
3999 
4000  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4001 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4002 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4003  private:
4004  friend class boost::serialization::access;
4005 
4006  template<class S>
4007  void serialize(S & s, const unsigned /*version*/) {
4008  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4009  }
4010 #endif
4011  protected:
4012  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4013 
4014  public:
4017  p_declarationList.push_back(declaration);
4018  }
4019 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4020 
4021 #ifdef DOCUMENTATION
4022  };
4023 #endif
4024 
4025 
4027 
4028  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4029  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4030 
4031 #ifdef DOCUMENTATION
4032  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4034  public:
4035 #endif
4036 
4037 #ifdef DOCUMENTATION
4038 
4041  const std::string& get_name() const;
4042  void set_name(const std::string&);
4044 #else
4045  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4046  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4047  NO_DELETE);
4048 #endif
4049 
4050 #ifdef DOCUMENTATION
4051  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4055  uint64_t get_offset() const;
4056  void set_ofset(uint64_t);
4058 #else
4059  // Not clear if we want to store the offset explicitly
4060  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4061  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4062  NO_DELETE);
4063 #endif
4064 
4065  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4066 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4067 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4068  private:
4069  friend class boost::serialization::access;
4070 
4071  template<class S>
4072  void serialize(S &s, const unsigned /*version*/) {
4073  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4074  }
4075 #endif
4076 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4077 
4078 #ifdef DOCUMENTATION
4079  };
4080 #endif
4081 
4082 
4084 
4085  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4086  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4087  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4088  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4089  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4090 
4091 #ifdef DOCUMENTATION
4092 
4099  public:
4100 #endif
4101 
4102  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4103 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4104 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4105  private:
4106  friend class boost::serialization::access;
4107 
4108  template<class S>
4109  void serialize(S &s, const unsigned /*version*/) {
4110  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4111  };
4112 #endif
4113 #endif // SgAsmSynthesizedDeclaration_OTHERS
4114 
4115 #ifdef DOCUMENTATION
4116  };
4117 #endif
4118 
4119 
4121 
4122  NEW_NONTERMINAL_MACRO(AsmStatement,
4123  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4124  "AsmStatement", "AsmStatementTag", false);
4125  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4126  IS_SERIALIZABLE(AsmStatement);
4127 
4128 #ifdef DOCUMENTATION
4129 
4133  class SgAsmStatement: public SgAsmNode {
4134  public:
4135 #endif
4136 
4137 #ifdef DOCUMENTATION
4138 
4143  rose_addr_t get_address() const;
4144  void set_address(rose_addr_t);
4146 #else
4147  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4148  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4149 #endif
4150 
4151 
4152 #ifdef DOCUMENTATION
4153 
4156  const std::string& get_comment() const;
4157  void set_comment(const std::string&);
4159 #else
4160  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4161  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4162 #endif
4163 
4164  DECLARE_OTHERS(AsmStatement);
4165 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4166 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4167  private:
4168  friend class boost::serialization::access;
4169 
4170  template<class S>
4171  void serialize(S &s, const unsigned /*version*/) {
4172  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4173  s & BOOST_SERIALIZATION_NVP(p_address);
4174  s & BOOST_SERIALIZATION_NVP(p_comment);
4175  }
4176 #endif
4177 #endif // SgAsmStatement_OTHERS
4178 
4179 #ifdef DOCUMENTATION
4180  };
4181 #endif
4182 
4183 
4184 
4185 
4187 
4188  /*************************************************************************************************************************
4189  * Binary Interpretations
4190  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4191  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4192  * an AST that represents a single, coherent sub-part of the file.
4193  *************************************************************************************************************************/
4194 
4196 
4197  DECLARE_LEAF_CLASS(AsmInterpretationList);
4198  IS_SERIALIZABLE(AsmInterpretationList);
4199 
4200 #ifdef DOCUMENTATION
4201 
4203  public:
4204 #endif
4205 
4206 #ifdef DOCUMENTATION
4207 
4216 #else
4217  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4218  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4219  NO_DELETE);
4220 #endif
4221 
4222  DECLARE_OTHERS(AsmInterpretationList);
4223 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4224 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4225  private:
4226  friend class boost::serialization::access;
4227 
4228  template<class S>
4229  void serialize(S &s, const unsigned /*version*/) {
4230  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4231  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4232  }
4233 #endif
4234 #endif // SgAsmInterpretationList_OTHERS
4235 
4236 #ifdef DOCUMENTATION
4237  };
4238 #endif
4239 
4241 
4242  DECLARE_LEAF_CLASS(AsmInterpretation);
4243  IS_SERIALIZABLE(AsmInterpretation);
4244 
4245  DECLARE_HEADERS(AsmInterpretation);
4246 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4247  #include <MemoryMap.h>
4248  class RegisterDictionary;
4249 #endif // SgAsmInterpretation_HEADERS
4250 
4251 #ifdef DOCUMENTATION
4252 
4259  public:
4260 #endif
4261 
4262 #ifdef DOCUMENTATION
4263  // documentation and definition are below
4264 #else
4265  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4266 #endif
4267 
4268 #ifdef DOCUMENTATION
4269 
4280 #else
4281  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4282  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4283 #endif
4284 
4285 #ifdef DOCUMENTATION
4286 
4291  SgAsmBlock* get_global_block() const;
4294 #else
4295  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4296  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4297 #endif
4298 
4299  DECLARE_OTHERS(AsmInterpretation);
4300 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4301  private:
4303  const RegisterDictionary *p_registers;
4304  bool coverageComputed; // true iff percentageCoverage has been computed
4305  mutable InstructionMap instruction_map; // cached instruction map
4306 
4308  // disassembly into instructions.
4309  double percentageCoverage;
4310 
4311 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4312  private:
4313  friend class boost::serialization::access;
4314 
4315  template<class S>
4316  void serialize(S &s, const unsigned /*version*/) {
4317  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4318  s & BOOST_SERIALIZATION_NVP(p_headers);
4319  s & BOOST_SERIALIZATION_NVP(p_global_block);
4320  s & BOOST_SERIALIZATION_NVP(p_map);
4321  s & BOOST_SERIALIZATION_NVP(p_registers);
4322  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4323  s & BOOST_SERIALIZATION_NVP(instruction_map);
4324  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4325  }
4326 #endif
4327 
4328  public:
4331  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4332  ctor();
4333  }
4334 
4339  SgAsmGenericFilePtrList get_files() const;
4340 
4356  const RegisterDictionary *get_registers() const;
4357  void set_registers(const RegisterDictionary*);
4367  InstructionMap& get_instruction_map(bool recompute=false);
4368  void set_instruction_map(const InstructionMap&);
4375  void insert_instructions(InstructionMap&/*in,out*/);
4376 
4381  void erase_instructions(InstructionMap&/*in,out*/);
4382 
4388  void set_coverageComputed(bool x) { coverageComputed = x; }
4389  void set_percentageCoverage(double x) { percentageCoverage = x; }
4392  private:
4393  void ctor(); // finalize construction
4394 #endif // SgAsmInterpretation_OTHERS
4395 
4396 #ifdef DOCUMENTATION
4397  };
4398 #endif
4399 
4400 
4401 
4403 
4404  /*************************************************************************************************************************
4405  * ELF File Header
4406  *************************************************************************************************************************/
4407 
4409 
4410  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4411  IS_SERIALIZABLE(AsmElfFileHeader);
4412 
4413 #ifdef DOCUMENTATION
4414 
4423  public:
4424 #endif
4425 
4426 #ifdef DOCUMENTATION
4427 
4432  unsigned char get_e_ident_file_class() const;
4433  void set_e_ident_file_class(unsigned char);
4435 #else
4436  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4437  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4438 #endif
4439 
4440 #ifdef DOCUMENTATION
4441 
4446  unsigned char get_e_ident_data_encoding() const;
4447  void set_e_ident_data_encoding(unsigned char);
4449 #else
4450  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4451  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4452 #endif
4453 
4454 #ifdef DOCUMENTATION
4455 
4460  unsigned char get_e_ident_file_version() const;
4461  void set_e_ident_file_version(unsigned char*);
4463 #else
4464  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4465  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4466 #endif
4467 
4468 #ifdef DOCUMENTATION
4469 
4474  const SgUnsignedCharList& get_e_ident_padding() const;
4475  void set_e_ident_padding(const SgUnsignedCharList&);
4477 #else
4478  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4479  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4480 #endif
4481 
4482 #ifdef DOCUMENTATION
4483 
4488  unsigned long get_e_type() const;
4489  void set_e_type(unsigned long);
4491 #else
4492  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4493  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4494 #endif
4495 
4496 #ifdef DOCUMENTATION
4497 
4502  unsigned long get_e_machine() const;
4503  void set_e_machine(unsigned long);
4505 #else
4506  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4507  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4508 #endif
4509 
4510 #ifdef DOCUMENTATION
4511 
4516  unsigned long get_e_flags() const;
4517  void set_e_flags(unsigned long);
4519 #else
4520  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4521  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4522 #endif
4523 
4524 #ifdef DOCUMENTATION
4525 
4530  unsigned long get_e_ehsize() const;
4531  void set_e_ehsize(unsigned long);
4533 #else
4534  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4535  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4536 #endif
4537 
4538 #ifdef DOCUMENTATION
4539 
4544  unsigned long get_phextrasz() const;
4545  void set_phextrasz(unsigned long);
4547 #else
4548  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4549  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4550 #endif
4551 
4552 #ifdef DOCUMENTATION
4553 
4558  unsigned long get_e_phnum() const;
4559  void set_e_phnum(unsigned long);
4561 #else
4562  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
4563  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4564 #endif
4565 
4566 #ifdef DOCUMENTATION
4567 
4572  unsigned long get_shextrasz() const;
4573  void set_shextrasz(unsigned long);
4575 #else
4576  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
4577  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4578 #endif
4579 
4580 #ifdef DOCUMENTATION
4581 
4586  unsigned long get_e_shnum() const;
4587  void set_e_shnum(unsigned long);
4589 #else
4590  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
4591  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4592 #endif
4593 
4594 #ifdef DOCUMENTATION
4595 
4600  unsigned long get_e_shstrndx() const;
4601  void set_e_shstrndx(unsigned long);
4603 #else
4604  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
4605  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4606 #endif
4607 
4608 #ifdef DOCUMENTATION
4609 
4619 #else
4620  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
4621  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4622 #endif
4623 
4624 #ifdef DOCUMENTATION
4625 
4634 #else
4635  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
4636  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4637 #endif
4638 
4639  DECLARE_OTHERS(AsmElfFileHeader);
4640 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
4641 
4642 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4643  private:
4644  friend class boost::serialization::access;
4645 
4646  template<class S>
4647  void serialize(S &s, const unsigned /*version*/) {
4648  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
4649  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
4650  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
4651  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
4652  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
4653  s & BOOST_SERIALIZATION_NVP(p_e_type);
4654  s & BOOST_SERIALIZATION_NVP(p_e_machine);
4655  s & BOOST_SERIALIZATION_NVP(p_e_flags);
4656  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
4657  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
4658  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
4659  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
4660  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
4661  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
4662  s & BOOST_SERIALIZATION_NVP(p_section_table);
4663  s & BOOST_SERIALIZATION_NVP(p_segment_table);
4664  }
4665 #endif
4666 
4667  public:
4669  enum ObjectType {
4670  ET_NONE = 0
4671  ,ET_REL = 1
4672  ,ET_EXEC = 2
4673  ,ET_DYN = 3
4674  ,ET_CORE = 4
4676  ,ET_LOOS = 0xfe00
4677  ,ET_HIOS = 0xfeff
4678  ,ET_LOPROC = 0xff00
4679  ,ET_HIPROC = 0xffff
4680  };
4681 
4682  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
4683  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
4684  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
4685  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
4686  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
4687 #ifdef _MSC_VER
4688 # pragma pack (1)
4689 #endif
4690 
4697  unsigned char e_ident_magic[4];
4698  unsigned char e_ident_file_class;
4699  unsigned char e_ident_data_encoding;
4700  unsigned char e_ident_file_version;
4701  unsigned char e_ident_padding[9];
4702  uint16_t e_type;
4703  uint16_t e_machine;
4704  uint32_t e_version;
4705  uint32_t e_entry;
4706  uint32_t e_phoff;
4707  uint32_t e_shoff;
4708  uint32_t e_flags;
4709  uint16_t e_ehsize;
4710  uint16_t e_phentsize;
4711  uint16_t e_phnum;
4712  uint16_t e_shentsize;
4713  uint16_t e_shnum;
4714  uint16_t e_shstrndx;
4715  }
4716 #if !defined(SWIG) && !defined(_MSC_VER)
4717  __attribute__((packed))
4718 #endif
4719  ;
4720 
4722  unsigned char e_ident_magic[4];
4723  unsigned char e_ident_file_class;
4724  unsigned char e_ident_data_encoding;
4725  unsigned char e_ident_file_version;
4726  unsigned char e_ident_padding[9];
4727  uint16_t e_type;
4728  uint16_t e_machine;
4729  uint32_t e_version;
4730  uint64_t e_entry;
4731  uint64_t e_phoff;
4732  uint64_t e_shoff;
4733  uint32_t e_flags;
4734  uint16_t e_ehsize;
4735  uint16_t e_phentsize;
4736  uint16_t e_phnum;
4737  uint16_t e_shentsize;
4738  uint16_t e_shnum;
4739  uint16_t e_shstrndx;
4740  }
4741 #if !defined(SWIG) && !defined(_MSC_VER)
4742  __attribute__((packed))
4743 #endif
4744  ;
4745 
4746 #ifdef _MSC_VER
4747 # pragma pack ()
4748 #endif
4749 
4757  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
4758  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
4759  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
4760  ctor();
4761  }
4762 
4768  uint64_t max_page_size();
4769 
4772 
4775 
4781  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
4782 
4784  virtual bool reallocate() $ROSE_OVERRIDE;
4785 
4787  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4788 
4790  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4791 
4793  static bool is_ELF(SgAsmGenericFile*);
4794 
4796  SgAsmGenericSectionPtrList get_sectab_sections();
4797 
4799  SgAsmGenericSectionPtrList get_segtab_sections();
4800 
4801  // Overrides documented in base class
4802  virtual const char *format_name() const $ROSE_OVERRIDE;
4803 
4804  private:
4805  void ctor(); // called by constructors
4806  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
4807  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
4808 #endif // SgAsmElfFileHeader_OTHERS
4809 
4810 #ifdef DOCUMENTATION
4811  };
4812 #endif
4813 
4814 
4815 
4817 
4818  /*************************************************************************************************************************
4819  * ELF Section Tables
4820  *************************************************************************************************************************/
4821 
4823 
4824  DECLARE_LEAF_CLASS(AsmElfSectionTable);
4825  IS_SERIALIZABLE(AsmElfSectionTable);
4826 
4827 #ifdef DOCUMENTATION
4828 
4834  public:
4835 #endif
4836 
4837  DECLARE_OTHERS(AsmElfSectionTable);
4838 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
4839 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4840  private:
4841  friend class boost::serialization::access;
4842 
4843  template<class S>
4844  void serialize(S &s, const unsigned /*version*/) {
4845  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
4846  }
4847 #endif
4848 
4849  public:
4852  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
4853  ctor();
4854  }
4855 
4861  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
4862 
4874 
4878  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
4879 
4881  virtual bool reallocate() $ROSE_OVERRIDE;
4882 
4884  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4885 
4887  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4888 
4889  private:
4890  void ctor();
4891 #endif // SgAsmElfSectionTable_OTHERS
4892 
4893 #ifdef DOCUMENTATION
4894  };
4895 #endif
4896 
4897 
4899 
4900  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
4901  IS_SERIALIZABLE(AsmElfSectionTableEntry);
4902 
4903 #ifdef DOCUMENTATION
4904 
4906  public:
4907 #endif
4908 
4909 #ifdef DOCUMENTATION
4910 
4915  unsigned get_sh_name() const;
4916  void set_sh_name(unsigned);
4918 #else
4919  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
4920  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4921 #endif
4922 
4923 #ifdef DOCUMENTATION
4924 
4929  SectionType get_sh_type() const;
4930  void set_sh_type(SectionType);
4932 #else
4933  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
4934  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4935 #endif
4936 
4937 #ifdef DOCUMENTATION
4938 
4943  unsigned long get_sh_link() const;
4944  void set_sh_link(unsigned long);
4946 #else
4947  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
4948  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4949 #endif
4950 
4951 #ifdef DOCUMENTATION
4952 
4957  unsigned long get_sh_info() const;
4958  void set_sh_info(unsigned long);
4960 #else
4961  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
4962  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4963 #endif
4964 
4965 #ifdef DOCUMENTATION
4966 
4971  uint64_t get_sh_flags() const;
4972  void set_sh_flags(uint64_t);
4974 #else
4975  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
4976  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4977 #endif
4978 
4979 #ifdef DOCUMENTATION
4980 
4985  rose_addr_t get_sh_addr() const;
4986  void set_sh_addr(rose_addr_t);
4988 #else
4989  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
4990  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4991 #endif
4992 
4993 #ifdef DOCUMENTATION
4994 
4999  rose_addr_t get_sh_offset() const;
5000  void set_sh_offset(rose_addr_t);
5002 #else
5003  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
5004  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5005 #endif
5006 
5007 #ifdef DOCUMENTATION
5008 
5013  rose_addr_t get_sh_size() const;
5014  void set_sh_size(rose_addr_t);
5016 #else
5017  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
5018  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5019 #endif
5020 
5021 #ifdef DOCUMENTATION
5022 
5027  rose_addr_t get_sh_addralign() const;
5028  void set_sh_addralign(rose_addr_t);
5030 #else
5031  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
5032  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5033 #endif
5034 
5035 #ifdef DOCUMENTATION
5036 
5041  rose_addr_t get_sh_entsize() const;
5042  void set_sh_entsize(rose_addr_t);
5044 #else
5045  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
5046  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5047 #endif
5048 
5049 #ifdef DOCUMENTATION
5050 
5055  const SgUnsignedCharList& get_extra() const;
5056  void set_extra(const SgUnsignedCharLit&);
5058 #else
5059  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5060  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5061  NO_DELETE);
5062 #endif
5063 
5064  DECLARE_OTHERS(AsmElfSectionTableEntry);
5065 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5066 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5067  private:
5068  friend class boost::serialization::access;
5069 
5070  template<class S>
5071  void serialize(S &s, const unsigned /*version*/) {
5072  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5073  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5074  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5075  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5076  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5077  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5078  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5079  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5080  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5081  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5082  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5083  s & BOOST_SERIALIZATION_NVP(p_extra);
5084  }
5085 #endif
5086 
5087  public:
5090  SHT_NULL = 0,
5094  SHT_RELA = 4,
5095  SHT_HASH = 5,
5097  SHT_NOTE = 7,
5099  SHT_REL = 9,
5100  SHT_SHLIB = 10,
5101  SHT_DYNSYM = 11,
5103  SHT_LOOS = 0x60000000,
5104  SHT_GNU_verdef = 0x6ffffffd,
5105  SHT_GNU_verneed = 0x6ffffffe,
5106  SHT_GNU_versym = 0x6fffffff,
5107  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5108 
5109  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5110  SHT_HIPROC = 0x7fffffff,
5111  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5112  SHT_HIUSER = 0xffffffff
5113  };
5114 
5118  SHF_WRITE= (1 << 0),
5119  SHF_ALLOC= (1 << 1),
5120  SHF_EXECINSTR= (1 << 2),
5121  SHF_MERGE= (1 << 4),
5122  SHF_STRINGS= (1 << 5),
5123  SHF_INFO_LINK= (1 << 6),
5124  SHF_LINK_ORDER= (1 << 7),
5126  SHF_GROUP= (1 << 9),
5127  SHF_TLS= (1 << 10),
5128  SHF_MASKOS= 0x0ff00000,
5129  SHF_MASKPROC= 0xf0000000
5130  };
5131 
5138 #ifdef _MSC_VER
5139 # pragma pack (1)
5140 #endif
5142  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5143  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5144  uint32_t sh_flags; /* 0x08 Bit flags */
5145  uint32_t sh_addr; /* 0x0c Desired mapped address */
5146  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5147  uint32_t sh_size; /* 0x14 Section size in bytes */
5148  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5149  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5150  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5151  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5152  } /* 0x28 */
5153 #if !defined(SWIG) && !defined(_MSC_VER)
5154  __attribute__((packed))
5155 #endif
5156  ;
5157 
5159  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5160  uint32_t sh_type; /* 0x04 */
5161  uint64_t sh_flags; /* 0x08 */
5162  uint64_t sh_addr; /* 0x10 */
5163  uint64_t sh_offset; /* 0x18 */
5164  uint64_t sh_size; /* 0x20 */
5165  uint32_t sh_link; /* 0x28 */
5166  uint32_t sh_info; /* 0x2c */
5167  uint64_t sh_addralign; /* 0x30 */
5168  uint64_t sh_entsize; /* 0x38 */
5169  } /* 0x40 */
5170 #if !defined(SWIG) && !defined(_MSC_VER)
5171  __attribute__((packed))
5172 #endif
5173  ;
5174 #ifdef _MSC_VER
5175 # pragma pack ()
5176 #endif
5177 
5179  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5181 
5183  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5185 
5189  void *encode(ByteOrder::Endianness sex,
5191  void *encode(ByteOrder::Endianness sex,
5197 
5199  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5200 
5201  // Use Rose::stringify... function instead.
5202  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5203  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5204 
5205  private:
5206  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5207  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5208 #endif // SgAsmElfSectionTableEntry_OTHERS
5209 
5210 #ifdef DOCUMENTATION
5211  };
5212 #endif
5213 
5214 
5215 
5217 
5218  /*************************************************************************************************************************
5219  * ELF Segment Tables
5220  *************************************************************************************************************************/
5221 
5223 
5224  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5225  IS_SERIALIZABLE(AsmElfSegmentTable);
5226 
5227 #ifdef DOCUMENTATION
5228 
5235  public:
5236 #endif
5237 
5238  DECLARE_OTHERS(AsmElfSegmentTable);
5239 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5240 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5241  private:
5242  friend class boost::serialization::access;
5243 
5244  template<class S>
5245  void serialize(S &s, const unsigned /*version*/) {
5246  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5247  }
5248 #endif
5249 
5250  public:
5253  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5254  ctor();
5255  }
5256 
5261  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5262 
5277 
5281  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5282 
5284  virtual bool reallocate() $ROSE_OVERRIDE;
5285 
5287  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5288 
5290  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5291 
5292  private:
5293  void ctor();
5294 #endif // SgAsmElfSegmentTable_OTHERS
5295 
5296 #ifdef DOCUMENTATION
5297  };
5298 #endif
5299 
5301 
5302  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5303  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5304 
5305 #ifdef DOCUMENTATION
5307  public:
5308 #endif
5309 
5310 #ifdef DOCUMENTATION
5311 
5317  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5318  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5320 #else
5321  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5322  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5323  NO_DELETE);
5324 #endif
5325 
5326  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5327 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5328 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5329  private:
5330  friend class boost::serialization::access;
5331 
5332  template<class S>
5333  void serialize(S &s, const unsigned /*version*/) {
5334  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5335  }
5336 #endif
5337 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5338 
5339 #ifdef DOCUMENTATION
5340  };
5341 #endif
5342 
5343 
5345 
5346  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5347  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5348 
5349 #ifdef DOCUMENTATION
5350 
5352  public:
5353 #endif
5354 
5355 #ifdef DOCUMENTATION
5356 
5361  size_t get_index() const;
5362  void set_index(size_t);
5364 #else
5365  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5366  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5367 #endif
5368 
5369 #ifdef DOCUMENTATION
5370 
5373  SegmentType get_type() const;
5374  void set_type(SegmentType);
5376 #else
5377  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5378  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5379  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5380 #endif
5381 
5382 #ifdef DOCUMENTATION
5383 
5386  SegmentFlags get_flags() const;
5387  void set_flags(SegmentFlags);
5389 #else
5390  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5391  "= SgAsmElfSegmentTableEntry::PF_NONE",
5392  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5393 #endif
5394 
5395 #ifdef DOCUMENTATION
5396 
5401  rose_addr_t get_offset() const;
5402  void set_offset(rose_addr_t);
5404 #else
5405  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5406  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5407 #endif
5408 
5409 #ifdef DOCUMENTATION
5410 
5416  rose_addr_t get_vaddr() const;
5417  void set_vaddr(rose_addr_t);
5419 #else
5420  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5421  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5422 #endif
5423 
5424 #ifdef DOCUMENTATION
5425 
5430  rose_addr_t get_paddr() const;
5431  void set_paddr(rose_addr_t);
5433 #else
5434  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5435  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5436 #endif
5437 
5438 #ifdef DOCUMENTATION
5439 
5444  rose_addr_t get_filesz() const;
5445  void set_filesz(rose_addr_t);
5447 #else
5448  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5449  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5450 #endif
5451 
5452 #ifdef DOCUMENTATION
5453 
5458  rose_addr_t get_memsz() const;
5459  void set_memsz(rose_addr_t);
5461 #else
5462  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5463  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5464 #endif
5465 
5466 #ifdef DOCUMENTATION
5467 
5472  rose_addr_t get_align() const;
5473  void set_align(rose_addr_t);
5475 #else
5476  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5477  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5478 #endif
5479 
5480 #ifdef DOCUMENTATION
5481 
5486  const SgUnsignedCharList& get_extra() const;
5487  void set_extra(const SgUnsignedCharList&);
5489 #else
5490  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5491  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5492 #endif
5493 
5494  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5495 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
5496 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5497  private:
5498  friend class boost::serialization::access;
5499 
5500  template<class S>
5501  void serialize(S &s, const unsigned /*version*/) {
5502  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5503  s & BOOST_SERIALIZATION_NVP(p_index);
5504  s & BOOST_SERIALIZATION_NVP(p_type);
5505  s & BOOST_SERIALIZATION_NVP(p_flags);
5506  s & BOOST_SERIALIZATION_NVP(p_offset);
5507  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5508  s & BOOST_SERIALIZATION_NVP(p_paddr);
5509  s & BOOST_SERIALIZATION_NVP(p_filesz);
5510  s & BOOST_SERIALIZATION_NVP(p_memsz);
5511  s & BOOST_SERIALIZATION_NVP(p_align);
5512  s & BOOST_SERIALIZATION_NVP(p_extra);
5513  }
5514 #endif
5515 
5516  public:
5519  PT_NULL = 0,
5520  PT_LOAD = 1,
5523  PT_NOTE = 4,
5524  PT_SHLIB = 5,
5525  PT_PHDR = 6,
5526  PT_TLS = 7,
5528  // OS- and Processor-specific ranges
5529  PT_LOOS = 0x60000000,
5530  PT_HIOS = 0x6fffffff,
5531  PT_LOPROC = 0x70000000,
5532  PT_HIPROC = 0x7fffffff,
5533 
5534  // OS-specific values for GNU/Linux
5535  PT_GNU_EH_FRAME = 0x6474e550,
5536  PT_GNU_STACK = 0x6474e551,
5537  PT_GNU_RELRO = 0x6474e552,
5538  PT_PAX_FLAGS = 0x65041580,
5540  // OS-specific values for Sun
5541  PT_SUNWBSS = 0x6ffffffa,
5542  PT_SUNWSTACK = 0x6ffffffb
5543  };
5544 
5547  PF_NONE = 0,
5548  PF_RESERVED = 0x000ffff8,
5549  PF_XPERM = 0x00000001,
5550  PF_WPERM = 0x00000002,
5551  PF_RPERM = 0x00000004,
5552  PF_OS_MASK = 0x0ff00000,
5553  PF_PROC_MASK = 0xf0000000
5554  };
5555 
5556 #ifdef _MSC_VER
5557 # pragma pack (1)
5558 #endif
5559 
5567  uint32_t p_type;
5568  uint32_t p_offset;
5569  uint32_t p_vaddr;
5570  uint32_t p_paddr;
5571  uint32_t p_filesz;
5572  uint32_t p_memsz;
5573  uint32_t p_flags;
5574  uint32_t p_align;
5575  } /* 0x30 */
5576 #if !defined(SWIG) && !defined(_MSC_VER)
5577  __attribute__((packed))
5578 #endif
5579  ;
5580 
5582  uint32_t p_type; /* 0x00 */
5583  uint32_t p_flags; /* 0x04 */
5584  uint64_t p_offset; /* 0x08 */
5585  uint64_t p_vaddr; /* 0x10 */
5586  uint64_t p_paddr; /* 0x18 */
5587  uint64_t p_filesz; /* 0x20 */
5588  uint64_t p_memsz; /* 0x28 */
5589  uint64_t p_align; /* 0x30 */
5590  } /* 0x38 */
5591 #if !defined(SWIG) && !defined(_MSC_VER)
5592  __attribute__((packed))
5593 #endif
5594  ;
5595 #ifdef _MSC_VER
5596 # pragma pack ()
5597 #endif
5598 
5600  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5602 
5604  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5606 
5610  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
5611  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
5616 
5618  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5619 
5622 
5625 
5626  private:
5627  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
5628  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
5629 #endif // SgAsmElfSegmentTableEntry_OTHERS
5630 
5631 #ifdef DOCUMENTATION
5632  };
5633 #endif
5634 
5635 
5636 
5638 
5639  /*************************************************************************************************************************
5640  * ELF Symbol Tables
5641  *************************************************************************************************************************/
5642 
5644 
5645  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
5646  IS_SERIALIZABLE(AsmElfSymbolSection);
5647 
5648 #ifdef DOCUMENTATION
5649 
5651  public:
5652 #endif
5653 
5654 #ifdef DOCUMENTATION
5655 
5658  bool get_is_dynamic() const;
5659  void set_is_dynamic(bool);
5661 #else
5662  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
5663  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5664 #endif
5665 
5666 #ifdef DOCUMENTATION
5667 
5676 #else
5677  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
5678  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5679 #endif
5680 
5681  DECLARE_OTHERS(AsmElfSymbolSection);
5682 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
5683 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5684  private:
5685  friend class boost::serialization::access;
5686 
5687  template<class S>
5688  void serialize(S &s, const unsigned /*version*/) {
5689  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5690  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
5691  s & BOOST_SERIALIZATION_NVP(p_symbols);
5692  }
5693 #endif
5694 
5695  public:
5698  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
5699  ctor(strsec);
5700  }
5701 
5703  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
5704 
5717  virtual void finish_parsing() $ROSE_OVERRIDE;
5718 
5720  size_t index_of(SgAsmElfSymbol*);
5721 
5726  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5727 
5731  virtual bool reallocate() $ROSE_OVERRIDE;
5732 
5734  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5735 
5737  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5738 
5739  private:
5740  void ctor(SgAsmElfStringSection*);
5741 #endif // SgAsmElfSymbolSection_OTHERS
5742 
5743 #ifdef DOCUMENTATION
5744  };
5745 #endif
5746 
5748 
5749  DECLARE_LEAF_CLASS(AsmElfSymbolList);
5750  IS_SERIALIZABLE(AsmElfSymbolList);
5751 
5752 #ifdef DOCUMENTATION
5754  public:
5755 #endif
5756 
5757 #ifdef DOCUMENTATION
5758 
5764  const SgAsmElfSymbolPtrList& get_symbols() const;
5765  void set_symbols(const SgAsmElfSymbolPtrList&);
5767 #else
5768  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
5769  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5770 #endif
5771 
5772  DECLARE_OTHERS(AsmElfSymbolList);
5773 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
5774 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5775  private:
5776  friend class boost::serialization::access;
5777 
5778  template<class S>
5779  void serialize(S &s, const unsigned /*version*/) {
5780  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5781  s & BOOST_SERIALIZATION_NVP(p_symbols);
5782  }
5783 #endif
5784 #endif // SgAsmElfSymbolList_OTHERS
5785 
5786 #ifdef DOCUMENTATION
5787  };
5788 #endif
5789 
5791 
5792  DECLARE_LEAF_CLASS(AsmElfSymbol);
5793  IS_SERIALIZABLE(AsmElfSymbol);
5794 
5795 #ifdef DOCUMENTATION
5796 
5801  public:
5802 #endif
5803 
5804 #ifdef DOCUMENTATION
5805 
5810  unsigned char get_st_info() const;
5811  void set_st_info(unsigned char);
5813 #else
5814  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
5815  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5816 #endif
5817 
5818 #ifdef DOCUMENTATION
5819 
5824  unsigned char get_st_res1() const;
5825  void set_st_res1(unsigned char);
5827 #else
5828  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
5829  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5830 #endif
5831 
5832 #ifdef DOCUMENTATION
5833 
5838  unsigned get_st_shndx() const;
5839  void set_st_shndx(unsigned);
5841 #else
5842  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
5843  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5844 #endif
5845 
5846 #ifdef DOCUMENTATION
5847 
5852  rose_addr_t get_st_size() const;
5853  void set_st_size(rose_addr_t);
5855 #else
5856  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
5857  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5858 #endif
5859 
5860 #ifdef DOCUMENTATION
5861 
5866  const SgUnsignedCharList& get_extra() const;
5867  void set_extra(const SgUnsignedCharList&);
5869 #else
5870  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
5871  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5872 #endif
5873 
5874  DECLARE_OTHERS(AsmElfSymbol);
5875 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
5876 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5877  private:
5878  friend class boost::serialization::access;
5879 
5880  template<class S>
5881  void serialize(S &s, const unsigned /*version*/) {
5882  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
5883  s & BOOST_SERIALIZATION_NVP(p_st_info);
5884  s & BOOST_SERIALIZATION_NVP(p_st_res1);
5885  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
5886  s & BOOST_SERIALIZATION_NVP(p_st_size);
5887  s & BOOST_SERIALIZATION_NVP(p_extra);
5888  }
5889 #endif
5890 
5891  public:
5892  enum ElfSymBinding {
5893  STB_LOCAL=0,
5894  STB_GLOBAL=1,
5895  STB_WEAK=2
5896  };
5897 
5898  enum ElfSymType {
5901  STT_FUNC = 2,
5903  STT_FILE = 4,
5905  STT_TLS = 6,
5907  };
5908 
5909 #ifdef _MSC_VER
5910 # pragma pack (1)
5911 #endif
5912 
5915  uint32_t st_name;
5916  uint32_t st_value;
5917  uint32_t st_size;
5918  unsigned char st_info;
5919  unsigned char st_res1;
5920  uint16_t st_shndx;
5921  }
5922 #if !defined(SWIG) && !defined(_MSC_VER)
5923  __attribute__((packed))
5924 #endif
5925  ;
5926 
5928  uint32_t st_name;
5929  unsigned char st_info;
5930  unsigned char st_res1;
5931  uint16_t st_shndx;
5932  uint64_t st_value;
5933  uint64_t st_size;
5934  }
5935 #if !defined(SWIG) && !defined(_MSC_VER)
5936  __attribute__((packed))
5937 #endif
5938  ;
5939 
5940 #ifdef _MSC_VER
5941 # pragma pack ()
5942 #endif
5943 
5945  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
5946 
5950  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
5951 
5955  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
5956 
5960  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
5961  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
5969  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5970  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
5974  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
5975 
5978 
5980  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
5981 
5983  static std::string to_string(SgAsmElfSymbol::ElfSymType);
5984 
5985  private:
5986  void ctor(SgAsmElfSymbolSection*);
5987  void parse_common(); // initialization common to all parse() methods
5988 #endif // SgAsmElfSymbol_OTHERS
5989 
5990 #ifdef DOCUMENTATION
5991  };
5992 #endif
5993 
5994 
5995 
5997 
5998  /*************************************************************************************************************************
5999  * ELF Symbol Version Tables
6000  *************************************************************************************************************************/
6001 
6003 
6004  DECLARE_LEAF_CLASS(AsmElfSymverSection);
6005  IS_SERIALIZABLE(AsmElfSymverSection);
6006 
6007 #ifdef DOCUMENTATION
6008 
6013  public:
6014 #endif
6015 
6016 #ifdef DOCUMENTATION
6017 
6026 #else
6027  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
6028  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6029 #endif
6030 
6031  DECLARE_OTHERS(AsmElfSymverSection);
6032 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
6033 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6034  private:
6035  friend class boost::serialization::access;
6036 
6037  template<class S>
6038  void serialize(S &s, const unsigned /*version*/) {
6039  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6040  s & BOOST_SERIALIZATION_NVP(p_entries);
6041  }
6042 #endif
6043 
6044  public:
6047  : SgAsmElfSection(fhdr) {
6048  ctor();
6049  }
6050 
6052  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
6053 
6058  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6059 
6061  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6062 
6064  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6065  private:
6066  void ctor();
6067 #endif // SgAsmElfSymverSection_OTHERS
6068 
6069 #ifdef DOCUMENTATION
6070  };
6071 #endif
6072 
6074 
6075  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6076  IS_SERIALIZABLE(AsmElfSymverEntry);
6077 
6078 #ifdef DOCUMENTATION
6079 
6081  public:
6082 #endif
6083 
6084 #ifdef DOCUMENTATION
6085 
6090  size_t get_value() const;
6091  void set_value(size_t);
6093 #else
6094  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6095  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6096 #endif
6097 
6098  DECLARE_OTHERS(AsmElfSymverEntry);
6099 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6100 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6101  private:
6102  friend class boost::serialization::access;
6103 
6104  template<class S>
6105  void serialize(S &s, const unsigned /*version*/) {
6106  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6107  s & BOOST_SERIALIZATION_NVP(p_value);
6108  }
6109 #endif
6110 
6111  public:
6114  : p_value(0) {
6115  ctor(symver);
6116  }
6117 
6119  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6120 
6121  private:
6122  void ctor(SgAsmElfSymverSection*);
6123 #endif // SgAsmElfSymverEntry_OTHERS
6124 
6125 #ifdef DOCUMENTATION
6126  };
6127 #endif
6128 
6130 
6131 
6132  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6133  IS_SERIALIZABLE(AsmElfSymverEntryList);
6134 
6135 #ifdef DOCUMENTATION
6136 
6141  public:
6142 #endif
6143 
6144 #ifdef DOCUMENTATION
6145 
6148  const SgAsmElfSymverEntryPtrList& get_entries() const;
6149  void set_entries(const SgAsmElfSymverEntryPtrList&);
6151 #else
6152  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6153  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6154  NO_DELETE);
6155 #endif
6156 
6157  DECLARE_OTHERS(AsmElfSymverEntryList);
6158 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6159 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6160  private:
6161  friend class boost::serialization::access;
6162 
6163  template<class S>
6164  void serialize(S &s, const unsigned /*version*/) {
6165  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6166  s & BOOST_SERIALIZATION_NVP(p_entries);
6167  }
6168 #endif
6169 #endif // SgAsmElfSymverEntryList_OTHERS
6170 
6171 #ifdef DOCUMENTATION
6172  };
6173 #endif
6174 
6176 
6177  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6178  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6179 
6180 #ifdef DOCUMENTATION
6181 
6187  public:
6188 #endif
6189 
6190 #ifdef DOCUMENTATION
6191 
6200 #else
6201  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6202  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6203  NO_DELETE);
6204 #endif
6205 
6206  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6207 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6208 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6209  private:
6210  friend class boost::serialization::access;
6211 
6212  template<class S>
6213  void serialize(S &s, const unsigned /*version*/) {
6214  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6215  s & BOOST_SERIALIZATION_NVP(p_entries);
6216  }
6217 #endif
6218 
6219  public:
6222  : SgAsmElfSection(fhdr) {
6223  ctor(strsec);
6224  }
6225 
6294  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6295 
6298  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6299 
6303  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6304 
6306  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6307 
6308  private:
6309  void ctor(SgAsmElfStringSection*);
6310 #endif // SgAsmElfSymverDefinedSection_OTHERS
6311 
6312 #ifdef DOCUMENTATION
6313  };
6314 #endif
6315 
6317 
6318  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6319  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6320 
6321 #ifdef DOCUMENTATION
6322 
6327  public:
6328 #endif
6329 
6330 #ifdef DOCUMENTATION
6331 
6334  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6335  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6337 #else
6338  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6339  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6340  NO_DELETE);
6341 #endif
6342 
6343  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6344 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6345 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6346  private:
6347  friend class boost::serialization::access;
6348 
6349  template<class S>
6350  void serialize(S &s, const unsigned /*version*/) {
6351  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6352  s & BOOST_SERIALIZATION_NVP(p_entries);
6353  }
6354 #endif
6355 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6356 
6357 #ifdef DOCUMENTATION
6358  };
6359 #endif
6360 
6362 
6363  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6364  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6365 
6366 #ifdef DOCUMENTATION
6367 
6369  public:
6370 #endif
6371 
6372 #ifdef DOCUMENTATION
6373 
6378  size_t get_version() const;
6379  void set_version(size_t);
6381 #else
6382  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6383  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6384 #endif
6385 
6386 #ifdef DOCUMENTATION
6387 
6392  int get_flags() const;
6393  void set_flags(int);
6395 #else
6396  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6397  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6398 #endif
6399 
6400 #ifdef DOCUMENTATION
6401 
6406  size_t get_index() const;
6407  void set_index(size_t);
6409 #else
6410  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6411  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6412 #endif
6413 
6414 #ifdef DOCUMENTATION
6415 
6420  uint32_t get_hash() const;
6421  void set_hash(uint32_t);
6423 #else
6424  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6425  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6426 #endif
6427 
6428 #ifdef DOCUMENTATION
6429 
6438 #else
6439  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6440  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6441 #endif
6442 
6443  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6444 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6445 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6446  private:
6447  friend class boost::serialization::access;
6448 
6449  template<class S>
6450  void serialize(S &s, const unsigned /*version*/) {
6451  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6452  s & BOOST_SERIALIZATION_NVP(p_version);
6453  s & BOOST_SERIALIZATION_NVP(p_flags);
6454  s & BOOST_SERIALIZATION_NVP(p_index);
6455  s & BOOST_SERIALIZATION_NVP(p_hash);
6456  s & BOOST_SERIALIZATION_NVP(p_entries);
6457  }
6458 #endif
6459 
6460  public:
6461 #ifdef _MSC_VER
6462 # pragma pack (1)
6463 #endif
6464 
6466  uint16_t vd_version;
6467  uint16_t vd_flags;
6468  uint16_t vd_ndx;
6469  uint16_t vd_cnt;
6470  uint32_t vd_hash;
6471  uint32_t vd_aux;
6472  uint32_t vd_next;
6473  }
6474 #if !defined(SWIG) && !defined(_MSC_VER)
6475  __attribute__((packed))
6476 #endif
6477  ;
6478 
6479 #ifdef _MSC_VER
6480 # pragma pack ()
6481 #endif
6482 
6485  ctor(symver_defined);
6486  }
6487 
6489  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6490 
6492  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6493 
6495  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6496 
6497  private:
6498  void ctor(SgAsmElfSymverDefinedSection*);
6499 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6500 
6501 #ifdef DOCUMENTATION
6502  };
6503 #endif
6504 
6506 
6507  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6508  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6509 
6510 #ifdef DOCUMENTATION
6511 
6516  pbulic:
6517 #endif
6518 
6519 #ifdef DOCUMENTATION
6520 
6523  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6524  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6526 #else
6527  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6528  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6529  NO_DELETE);
6530 #endif
6531 
6532  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6533 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6534 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6535  private:
6536  friend class boost::serialization::access;
6537 
6538  template<class S>
6539  void serialize(S &s, const unsigned /*version*/) {
6540  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6541  s & BOOST_SERIALIZATION_NVP(p_entries);
6542  }
6543 #endif
6544 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6545 
6546 #ifdef DOCUMENTATION
6547  };
6548 #endif
6549 
6551 
6552  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
6553  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
6554 
6555 #ifdef DOCUMENTATION
6557  public:
6558 #endif
6559 
6560 #ifdef DOCUMENTATION
6561 
6564  SgAsmGenericString* get_name() const;
6567 #else
6568  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6569  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6570 #endif
6571 
6572  DECLARE_OTHERS(AsmElfSymverDefinedAux);
6573 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
6574 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6575  private:
6576  friend class boost::serialization::access;
6577 
6578  template<class S>
6579  void serialize(S &s, const unsigned /*version*/) {
6580  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6581  s & BOOST_SERIALIZATION_NVP(p_name);
6582  }
6583 #endif
6584 
6585  public:
6586 #ifdef _MSC_VER
6587 # pragma pack (1)
6588 #endif
6589 
6592  uint32_t vda_name;
6593  uint32_t vda_next;
6594  }
6595 #if !defined(SWIG) && !defined(_MSC_VER)
6596  __attribute__((packed))
6597 #endif
6598  ;
6599 
6600 #ifdef _MSC_VER
6601 # pragma pack ()
6602 #endif
6603 
6608  SgAsmElfSymverDefinedSection *symver_def_sec)
6609  : p_name(NULL) {
6610  ctor(symver_def_entry,symver_def_sec);
6611  }
6612 
6614  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
6615 
6617  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
6618 
6624  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6625 
6626  private:
6627  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
6628 #endif // SgAsmElfSymverDefinedAux_OTHERS
6629 
6630 #ifdef DOCUMENTATION
6631  };
6632 #endif
6633 
6635 
6636  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
6637  IS_SERIALIZABLE(AsmElfSymverNeededSection);
6638 
6639 #ifdef DOCUMENTATION
6640 
6646  public:
6647 #endif
6648 
6649 #ifdef DOCUMENTATION
6650 
6659 #else
6660  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
6661  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6662 #endif
6663 
6664  DECLARE_OTHERS(AsmElfSymverNeededSection);
6665 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
6666 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6667  private:
6668  friend class boost::serialization::access;
6669 
6670  template<class S>
6671  void serialize(S &s, const unsigned /*version*/) {
6672  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6673  s & BOOST_SERIALIZATION_NVP(p_entries);
6674  }
6675 #endif
6676 
6677  public:
6682  : SgAsmElfSection(fhdr) {
6683  ctor(strsec);
6684  }
6685 
6695  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
6696 
6701  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6702 
6706  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6707 
6709  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6710 
6711  private:
6712  void ctor(SgAsmElfStringSection*);
6713 #endif // SgAsmElfSymverNeededSection_OTHERS
6714 
6715 #ifdef DOCUMENTATION
6716  };
6717 #endif
6718 
6720 
6721  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
6722  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
6723 
6724 #ifdef DOCUMENTATION
6725 
6730  public:
6731 #endif
6732 
6733 #ifdef DOCUMENTATION
6734 
6737  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
6738  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
6740 #else
6741  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
6742  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6743  NO_DELETE);
6744 #endif
6745 
6746  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
6747 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
6748 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6749  private:
6750  friend class boost::serialization::access;
6751 
6752  template<class S>
6753  void serialize(S &s, const unsigned /*version*/) {
6754  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6755  s & BOOST_SERIALIZATION_NVP(p_entries);
6756  }
6757 #endif
6758 #endif // SgAsmElfSymverNeededEntryList_OTHERS
6759 
6760 #ifdef DOCUMENTATION
6761  };
6762 #endif
6763 
6765 
6766  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
6767  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
6768 
6769 #ifdef DOCUMENTATION
6770 
6772  public:
6773 #endif
6774 
6775 #ifdef DOCUMENTATION
6776 
6781  size_t get_version() const;
6782  void set_version(size_t);
6784 #else
6785  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
6786  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6787 #endif
6788 
6789 #ifdef DOCUMENTATION
6790 
6796 #else
6797  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
6798  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6799 #endif
6800 
6801 #ifdef DOCUMENTATION
6802 
6811 #else
6812  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
6813  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6814 #endif
6815 
6816  DECLARE_OTHERS(AsmElfSymverNeededEntry);
6817 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
6818 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6819  private:
6820  friend class boost::serialization::access;
6821 
6822  template<class S>
6823  void serialize(S &s, const unsigned /*version*/) {
6824  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6825  s & BOOST_SERIALIZATION_NVP(p_version);
6826  s & BOOST_SERIALIZATION_NVP(p_file_name);
6827  s & BOOST_SERIALIZATION_NVP(p_entries);
6828  }
6829 #endif
6830 
6831  public:
6832 #ifdef _MSC_VER
6833 # pragma pack (1)
6834 #endif
6835 
6838  uint16_t vn_version;
6839  uint16_t vn_cnt;
6840  uint32_t vn_file;
6841  uint32_t vn_aux;
6842  uint32_t vn_next;
6843  }
6844 #if !defined(SWIG) && !defined(_MSC_VER)
6845  __attribute__((packed))
6846 #endif
6847  ;
6848 
6849 #ifdef _MSC_VER
6850 # pragma pack ()
6851 #endif
6852 
6855  : p_file_name(NULL) {
6856  ctor(symver_needed);
6857  }
6858 
6860  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
6861 
6863  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
6864 
6866  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6867 
6868  private:
6869  void ctor(SgAsmElfSymverNeededSection*);
6870 #endif // SgAsmElfSymverNeededEntry_OTHERS
6871 
6872 #ifdef DOCUMENTATION
6873  };
6874 #endif
6875 
6877 
6878  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
6879  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
6880 
6881 #ifdef DOCUMENTATION
6882 
6887  public:
6888 #endif
6889 
6890 #ifdef DOCUMENTATION
6891 
6894  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
6895  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
6897 #else
6898  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
6899  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6900  NO_DELETE);
6901 #endif
6902 
6903  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
6904 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
6905 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6906  private:
6907  friend class boost::serialization::access;
6908 
6909  template<class S>
6910  void serialize(S &s, const unsigned /*version*/) {
6911  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6912  s & BOOST_SERIALIZATION_NVP(p_entries);
6913  }
6914 #endif
6915 #endif // SgAsmElfSymverNeededAuxList_OTHERS
6916 
6917 #ifdef DOCUMENTATION
6918  };
6919 #endif
6920 
6922 
6923  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
6924  IS_SERIALIZABLE(AsmElfSymverNeededAux);
6925 
6926 #ifdef DOCUMENTATION
6927 
6929  public:
6930 #endif
6931 
6932 #ifdef DOCUMENTATION
6933 
6938  uint32_t get_hash() const;
6939  void set_hash(uint32_t);
6941 #else
6942  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
6943  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6944 #endif
6945 
6946 #ifdef DOCUMENTATION
6947 
6952  int get_flags() const;
6953  void set_flags(int);
6955 #else
6956  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
6957  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6958 #endif
6959 
6960 #ifdef DOCUMENTATION
6961 
6966  size_t get_other() const;
6967  void set_other(size_t);
6969 #else
6970  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
6971  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6972 #endif
6973 
6974 #ifdef DOCUMENTATION
6975 
6978  SgAsmGenericString* get_name() const;
6981 #else
6982  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6983  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6984 #endif
6985 
6986  DECLARE_OTHERS(AsmElfSymverNeededAux);
6987 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
6988 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6989  private:
6990  friend class boost::serialization::access;
6991 
6992  template<class S>
6993  void serialize(S &s, const unsigned /*version*/) {
6994  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6995  s & BOOST_SERIALIZATION_NVP(p_hash);
6996  s & BOOST_SERIALIZATION_NVP(p_flags);
6997  s & BOOST_SERIALIZATION_NVP(p_other);
6998  s & BOOST_SERIALIZATION_NVP(p_name);
6999  }
7000 #endif
7001 
7002  public:
7003 #ifdef _MSC_VER
7004 # pragma pack (1)
7005 #endif
7006 
7009  uint32_t vna_hash;
7010  uint16_t vna_flags;
7011  uint16_t vna_other;
7012  uint32_t vna_name;
7013  uint32_t vna_next;
7014  }
7015 #if !defined(SWIG) && !defined(_MSC_VER)
7016  __attribute__((packed))
7017 #endif
7018  ;
7019 
7020 #ifdef _MSC_VER
7021 # pragma pack ()
7022 #endif
7023 
7029  : p_name(NULL) {
7030  ctor(symver_needed_entry,symver_needed_sec);
7031  }
7032 
7034  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
7035 
7037  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
7038 
7044  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7045 
7046  private:
7048 #endif // SgAsmElfSymverNeededAux_OTHERS
7049 
7050 #ifdef DOCUMENTATION
7051  };
7052 #endif
7053 
7054 
7055 
7056 
7058 
7059  /*************************************************************************************************************************
7060  * ELF Relocation Tables
7061  *************************************************************************************************************************/
7062 
7064 
7065  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7066  IS_SERIALIZABLE(AsmElfRelocSection);
7067 
7068 #ifdef DOCUMENTATION
7069 
7071  public:
7072 #endif
7073 
7074 #ifdef DOCUMENTATION
7075 
7078  bool get_uses_addend() const;
7079  void set_uses_addend(bool);
7081 #else
7082  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7083  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7084 #endif
7085 
7086 #ifdef DOCUMENTATION
7087 
7093 #else
7094  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7095  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7096 #endif
7097 
7098 #ifdef DOCUMENTATION
7099 
7107 #else
7108  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7109  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7110 #endif
7111 
7112  DECLARE_OTHERS(AsmElfRelocSection);
7113 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7114 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7115  private:
7116  friend class boost::serialization::access;
7117 
7118  template<class S>
7119  void serialize(S &s, const unsigned /*version*/) {
7120  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7121  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7122  s & BOOST_SERIALIZATION_NVP(p_target_section);
7123  s & BOOST_SERIALIZATION_NVP(p_entries);
7124  }
7125 #endif
7126 
7127  public:
7129  : SgAsmElfSection(fhdr) {
7130  ctor(symsec,targetsec);
7131  }
7132 
7135  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7136 
7138  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7139 
7141  virtual bool reallocate() $ROSE_OVERRIDE;
7142 
7144  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7145 
7147  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7148 
7149  private:
7151 #endif // SgAsmElfRelocSection_OTHERS
7152 
7153 #ifdef DOCUMENTATION
7154  };
7155 #endif
7156 
7158 
7159  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7160  IS_SERIALIZABLE(AsmElfRelocEntryList);
7161 
7162 #ifdef DOCUMENTATION
7163 
7168  public:
7169 #endif
7170 
7171 #ifdef DOCUMENTATION
7172 
7175  const SgAsmElfRelocEntryPtrList& get_entries() const;
7176  void set_entries(const SgAsmElfRelocEntryPtrList&);
7178 #else
7179  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7180  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7181  NO_DELETE);
7182 #endif
7183 
7184  DECLARE_OTHERS(AsmElfRelocEntryList);
7185 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7186 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7187  private:
7188  friend class boost::serialization::access;
7189 
7190  template<class S>
7191  void serialize(S &s, const unsigned /*version*/) {
7192  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7193  s & BOOST_SERIALIZATION_NVP(p_entries);
7194  }
7195 #endif
7196 #endif // SgAsmElfRelocEntryList_OTHERS
7197 
7198 #ifdef DOCUMENTATION
7199  };
7200 #endif
7201 
7203 
7204  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7205  IS_SERIALIZABLE(AsmElfRelocEntry);
7206 
7207 #ifdef DOCUMENTATION
7208 
7210  public:
7211 #endif
7212 
7213 #ifdef DOCUMENTATION
7214 
7219  rose_addr_t get_r_offset() const;
7220  void set_r_offset(rose_addr_t);
7222 #else
7223  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7224  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7225 #endif
7226 
7227 #ifdef DOCUMENTATION
7228 
7233  rose_addr_t get_r_addend() const;
7234  void set_r_addend(rose_addr_t);
7236 #else
7237  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7238  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7239 #endif
7240 
7241 #ifdef DOCUMENTATION
7242 
7247  unsigned long get_sym() const;
7248  void set_sym(unsigned long);
7250 #else
7251  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7252  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7253 #endif
7254 
7255 #ifdef DOCUMENTATION
7256 
7261  RelocType get_type() const;
7262  void set_type(RelocType);
7264 #else
7265  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7266  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7267 #endif
7268 
7269 #ifdef DOCUMENTATION
7270 
7273  const SgUnsignedCharList& get_extra() const;
7274  void set_extra(const SgUnsignedCharList&);
7276 #else
7277  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7278  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7279 #endif
7280 
7281  DECLARE_OTHERS(AsmElfRelocEntry);
7282 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7283 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7284  private:
7285  friend class boost::serialization::access;
7286 
7287  template<class S>
7288  void serialize(S &s, const unsigned /*version*/) {
7289  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7290  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7291  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7292  s & BOOST_SERIALIZATION_NVP(p_sym);
7293  s & BOOST_SERIALIZATION_NVP(p_type);
7294  s & BOOST_SERIALIZATION_NVP(p_extra);
7295  }
7296 #endif
7297 
7298  public:
7301  // Intel 80386 specific definitions.
7313  R_386_32PLT =11,
7320  R_386_16 =20,
7321  R_386_PC16 =21,
7322  R_386_8 =22,
7323  R_386_PC8 =23,
7339  // First Entry for X86-64
7354  R_X86_64_8 =114,
7364  };
7365 
7366 #ifdef _MSC_VER
7367 # pragma pack (1)
7368 #endif
7369 
7371  uint32_t r_offset;
7372  uint32_t r_info;
7373  uint32_t r_addend;
7374  }
7375 #if !defined(SWIG) && !defined(_MSC_VER)
7376  __attribute__((packed))
7377 #endif
7378  ;
7379 
7381  uint64_t r_offset;
7382  uint64_t r_info;
7383  uint64_t r_addend;
7384  }
7385 #if !defined(SWIG) && !defined(_MSC_VER)
7386  __attribute__((packed))
7387 #endif
7388  ;
7389 
7391  uint32_t r_offset;
7392  uint32_t r_info;
7393  }
7394 #if !defined(SWIG) && !defined(_MSC_VER)
7395  __attribute__((packed))
7396 #endif
7397  ;
7398 
7400  uint64_t r_offset;
7401  uint64_t r_info;
7402  }
7403 #if !defined(SWIG) && !defined(_MSC_VER)
7404  __attribute__((packed))
7405 #endif
7406  ;
7407 
7408 #ifdef _MSC_VER
7409 # pragma pack ()
7410 #endif
7411 
7414  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7415  ctor(section);
7416  }
7417 
7421  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7422  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7423  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7424  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7430  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7431  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7432  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7433  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7439  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7440  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7441  dump(f, prefix, idx, NULL);
7442  }
7446  std::string reloc_name() const;
7447 
7448  private:
7449  void ctor(SgAsmElfRelocSection*);
7450 #endif // SgAsmElfRelocEntry_OTHERS
7451 
7452 #ifdef DOCUMENTATION
7453  };
7454 #endif
7455 
7456 
7457 
7459 
7460  /*************************************************************************************************************************
7461  * ELF Dynamic Linking
7462  *************************************************************************************************************************/
7463 
7465 
7466  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7467  IS_SERIALIZABLE(AsmElfDynamicSection);
7468 
7469 #ifdef DOCUMENTATION
7470 
7472  public:
7473 #endif
7474 
7475 #ifdef DOCUMENTATION
7476 
7485 #else
7486  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7487  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7488 #endif
7489 
7490  DECLARE_OTHERS(AsmElfDynamicSection);
7491 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7492 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7493  private:
7494  friend class boost::serialization::access;
7495 
7496  template<class S>
7497  void serialize(S &s, const unsigned /*version*/) {
7498  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7499  s & BOOST_SERIALIZATION_NVP(p_entries);
7500  }
7501 #endif
7502 
7503  public:
7506  : SgAsmElfSection(fhdr) {
7507  ctor(strsec);
7508  }
7509 
7511  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7512 
7514  virtual void finish_parsing() $ROSE_OVERRIDE;
7515 
7518  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7519 
7521  virtual bool reallocate() $ROSE_OVERRIDE;
7522 
7524  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7525 
7527  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7528 
7529  private:
7530  void ctor(SgAsmElfStringSection*);
7531 #endif // SgAsmElfDynamicSection_OTHERS
7532 
7533 #ifdef DOCUMENTATION
7534  };
7535 #endif
7536 
7538 
7539  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7540  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7541 
7542 #ifdef DOCUMENTATION
7543 
7548  public:
7549 #endif
7550 
7551 #ifdef DOCUMENTATION
7552 
7555  const SgAsmElfDynamicEntryPtrList& get_entries() const;
7556  void set_entries(const SgAsmElfDynamicEntryPtrList&);
7558 #else
7559  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
7560  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
7561  NO_DELETE);
7562 #endif
7563 
7564  DECLARE_OTHERS(AsmElfDynamicEntryList);
7565 #if defined(SgAsmElfDynamicEntryList_OTHERS) || defined(DOCUMENTATION)
7566 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7567  private:
7568  friend class boost::serialization::access;
7569 
7570  template<class S>
7571  void serialize(S &s, const unsigned /*version*/) {
7572  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7573  s & BOOST_SERIALIZATION_NVP(p_entries);
7574  }
7575 #endif
7576 #endif // SgAsmElfDynamicEntryList_OTHERS
7577 
7578 #ifdef DOCUMENTATION
7579  };
7580 #endif
7581 
7583 
7584  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
7585  IS_SERIALIZABLE(AsmElfDynamicEntry);
7586 
7587 #ifdef DOCUMENTATION
7588 
7590  public:
7591 #endif
7592 
7593 #ifdef DOCUMENTATION
7594 
7599  EntryType get_d_tag() const;
7600  void set_d_tag(EntryType);
7602 #else
7603  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
7604  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7605 #endif
7606 
7607 #ifdef DOCUMENTATION
7608 
7613  rose_rva_t get_d_val() const;
7614  void set_d_val(rose_rva_t);
7616 #else
7617  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
7618  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7619 #endif
7620 
7621 #ifdef DOCUMENTATION
7622  // declared and documented below
7623 #else
7624  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
7625  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7626 #endif
7627 
7628 #ifdef DOCUMENTATION
7629 
7632  const SgUnsignedCharList& get_extra() const;
7633  void set_extra(const SgUnsignedCharList&);
7635 #else
7636  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7637  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7638 #endif
7639 
7640  DECLARE_OTHERS(AsmElfDynamicEntry);
7641 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
7642 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7643  private:
7644  friend class boost::serialization::access;
7645 
7646  template<class S>
7647  void serialize(S &s, const unsigned /*version*/) {
7648  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7649  s & BOOST_SERIALIZATION_NVP(p_d_tag);
7650  s & BOOST_SERIALIZATION_NVP(p_d_val);
7651  s & BOOST_SERIALIZATION_NVP(p_name);
7652  s & BOOST_SERIALIZATION_NVP(p_extra);
7653  }
7654 #endif
7655 
7656  public:
7657  enum EntryType { /* Type Executable SharedObj Purpose */
7658  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
7659  DT_NEEDED = 1, /* value optional optional Name of needed library */
7660  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
7661  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
7662  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
7663  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
7664  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
7665  DT_RELA = 7, /* pointer mandatory optional Relocation table */
7666  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
7667  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
7668  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
7669  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
7670  DT_INIT = 12, /* pointer optional optional Initialization function */
7671  DT_FINI = 13, /* pointer optional optional Termination function */
7672  DT_SONAME = 14, /* value ignored optional Name of shared object */
7673  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
7674  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
7675  DT_REL = 17, /* pointer mandatory optional Relocation table */
7676  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
7677  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
7678  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
7679  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
7680  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
7681  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
7682  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
7683  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
7684  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
7685  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
7686  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
7687  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
7688  DT_FLAGS = 30, /* value optional ? Bit flags */
7689  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
7690  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
7691  DT_NUM = 34, /* ? ? ? "number used"? */
7692 
7693  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
7694  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
7695  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
7696  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
7697  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
7698  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
7699  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
7700  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
7701  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
7702  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
7703  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
7704 
7705  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
7706  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
7707  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
7708  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
7709  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
7710  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
7711  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
7712  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
7713  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
7714  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
7715  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
7716 
7717  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
7718  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
7719  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
7720  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
7721  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
7722  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
7723  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
7724  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
7725 
7726  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
7727  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
7728  };
7729 
7730 #ifdef _MSC_VER
7731 # pragma pack (1)
7732 #endif
7733 
7736  uint32_t d_tag;
7737  uint32_t d_val;
7738  }
7739 #if !defined(SWIG) && !defined(_MSC_VER)
7740  __attribute__((packed))
7741 #endif
7742  ;
7743 
7745  uint64_t d_tag;
7746  uint64_t d_val;
7747  }
7748 #if !defined(SWIG) && !defined(_MSC_VER)
7749  __attribute__((packed))
7750 #endif
7751  ;
7752 
7753 #ifdef _MSC_VER
7754 # pragma pack ()
7755 #endif
7756 
7759  : p_d_tag(DT_NULL), p_name(NULL) {
7760  ctor(dynsec);
7761  }
7762 
7766  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);
7767  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*);
7773  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*) const;
7774  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*) const;
7778  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
7779 
7781  static std::string to_string(SgAsmElfDynamicEntry::EntryType);
7782 
7786  SgAsmGenericString* get_name() const { return p_name; }
7790  private:
7791  void ctor(SgAsmElfDynamicSection*);
7792 #endif // SgAsmElfDynamicEntry_OTHERS
7793 
7794 #ifdef DOCUMENTATION
7795  };
7796 #endif
7797 
7798 
7799 
7800 
7802 
7803  /*************************************************************************************************************************
7804  * ELF String Tables
7805  *************************************************************************************************************************/
7806 
7808 
7809  DECLARE_LEAF_CLASS(AsmElfStringSection);
7810  IS_SERIALIZABLE(AsmElfStringSection);
7811  AsmElfStringSection.setAutomaticGenerationOfDestructor(false);
7812 
7813 #ifdef DOCUMENTATION
7814 
7818  public:
7819 #endif
7820 
7821 #ifdef DOCUMENTATION
7822 
7827  SgAsmElfStrtab* get_strtab() const;
7828  void set_strtab(SgAsmElfStrtab*);
7830 #else
7831  AsmElfStringSection.setDataPrototype("SgAsmElfStrtab*", "strtab", "= NULL",
7832  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7833 #endif
7834 
7835  DECLARE_OTHERS(AsmElfStringSection);
7836 #if defined(SgAsmElfStringSection_OTHERS) || defined(DOCUMENTATION)
7837 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7838  private:
7839  friend class boost::serialization::access;
7840 
7841  template<class S>
7842  void serialize(S &s, const unsigned /*version*/) {
7843  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7844  s & BOOST_SERIALIZATION_NVP(p_strtab);
7845  }
7846 #endif
7847 
7848  public:
7851  : SgAsmElfSection(fhdr), p_strtab(NULL) {
7852  ctor();
7853  }
7854 
7856  virtual SgAsmElfStringSection *parse() $ROSE_OVERRIDE;
7857 
7859  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7860 
7865  virtual void set_size(rose_addr_t newsize) $ROSE_OVERRIDE;
7866 
7873  virtual bool reallocate() $ROSE_OVERRIDE;
7874 
7876  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7877 
7878  private:
7879  void ctor();
7880  void ctor(SgAsmElfSectionTable*);
7881 #endif // SgAsmElfStringSection_OTHERS
7882 
7883 #ifdef DOCUMENTATION
7884  };
7885 #endif
7886 
7888 
7889  DECLARE_LEAF_CLASS(AsmElfStrtab);
7890  IS_SERIALIZABLE(AsmElfStrtab);
7891  AsmElfStrtab.setAutomaticGenerationOfDestructor(false);
7892 
7893 #ifdef DOCUMENTATION
7894 
7895  class SgAsmElfStrtab: public SgAsmGenericStrtab {
7896  public:
7897 #endif
7898 
7899  DECLARE_OTHERS(AsmElfStrtab);
7900 #if defined(SgAsmElfStrtab_OTHERS) || defined(DOCUMENTATION)
7901 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7902  private:
7903  friend class boost::serialization::access;
7904 
7905  template<class S>
7906  void serialize(S &s, const unsigned /*version*/) {
7907  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericStrtab);
7908  }
7909 #endif
7910 
7911  public:
7915  explicit SgAsmElfStrtab(class SgAsmElfSection *containing_section)
7916  : SgAsmGenericStrtab(containing_section) {
7917  ctor();
7918  }
7919 
7926  virtual ~SgAsmElfStrtab();
7927 
7931  virtual SgAsmElfStrtab *parse() $ROSE_OVERRIDE;
7932 
7936  virtual void unparse(std::ostream&) const;
7937 
7943  virtual SgAsmStringStorage *create_storage(rose_addr_t offset, bool shared) $ROSE_OVERRIDE;
7944 
7948  virtual rose_addr_t get_storage_size(const SgAsmStringStorage*) $ROSE_OVERRIDE;
7949 
7959  virtual void allocate_overlap(SgAsmStringStorage*) $ROSE_OVERRIDE;
7960 
7962  virtual void rebind(SgAsmStringStorage*, rose_addr_t) $ROSE_OVERRIDE;
7963 
7964  private:
7965  void ctor();
7966 #endif // SgAsmElfStrtab_OTHERS
7967 
7968 #ifdef DOCUMENTATION
7969  };
7970 #endif
7971 
7972 
7973 
7974 
7976 
7977  /*************************************************************************************************************************
7978  * ELF Notes
7979  *************************************************************************************************************************/
7980 
7982 
7983  DECLARE_LEAF_CLASS(AsmElfNoteSection);
7984  IS_SERIALIZABLE(AsmElfNoteSection);
7985 
7986 #ifdef DOCUMENTATION
7988  public:
7989 #endif
7990 
7991 #ifdef DOCUMENTATION
7992 
8001 #else
8002  AsmElfNoteSection.setDataPrototype("SgAsmElfNoteEntryList*", "entries", "= NULL",
8003  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8004 #endif
8005 
8006  DECLARE_OTHERS(AsmElfNoteSection);
8007 #if defined(SgAsmElfNoteSection_OTHERS) || defined(DOCUMENTATION)
8008 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8009  private:
8010  friend class boost::serialization::access;
8011 
8012  template<class S>
8013  void serialize(S &s, const unsigned /*version*/) {
8014  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8015  s & BOOST_SERIALIZATION_NVP(p_entries);
8016  }
8017 #endif
8018 
8019  public:
8022  : SgAsmElfSection(fhdr) {
8023  ctor();
8024  }
8025  virtual SgAsmElfNoteSection *parse() $ROSE_OVERRIDE;
8026 
8028  virtual bool reallocate() $ROSE_OVERRIDE;
8029 
8031  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8032 
8034  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8035 
8036  private:
8037  void ctor();
8038 #endif // SgAsmElfNoteSection_OTHERS
8039 
8040 #ifdef DOCUMENTATION
8041  };
8042 #endif
8043 
8045 
8046  DECLARE_LEAF_CLASS(AsmElfNoteEntryList);
8047  IS_SERIALIZABLE(AsmElfNoteEntryList);
8048 
8049 #ifdef DOCUMENTATION
8050 
8055  public:
8056 #endif
8057 
8058 #ifdef DOCUMENTATION
8059 
8062  const SgAsmElfNoteEntryPtrList& get_entries() const;
8063  void set_entries(const SgAsmElfNoteEntryPtrList&);
8065 #else
8066  AsmElfNoteEntryList.setDataPrototype("SgAsmElfNoteEntryPtrList", "entries", "",
8067  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8068 #endif
8069 
8070  DECLARE_OTHERS(AsmElfNoteEntryList);
8071 #if defined(SgAsmElfNoteEntryList_OTHERS) || defined(DOCUMENTATION)
8072 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8073  private:
8074  friend class boost::serialization::access;
8075 
8076  template<class S>
8077  void serialize(S &s, const unsigned /*version*/) {
8078  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8079  s & BOOST_SERIALIZATION_NVP(p_entries);
8080  }
8081 #endif
8082 #endif // SgAsmElfNoteEntryList_OTHERS
8083 
8084 #ifdef DOCUMENTATION
8085  };
8086 #endif
8087 
8089 
8090  DECLARE_LEAF_CLASS(AsmElfNoteEntry);
8091  IS_SERIALIZABLE(AsmElfNoteEntry);
8092 
8093 #ifdef DOCUMENTATION
8094 
8096  public:
8097 #endif
8098 
8099 #ifdef DOCUMENTATION
8100 
8105  unsigned get_type() const;
8106  void set_type(unsigned);
8108 #else
8109  AsmElfNoteEntry.setDataPrototype("unsigned", "type", "= 0",
8110  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8111 #endif
8112 
8113 #ifdef DOCUMENTATION
8114  // documented below
8115 #else
8116  AsmElfNoteEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
8117  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8118 #endif
8119 
8120 #ifdef DOCUMENTATION
8121 
8126  const SgUnsignedCharList& get_payload() const;
8127  void set_payload(const SgUnsignedCharList&);
8129 #else
8130  AsmElfNoteEntry.setDataPrototype("SgUnsignedCharList", "payload", "",
8131  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8132 #endif
8133 
8134  DECLARE_OTHERS(AsmElfNoteEntry);
8135 #if defined(SgAsmElfNoteEntry_OTHERS) || defined(DOCUMENTATION)
8136 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8137  private:
8138  friend class boost::serialization::access;
8139 
8140  template<class S>
8141  void serialize(S &s, const unsigned /*version*/) {
8142  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8143  s & BOOST_SERIALIZATION_NVP(p_type);
8144  s & BOOST_SERIALIZATION_NVP(p_name);
8145  s & BOOST_SERIALIZATION_NVP(p_payload);
8146  }
8147 #endif
8148 
8149  public:
8152  : p_type(0), p_name(NULL) {
8153  ctor(section);
8154  }
8155 
8162  SgAsmGenericString *get_name() const;
8163  void set_name(SgAsmGenericString *name);
8169  rose_addr_t parse(rose_addr_t starting_offset);
8170 
8174  rose_addr_t unparse(std::ostream &f, rose_addr_t starting_offset);
8175 
8177  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
8178 
8182  void set_payload(const void*, size_t nbytes);
8183 
8185  rose_addr_t calculate_size() const;
8186 
8187  private:
8188  void ctor(SgAsmElfNoteSection *section);
8189 #endif // SgAsmElfNoteEntry_OTHERS
8190 
8191 #ifdef DOCUMENTATION
8192  };
8193 #endif
8194 
8195 
8196 
8198 
8199  /*************************************************************************************************************************
8200  * ELF Exception Handling
8201  *************************************************************************************************************************/
8202 
8204 
8205  DECLARE_LEAF_CLASS(AsmElfEHFrameSection);
8206  IS_SERIALIZABLE(AsmElfEHFrameSection);
8207 
8208 #ifdef DOCUMENTATION
8209 
8211  public:
8212 #endif
8213 
8214 #ifdef DOCUMENTATION
8215 
8224 #else
8225  AsmElfEHFrameSection.setDataPrototype("SgAsmElfEHFrameEntryCIList*", "ci_entries", "= NULL",
8226  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8227 #endif
8228 
8229  DECLARE_OTHERS(AsmElfEHFrameSection);
8230 #if defined(SgAsmElfEHFrameSection_OTHERS) || defined(DOCUMENTATION)
8231 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8232  private:
8233  friend class boost::serialization::access;
8234 
8235  template<class S>
8236  void serialize(S &s, const unsigned /*version*/) {
8237  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8238  s & BOOST_SERIALIZATION_NVP(p_ci_entries);
8239  }
8240 #endif
8241 
8242  public: