ROSE  0.9.10.69
binaryInstruction.C
1 /******************************************************************************************************************************
2  * NOTE: For any given IR class, please keep all its parts as close together as possible. Its bad enough that we're
3  * defining classes in a non-C-like language -- and it's painful when a definition is scattered all over this file. We
4  * already have four places to look to get the definition of an IR class:
5  * (1) here, in this source file, built with ROSETTA functions
6  * (2) additional declarations between HEADER_* markers in ../Grammar/BinaryInstruction.code (which we can't
7  * even parse as a C++ file, making IDEs useless there).
8  * (3) function definitions between SOURCE_* markers in ../Grammar/BinaryInstruction.code, which for some
9  * reason are not next to the corresponding HEADER_ markers. Please migrate these definitions to *.C files
10  * whenever you have an opportunity, so that IDEs can see the definitions.
11  * (4) Doxygen documentation in ../../../docs/testDoxygen directory since doxygen can't parse the IR classes
12  * from this source file. Documented entities are marked with a "DOXYGEN" comment here to make it more
13  * obvious when documentation is present.
14  *
15  * NOTE: First part of the file is for classes describing instructions. Middle part is for classes describing binary
16  * containers (organized by container type: ELF, DOS, PE, ...) Last part is the base classes. Unlike C++, the classes
17  * defined in this file need to be defined from the most specific (derived classes) to the most general (base class).
18  *
19  * NOTE: Please use three blank lines between IR node definitions to help make this file more readable. Unless those IR
20  * nodes are so closely related to one another that it's better to keep them close.
21  *
22  * UPDATE: Instead of splitting class declarations into four separate places, we can now use the macros defined below to put
23  * everything into one place in this file. My goal is to eventually remove the
24  * src/ROSETTA/Grammar/BinaryInstruction.code file and the related docs/testDoxygen/xxx.docs files and to add
25  * documentation here for all property accessors.
26  *
27  * ROSETTA FAILURE MODES:
28  *
29  * + If you get thousands of compile errors in Cxx_Grammar.h that seem to have absolutely nothing to do with the node
30  * you just added, then double check that the new node type is listed as the descendant of some other node type in a
31  * NEW_NONTERMINAL_MACRO macro expansion.
32  *
33  * + If CxxGrammarMetaProgram uses gigabytes and gigabytes of memory and never terminates then check that all the new
34  * IR node types have a correctly spelled entry in the astNodeList file.
35  *-----------------------------------------------------------------------------------------------------------------------------*/
36 
37 #include "ROSETTA_macros.h"
38 #include "grammar.h"
39 #include "AstNodeClass.h"
40 
41 // The following macros try to make it possile to keep all aspects of a Sage node's declaration in this one file. The old way
42 // of doing things required the class declarations to be split into four places:
43 // (1) The #include files necessary to declare the class were at the top of a src/ROSETTA/Grammar/*.code file
44 // (2) The class declaration and properties were built in src/ROSETTA/src/*.C
45 // (3) The documentation for the class and its properties were in docs/testDoxygen/*.docs files
46 // (4) Additional non-ROSETTA members were in src/ROSETTA/Grammar/*.code files
47 // Implementations were originally also in the src/ROSETTA/Grammar/*.code files but have since been moved to *.C files. The
48 // problem with *.code files is no IDE understands them.
49 //
50 // The following macros take a CLASS_WITHOUT_Sg parameter, which is the name of the Sage node class but without the leading
51 // "Sg". I'm not sure why ROSETTA was written this way. For instance, use "AsmInstruction" instead of "SgAsmInstruction". Most
52 // other things will use the full class name.
53 //
54 // The macros are:
55 // DOCUMENTATION is never defined when compiling, but will be defined when generating documentation and can be used to help
56 // IDE's figure out the indentation and as commentary. We don't use "#if 0" because some IDEs figure out that the code is
57 // never possible and don't indent it properly. For instance, most of the classes are defined like this:
58 // #ifdef DOCUMENTATION
59 // class SgAsmArmInstruction: public SgAsmInstruction {
60 // #endif
61 //
62 // ...
63 //
64 // #ifdef DOCUMENTATION
65 // };
66 // #endif
67 //
68 //
69 // DECLARE_LEAF_CLASS is the simpler way to declare a Sage class that has no subclasses. This must be the first macro
70 // invoked when starting a new class declaration. Example, to declare the SgMyClass node, say:
71 // DECLARE_LEAF_CLASS(MyClass);
72 // #ifdef DOCUMENTATION
73 // class SgMyClass: public ...base-classes... {
74 // #endif
75 //
76 //
77 // DECLARE_HEADERS is used to indicate what header files need to be included. Note that due to limitations of ROSETTA
78 // (specifically, not having any portable regular expression library due to prohibition against using boost), the #ifdef and
79 // #endif lines must be *exactly* as written here -- they are sensitive to white space.
80 // DECLARE_HEADERS(MyClass);
81 // #if defined(SgMyClass_HEADERS) || defined(DOCUMENTATION)
82 // #include <someHeader>
83 // #endif // SgMyClass_HEADERS
84 //
85 //
86 // DECLARE_OTHERS is for declaring other class members that don't need to be processed by ROSETTA. Due to limitations of
87 // ROSETTA (specifically, not having any portable regular expression library due to prohibition against using boost), the
88 // #ifdef and #endif lines must be *exactly* as written here -- they are sensitive to white space.
89 // DECLARE_OTHERS(MyClass);
90 // #if defined(SgMyClass_OTHERS) || defined(DOCUMENTATION)
91 // // other declarations here
92 // #endif // SgMyClass_OTHERS
93 
94 //#undef DOCUMENTATION -- commented out so IDEs can't figure it out
95 #ifdef DOCUMENTATION
96 DOCUMENTATION_should_never_be_defined;
97 #endif
98 
99 #ifdef DOCUMENTATION
100 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) /*void*/
101 #else
102 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) \
103  NEW_TERMINAL_MACRO(CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg "Tag"); \
104  CLASS_WITHOUT_Sg.setCppCondition("!defined(DOCUMENTATION)")
105 #endif
106 
107 #ifdef DOCUMENTATION
108 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) /*void*/
109 #else
110 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) \
111  CLASS_WITHOUT_Sg.setPredeclarationString("Sg" #CLASS_WITHOUT_Sg "_HEADERS", __FILE__)
112 #endif
113 
114 #ifdef DOCUMENTATION
115 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) /*void*/
116 #else
117 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) \
118  CLASS_WITHOUT_Sg.setFunctionPrototype("Sg" #CLASS_WITHOUT_Sg "_OTHERS", __FILE__)
119 #endif
120 
121 #ifdef DOCUMENTATION
122 #define IS_SERIALIZABLE() /*void*/
123 #else
124 #define IS_SERIALIZABLE(CLASS_WITHOUT_Sg) \
125  CLASS_WITHOUT_Sg.isBoostSerializable(true)
126 #endif
127 
128 // Since ROSETTA builds classes from the leaves up to the base, and C++ builds classes from the base down to the leaves, we
129 // need to make sure that doxygen sees the base classes before the derived classes. So just list all the non-leaf classes here.
130 #ifdef DOCUMENTATION
133 class SgAsmDwarfConstruct;
135 class SgAsmElfSection;
137 class SgAsmExpression;
138 class SgAsmGenericHeader;
139 class SgAsmGenericSection;
140 class SgAsmGenericString;
141 class SgAsmGenericStrtab;
142 class SgAsmGenericSymbol;
143 class SgAsmInstruction;
144 class SgAsmNode;
145 class SgAsmPESection;
147 class SgAsmScalarType;
148 class SgAsmStatement;
149 class AsmSynthesizedFieldDeclaration;
150 class SgAsmType;
153 class SgNode;
154 #endif
155 
156 #ifndef DOCUMENTATION
157 void Grammar::setUpBinaryInstructions() {
158 #endif
159 
161 
162  /**************************************************************************************************************************
163  * Instructions.
164  * Base class (SgAsmInstruction) and various subclasses, one per architecture.
165  **************************************************************************************************************************/
166 
168 
169  DECLARE_LEAF_CLASS(AsmArmInstruction);
170  IS_SERIALIZABLE(AsmArmInstruction);
171 
172  DECLARE_HEADERS(AsmArmInstruction);
173 #if defined(SgAsmArmInstruction_HEADERS) || defined(DOCUMENTATION)
174  #include <armInstructionEnum.h>
175 #endif // SgAsmArmInstruction_HEADERS
176 
177 #ifdef DOCUMENTATION
178 
180  public:
181 #endif
182 
183 #ifdef DOCUMENTATION
184 
190  ArmInstructionKind get_kind() const;
191  void set_kind(ArmInstructionKind);
193 #else
194  AsmArmInstruction.setDataPrototype("ArmInstructionKind", "kind", "= arm_unknown_instruction",
195  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
196 #endif
197 
198 #ifdef DOCUMENTATION
199 
202  ArmInstructionCondition get_condition() const;
203  void set_condition(ArmInstructionCondition);
205 #else
206  AsmArmInstruction.setDataPrototype("ArmInstructionCondition", "condition", "= arm_cond_unknown",
207  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
208 #endif
209 
210 #ifdef DOCUMENTATION
211 
217 #else
218  AsmArmInstruction.setDataPrototype("int", "positionOfConditionInMnemonic", "= -1",
219  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
220 #endif
221 
222  DECLARE_OTHERS(AsmArmInstruction);
223 #if defined(SgAsmArmInstruction_OTHERS) || defined(DOCUMENTATION)
224 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
225  private:
226  friend class boost::serialization::access;
227 
228  template<class S>
229  void serialize(S &s, const unsigned /*version*/) {
230  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
231  s & BOOST_SERIALIZATION_NVP(p_kind);
232  s & BOOST_SERIALIZATION_NVP(p_condition);
233  s & BOOST_SERIALIZATION_NVP(p_positionOfConditionInMnemonic);
234  }
235 #endif
236 
237  public:
238  // Overrides are documented in the base class
239  virtual std::string description() const $ROSE_OVERRIDE;
240  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
241  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
242  virtual bool isUnknown() const $ROSE_OVERRIDE;
243  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
244 #endif // SgAsmArmInstruction_OTHERS
245 #ifdef DOCUMENTATION
246  };
247 #endif
248 
249 
251 
252  DECLARE_LEAF_CLASS(AsmX86Instruction);
253  IS_SERIALIZABLE(AsmX86Instruction);
254  DECLARE_HEADERS(AsmX86Instruction);
255 #if defined(SgAsmX86Instruction_HEADERS) || defined(DOCUMENTATION)
256  #include <InstructionEnumsX86.h>
257  class RegisterDictionary;
258 #endif // SgAsmX86Instruction_HEADERS
259 
260 #ifdef DOCUMENTATION
261 
263  public:
264 #endif
265 
266 #ifdef DOCUMENTATION
267 
273  X86InstructionKind get_kind() const;
274  void set_kind(X86InstructionSize);
276 #else
277  AsmX86Instruction.setDataPrototype("X86InstructionKind", "kind", "= x86_unknown_instruction",
278  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
279 #endif
280 
281 #ifdef DOCUMENTATION
282 
285  X86InstructionSize get_baseSize() const;
286  void set_baseSize(X86InstructionSize);
288 #else
289  AsmX86Instruction.setDataPrototype("X86InstructionSize", "baseSize", "= x86_insnsize_none",
290  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
291 #endif
292 
293 #ifdef DOCUMENTATION
294 
297  X86InstructionSize get_operandSize() const;
298  void set_operandSize(X86InstructionSize);
300 #else
301  AsmX86Instruction.setDataPrototype("X86InstructionSize", "operandSize", "= x86_insnsize_none",
302  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
303 #endif
304 
305 #ifdef DOCUMENTATION
306 
309  X86InstructionSize get_addressSize() const;
310  void set_addressSize(X86InstructionSize);
312 #else
313  AsmX86Instruction.setDataPrototype("X86InstructionSize", "addressSize", "= x86_insnsize_none",
314  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
315 #endif
316 
317 #ifdef DOCUMENTATION
318 
323  bool get_lockPrefix() const;
324  void set_lockPrefix(bool);
326 #else
327  AsmX86Instruction.setDataPrototype("bool", "lockPrefix", "= false",
328  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
329 #endif
330 
331 #ifdef DOCUMENTATION
332 
335  X86RepeatPrefix get_repeatPrefix() const;
336  void set_repeatPrefix(X86RepeatPrefix);
338 #else
339  AsmX86Instruction.setDataPrototype("X86RepeatPrefix", "repeatPrefix", "= x86_repeat_none",
340  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
341 #endif
342 
343 #ifdef DOCUMENTATION
344 
347  X86BranchPrediction get_branchPrediction() const;
348  void set_branchPrediction(X86BranchPrediction);
350 #else
351  AsmX86Instruction.setDataPrototype("X86BranchPrediction", "branchPrediction", "= x86_branch_prediction_none",
352  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
353 #endif
354 
355 #ifdef DOCUMENTATION
356 
362  X86SegmentRegister get_segmentOverride() const;
363  void set_segmentOverride(X86SegmentRegister);
365 #else
366  AsmX86Instruction.setDataPrototype("X86SegmentRegister", "segmentOverride", "= x86_segreg_none",
367  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
368 #endif
369 
370 
371  DECLARE_OTHERS(AsmX86Instruction);
372 #if defined(SgAsmX86Instruction_OTHERS) || defined(DOCUMENTATION)
373 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
374  private:
375  friend class boost::serialization::access;
376 
377  template<class S>
378  void serialize(S &s, const unsigned /*version*/) {
379  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
380  s & BOOST_SERIALIZATION_NVP(p_kind);
381  s & BOOST_SERIALIZATION_NVP(p_baseSize);
382  s & BOOST_SERIALIZATION_NVP(p_operandSize);
383  s & BOOST_SERIALIZATION_NVP(p_addressSize);
384  s & BOOST_SERIALIZATION_NVP(p_lockPrefix);
385  s & BOOST_SERIALIZATION_NVP(p_repeatPrefix);
386  s & BOOST_SERIALIZATION_NVP(p_branchPrediction);
387  s & BOOST_SERIALIZATION_NVP(p_segmentOverride);
388  }
389 #endif
390 
391  public:
395  static X86InstructionSize instructionSizeForWidth(size_t);
396 
400  static size_t widthForInstructionSize(X86InstructionSize);
401 
406  static const RegisterDictionary* registersForInstructionSize(X86InstructionSize);
407 
412  static const RegisterDictionary* registersForWidth(size_t);
413 
414  // Overrides are documented in the base class
415  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
416  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
417  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
418  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
419  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
420  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
421  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
422  virtual bool getBranchTarget(rose_addr_t *target/*out*/) $ROSE_OVERRIDE;
423  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
424  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*>&,
425  bool* complete,
426  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
427  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
428  virtual bool isUnknown() const $ROSE_OVERRIDE;
429  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
430 #endif // SgAsmX86Instruction_OTHERS
431 #ifdef DOCUMENTATION
432  };
433 #endif
434 
436 
437  DECLARE_LEAF_CLASS(AsmPowerpcInstruction);
438  IS_SERIALIZABLE(AsmPowerpcInstruction);
439  DECLARE_HEADERS(AsmPowerpcInstruction);
440 #if defined(SgAsmPowerpcInstruction_HEADERS) || defined(DOCUMENTATION)
441  #include <powerpcInstructionEnum.h>
442 #endif // SgAsmPowerpcInstruction_HEADERS
443 
444 #ifdef DOCUMENTATION
445 
447  public:
448 #endif
449 
450 
451 #ifdef DOCUMENTATION
452 
458  PowerpcInstructionKind get_kind() const;
459  void set_kind(PowerpcInstructionKind);
461 #else
462  AsmPowerpcInstruction.setDataPrototype("PowerpcInstructionKind", "kind", "= powerpc_unknown_instruction",
463  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
464  COPY_DATA);
465 #endif
466 
467  DECLARE_OTHERS(AsmPowerpcInstruction);
468 #if defined(SgAsmPowerpcInstruction_OTHERS) || defined(DOCUMENTATION)
469 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
470  private:
471  friend class boost::serialization::access;
472 
473  template<class S>
474  void serialize(S &s, const unsigned /*version*/) {
475  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
476  s & BOOST_SERIALIZATION_NVP(p_kind);
477  }
478 #endif
479 
480  public:
481  // Overrides are documented in the base class
482  virtual std::string description() const $ROSE_OVERRIDE;
483  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
484  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
485  virtual bool isUnknown() const $ROSE_OVERRIDE;
486  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
487 #endif // SgAsmPowerpcInstruction_OTHERS
488 #ifdef DOCUMENTATION
489  };
490 #endif
491 
492 
494 
495  DECLARE_LEAF_CLASS(AsmMipsInstruction);
496  IS_SERIALIZABLE(AsmMipsInstruction);
497  DECLARE_HEADERS(AsmMipsInstruction);
498 #if defined(SgAsmMipsInstruction_HEADERS) || defined(DOCUMENTATION)
499  #include <InstructionEnumsMips.h>
500 #endif // SgAsmMipsInstruction_HEADERS
501 
502 #ifdef DOCUMENTATION
503 
505  public:
506 #endif
507 
508 #ifdef DOCUMENTATION
509 
515  MipsInstructionKind get_kind() const;
516  void set_kind(MipsInstructionKind);
518 #else
519  AsmMipsInstruction.setDataPrototype("MipsInstructionKind", "kind", "= mips_unknown_instruction",
520  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
521  COPY_DATA);
522 #endif
523 
524  DECLARE_OTHERS(AsmMipsInstruction);
525 #if defined(SgAsmMipsInstruction_OTHERS) || defined(DOCUMENTATION)
526 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
527  private:
528  friend class boost::serialization::access;
529 
530  template<class S>
531  void serialize(S &s, const unsigned /*version*/) {
532  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
533  s & BOOST_SERIALIZATION_NVP(p_kind);
534  }
535 #endif
536 
537  public:
538  // Overrides are documented in the base class
539  virtual std::string description() const $ROSE_OVERRIDE;
540  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
541  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
542  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
543  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
544  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
545  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
546  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
547  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
548  virtual bool isUnknown() const $ROSE_OVERRIDE;
549  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
550  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
551 #endif // SgAsmMipsInstruction_OTHERS
552 #ifdef DOCUMENTATION
553  };
554 #endif
555 
557 
558  DECLARE_LEAF_CLASS(AsmM68kInstruction);
559  IS_SERIALIZABLE(AsmM68kInstruction);
560  DECLARE_HEADERS(AsmM68kInstruction);
561 #if defined(SgAsmM68kInstruction_HEADERS) || defined(DOCUMENTATION)
562  #include "InstructionEnumsM68k.h"
563 #endif // SgAsmM68kInstruction_HEADERS
564 
565 #ifdef DOCUMENTATION
567  public:
568 #endif
569 
570 #ifdef DOCUMENTATION
571 
577  M68kInstructionKind get_kind() const;
578  void set_kind(M68kInstructionKind);
580 #else
581  AsmM68kInstruction.setDataPrototype("M68kInstructionKind", "kind", " = m68k_unknown_instruction",
582  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
583  COPY_DATA);
584 #endif
585 
586  DECLARE_OTHERS(AsmM68kInstruction);
587 #if defined(SgAsmM68kInstruction_OTHERS) || defined(DOCUMENTATION)
588 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
589  private:
590  friend class boost::serialization::access;
591 
592  template<class S>
593  void serialize(S &s, const unsigned /*version*/) {
594  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
595  s & BOOST_SERIALIZATION_NVP(p_kind);
596  }
597 #endif
598 
599  public:
600  // Overrides are documented in the base class
601  virtual std::string description() const $ROSE_OVERRIDE;
602  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
603  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
604  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
605  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
606  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
607  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
608  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
609  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
610  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
611  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*>&,
612  bool* complete,
613  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
614  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
615  virtual bool isUnknown() const $ROSE_OVERRIDE;
616  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
617 #endif // SgAsmM68kInstruction_OTHERS
618 #ifdef DOCUMENTATION
619  };
620 #endif
621 
623 
624  NEW_NONTERMINAL_MACRO(AsmInstruction,
625  AsmX86Instruction | AsmArmInstruction | AsmPowerpcInstruction | AsmMipsInstruction |
626  AsmM68kInstruction,
627  "AsmInstruction", "AsmInstructionTag", true);
628  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
629  IS_SERIALIZABLE(AsmInstruction);
630 
631  DECLARE_HEADERS(AsmInstruction);
632 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
633  #include <MemoryMap.h>
634 #endif // SgAsmInstruction_HEADERS
635 
636 #ifdef DOCUMENTATION
637 
659  public:
660 #endif
661 
662 #ifdef DOCUMENTATION
663 
671  const std::string& get_mnemonic() const;
672  void set_mnemonic(const std::string&);
674 #else
675  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
676  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
677 #endif
678 
679 #ifdef DOCUMENTATION
680 
685  const SgUnsignedList& get_raw_bytes() const;
686  void set_raw_bytes(const SgUnsignedList&);
688 #else
689  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
690  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
691 #endif
692 
693 #ifdef DOCUMENTATION
694 
703 #else
704  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
705  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
706 #endif
707 
708 #ifdef DOCUMENTATION
709  // FIXME[Robb P Matzke 2017-02-13]: unused?
710 #else
711  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
712  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
713 #endif
714 
715 #ifdef DOCUMENTATION
716 
722  int64_t get_stackDeltaIn() const;
723  void set_stackDeltaIn(int64_t);
725 #else
726  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
727  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
728 #endif
729 
730 #ifdef DOCUMENTATION
731  // FIXME[Robb P Matzke 2017-02-13]: unused?
732 #else
733  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
734  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
735 #endif
736 
737  DECLARE_OTHERS(AsmInstruction);
738 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
739 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
740  private:
741  friend class boost::serialization::access;
742 
743  template<class S>
744  void serialize(S &s, const unsigned /*version*/) {
745  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
746  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
747  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
748  s & BOOST_SERIALIZATION_NVP(p_operandList);
749  s & BOOST_SERIALIZATION_NVP(p_sources);
750  }
751 #endif
752 
753  public:
758  static const int64_t INVALID_STACK_DELTA;
759 
765  virtual std::string description() const { return ""; }
766 
767  // FIXME[Robb P Matzke 2017-02-13]: unused?
768  void appendSources( SgAsmInstruction* instruction );
769 
776  virtual bool terminatesBasicBlock();
777 
791  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
792  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
804  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
805  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
811  bool isFirstInBlock();
812 
816  bool isLastInBlock();
817 
822  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
823 
958  virtual bool hasEffect();
959 
968  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
969  bool relax_stack_semantics=false);
970 
980  virtual std::vector<std::pair<size_t,size_t> >
981  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
982  bool relax_stack_semantics=false);
983 
990  virtual std::set<rose_addr_t> getSuccessors(bool* complete); /*subclasses must redefine*/
991 
1000  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1001  bool *complete,
1002  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1004 
1010  virtual size_t get_size() const;
1011 
1017  virtual bool isUnknown() const;
1018 
1052  virtual unsigned get_anyKind() const;
1053 #endif // SgAsmInstruction_OTHERS
1054 
1055 #ifdef DOCUMENTATION
1056  };
1057 #endif
1058 
1059 
1060 
1062 
1063  /**************************************************************************************************************************
1064  * Instruction Expressions
1065  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1066  **************************************************************************************************************************/
1067 
1069 
1070  DECLARE_LEAF_CLASS(AsmOperandList);
1071  IS_SERIALIZABLE(AsmOperandList);
1072 
1073 #ifdef DOCUMENTATION
1074 
1075  class SgAsmOperandList: public SgAsmNode {
1076  public:
1077 #endif
1078 
1079 #ifdef DOCUMENTATION
1080 
1086  const SgAsmExpressionPtrList& get_operands() const;
1087  void set_oerands(const SgAsmExpressionPtrList&);
1089 #else
1090  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1091  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1092 #endif
1093 
1094  DECLARE_OTHERS(AsmOperandList);
1095 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1096 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1097  private:
1098  friend class boost::serialization::access;
1099 
1100  template<class S>
1101  void serialize(S &s, const unsigned /*version*/) {
1102  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1103  s & BOOST_SERIALIZATION_NVP(p_operands);
1104  }
1105 #endif
1106 
1107  public:
1109  void append_operand(SgAsmExpression* operand);
1110 #endif // SgAsmOperandList_OTHERS
1111 
1112 #ifdef DOCUMENTATION
1113  };
1114 #endif
1115 
1116  // FIXME[Robb P Matzke 2016-10-31]
1117  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1118 
1120 
1121  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1122  IS_SERIALIZABLE(AsmBinaryAdd);
1123 
1124 #ifdef DOCUMENTATION
1125 
1127  public:
1128 #endif
1129 
1130  DECLARE_OTHERS(AsmBinaryAdd);
1131 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1132 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1133  private:
1134  friend class boost::serialization::access;
1135 
1136  template<class S>
1137  void serialize(S &s, const unsigned /*version*/) {
1138  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1139  }
1140 #endif
1141 #endif // SgAsmBinaryAdd_OTHERS
1142 
1143 #ifdef DOCUMENTATION
1144  };
1145 #endif
1146 
1148 
1149  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1150  IS_SERIALIZABLE(AsmBinarySubtract);
1151 
1152 #ifdef DOCUMENTATION
1153 
1155  public:
1156 #endif
1157 
1158  DECLARE_OTHERS(AsmBinarySubtract);
1159 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1160 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1161  private:
1162  friend class boost::serialization::access;
1163 
1164  template<class S>
1165  void serialize(S &s, const unsigned /*version*/) {
1166  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1167  }
1168 #endif
1169 #endif // SgAsmBinarySubtract_OTHERS
1170 
1171 #ifdef DOCUMENTATION
1172  };
1173 #endif
1174 
1176 
1177  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1178  IS_SERIALIZABLE(AsmBinaryMultiply);
1179 
1180 #ifdef DOCUMENTATION
1181 
1183  public:
1184 #endif
1185 
1186  DECLARE_OTHERS(AsmBinaryMultiply);
1187 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1188 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1189  private:
1190  friend class boost::serialization::access;
1191 
1192  template<class S>
1193  void serialize(S &s, const unsigned /*version*/) {
1194  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1195  }
1196 #endif
1197 #endif // SgAsmBinaryMultiply_OTHERS
1198 
1199 #ifdef DOCUMENTATION
1200  };
1201 #endif
1202 
1204 
1205  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1206  IS_SERIALIZABLE(AsmBinaryDivide);
1207 
1208 #ifdef DOCUMENTATION
1209 
1211  public:
1212 #endif
1213 
1214  DECLARE_OTHERS(AsmBinaryDivide);
1215 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1216 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1217  private:
1218  friend class boost::serialization::access;
1219 
1220  template<class S>
1221  void serialize(S &s, const unsigned /*version*/) {
1222  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1223  }
1224 #endif
1225 #endif // SgAsmBinaryDivide_OTHERS
1226 
1227 #ifdef DOCUMENTATION
1228  };
1229 #endif
1230 
1232 
1233  DECLARE_LEAF_CLASS(AsmBinaryMod);
1234  IS_SERIALIZABLE(AsmBinaryMod);
1235 
1236 #ifdef DOCUMENTATION
1237 
1239  public:
1240 #endif
1241 
1242  DECLARE_OTHERS(AsmBinaryMod);
1243 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1244 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1245  private:
1246  friend class boost::serialization::access;
1247 
1248  template<class S>
1249  void serialize(S &s, const unsigned /*version*/) {
1250  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1251  }
1252 #endif
1253 #endif // SgAsmBinaryMod_OTHERS
1254 
1255 #ifdef DOCUMENTATION
1256  };
1257 #endif
1258 
1260 
1261  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1262  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1263 
1264 #ifdef DOCUMENTATION
1265 
1267  public:
1268 #endif
1269 
1270  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1271 #if defined(SgAsmBinaryAddPreupdate_OTHERS) || defined(DOCUMENTATION)
1272 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1273  private:
1274  friend class boost::serialization::access;
1275 
1276  template<class S>
1277  void serialize(S &s, const unsigned /*version*/) {
1278  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1279  }
1280 #endif
1281 #endif // SgAsmBinaryAddPreupdate_OTHERS
1282 
1283 #ifdef DOCUMENTATION
1284  };
1285 #endif
1286 
1288 
1289  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1290  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1291 
1292 #ifdef DOCUMENTATION
1293 
1295  public:
1296 #endif
1297 
1298  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1299 #if defined(SgAsmBinarySubtractPreupdate_OTHERS) || defined(DOCUMENTATION)
1300 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1301  private:
1302  friend class boost::serialization::access;
1303 
1304  template<class S>
1305  void serialize(S &s, const unsigned /*version*/) {
1306  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1307  }
1308 #endif
1309 #endif // SgAsmBinarySubtractPreupdate_OTHERS
1310 
1311 #ifdef DOCUMENTATION
1312  };
1313 #endif
1314 
1316 
1317  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1318  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1319 
1320 #ifdef DOCUMENTATION
1321 
1323  public:
1324 #endif
1325 
1326  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1327 #if defined(SgAsmBinaryAddPostupdate_OTHERS) || defined(DOCUMENTATION)
1328 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1329  private:
1330  friend class boost::serialization::access;
1331 
1332  template<class S>
1333  void serialize(S &s, const unsigned /*version*/) {
1334  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1335  }
1336 #endif
1337 #endif // SgAsmBinaryAddPostupdate_OTHERS
1338 
1339 #ifdef DOCUMENTATION
1340  };
1341 #endif
1342 
1344 
1345  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1346  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1347 
1348 #ifdef DOCUMENTATION
1349 
1351  public:
1352 #endif
1353 
1354  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1355 #if defined(SgAsmBinarySubtractPostupdate_OTHERS) || defined(DOCUMENTATION)
1356 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1357  private:
1358  friend class boost::serialization::access;
1359 
1360  template<class S>
1361  void serialize(S &s, const unsigned /*version*/) {
1362  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1363  }
1364 #endif
1365 #endif // SgAsmBinarySubtractPostupdate_OTHERS
1366 
1367 #ifdef DOCUMENTATION
1368  };
1369 #endif
1370 
1372 
1373  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1374  IS_SERIALIZABLE(AsmBinaryLsl);
1375 
1376 #ifdef DOCUMENTATION
1377 
1379  public:
1380 #endif
1381 
1382  DECLARE_OTHERS(AsmBinaryLsl);
1383 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1384 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1385  private:
1386  friend class boost::serialization::access;
1387 
1388  template<class S>
1389  void serialize(S &s, const unsigned /*version*/) {
1390  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1391  }
1392 #endif
1393 #endif // SgAsmBinaryLsl_OTHERS
1394 
1395 #ifdef DOCUMENTATION
1396  };
1397 #endif
1398 
1400 
1401  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1402  IS_SERIALIZABLE(AsmBinaryLsr);
1403 
1404 #ifdef DOCUMENTATION
1405 
1407  public:
1408 #endif
1409 
1410  DECLARE_OTHERS(AsmBinaryLsr);
1411 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1412 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1413  private:
1414  friend class boost::serialization::access;
1415 
1416  template<class S>
1417  void serialize(S &s, const unsigned /*version*/) {
1418  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1419  }
1420 #endif
1421 #endif // SgAsmBinaryLsr_OTHERS
1422 
1423 #ifdef DOCUMENTATION
1424  };
1425 #endif
1426 
1428 
1429  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1430  IS_SERIALIZABLE(AsmBinaryAsr);
1431 
1432 #ifdef DOCUMENTATION
1433 
1435  public:
1436 #endif
1437 
1438  DECLARE_OTHERS(AsmBinaryAsr);
1439 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1440 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1441  private:
1442  friend class boost::serialization::access;
1443 
1444  template<class S>
1445  void serialize(S &s, const unsigned /*version*/) {
1446  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1447  }
1448 #endif
1449 #endif // SgAsmBinaryAsr_OTHERS
1450 
1451 #ifdef DOCUMENTATION
1452  };
1453 #endif
1454 
1456 
1457  DECLARE_LEAF_CLASS(AsmBinaryRor);
1458  IS_SERIALIZABLE(AsmBinaryRor);
1459 
1460 #ifdef DOCUMENTATION
1461 
1463  public:
1464 #endif
1465 
1466  DECLARE_OTHERS(AsmBinaryRor);
1467 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1468 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1469  private:
1470  friend class boost::serialization::access;
1471 
1472  template<class S>
1473  void serialize(S &s, const unsigned /*version*/) {
1474  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1475  }
1476 #endif
1477 #endif // SgAsmBinaryRor_OTHERS
1478 
1479 #ifdef DOCUMENTATION
1480  };
1481 #endif
1482 
1484 
1485  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1486  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1487  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1488  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1489  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1490  AsmBinaryRor,
1491  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1492  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1493  IS_SERIALIZABLE(AsmBinaryExpression);
1494 
1495 #ifdef DOCUMENTATION
1496 
1498  public:
1499 #endif
1500 
1501 #ifdef DOCUMENTATION
1502 
1505  SgAsmExpression* get_lhs() const;
1506  void set_lhs(SgAsmExpression*);
1508 #else
1509  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1510  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1511 #endif
1512 
1513 #ifdef DOCUMENTATION
1514 
1517  SgAsmExpression* get_rhs() const;
1518  void set_rhs(SgAsmExpression*);
1520 #else
1521  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1522  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1523 #endif
1524 
1525  DECLARE_OTHERS(AsmBinaryExpression);
1526 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1527 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1528  private:
1529  friend class boost::serialization::access;
1530 
1531  template<class S>
1532  void serialize(S &s, const unsigned /*version*/) {
1533  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1534  s & BOOST_SERIALIZATION_NVP(p_lhs);
1535  s & BOOST_SERIALIZATION_NVP(p_rhs);
1536  }
1537 #endif
1538 #endif // SgAsmBinaryExpression_OTHERS
1539 
1540 #ifdef DOCUMENTATION
1541  };
1542 #endif
1543 
1545 
1546  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1547  IS_SERIALIZABLE(AsmUnaryPlus);
1548 
1549 #ifdef DOCUMENTATION
1550 
1552  public:
1553 #endif
1554 
1555  DECLARE_OTHERS(AsmUnaryPlus);
1556 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1557 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1558  private:
1559  friend class boost::serialization::access;
1560 
1561  template<class S>
1562  void serialize(S &s, const unsigned /*version*/) {
1563  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1564  }
1565 #endif
1566 #endif // SgAsmUnaryPlus_OTHERS
1567 
1568 #ifdef DOCUMENTATION
1569  };
1570 #endif
1571 
1573 
1574  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1575  IS_SERIALIZABLE(AsmUnaryMinus);
1576 
1577 #ifdef DOCUMENTATION
1578 
1580  public:
1581 #endif
1582 
1583  DECLARE_OTHERS(AsmUnaryMinus);
1584 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1585 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1586  private:
1587  friend class boost::serialization::access;
1588 
1589  template<class S>
1590  void serialize(S &s, const unsigned /*version*/) {
1591  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1592  }
1593 #endif
1594 #endif // SgAsmUnaryMinus_OTHERS
1595 
1596 #ifdef DOCUMENTATION
1597  };
1598 #endif
1599 
1601 
1602  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1603  IS_SERIALIZABLE(AsmUnaryRrx);
1604 
1605 #ifdef DOCUMENTATION
1606  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1608  public:
1609 #endif
1610 
1611  DECLARE_OTHERS(AsmUnaryRrx);
1612 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1613 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1614  private:
1615  friend class boost::serialization::access;
1616 
1617  template<class S>
1618  void serialize(S &s, const unsigned /*version*/) {
1619  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1620  }
1621 #endif
1622 #endif // SgAsmUnaryRrx_OTHERS
1623 
1624 #ifdef DOCUMENTATION
1625  };
1626 #endif
1627 
1629 
1630  DECLARE_LEAF_CLASS(AsmUnaryArmSpecialRegisterList);
1631  IS_SERIALIZABLE(AsmUnaryArmSpecialRegisterList);
1632 
1633 #ifdef DOCUMENTATION
1634  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1636  public:
1637 #endif
1638 
1639  DECLARE_OTHERS(AsmUnaryArmSpecialRegisterList);
1640 #if defined(SgAsmUnaryArmSpecialRegisterList_OTHERS) || defined(DOCUMENTATION)
1641 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1642  private:
1643  friend class boost::serialization::access;
1644 
1645  template<class S>
1646  void serialize(S &s, const unsigned /*version*/) {
1647  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1648  }
1649 #endif
1650 #endif // SgAsmUnaryArmSpecialRegisterList_OTHERS
1651 
1652 #ifdef DOCUMENTATION
1653  };
1654 #endif
1655 
1657 
1658  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
1659  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryArmSpecialRegisterList,
1660  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
1661  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1662  IS_SERIALIZABLE(AsmUnaryExpression);
1663 
1664 #ifdef DOCUMENTATION
1665 
1667  public:
1668 #endif
1669 
1670 #ifdef DOCUMENTATION
1671 
1674  SgAsmExpression* get_operand() const;
1677 #else
1678  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
1679  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1680 #endif
1681 
1682  DECLARE_OTHERS(AsmUnaryExpression);
1683 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
1684 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1685  private:
1686  friend class boost::serialization::access;
1687 
1688  template<class S>
1689  void serialize(S &s, const unsigned /*version*/) {
1690  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1691  s & BOOST_SERIALIZATION_NVP(p_operand);
1692  }
1693 #endif
1694 #endif // SgAsmUnaryExpression_OTHERS
1695 
1696 #ifdef DOCUMENTATION
1697  };
1698 #endif
1699 
1701 
1702  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
1703  IS_SERIALIZABLE(AsmDirectRegisterExpression);
1704 
1705 #ifdef DOCUMENTATION
1706 
1708  public:
1709 #endif
1710 
1711 #ifdef DOCUMENTATION
1712 
1715  unsigned get_psr_mask() const;
1716  void set_psr_mask(unsigned);
1718 #else
1719  AsmDirectRegisterExpression.setDataPrototype("unsigned", "psr_mask", "=0", // for ARM
1720  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1721  NO_DELETE);
1722 #endif
1723 
1724  DECLARE_OTHERS(AsmDirectRegisterExpression);
1725 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1726 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1727  private:
1728  friend class boost::serialization::access;
1729 
1730  template<class S>
1731  void serialize(S &s, const unsigned /*version*/) {
1732  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1733  s & BOOST_SERIALIZATION_NVP(p_psr_mask);
1734  }
1735 #endif
1736 
1737  private:
1738  // Default c'tor needed for serialization
1740  : p_psr_mask(0) {}
1741 #endif // SgAsmDirectRegisterExpression_OTHERS
1742 
1743 #ifdef DOCUMENTATION
1744  };
1745 #endif
1746 
1748 
1749  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
1750  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
1751 
1752 #ifdef DOCUMENTATION
1753 
1770  public:
1771 #endif
1772 
1773 #ifdef DOCUMENTATION
1774 
1782 #else
1783  AsmIndirectRegisterExpression.setDataPrototype("RegisterDescriptor", "stride", "",
1784  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1785 #endif
1786 
1787 #ifdef DOCUMENTATION
1788 
1796 #else
1797  AsmIndirectRegisterExpression.setDataPrototype("RegisterDescriptor", "offset", "",
1798  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1799 #endif
1800 
1801 #ifdef DOCUMENTATION
1802 
1807  size_t get_index() const;
1808  void set_index(size_t);
1810 #else
1811  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
1812  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1813 #endif
1814 
1815 #ifdef DOCUMENTATION
1816 
1821  size_t get_modulus() const;
1822  void set_modulus(size_t);
1824 #else
1825  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
1826  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1827 #endif
1828 
1829  DECLARE_OTHERS(AsmIndirectRegisterExpression);
1830 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1831 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1832  private:
1833  friend class boost::serialization::access;
1834 
1835  template<class S>
1836  void serialize(S &s, const unsigned /*version*/) {
1837  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1838  s & BOOST_SERIALIZATION_NVP(p_stride);
1839  s & BOOST_SERIALIZATION_NVP(p_offset);
1840  s & BOOST_SERIALIZATION_NVP(p_index);
1841  s & BOOST_SERIALIZATION_NVP(p_modulus);
1842  }
1843 #endif
1844 
1845  private:
1846  // Default c'tor needed for serialization
1848  : p_index(0), p_modulus(0) {}
1849 #endif // SgAsmIndirectRegisterExpression_OTHERS
1850 
1851 #ifdef DOCUMENTATION
1852  };
1853 #endif
1854 
1856 
1857  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
1858  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
1859  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
1860  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
1861 
1862 #ifdef DOCUMENTATION
1863 
1865  public:
1866 #endif
1867 
1868 #ifdef DOCUMENTATION
1869 
1875 #else
1876  AsmRegisterReferenceExpression.setDataPrototype("RegisterDescriptor", "descriptor", "",
1877  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1878 #endif
1879 
1880 #ifdef DOCUMENTATION
1881 
1886  int get_adjustment() const;
1887  void set_adjustment(int);
1889 #else
1890  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
1891  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1892  NO_DELETE);
1893 #endif
1894 
1895  DECLARE_OTHERS(AsmRegisterReferenceExpression);
1896 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
1897 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1898  private:
1899  friend class boost::serialization::access;
1900 
1901  template<class S>
1902  void serialize(S &s, const unsigned /*version*/) {
1903  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1904  s & BOOST_SERIALIZATION_NVP(p_descriptor);
1905  s & BOOST_SERIALIZATION_NVP(p_adjustment);
1906  }
1907 #endif
1908 
1909  protected:
1910  // Default c'tor needed for serialization
1912  : p_adjustment(0) {}
1913 #endif // SgAsmRegisterReferenceExpression_OTHERS
1914 
1915 #ifdef DOCUMENTATION
1916  };
1917 #endif
1918 
1920 
1921  DECLARE_LEAF_CLASS(AsmRegisterNames);
1922  IS_SERIALIZABLE(AsmRegisterNames);
1923 
1924 #ifdef DOCUMENTATION
1925 
1927  public:
1928 #endif
1929 
1930 #ifdef DOCUMENTATION
1931 
1937  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
1938  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
1940 #else
1941  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
1942  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1943 #endif
1944 
1945 #ifdef DOCUMENTATION
1946 
1952  unsigned get_mask() const;
1953  void set_mask(unsigned);
1955 #else
1956  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
1957  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1958 #endif
1959 
1960  DECLARE_OTHERS(AsmRegisterNames);
1961 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
1962 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1963  private:
1964  friend class boost::serialization::access;
1965 
1966  template<class S>
1967  void serialize(S &s, const unsigned /*version*/) {
1968  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1969  s & BOOST_SERIALIZATION_NVP(p_registers);
1970  s & BOOST_SERIALIZATION_NVP(p_mask);
1971  }
1972 #endif
1973 #endif // SgAsmRegisterNames_OTHERS
1974 
1975 #ifdef DOCUMENTATION
1976  };
1977 #endif
1978 
1980 
1981  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
1982  IS_SERIALIZABLE(AsmIntegerValueExpression);
1983 
1984 #ifdef DOCUMENTATION
1985 
2001  public:
2002 #endif
2003 
2004 #ifdef DOCUMENTATION
2005 
2015  SgNode* get_baseNode() const;
2016  void set_baseNode(SgNode*);
2018 #else
2019  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2020  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2021 #endif
2022 
2023  DECLARE_OTHERS(AsmIntegerValueExpression);
2024 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2025 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2026  private:
2027  friend class boost::serialization::access;
2028 
2029  template<class S>
2030  void serialize(S &s, const unsigned /*version*/) {
2031  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2032  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2033  }
2034 #endif
2035 
2036  public:
2041  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2042 
2049 
2051  static uint64_t virtualAddress(SgNode*);
2052 
2072  std::string get_label(bool quiet=false) const;
2073 
2075  size_t get_significantBits() const;
2076 
2082  void makeRelativeTo(SgNode *baseNode);
2083 
2088  uint64_t get_baseAddress() const;
2089 
2095  uint64_t get_absoluteValue(size_t nbits=0) const;
2096 
2100  void set_absoluteValue(uint64_t);
2101 
2103  int64_t get_signedValue() const;
2104 
2108  int64_t get_relativeValue() const;
2109 
2114  void set_relativeValue(int64_t v, size_t nbits=64);
2115 
2116  uint64_t get_value() const { return get_absoluteValue(); }
2117 
2118  // These are deprecated; use CamelCase versions instead [Robb P. Matzke 2014-07-21]
2119  size_t get_significant_bits() const ROSE_DEPRECATED("use get_significantBits");
2120  void make_relative_to(SgNode*) ROSE_DEPRECATED("use makeRelativeTo");
2121  uint64_t get_base_address() const ROSE_DEPRECATED("use get_baseAddress");
2122  uint64_t get_absolute_value(size_t nbits=0) const ROSE_DEPRECATED("use get_absoluteValue");
2123  void set_absolute_value(uint64_t) ROSE_DEPRECATED("use set_absoluteValue");
2124  int64_t get_signed_value() const ROSE_DEPRECATED("use set_signedValue");
2125  int64_t get_relative_value() const ROSE_DEPRECATED("use get_relativeValue");
2126  void set_relative_value(int64_t, size_t nbits=64) ROSE_DEPRECATED("use set_relativeValue");
2127 #endif // SgAsmIntegerValueExpression_OTHERS
2128 
2129 #ifdef DOCUMENTATION
2130  };
2131 #endif
2132 
2134 
2135  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2136  IS_SERIALIZABLE(AsmFloatValueExpression);
2137 
2138 #ifdef DOCUMENTATION
2139 
2144  public:
2145 #endif
2146 
2147  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2148 
2149  DECLARE_OTHERS(AsmFloatValueExpression);
2150 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2151  private:
2152  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2153  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2154  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2155  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2156  // understand "mutable".
2157  mutable double p_nativeValue;
2158  mutable bool p_nativeValueIsValid;
2159 
2160 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2161  private:
2162  friend class boost::serialization::access;
2163 
2164  template<class S>
2165  void serialize(S &s, const unsigned /*version*/) {
2166  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2167  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2168  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2169  }
2170 #endif
2171 
2172  public:
2177  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2178 
2184  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2185 
2192 
2194  void set_nativeValue(double);
2195 
2197  double get_nativeValue() const;
2198 
2203  void updateBitVector();
2204 
2209  void updateNativeValue() const;
2210 #endif // SgAsmFloatValueExpression_OTHERS
2211 
2212 #ifdef DOCUMENTATION
2213  };
2214 #endif
2215 
2217 
2218  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2219  AsmIntegerValueExpression | AsmFloatValueExpression,
2220  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2221  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2222  IS_SERIALIZABLE(AsmConstantExpression);
2223 
2224  DECLARE_HEADERS(AsmConstantExpression);
2225 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2226  #include <Sawyer/BitVector.h>
2227 #endif // SgAsmConstantExpression_HEADERS
2228 
2229 #ifdef DOCUMENTATION
2230 
2235  public:
2236 #endif
2237 
2238 #ifndef DOCUMENTATION
2239  // Documented below. Implemented below due to ROSETTA limitations.
2240  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2241  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2242 #endif
2243 
2244  DECLARE_OTHERS(AsmConstantExpression);
2245 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2246 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2247  private:
2248  friend class boost::serialization::access;
2249 
2250  template<class S>
2251  void serialize(S &s, const unsigned /*version*/) {
2252  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2253  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2254  }
2255 #endif
2256 
2257  public:
2263  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2264  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2265  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2267 #endif // SgAsmConstantExpression_OTHERS
2268 
2269 #ifdef DOCUMENTATION
2270  };
2271 #endif
2272 
2274 
2275  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2276  AsmConstantExpression,
2277  "AsmValueExpression", "AsmValueExpressionTag", false);
2278  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2279  IS_SERIALIZABLE(AsmValueExpression);
2280 
2281 #ifdef DOCUMENTATION
2282 
2290  public:
2291 #endif
2292 
2293 #ifdef DOCUMENTATION
2294 
2304 #else
2305  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
2306  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2307 #endif
2308 
2309 #ifdef DOCUMENTATION
2310 
2318  unsigned short get_bit_offset() const;
2319  void set_bit_offset(unsigned short);
2321 #else
2322  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
2323  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2324 #endif
2325 
2326 #ifdef DOCUMENTATION
2327 
2333  unsigned short get_bit_size() const;
2334  void set_bit_size(unsigned short);
2336 #else
2337  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
2338  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2339 #endif
2340 
2341 #ifdef DOCUMENTATION
2342 
2348  SgSymbol* get_symbol() const;
2349  void set_symbol(SgSymbol*);
2351 #else
2352  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
2353  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2354 #endif
2355 
2356  DECLARE_OTHERS(AsmValueExpression);
2357 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
2358 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2359  private:
2360  friend class boost::serialization::access;
2361 
2362  template<class S>
2363  void serialize(S &s, const unsigned /*version*/) {
2364  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2365  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
2366  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
2367  s & BOOST_SERIALIZATION_NVP(p_bit_size);
2368 #if 1
2369  ASSERT_require2(p_symbol == NULL, "not implemented yet");
2370 #else
2371  s & BOOST_SERIALIZATION_NVP(p_symbol);
2372 #endif
2373  }
2374 #endif
2375 #endif // SgAsmValueExpression_OTHERS
2376 
2377 #ifdef DOCUMENTATION
2378  };
2379 #endif
2380 
2382 
2383  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
2384  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
2385 
2386 #ifdef DOCUMENTATION
2387 
2389  public:
2390 #endif
2391 
2392 #ifdef DOCUMENTATION
2393 
2400  SgAsmExpression* get_address() const;
2403 #else
2404  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
2405  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2406 #endif
2407 
2408 #ifdef DOCUMENTATION
2409 
2416  SgAsmExpression* get_segment() const;
2419 #else
2420  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
2421  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2422 #endif
2423 
2424  DECLARE_OTHERS(AsmMemoryReferenceExpression);
2425 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2426 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2427  private:
2428  friend class boost::serialization::access;
2429 
2430  template<class S>
2431  void serialize(S &s, const unsigned /*version*/) {
2432  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2433  s & BOOST_SERIALIZATION_NVP(p_address);
2434  s & BOOST_SERIALIZATION_NVP(p_segment);
2435  }
2436 #endif
2437 #endif // SgAsmMemoryReferenceExpression_OTHERS
2438 
2439 #ifdef DOCUMENTATION
2440  };
2441 #endif
2442 
2444 
2445  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
2446  IS_SERIALIZABLE(AsmControlFlagsExpression);
2447 
2448 #ifdef DOCUMENTATION
2449  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2451  public:
2452 #endif
2453 
2454 #ifndef DOCUMENTATION
2455  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
2456  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2457 #endif
2458 
2459  DECLARE_OTHERS(AsmControlFlagsExpression);
2460 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
2461 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2462  private:
2463  friend class boost::serialization::access;
2464 
2465  template<class S>
2466  void serialize(S &s, const unsigned /*version*/) {
2467  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2468  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
2469  }
2470 #endif
2471 #endif // SgAsmControlFlagsExpression_OTHERS
2472 
2473 #ifdef DOCUMENTATION
2474  };
2475 #endif
2476 
2478 
2479  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
2480  IS_SERIALIZABLE(AsmCommonSubExpression);
2481 
2482 #ifdef DOCUMENTATION
2483  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2485  public:
2486 #endif
2487 
2488 #ifndef DOCUMENTATION
2489  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
2490  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2491 #endif
2492 
2493  DECLARE_OTHERS(AsmCommonSubExpression);
2494 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
2495 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2496  private:
2497  friend class boost::serialization::access;
2498 
2499  template<class S>
2500  void serialize(S &s, const unsigned /*version*/) {
2501  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2502  s & BOOST_SERIALIZATION_NVP(p_subexpression);
2503  }
2504 #endif
2505 #endif // SgAsmCommonSubExpression_OTHERS
2506 
2507 #ifdef DOCUMENTATION
2508  };
2509 #endif
2510 
2512 
2513  DECLARE_LEAF_CLASS(AsmRiscOperation);
2514  IS_SERIALIZABLE(AsmRiscOperation);
2515 
2516 #ifdef DOCUMENTATION
2517 
2526  public:
2527 #endif
2528 
2529 #ifdef DOCUMENTATION
2530 
2539 #else
2540  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
2541  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
2542 #endif
2543 
2544 #ifdef DOCUMENTATION
2545 
2551  SgAsmExprListExp* get_operands() const;
2554 #else
2555  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
2556  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2557 #endif
2558 
2559  DECLARE_OTHERS(AsmRiscOperation);
2560 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
2561  public:
2568  OP_NONE,
2569  OP_bottom,
2570  OP_undefined,
2571  OP_unspecified,
2572  OP_filterCallTarget,
2573  OP_filterReturnTarget,
2574  OP_filterIndirectJumpTarget,
2575  OP_hlt,
2576  OP_cpuid,
2577  OP_rdtsc,
2578  OP_and_,
2579  OP_or_,
2580  OP_xor_,
2581  OP_invert,
2582  OP_extract,
2583  OP_concat,
2584  OP_leastSignificantSetBit,
2585  OP_mostSignificantSetBit,
2586  OP_rotateLeft,
2587  OP_rotateRight,
2588  OP_shiftLeft,
2589  OP_shiftRight,
2590  OP_shiftRightArithmetic,
2591  OP_equalToZero,
2592  OP_ite,
2593  OP_isEqual,
2594  OP_isNotEqual,
2595  OP_isUnsignedLessThan,
2596  OP_isUnsignedLessThanOrEqual,
2597  OP_isUnsignedGreaterThan,
2598  OP_isUnsignedGreaterThanOrEqual,
2599  OP_isSignedLessThan,
2600  OP_isSignedLessThanOrEqual,
2601  OP_isSignedGreaterThan,
2602  OP_isSignedGreaterThanOrEqual,
2603  OP_unsignedExtend,
2604  OP_signExtend,
2607  OP_subtract,
2608  OP_negate,
2609  OP_signedDivide,
2610  OP_signedModulo,
2611  OP_signedMultiply,
2612  OP_unsignedDivide,
2613  OP_unsignedModulo,
2614  OP_unsignedMultiply,
2615  OP_interrupt,
2616  OP_readRegister,
2617  OP_peekRegister,
2618  OP_writeRegister,
2620  OP_peekMemory,
2622  OP_N_OPERATORS // MUST BE LAST!
2623  };
2624 
2625 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2626  private:
2627  friend class boost::serialization::access;
2628 
2629  template<class S>
2630  void serialize(S &s, const unsigned /*version*/) {
2631  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2632  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
2633  s & BOOST_SERIALIZATION_NVP(p_operands);
2634  }
2635 #endif
2636 #endif // SgAsmRiscOperation_OTHERS
2637 
2638 #ifdef DOCUMENTATION
2639  };
2640 #endif
2641 
2643 
2644  DECLARE_LEAF_CLASS(AsmExprListExp);
2645  IS_SERIALIZABLE(AsmExprListExp);
2646 
2647 #ifdef DOCUMENTATION
2648 
2650  public:
2651 #endif
2652 
2653 #ifdef DOCUMENTATION
2654 
2660  const SgAsmExpressionPtrList& get_expressions() const;
2661  void set_expressions(const SgAsmExpressionPtrList&);
2663 #else
2664  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
2665  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2666 #endif
2667 
2668  DECLARE_OTHERS(AsmExprListExp);
2669 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
2670 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2671  private:
2672  friend class boost::serialization::access;
2673 
2674  template<class S>
2675  void serialize(S &s, const unsigned /*version*/) {
2676  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2677  s & BOOST_SERIALIZATION_NVP(p_expressions);
2678  }
2679 #endif
2680 #endif // SgAsmExprListExp_OTHERS
2681 
2682 #ifdef DOCUMENTATION
2683  };
2684 #endif
2685 
2687 
2688  NEW_NONTERMINAL_MACRO(AsmExpression,
2689  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
2690  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
2691  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
2692  AsmRiscOperation,
2693  "AsmExpression", "AsmExpressionTag", false);
2694  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
2695  IS_SERIALIZABLE(AsmExpression);
2696 
2697 #ifdef DOCUMENTATION
2698 
2699  class SgAsmExpression: public SgAsmNode {
2700  public:
2701 #endif
2702 
2703 #ifdef DOCUMENTATION
2704 
2709  SgAsmType* get_type() const;
2710  void set_type(SgAsmType*);
2712 #else
2713  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
2714  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2715 #endif
2716 
2717 #ifdef DOCUMENTATION
2718 
2723  const std::string& get_comment() const;
2724  void set_comment(const std::string&);
2726 #else
2727  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
2728  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2729 #endif
2730 
2731  DECLARE_OTHERS(AsmExpression);
2732 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
2733 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2734  private:
2735  friend class boost::serialization::access;
2736 
2737  template<class S>
2738  void serialize(S &s, const unsigned /*version*/) {
2739  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
2740  s & BOOST_SERIALIZATION_NVP(p_type);
2741  s & BOOST_SERIALIZATION_NVP(p_comment);
2742  }
2743 #endif
2744 
2745  public:
2749  size_t get_nBits() const;
2750 #endif // SgAsmExpression_OTHERS
2751 
2752 #ifdef DOCUMENTATION
2753  };
2754 #endif
2755 
2756 
2757 
2758 
2760 
2761  /***************************************************************************************************************************
2762  * Data Types (new interface 2014-07)
2763  *
2764  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
2765  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
2766  * 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
2767  * don't allow types to be modified after they're created.
2768  ***************************************************************************************************************************/
2769 
2771 
2772  DECLARE_LEAF_CLASS(AsmIntegerType);
2773  IS_SERIALIZABLE(AsmIntegerType);
2774 
2775 #ifdef DOCUMENTATION
2776 
2778  public:
2779 #endif
2780 
2781 #ifndef DOCUMENTATION
2782  // Documented below due to ROSETTA limitations
2783  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
2784  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2785 #endif
2786 
2787  DECLARE_OTHERS(AsmIntegerType);
2788 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
2789 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2790  private:
2791  friend class boost::serialization::access;
2792 
2793  template<class S>
2794  void serialize(S &s, const unsigned /*version*/) {
2795  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2796  s & BOOST_SERIALIZATION_NVP(p_isSigned);
2797  }
2798 #endif
2799 
2800  public:
2804  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
2805 
2809  bool get_isSigned() const;
2810 
2811  // Overrides documented in base class
2812  virtual void check() const $ROSE_OVERRIDE;
2813  virtual std::string toString() const $ROSE_OVERRIDE;
2814 #endif // SgAsmIntegerType_OTHERS
2815 
2816 #ifdef DOCUMENTATION
2817  };
2818 #endif
2819 
2821 
2822  DECLARE_LEAF_CLASS(AsmFloatType);
2823  IS_SERIALIZABLE(AsmFloatType);
2824 
2825  DECLARE_HEADERS(AsmFloatType);
2826 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
2827  #include <Sawyer/BitVector.h>
2828 #endif // SgAsmFloatType_HEADERS
2829 
2830 #ifdef DOCUMENTATION
2831 
2833  public:
2834 #endif
2835 
2836 #ifndef DOCUMENTATION
2837  // Documented below because of ROSETTA limitations (they're read-only)
2838  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
2839  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2840  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
2841  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2842  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
2843  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2844  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
2845  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2846  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
2847  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2848  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
2849  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2850  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
2851  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2852 #endif
2853 
2854  DECLARE_OTHERS(AsmFloatType);
2855 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
2856 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2857  private:
2858  friend class boost::serialization::access;
2859 
2860  template<class S>
2861  void serialize(S &s, const unsigned /*version*/) {
2862  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2863  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
2864  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
2865  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
2866  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
2867  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
2868  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
2869  s & BOOST_SERIALIZATION_NVP(p_flags);
2870  }
2871 #endif
2872 
2873  public:
2874  enum {
2875  GRADUAL_UNDERFLOW = 0x00000001,
2876  NORMALIZED_SIGNIFICAND = 0x00000002
2877  };
2878 
2880 
2882  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
2883  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
2884  uint64_t exponentBias, unsigned flags);
2885 
2887  BitRange significandBits() const;
2888 
2890  BitRange exponentBits() const;
2891 
2893  size_t signBit() const;
2894 
2896  uint64_t exponentBias() const;
2897 
2899  unsigned flags() const;
2900 
2902  bool gradualUnderflow() const;
2903 
2905  bool normalizedSignificand() const;
2906 
2907  // Overrides documented in base class
2908  virtual void check() const $ROSE_OVERRIDE;
2909  virtual std::string toString() const $ROSE_OVERRIDE;
2910 #endif // SgAsmFloatType_OTHERS
2911 
2912 #ifdef DOCUMENTATION
2913  };
2914 #endif
2915 
2917 
2918  NEW_NONTERMINAL_MACRO(AsmScalarType,
2919  AsmIntegerType | AsmFloatType,
2920  "AsmScalarType", "AsmScalarTypeTag", false);
2921  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
2922  IS_SERIALIZABLE(AsmScalarType);
2923 
2924 #ifdef DOCUMENTATION
2925 
2926  class SgAsmScalarType: public SgAsmType {
2927  public:
2928 #endif
2929 
2930 #ifndef DOCUMENTATION
2931  // Documented below due to ROSETTA limitations (read-only)
2932  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2933  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2934  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2935  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2936  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
2937  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2938  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
2939  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2940 #endif
2941 
2942  DECLARE_OTHERS(AsmScalarType);
2943 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
2944 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2945  private:
2946  friend class boost::serialization::access;
2947 
2948  template<class S>
2949  void serialize(S &s, const unsigned /*version*/) {
2950  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
2951  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
2952  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
2953  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
2954  s & BOOST_SERIALIZATION_NVP(p_nBits);
2955  }
2956 #endif
2957 
2958  protected:
2963  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
2964 
2965  public:
2967  virtual size_t get_nBits() const $ROSE_OVERRIDE;
2968 
2970  ByteOrder::Endianness get_minorOrder() const;
2971 
2973  ByteOrder::Endianness get_majorOrder() const;
2974 
2976  size_t get_majorNBytes() const;
2977 
2978  // Overrides documented in base class
2979  virtual void check() const $ROSE_OVERRIDE;
2980  virtual std::string toString() const $ROSE_OVERRIDE;
2981 #endif // SgAsmScalarType_OTHERS
2982 
2983 #ifdef DOCUMENTATION
2984  };
2985 #endif
2986 
2988 
2989  DECLARE_LEAF_CLASS(AsmVectorType);
2990  IS_SERIALIZABLE(AsmVectorType);
2991 
2992 #ifdef DOCUMENTATION
2993 
2994  class SgAsmVectorType: public SgAsmType {
2995  public:
2996 #endif
2997 
2998 #ifndef DOCUMENTATION
2999  // Documented below due to ROSETTA limitations (read-only)
3000  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3001  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3002  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3003  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3004 #endif
3005 
3006  DECLARE_OTHERS(AsmVectorType);
3007 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3008 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3009  private:
3010  friend class boost::serialization::access;
3011 
3012  template<class S>
3013  void serialize(S &s, const unsigned /*version*/) {
3014  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3015  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3016  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3017  }
3018 #endif
3019 
3020  public:
3022  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3023 
3025  size_t get_nElmts() const;
3026 
3028  SgAsmType* get_elmtType() const;
3029 
3030  // Overrides documented in base class
3031  virtual void check() const $ROSE_OVERRIDE;
3032  virtual std::string toString() const $ROSE_OVERRIDE;
3033  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3034 #endif // SgAsmVectorType_OTHERS
3035 
3036 #ifdef DOCUMENTATION
3037  };
3038 #endif
3039 
3041 
3042  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3043  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3044  IS_SERIALIZABLE(AsmType);
3045 
3046 #ifdef DOCUMENTATION
3047 
3048  class SgAsmType: public SgAsmNode {
3049  public:
3050 #endif
3051 
3052  DECLARE_OTHERS(AsmType);
3053 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3054  private:
3056 
3057 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3058  private:
3059  friend class boost::serialization::access;
3060 
3061  template<class S>
3062  void serialize(S &s, const unsigned /*version*/) {
3063  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3064  }
3065 #endif
3066 
3067  public:
3075  virtual void check() const;
3076 
3082  virtual std::string toString() const {
3083  abort(); // ROSETTA limitation: intended pure virtual
3084  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3085  }
3086 
3088  virtual size_t get_nBits() const {
3089  abort(); // ROSETTA limitation: intended pure virtual
3090  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3091  }
3092 
3094  virtual size_t get_nBytes() const;
3095 
3101  template<class Type> // Type is a subclass of SgAsmType
3102  static Type* registerOrDelete(Type *toInsert) {
3103  ASSERT_not_null(toInsert);
3104  std::string key = toInsert->toString();
3105  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3106  ASSERT_not_null(retval);
3107  if (retval!=toInsert)
3108  delete toInsert;
3109  return retval;
3110  }
3111 #endif // SgAsmType_OTHERS
3112 
3113 #ifdef DOCUMENTATION
3114  };
3115 #endif
3116 
3117 
3118 
3120 
3121  /**************************************************************************************************************************
3122  * Collections of Instructions
3123  **************************************************************************************************************************/
3124 
3126 
3127  DECLARE_LEAF_CLASS(AsmFunction);
3128  IS_SERIALIZABLE(AsmFunction);
3129 
3130 #ifdef DOCUMENTATION
3131 
3147  public:
3148 #endif
3149 
3150 #ifdef DOCUMENTATION
3151 
3156  const std::string& get_name() const;
3157  void set_name(const std::string&);
3159 #else
3160  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3161  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3162 #endif
3163 
3164 #ifdef DOCUMENTATION
3165 
3171  unsigned get_reason() const;
3172  void set_reason(unsigned);
3174 #else
3175  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3176  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3177 #endif
3178 
3179 #ifdef DOCUMENTATION
3180 
3188 #else
3189  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3190  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3191 #endif
3192 
3193 #ifdef DOCUMENTATION
3194 
3197  MayReturn get_may_return() const;
3198  void set_may_return(MayReturn);
3200 #else
3201  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3202  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3203 #endif
3204 
3205 #ifdef DOCUMENTATION
3206 
3211  const std::string& get_name_md5() const;
3212  void set_name_md5(const std::string&);
3214 #else
3215  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3216  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3217 #endif
3218 
3219 #ifdef DOCUMENTATION
3220 
3225  const SgAsmStatementPtrList& get_statementList() const;
3226  void set_statementList(const SgAsmStatementPtrList&);
3228 #else
3229  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3230  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3231 #endif
3232 
3233 #ifdef DOCUMENTATION
3234  // FIXME[Robb P Matzke 2017-02-13]: unused?
3235 #else
3236  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3237  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3238 #endif
3239 
3240 #ifdef DOCUMENTATION
3241 
3247  rose_addr_t get_entry_va() const;
3248  void set_entry_va(rose_addr_t);
3250 #else
3251  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3252  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3253 #endif
3254 
3255 #ifdef DOCUMENTATION
3256 
3265 #else
3266  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3267  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3268 #endif
3269 
3270 #ifdef DOCUMENTATION
3271  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3272 #else
3273  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3274  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3275 #endif
3276 
3277 #ifdef DOCUMENTATION
3278 
3287  int64_t get_stackDelta() const;
3288  void set_stackDelta(int64_t);
3290 #else
3291  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3292  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3293 #endif
3294 
3295 #ifdef DOCUMENTATION
3296 
3304  const std::string& get_callingConvention() const;
3305  void set_callingConvention(const std::string&);
3307 #else
3308  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3309  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3310 #endif
3311 
3312  DECLARE_OTHERS(AsmFunction);
3313 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3314 
3315 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3316  private:
3317  friend class boost::serialization::access;
3318 
3319  template<class S>
3320  void serialize(S &s, const unsigned /*version*/) {
3321  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3322  s & BOOST_SERIALIZATION_NVP(p_name);
3323  s & BOOST_SERIALIZATION_NVP(p_reason);
3324  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3325  s & BOOST_SERIALIZATION_NVP(p_may_return);
3326  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3327  s & BOOST_SERIALIZATION_NVP(p_statementList);
3328  s & BOOST_SERIALIZATION_NVP(p_dest);
3329  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3330  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3331  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3332  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3333  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3334  }
3335 #endif
3336 
3337  public:
3338  // [Robb P Matzke 2017-02-13]: Deprecated because it uses a very old CFG implementation
3339  int nrOfValidInstructions(std::vector<SgNode*>& succs) ROSE_DEPRECATED("use modern CFG classes instead");
3340 
3343 
3347  void remove_statement(SgAsmStatement* statement);
3348 
3349  // [Robb P Matzke 2017-02-13]: I don't think this is used anywhere. It appends to the poorly named "dest" property.
3350  void append_dest(SgAsmStatement* instruction) ROSE_DEPRECATED("apparently not used anywhere");
3351 
3352  // FIXME[Robb P Matzke 2017-02-13]: This is a bad name--it removes only statements, not all AST children.
3356  void remove_children();
3357 
3362  SgAsmBlock* get_entry_block() const;
3363 
3365  enum MayReturn {
3370  };
3371 
3376  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3377  // Also fix SgAsmFunction::reason_key()
3378  FUNC_NONE = 0x00000000,
3380  = 0x00008000,
3381  FUNC_ENTRY_POINT = 0x00010000,
3382  FUNC_CALL_TARGET = 0x00020000,
3385  FUNC_CALL_INSN = 0x00040000,
3391  FUNC_EH_FRAME = 0x00080000,
3392  FUNC_SYMBOL = 0x00100000,
3393  FUNC_PATTERN = 0x00200000,
3398  FUNC_GRAPH = 0x00400000,
3402  FUNC_USERDEF = 0x00800000,
3403  FUNC_PADDING = 0x01000000,
3408  FUNC_DISCONT = 0x02000000,
3411  FUNC_INSNHEAD = 0x04000000,
3412  FUNC_IMPORT = 0x08000000,
3415  FUNC_LEFTOVERS = 0x10000000,
3419  FUNC_INTRABLOCK = 0x20000000,
3427  FUNC_THUNK = 0x40000000,
3436  FUNC_EXPORT = 0x80000000,
3438  FUNC_DEFAULT = 0xefff80ff,
3440  /*========= Miscellaneous Reasons ===========================================================================
3441  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3442  * availalble for users to use as they see fit. */
3443  FUNC_MISCMASK = 0x000000ff,
3449  FUNC_INTERPADFUNC = 0x00000001
3452  };
3453 
3457  static std::string reason_key(const std::string &prefix="");
3458 
3460  std::string reason_str(bool pad) const;
3461 
3465  static std::string reason_str(bool pad, unsigned reason);
3466 
3469  public:
3470  virtual ~NodeSelector() {}
3471  virtual bool operator()(SgNode*) = 0;
3472  };
3473 
3513  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
3514  NodeSelector *selector=NULL);
3515 
3521  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
3522 
3525  e_unknown = 0,
3526  e_standard = 1,
3527  e_library = 2,
3528  e_imported = 3,
3529  e_thunk = 4,
3530  e_last
3531  };
3532 
3533  // Computes the offset of the stack at the end of the call relative the the start of the call (in a perfect function
3534  // this would be zero, this is used to score properly formed functions).
3535  // [Robb P Matzke 2017-02-13]: deprecated
3536  int get_stackNutralityMetric() const ROSE_DEPRECATED("use get_stackDelta instead");
3537 #endif // SgAsmFunction_OTHERS
3538 
3539 
3540 #ifdef DOCUMENTATION
3541  };
3542 #endif
3543 
3544 
3546 
3547  DECLARE_LEAF_CLASS(AsmBlock);
3548  IS_SERIALIZABLE(AsmBlock);
3549 
3550 #ifdef DOCUMENTATION
3551 
3571  class SgAsmBlock: public SgAsmStatement {
3572  public:
3573 #endif
3574 
3575 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3576  // [tps 05Apr07] needed for the control_flow_graph
3577  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
3578  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3579 #endif
3580 
3581 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3582  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
3583  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3584 #endif
3585 
3586 #ifdef DOCUMENTATION
3587 
3592  rose_addr_t get_id() const;
3593  void set_id(rose_addr_t);
3595 #else
3596  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
3597  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3598 #endif
3599 
3600 #ifdef DOCUMENTATION
3601 
3606  unsigned get_reason() const;
3607  void set_reason(unsigned);
3609 #else
3610  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
3611  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3612 #endif
3613 
3614 #ifdef DOCUMENTATION
3615  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3616  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3617  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3618  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3625  const SgAsmStatementPtrList& get_statementList() const;
3626  void set_statementList(const SgAsmStatementPtrList&);
3628 #else
3629  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3630  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3631 #endif
3632 
3633 #ifdef DOCUMENTATION
3634  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3635  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3636  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3637  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3645  const SgAsmIntegerValuePtrList& get_successors() const;
3646  void set_successors(const SgAsmIntegerValuePtrList&);
3648 #else
3649  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
3650  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3651 #endif
3652 
3653 #ifdef DOCUMENTATION
3654 
3664  bool get_successors_complete() const;
3665  void set_successors_complete(bool);
3667 #else
3668  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
3669  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3670 #endif
3671 
3672 #ifdef DOCUMENTATION
3673 
3685 #else
3686  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
3687  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3688 #endif
3689 
3690 #ifdef DOCUMENTATION
3691 
3699  size_t get_cached_vertex() const;
3700  void set_cached_vertex(size_t);
3702 #else
3703  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
3704  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3705 #endif
3706 
3707 #ifdef DOCUMENTATION
3708 
3714  double get_code_likelihood() const;
3715  void set_code_likelihood(double);
3717 #else
3718  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
3719  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3720 #endif
3721 
3722 #ifdef DOCUMENTATION
3723 
3731  int64_t get_stackDeltaOut() const;
3732  void set_stackDeltaOut(int64_t);
3734 #else
3735  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
3736  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3737 #endif
3738 
3739  DECLARE_OTHERS(AsmBlock);
3740 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
3741 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3742  private:
3743  friend class boost::serialization::access;
3744 
3745  template<class S>
3746  void serialize(S &s, const unsigned /*version*/) {
3747  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3748  s & BOOST_SERIALIZATION_NVP(p_reason);
3749  s & BOOST_SERIALIZATION_NVP(p_statementList);
3750  s & BOOST_SERIALIZATION_NVP(p_successors);
3751  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
3752  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
3753  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3754  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
3755  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
3756  }
3757 #endif
3758 
3759  public:
3761  enum Reason {
3762  // Please update SgAsmBlock::reason_str() if you change this enum!
3763  BLK_NONE = 0x00000000,
3764  BLK_ENTRY_POINT = 0x00010000,
3765  BLK_PADDING = 0x00020000,
3766  BLK_FRAGMENT = 0x00080000,
3768  BLK_CFGHEAD = 0x00100000,
3769  BLK_USERDEF = 0x00200000,
3770  BLK_LEFTOVERS = 0x00400000,
3772  BLK_JUMPTABLE = 0x00800000,
3773  BLK_GRAPH1 = 0x01000000,
3774  BLK_GRAPH2 = 0x02000000,
3775  BLK_GRAPH3 = 0x04000000,
3777  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
3778 
3779  // ========= Miscellaneous Reasons ===========================================================================
3780  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3781  // availalble for users to use as they see fit.
3782  BLK_MISCMASK = 0x000000ff,
3784  BLK_FINDDATA = 0x00000001,
3786  BLK_POSTFUNC = 0x00000002
3788  };
3789 
3794 
3799 
3800  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
3805  void remove_children();
3806 
3811  rose_addr_t get_fallthrough_va();
3812 
3817 
3823  bool has_instructions() const;
3824 
3830  bool is_basic_block() const { return has_instructions(); }
3831 
3841  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
3842 
3846  static std::string reason_key(const std::string &prefix="");
3847 
3851  std::string reason_str(bool pad) const;
3852 
3858  static std::string reason_str(bool pad, unsigned reason);
3859 #endif // SgAsmBlock_OTHERS
3860 
3861 #ifdef DOCUMENTATION
3862  };
3863 #endif
3864 
3865 
3867 
3868  DECLARE_LEAF_CLASS(AsmStaticData);
3869  IS_SERIALIZABLE(AsmStaticData);
3870 
3871 #ifdef DOCUMENTATION
3872 
3880  public:
3881 #endif
3882 
3883 #ifdef DOCUMENTATION
3884 
3890  const SgUnsignedCharList& get_raw_bytes() const;
3891  void set_raw_bytes(const SgUnsignedCharList&);
3893 #else
3894  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
3895  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3896 #endif
3897 
3898  DECLARE_OTHERS(AsmStaticData);
3899 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
3900 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3901  private:
3902  friend class boost::serialization::access;
3903 
3904  template<class S>
3905  void serialize(S &s, const unsigned /*version*/) {
3906  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3907  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
3908  }
3909 #endif
3910 
3911  public:
3915  size_t get_size() const { return p_raw_bytes.size(); }
3916 #endif // SgAsmStaticData_OTHERS
3917 
3918 #ifdef DOCUMENTATION
3919  };
3920 #endif
3921 
3922 
3924 
3925  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
3926  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
3927 
3928 #ifdef DOCUMENTATION
3929 
3940  public:
3941 #endif
3942 
3943  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
3944 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
3945 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3946  private:
3947  friend class boost::serialization::access;
3948 
3949  template<class S>
3950  void serialize(S & s, const unsigned /*version*/) {
3951  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3952  }
3953 #endif
3954  protected:
3955  SgAsmSynthesizedDeclarationPtrList p_declarationList;
3956 
3957  public:
3960  p_declarationList.push_back(declaration);
3961  }
3962 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
3963 
3964 #ifdef DOCUMENTATION
3965  };
3966 #endif
3967 
3968 
3970 
3971  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
3972  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
3973 
3974 #ifdef DOCUMENTATION
3975  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3977  public:
3978 #endif
3979 
3980 #ifdef DOCUMENTATION
3981 
3984  const std::string& get_name() const;
3985  void set_name(const std::string&);
3987 #else
3988  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
3989  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
3990  NO_DELETE);
3991 #endif
3992 
3993 #ifdef DOCUMENTATION
3994  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
3998  uint64_t get_offset() const;
3999  void set_ofset(uint64_t);
4001 #else
4002  // Not clear if we want to store the offset explicitly
4003  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4004  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4005  NO_DELETE);
4006 #endif
4007 
4008  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4009 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4010 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4011  private:
4012  friend class boost::serialization::access;
4013 
4014  template<class S>
4015  void serialize(S &s, const unsigned /*version*/) {
4016  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4017  }
4018 #endif
4019 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4020 
4021 #ifdef DOCUMENTATION
4022  };
4023 #endif
4024 
4025 
4027 
4028  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4029  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4030  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4031  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4032  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4033 
4034 #ifdef DOCUMENTATION
4035 
4042  public:
4043 #endif
4044 
4045  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4046 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4047 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4048  private:
4049  friend class boost::serialization::access;
4050 
4051  template<class S>
4052  void serialize(S &s, const unsigned /*version*/) {
4053  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4054  };
4055 #endif
4056 #endif // SgAsmSynthesizedDeclaration_OTHERS
4057 
4058 #ifdef DOCUMENTATION
4059  };
4060 #endif
4061 
4062 
4064 
4065  NEW_NONTERMINAL_MACRO(AsmStatement,
4066  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4067  "AsmStatement", "AsmStatementTag", false);
4068  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4069  IS_SERIALIZABLE(AsmStatement);
4070 
4071 #ifdef DOCUMENTATION
4072 
4076  class SgAsmStatement: public SgAsmNode {
4077  public:
4078 #endif
4079 
4080 #ifdef DOCUMENTATION
4081 
4086  rose_addr_t get_address() const;
4087  void set_address(rose_addr_t);
4089 #else
4090  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4091  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4092 #endif
4093 
4094 
4095 #ifdef DOCUMENTATION
4096 
4099  const std::string& get_comment() const;
4100  void set_comment(const std::string&);
4102 #else
4103  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4104  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4105 #endif
4106 
4107  DECLARE_OTHERS(AsmStatement);
4108 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4109 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4110  private:
4111  friend class boost::serialization::access;
4112 
4113  template<class S>
4114  void serialize(S &s, const unsigned /*version*/) {
4115  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4116  s & BOOST_SERIALIZATION_NVP(p_address);
4117  s & BOOST_SERIALIZATION_NVP(p_comment);
4118  }
4119 #endif
4120 #endif // SgAsmStatement_OTHERS
4121 
4122 #ifdef DOCUMENTATION
4123  };
4124 #endif
4125 
4126 
4127 
4128 
4130 
4131  /*************************************************************************************************************************
4132  * Binary Interpretations
4133  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4134  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4135  * an AST that represents a single, coherent sub-part of the file.
4136  *************************************************************************************************************************/
4137 
4139 
4140  DECLARE_LEAF_CLASS(AsmInterpretationList);
4141  IS_SERIALIZABLE(AsmInterpretationList);
4142 
4143 #ifdef DOCUMENTATION
4144 
4146  public:
4147 #endif
4148 
4149 #ifdef DOCUMENTATION
4150 
4159 #else
4160  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4161  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4162  NO_DELETE);
4163 #endif
4164 
4165  DECLARE_OTHERS(AsmInterpretationList);
4166 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4167 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4168  private:
4169  friend class boost::serialization::access;
4170 
4171  template<class S>
4172  void serialize(S &s, const unsigned /*version*/) {
4173  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4174  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4175  }
4176 #endif
4177 #endif // SgAsmInterpretationList_OTHERS
4178 
4179 #ifdef DOCUMENTATION
4180  };
4181 #endif
4182 
4184 
4185  DECLARE_LEAF_CLASS(AsmInterpretation);
4186  IS_SERIALIZABLE(AsmInterpretation);
4187 
4188  DECLARE_HEADERS(AsmInterpretation);
4189 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4190  #include <MemoryMap.h>
4191  class RegisterDictionary;
4192 #endif // SgAsmInterpretation_HEADERS
4193 
4194 #ifdef DOCUMENTATION
4195 
4202  public:
4203 #endif
4204 
4205 #ifdef DOCUMENTATION
4206  // documentation and definition are below
4207 #else
4208  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4209 #endif
4210 
4211 #ifdef DOCUMENTATION
4212 
4223 #else
4224  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4225  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4226 #endif
4227 
4228 #ifdef DOCUMENTATION
4229 
4234  SgAsmBlock* get_global_block() const;
4237 #else
4238  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4239  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4240 #endif
4241 
4242  DECLARE_OTHERS(AsmInterpretation);
4243 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4244  private:
4246  const RegisterDictionary *p_registers;
4247  bool coverageComputed; // true iff percentageCoverage has been computed
4248  mutable InstructionMap instruction_map; // cached instruction map
4249 
4251  // disassembly into instructions.
4252  double percentageCoverage;
4253 
4254 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4255  private:
4256  friend class boost::serialization::access;
4257 
4258  template<class S>
4259  void serialize(S &s, const unsigned /*version*/) {
4260  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4261  s & BOOST_SERIALIZATION_NVP(p_headers);
4262  s & BOOST_SERIALIZATION_NVP(p_global_block);
4263  s & BOOST_SERIALIZATION_NVP(p_map);
4264  s & BOOST_SERIALIZATION_NVP(p_registers);
4265  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4266  s & BOOST_SERIALIZATION_NVP(instruction_map);
4267  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4268  }
4269 #endif
4270 
4271  public:
4274  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4275  ctor();
4276  }
4277 
4282  SgAsmGenericFilePtrList get_files() const;
4283 
4299  const RegisterDictionary *get_registers() const;
4300  void set_registers(const RegisterDictionary*);
4310  InstructionMap& get_instruction_map(bool recompute=false);
4311  void set_instruction_map(const InstructionMap&);
4318  void insert_instructions(InstructionMap&/*in,out*/);
4319 
4324  void erase_instructions(InstructionMap&/*in,out*/);
4325 
4331  void set_coverageComputed(bool x) { coverageComputed = x; }
4332  void set_percentageCoverage(double x) { percentageCoverage = x; }
4335  private:
4336  void ctor(); // finalize construction
4337 #endif // SgAsmInterpretation_OTHERS
4338 
4339 #ifdef DOCUMENTATION
4340  };
4341 #endif
4342 
4343 
4344 
4346 
4347  /*************************************************************************************************************************
4348  * ELF File Header
4349  *************************************************************************************************************************/
4350 
4352 
4353  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4354  IS_SERIALIZABLE(AsmElfFileHeader);
4355 
4356 #ifdef DOCUMENTATION
4357 
4366  public:
4367 #endif
4368 
4369 #ifdef DOCUMENTATION
4370 
4375  unsigned char get_e_ident_file_class() const;
4376  void set_e_ident_file_class(unsigned char);
4378 #else
4379  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4380  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4381 #endif
4382 
4383 #ifdef DOCUMENTATION
4384 
4389  unsigned char get_e_ident_data_encoding() const;
4390  void set_e_ident_data_encoding(unsigned char);
4392 #else
4393  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4394  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4395 #endif
4396 
4397 #ifdef DOCUMENTATION
4398 
4403  unsigned char get_e_ident_file_version() const;
4404  void set_e_ident_file_version(unsigned char*);
4406 #else
4407  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4408  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4409 #endif
4410 
4411 #ifdef DOCUMENTATION
4412 
4417  const SgUnsignedCharList& get_e_ident_padding() const;
4418  void set_e_ident_padding(const SgUnsignedCharList&);
4420 #else
4421  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4422  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4423 #endif
4424 
4425 #ifdef DOCUMENTATION
4426 
4431  unsigned long get_e_type() const;
4432  void set_e_type(unsigned long);
4434 #else
4435  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4436  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4437 #endif
4438 
4439 #ifdef DOCUMENTATION
4440 
4445  unsigned long get_e_machine() const;
4446  void set_e_machine(unsigned long);
4448 #else
4449  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4450  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4451 #endif
4452 
4453 #ifdef DOCUMENTATION
4454 
4459  unsigned long get_e_flags() const;
4460  void set_e_flags(unsigned long);
4462 #else
4463  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4464  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4465 #endif
4466 
4467 #ifdef DOCUMENTATION
4468 
4473  unsigned long get_e_ehsize() const;
4474  void set_e_ehsize(unsigned long);
4476 #else
4477  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4478  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4479 #endif
4480 
4481 #ifdef DOCUMENTATION
4482 
4487  unsigned long get_phextrasz() const;
4488  void set_phextrasz(unsigned long);
4490 #else
4491  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4492  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4493 #endif
4494 
4495 #ifdef DOCUMENTATION
4496 
4501  unsigned long get_e_phnum() const;
4502  void set_e_phnum(unsigned long);
4504 #else
4505  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
4506  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4507 #endif
4508 
4509 #ifdef DOCUMENTATION
4510 
4515  unsigned long get_shextrasz() const;
4516  void set_shextrasz(unsigned long);
4518 #else
4519  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
4520  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4521 #endif
4522 
4523 #ifdef DOCUMENTATION
4524 
4529  unsigned long get_e_shnum() const;
4530  void set_e_shnum(unsigned long);
4532 #else
4533  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
4534  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4535 #endif
4536 
4537 #ifdef DOCUMENTATION
4538 
4543  unsigned long get_e_shstrndx() const;
4544  void set_e_shstrndx(unsigned long);
4546 #else
4547  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
4548  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4549 #endif
4550 
4551 #ifdef DOCUMENTATION
4552 
4562 #else
4563  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
4564  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4565 #endif
4566 
4567 #ifdef DOCUMENTATION
4568 
4577 #else
4578  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
4579  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4580 #endif
4581 
4582  DECLARE_OTHERS(AsmElfFileHeader);
4583 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
4584 
4585 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4586  private:
4587  friend class boost::serialization::access;
4588 
4589  template<class S>
4590  void serialize(S &s, const unsigned /*version*/) {
4591  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
4592  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
4593  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
4594  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
4595  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
4596  s & BOOST_SERIALIZATION_NVP(p_e_type);
4597  s & BOOST_SERIALIZATION_NVP(p_e_machine);
4598  s & BOOST_SERIALIZATION_NVP(p_e_flags);
4599  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
4600  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
4601  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
4602  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
4603  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
4604  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
4605  s & BOOST_SERIALIZATION_NVP(p_section_table);
4606  s & BOOST_SERIALIZATION_NVP(p_segment_table);
4607  }
4608 #endif
4609 
4610  public:
4612  enum ObjectType {
4613  ET_NONE = 0
4614  ,ET_REL = 1
4615  ,ET_EXEC = 2
4616  ,ET_DYN = 3
4617  ,ET_CORE = 4
4619  ,ET_LOOS = 0xfe00
4620  ,ET_HIOS = 0xfeff
4621  ,ET_LOPROC = 0xff00
4622  ,ET_HIPROC = 0xffff
4623  };
4624 
4625  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
4626  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
4627  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
4628  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
4629  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
4630 #ifdef _MSC_VER
4631 # pragma pack (1)
4632 #endif
4633 
4640  unsigned char e_ident_magic[4];
4641  unsigned char e_ident_file_class;
4642  unsigned char e_ident_data_encoding;
4643  unsigned char e_ident_file_version;
4644  unsigned char e_ident_padding[9];
4645  uint16_t e_type;
4646  uint16_t e_machine;
4647  uint32_t e_version;
4648  uint32_t e_entry;
4649  uint32_t e_phoff;
4650  uint32_t e_shoff;
4651  uint32_t e_flags;
4652  uint16_t e_ehsize;
4653  uint16_t e_phentsize;
4654  uint16_t e_phnum;
4655  uint16_t e_shentsize;
4656  uint16_t e_shnum;
4657  uint16_t e_shstrndx;
4658  }
4659 #if !defined(SWIG) && !defined(_MSC_VER)
4660  __attribute__((packed))
4661 #endif
4662  ;
4663 
4665  unsigned char e_ident_magic[4];
4666  unsigned char e_ident_file_class;
4667  unsigned char e_ident_data_encoding;
4668  unsigned char e_ident_file_version;
4669  unsigned char e_ident_padding[9];
4670  uint16_t e_type;
4671  uint16_t e_machine;
4672  uint32_t e_version;
4673  uint64_t e_entry;
4674  uint64_t e_phoff;
4675  uint64_t e_shoff;
4676  uint32_t e_flags;
4677  uint16_t e_ehsize;
4678  uint16_t e_phentsize;
4679  uint16_t e_phnum;
4680  uint16_t e_shentsize;
4681  uint16_t e_shnum;
4682  uint16_t e_shstrndx;
4683  }
4684 #if !defined(SWIG) && !defined(_MSC_VER)
4685  __attribute__((packed))
4686 #endif
4687  ;
4688 
4689 #ifdef _MSC_VER
4690 # pragma pack ()
4691 #endif
4692 
4700  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
4701  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
4702  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
4703  ctor();
4704  }
4705 
4711  uint64_t max_page_size();
4712 
4715 
4718 
4724  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
4725 
4727  virtual bool reallocate() $ROSE_OVERRIDE;
4728 
4730  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4731 
4733  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4734 
4736  static bool is_ELF(SgAsmGenericFile*);
4737 
4739  SgAsmGenericSectionPtrList get_sectab_sections();
4740 
4742  SgAsmGenericSectionPtrList get_segtab_sections();
4743 
4744  // Overrides documented in base class
4745  virtual const char *format_name() const $ROSE_OVERRIDE;
4746 
4747  private:
4748  void ctor(); // called by constructors
4749  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
4750  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
4751 #endif // SgAsmElfFileHeader_OTHERS
4752 
4753 #ifdef DOCUMENTATION
4754  };
4755 #endif
4756 
4757 
4758 
4760 
4761  /*************************************************************************************************************************
4762  * ELF Section Tables
4763  *************************************************************************************************************************/
4764 
4766 
4767  DECLARE_LEAF_CLASS(AsmElfSectionTable);
4768  IS_SERIALIZABLE(AsmElfSectionTable);
4769 
4770 #ifdef DOCUMENTATION
4771 
4777  public:
4778 #endif
4779 
4780  DECLARE_OTHERS(AsmElfSectionTable);
4781 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
4782 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4783  private:
4784  friend class boost::serialization::access;
4785 
4786  template<class S>
4787  void serialize(S &s, const unsigned /*version*/) {
4788  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
4789  }
4790 #endif
4791 
4792  public:
4795  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
4796  ctor();
4797  }
4798 
4804  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
4805 
4817 
4821  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
4822 
4824  virtual bool reallocate() $ROSE_OVERRIDE;
4825 
4827  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4828 
4830  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4831 
4832  private:
4833  void ctor();
4834 #endif // SgAsmElfSectionTable_OTHERS
4835 
4836 #ifdef DOCUMENTATION
4837  };
4838 #endif
4839 
4840 
4842 
4843  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
4844  IS_SERIALIZABLE(AsmElfSectionTableEntry);
4845 
4846 #ifdef DOCUMENTATION
4847 
4849  public:
4850 #endif
4851 
4852 #ifdef DOCUMENTATION
4853 
4858  unsigned get_sh_name() const;
4859  void set_sh_name(unsigned);
4861 #else
4862  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
4863  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4864 #endif
4865 
4866 #ifdef DOCUMENTATION
4867 
4872  SectionType get_sh_type() const;
4873  void set_sh_type(SectionType);
4875 #else
4876  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
4877  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4878 #endif
4879 
4880 #ifdef DOCUMENTATION
4881 
4886  unsigned long get_sh_link() const;
4887  void set_sh_link(unsigned long);
4889 #else
4890  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
4891  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4892 #endif
4893 
4894 #ifdef DOCUMENTATION
4895 
4900  unsigned long get_sh_info() const;
4901  void set_sh_info(unsigned long);
4903 #else
4904  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
4905  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4906 #endif
4907 
4908 #ifdef DOCUMENTATION
4909 
4914  uint64_t get_sh_flags() const;
4915  void set_sh_flags(uint64_t);
4917 #else
4918  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
4919  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4920 #endif
4921 
4922 #ifdef DOCUMENTATION
4923 
4928  rose_addr_t get_sh_addr() const;
4929  void set_sh_addr(rose_addr_t);
4931 #else
4932  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
4933  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4934 #endif
4935 
4936 #ifdef DOCUMENTATION
4937 
4942  rose_addr_t get_sh_offset() const;
4943  void set_sh_offset(rose_addr_t);
4945 #else
4946  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
4947  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4948 #endif
4949 
4950 #ifdef DOCUMENTATION
4951 
4956  rose_addr_t get_sh_size() const;
4957  void set_sh_size(rose_addr_t);
4959 #else
4960  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
4961  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4962 #endif
4963 
4964 #ifdef DOCUMENTATION
4965 
4970  rose_addr_t get_sh_addralign() const;
4971  void set_sh_addralign(rose_addr_t);
4973 #else
4974  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
4975  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4976 #endif
4977 
4978 #ifdef DOCUMENTATION
4979 
4984  rose_addr_t get_sh_entsize() const;
4985  void set_sh_entsize(rose_addr_t);
4987 #else
4988  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
4989  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4990 #endif
4991 
4992 #ifdef DOCUMENTATION
4993 
4998  const SgUnsignedCharList& get_extra() const;
4999  void set_extra(const SgUnsignedCharLit&);
5001 #else
5002  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5003  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5004  NO_DELETE);
5005 #endif
5006 
5007  DECLARE_OTHERS(AsmElfSectionTableEntry);
5008 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5009 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5010  private:
5011  friend class boost::serialization::access;
5012 
5013  template<class S>
5014  void serialize(S &s, const unsigned /*version*/) {
5015  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5016  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5017  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5018  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5019  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5020  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5021  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5022  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5023  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5024  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5025  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5026  s & BOOST_SERIALIZATION_NVP(p_extra);
5027  }
5028 #endif
5029 
5030  public:
5033  SHT_NULL = 0,
5037  SHT_RELA = 4,
5038  SHT_HASH = 5,
5040  SHT_NOTE = 7,
5042  SHT_REL = 9,
5043  SHT_SHLIB = 10,
5044  SHT_DYNSYM = 11,
5046  SHT_LOOS = 0x60000000,
5047  SHT_GNU_verdef = 0x6ffffffd,
5048  SHT_GNU_verneed = 0x6ffffffe,
5049  SHT_GNU_versym = 0x6fffffff,
5050  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5051 
5052  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5053  SHT_HIPROC = 0x7fffffff,
5054  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5055  SHT_HIUSER = 0xffffffff
5056  };
5057 
5061  SHF_WRITE= (1 << 0),
5062  SHF_ALLOC= (1 << 1),
5063  SHF_EXECINSTR= (1 << 2),
5064  SHF_MERGE= (1 << 4),
5065  SHF_STRINGS= (1 << 5),
5066  SHF_INFO_LINK= (1 << 6),
5067  SHF_LINK_ORDER= (1 << 7),
5069  SHF_GROUP= (1 << 9),
5070  SHF_TLS= (1 << 10),
5071  SHF_MASKOS= 0x0ff00000,
5072  SHF_MASKPROC= 0xf0000000
5073  };
5074 
5081 #ifdef _MSC_VER
5082 # pragma pack (1)
5083 #endif
5085  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5086  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5087  uint32_t sh_flags; /* 0x08 Bit flags */
5088  uint32_t sh_addr; /* 0x0c Desired mapped address */
5089  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5090  uint32_t sh_size; /* 0x14 Section size in bytes */
5091  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5092  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5093  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5094  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5095  } /* 0x28 */
5096 #if !defined(SWIG) && !defined(_MSC_VER)
5097  __attribute__((packed))
5098 #endif
5099  ;
5100 
5102  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5103  uint32_t sh_type; /* 0x04 */
5104  uint64_t sh_flags; /* 0x08 */
5105  uint64_t sh_addr; /* 0x10 */
5106  uint64_t sh_offset; /* 0x18 */
5107  uint64_t sh_size; /* 0x20 */
5108  uint32_t sh_link; /* 0x28 */
5109  uint32_t sh_info; /* 0x2c */
5110  uint64_t sh_addralign; /* 0x30 */
5111  uint64_t sh_entsize; /* 0x38 */
5112  } /* 0x40 */
5113 #if !defined(SWIG) && !defined(_MSC_VER)
5114  __attribute__((packed))
5115 #endif
5116  ;
5117 #ifdef _MSC_VER
5118 # pragma pack ()
5119 #endif
5120 
5122  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5124 
5126  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5128 
5132  void *encode(ByteOrder::Endianness sex,
5134  void *encode(ByteOrder::Endianness sex,
5140 
5142  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5143 
5144  // Use Rose::stringify... function instead.
5145  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5146  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5147 
5148  private:
5149  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5150  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5151 #endif // SgAsmElfSectionTableEntry_OTHERS
5152 
5153 #ifdef DOCUMENTATION
5154  };
5155 #endif
5156 
5157 
5158 
5160 
5161  /*************************************************************************************************************************
5162  * ELF Segment Tables
5163  *************************************************************************************************************************/
5164 
5166 
5167  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5168  IS_SERIALIZABLE(AsmElfSegmentTable);
5169 
5170 #ifdef DOCUMENTATION
5171 
5178  public:
5179 #endif
5180 
5181  DECLARE_OTHERS(AsmElfSegmentTable);
5182 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5183 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5184  private:
5185  friend class boost::serialization::access;
5186 
5187  template<class S>
5188  void serialize(S &s, const unsigned /*version*/) {
5189  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5190  }
5191 #endif
5192 
5193  public:
5196  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5197  ctor();
5198  }
5199 
5204  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5205 
5220 
5224  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5225 
5227  virtual bool reallocate() $ROSE_OVERRIDE;
5228 
5230  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5231 
5233  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5234 
5235  private:
5236  void ctor();
5237 #endif // SgAsmElfSegmentTable_OTHERS
5238 
5239 #ifdef DOCUMENTATION
5240  };
5241 #endif
5242 
5244 
5245  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5246  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5247 
5248 #ifdef DOCUMENTATION
5250  public:
5251 #endif
5252 
5253 #ifdef DOCUMENTATION
5254 
5260  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5261  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5263 #else
5264  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5265  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5266  NO_DELETE);
5267 #endif
5268 
5269  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5270 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5271 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5272  private:
5273  friend class boost::serialization::access;
5274 
5275  template<class S>
5276  void serialize(S &s, const unsigned /*version*/) {
5277  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5278  }
5279 #endif
5280 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5281 
5282 #ifdef DOCUMENTATION
5283  };
5284 #endif
5285 
5286 
5288 
5289  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5290  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5291 
5292 #ifdef DOCUMENTATION
5293 
5295  public:
5296 #endif
5297 
5298 #ifdef DOCUMENTATION
5299 
5304  size_t get_index() const;
5305  void set_index(size_t);
5307 #else
5308  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5309  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5310 #endif
5311 
5312 #ifdef DOCUMENTATION
5313 
5316  SegmentType get_type() const;
5317  void set_type(SegmentType);
5319 #else
5320  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5321  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5322  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5323 #endif
5324 
5325 #ifdef DOCUMENTATION
5326 
5329  SegmentFlags get_flags() const;
5330  void set_flags(SegmentFlags);
5332 #else
5333  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5334  "= SgAsmElfSegmentTableEntry::PF_NONE",
5335  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5336 #endif
5337 
5338 #ifdef DOCUMENTATION
5339 
5344  rose_addr_t get_offset() const;
5345  void set_offset(rose_addr_t);
5347 #else
5348  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5349  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5350 #endif
5351 
5352 #ifdef DOCUMENTATION
5353 
5359  rose_addr_t get_vaddr() const;
5360  void set_vaddr(rose_addr_t);
5362 #else
5363  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5364  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5365 #endif
5366 
5367 #ifdef DOCUMENTATION
5368 
5373  rose_addr_t get_paddr() const;
5374  void set_paddr(rose_addr_t);
5376 #else
5377  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5378  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5379 #endif
5380 
5381 #ifdef DOCUMENTATION
5382 
5387  rose_addr_t get_filesz() const;
5388  void set_filesz(rose_addr_t);
5390 #else
5391  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5392  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5393 #endif
5394 
5395 #ifdef DOCUMENTATION
5396 
5401  rose_addr_t get_memsz() const;
5402  void set_memsz(rose_addr_t);
5404 #else
5405  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5406  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5407 #endif
5408 
5409 #ifdef DOCUMENTATION
5410 
5415  rose_addr_t get_align() const;
5416  void set_align(rose_addr_t);
5418 #else
5419  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5420  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5421 #endif
5422 
5423 #ifdef DOCUMENTATION
5424 
5429  const SgUnsignedCharList& get_extra() const;
5430  void set_extra(const SgUnsignedCharList&);
5432 #else
5433  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5434  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5435 #endif
5436 
5437  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5438 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
5439 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5440  private:
5441  friend class boost::serialization::access;
5442 
5443  template<class S>
5444  void serialize(S &s, const unsigned /*version*/) {
5445  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5446  s & BOOST_SERIALIZATION_NVP(p_index);
5447  s & BOOST_SERIALIZATION_NVP(p_type);
5448  s & BOOST_SERIALIZATION_NVP(p_flags);
5449  s & BOOST_SERIALIZATION_NVP(p_offset);
5450  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5451  s & BOOST_SERIALIZATION_NVP(p_paddr);
5452  s & BOOST_SERIALIZATION_NVP(p_filesz);
5453  s & BOOST_SERIALIZATION_NVP(p_memsz);
5454  s & BOOST_SERIALIZATION_NVP(p_align);
5455  s & BOOST_SERIALIZATION_NVP(p_extra);
5456  }
5457 #endif
5458 
5459  public:
5462  PT_NULL = 0,
5463  PT_LOAD = 1,
5466  PT_NOTE = 4,
5467  PT_SHLIB = 5,
5468  PT_PHDR = 6,
5469  PT_TLS = 7,
5471  // OS- and Processor-specific ranges
5472  PT_LOOS = 0x60000000,
5473  PT_HIOS = 0x6fffffff,
5474  PT_LOPROC = 0x70000000,
5475  PT_HIPROC = 0x7fffffff,
5476 
5477  // OS-specific values for GNU/Linux
5478  PT_GNU_EH_FRAME = 0x6474e550,
5479  PT_GNU_STACK = 0x6474e551,
5480  PT_GNU_RELRO = 0x6474e552,
5481  PT_PAX_FLAGS = 0x65041580,
5483  // OS-specific values for Sun
5484  PT_SUNWBSS = 0x6ffffffa,
5485  PT_SUNWSTACK = 0x6ffffffb
5486  };
5487 
5490  PF_NONE = 0,
5491  PF_RESERVED = 0x000ffff8,
5492  PF_XPERM = 0x00000001,
5493  PF_WPERM = 0x00000002,
5494  PF_RPERM = 0x00000004,
5495  PF_OS_MASK = 0x0ff00000,
5496  PF_PROC_MASK = 0xf0000000
5497  };
5498 
5499 #ifdef _MSC_VER
5500 # pragma pack (1)
5501 #endif
5502 
5510  uint32_t p_type;
5511  uint32_t p_offset;
5512  uint32_t p_vaddr;
5513  uint32_t p_paddr;
5514  uint32_t p_filesz;
5515  uint32_t p_memsz;
5516  uint32_t p_flags;
5517  uint32_t p_align;
5518  } /* 0x30 */
5519 #if !defined(SWIG) && !defined(_MSC_VER)
5520  __attribute__((packed))
5521 #endif
5522  ;
5523 
5525  uint32_t p_type; /* 0x00 */
5526  uint32_t p_flags; /* 0x04 */
5527  uint64_t p_offset; /* 0x08 */
5528  uint64_t p_vaddr; /* 0x10 */
5529  uint64_t p_paddr; /* 0x18 */
5530  uint64_t p_filesz; /* 0x20 */
5531  uint64_t p_memsz; /* 0x28 */
5532  uint64_t p_align; /* 0x30 */
5533  } /* 0x38 */
5534 #if !defined(SWIG) && !defined(_MSC_VER)
5535  __attribute__((packed))
5536 #endif
5537  ;
5538 #ifdef _MSC_VER
5539 # pragma pack ()
5540 #endif
5541 
5543  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5545 
5547  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5549 
5553  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
5554  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
5559 
5561  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5562 
5565 
5568 
5569  private:
5570  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
5571  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
5572 #endif // SgAsmElfSegmentTableEntry_OTHERS
5573 
5574 #ifdef DOCUMENTATION
5575  };
5576 #endif
5577 
5578 
5579 
5581 
5582  /*************************************************************************************************************************
5583  * ELF Symbol Tables
5584  *************************************************************************************************************************/
5585 
5587 
5588  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
5589  IS_SERIALIZABLE(AsmElfSymbolSection);
5590 
5591 #ifdef DOCUMENTATION
5592 
5594  public:
5595 #endif
5596 
5597 #ifdef DOCUMENTATION
5598 
5601  bool get_is_dynamic() const;
5602  void set_is_dynamic(bool);
5604 #else
5605  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
5606  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5607 #endif
5608 
5609 #ifdef DOCUMENTATION
5610 
5619 #else
5620  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
5621  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5622 #endif
5623 
5624  DECLARE_OTHERS(AsmElfSymbolSection);
5625 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
5626 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5627  private:
5628  friend class boost::serialization::access;
5629 
5630  template<class S>
5631  void serialize(S &s, const unsigned /*version*/) {
5632  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5633  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
5634  s & BOOST_SERIALIZATION_NVP(p_symbols);
5635  }
5636 #endif
5637 
5638  public:
5641  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
5642  ctor(strsec);
5643  }
5644 
5646  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
5647 
5660  virtual void finish_parsing() $ROSE_OVERRIDE;
5661 
5663  size_t index_of(SgAsmElfSymbol*);
5664 
5669  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5670 
5674  virtual bool reallocate() $ROSE_OVERRIDE;
5675 
5677  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5678 
5680  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5681 
5682  private:
5683  void ctor(SgAsmElfStringSection*);
5684 #endif // SgAsmElfSymbolSection_OTHERS
5685 
5686 #ifdef DOCUMENTATION
5687  };
5688 #endif
5689 
5691 
5692  DECLARE_LEAF_CLASS(AsmElfSymbolList);
5693  IS_SERIALIZABLE(AsmElfSymbolList);
5694 
5695 #ifdef DOCUMENTATION
5697  public:
5698 #endif
5699 
5700 #ifdef DOCUMENTATION
5701 
5707  const SgAsmElfSymbolPtrList& get_symbols() const;
5708  void set_symbols(const SgAsmElfSymbolPtrList&);
5710 #else
5711  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
5712  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5713 #endif
5714 
5715  DECLARE_OTHERS(AsmElfSymbolList);
5716 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
5717 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5718  private:
5719  friend class boost::serialization::access;
5720 
5721  template<class S>
5722  void serialize(S &s, const unsigned /*version*/) {
5723  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5724  s & BOOST_SERIALIZATION_NVP(p_symbols);
5725  }
5726 #endif
5727 #endif // SgAsmElfSymbolList_OTHERS
5728 
5729 #ifdef DOCUMENTATION
5730  };
5731 #endif
5732 
5734 
5735  DECLARE_LEAF_CLASS(AsmElfSymbol);
5736  IS_SERIALIZABLE(AsmElfSymbol);
5737 
5738 #ifdef DOCUMENTATION
5739 
5744  public:
5745 #endif
5746 
5747 #ifdef DOCUMENTATION
5748 
5753  unsigned char get_st_info() const;
5754  void set_st_info(unsigned char);
5756 #else
5757  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
5758  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5759 #endif
5760 
5761 #ifdef DOCUMENTATION
5762 
5767  unsigned char get_st_res1() const;
5768  void set_st_res1(unsigned char);
5770 #else
5771  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
5772  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5773 #endif
5774 
5775 #ifdef DOCUMENTATION
5776 
5781  unsigned get_st_shndx() const;
5782  void set_st_shndx(unsigned);
5784 #else
5785  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
5786  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5787 #endif
5788 
5789 #ifdef DOCUMENTATION
5790 
5795  rose_addr_t get_st_size() const;
5796  void set_st_size(rose_addr_t);
5798 #else
5799  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
5800  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5801 #endif
5802 
5803 #ifdef DOCUMENTATION
5804 
5809  const SgUnsignedCharList& get_extra() const;
5810  void set_extra(const SgUnsignedCharList&);
5812 #else
5813  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
5814  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5815 #endif
5816 
5817  DECLARE_OTHERS(AsmElfSymbol);
5818 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
5819 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5820  private:
5821  friend class boost::serialization::access;
5822 
5823  template<class S>
5824  void serialize(S &s, const unsigned /*version*/) {
5825  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
5826  s & BOOST_SERIALIZATION_NVP(p_st_info);
5827  s & BOOST_SERIALIZATION_NVP(p_st_res1);
5828  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
5829  s & BOOST_SERIALIZATION_NVP(p_st_size);
5830  s & BOOST_SERIALIZATION_NVP(p_extra);
5831  }
5832 #endif
5833 
5834  public:
5835  enum ElfSymBinding {
5836  STB_LOCAL=0,
5837  STB_GLOBAL=1,
5838  STB_WEAK=2
5839  };
5840 
5841  enum ElfSymType {
5844  STT_FUNC = 2,
5846  STT_FILE = 4,
5848  STT_TLS = 6,
5850  };
5851 
5852 #ifdef _MSC_VER
5853 # pragma pack (1)
5854 #endif
5855 
5858  uint32_t st_name;
5859  uint32_t st_value;
5860  uint32_t st_size;
5861  unsigned char st_info;
5862  unsigned char st_res1;
5863  uint16_t st_shndx;
5864  }
5865 #if !defined(SWIG) && !defined(_MSC_VER)
5866  __attribute__((packed))
5867 #endif
5868  ;
5869 
5871  uint32_t st_name;
5872  unsigned char st_info;
5873  unsigned char st_res1;
5874  uint16_t st_shndx;
5875  uint64_t st_value;
5876  uint64_t st_size;
5877  }
5878 #if !defined(SWIG) && !defined(_MSC_VER)
5879  __attribute__((packed))
5880 #endif
5881  ;
5882 
5883 #ifdef _MSC_VER
5884 # pragma pack ()
5885 #endif
5886 
5888  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
5889 
5893  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
5894 
5898  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
5899 
5903  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
5904  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
5912  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5913  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
5917  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
5918 
5921 
5923  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
5924 
5926  static std::string to_string(SgAsmElfSymbol::ElfSymType);
5927 
5928  private:
5929  void ctor(SgAsmElfSymbolSection*);
5930  void parse_common(); // initialization common to all parse() methods
5931 #endif // SgAsmElfSymbol_OTHERS
5932 
5933 #ifdef DOCUMENTATION
5934  };
5935 #endif
5936 
5937 
5938 
5940 
5941  /*************************************************************************************************************************
5942  * ELF Symbol Version Tables
5943  *************************************************************************************************************************/
5944 
5946 
5947  DECLARE_LEAF_CLASS(AsmElfSymverSection);
5948  IS_SERIALIZABLE(AsmElfSymverSection);
5949 
5950 #ifdef DOCUMENTATION
5951 
5956  public:
5957 #endif
5958 
5959 #ifdef DOCUMENTATION
5960 
5969 #else
5970  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
5971  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5972 #endif
5973 
5974  DECLARE_OTHERS(AsmElfSymverSection);
5975 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
5976 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5977  private:
5978  friend class boost::serialization::access;
5979 
5980  template<class S>
5981  void serialize(S &s, const unsigned /*version*/) {
5982  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5983  s & BOOST_SERIALIZATION_NVP(p_entries);
5984  }
5985 #endif
5986 
5987  public:
5990  : SgAsmElfSection(fhdr) {
5991  ctor();
5992  }
5993 
5995  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
5996 
6001  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6002 
6004  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6005 
6007  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6008  private:
6009  void ctor();
6010 #endif // SgAsmElfSymverSection_OTHERS
6011 
6012 #ifdef DOCUMENTATION
6013  };
6014 #endif
6015 
6017 
6018  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6019  IS_SERIALIZABLE(AsmElfSymverEntry);
6020 
6021 #ifdef DOCUMENTATION
6022 
6024  public:
6025 #endif
6026 
6027 #ifdef DOCUMENTATION
6028 
6033  size_t get_value() const;
6034  void set_value(size_t);
6036 #else
6037  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6038  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6039 #endif
6040 
6041  DECLARE_OTHERS(AsmElfSymverEntry);
6042 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6043 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6044  private:
6045  friend class boost::serialization::access;
6046 
6047  template<class S>
6048  void serialize(S &s, const unsigned /*version*/) {
6049  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6050  s & BOOST_SERIALIZATION_NVP(p_value);
6051  }
6052 #endif
6053 
6054  public:
6057  : p_value(0) {
6058  ctor(symver);
6059  }
6060 
6062  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6063 
6064  private:
6065  void ctor(SgAsmElfSymverSection*);
6066 #endif // SgAsmElfSymverEntry_OTHERS
6067 
6068 #ifdef DOCUMENTATION
6069  };
6070 #endif
6071 
6073 
6074 
6075  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6076  IS_SERIALIZABLE(AsmElfSymverEntryList);
6077 
6078 #ifdef DOCUMENTATION
6079 
6084  public:
6085 #endif
6086 
6087 #ifdef DOCUMENTATION
6088 
6091  const SgAsmElfSymverEntryPtrList& get_entries() const;
6092  void set_entries(const SgAsmElfSymverEntryPtrList&);
6094 #else
6095  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6096  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6097  NO_DELETE);
6098 #endif
6099 
6100  DECLARE_OTHERS(AsmElfSymverEntryList);
6101 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6102 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6103  private:
6104  friend class boost::serialization::access;
6105 
6106  template<class S>
6107  void serialize(S &s, const unsigned /*version*/) {
6108  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6109  s & BOOST_SERIALIZATION_NVP(p_entries);
6110  }
6111 #endif
6112 #endif // SgAsmElfSymverEntryList_OTHERS
6113 
6114 #ifdef DOCUMENTATION
6115  };
6116 #endif
6117 
6119 
6120  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6121  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6122 
6123 #ifdef DOCUMENTATION
6124 
6130  public:
6131 #endif
6132 
6133 #ifdef DOCUMENTATION
6134 
6143 #else
6144  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6145  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6146  NO_DELETE);
6147 #endif
6148 
6149  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6150 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6151 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6152  private:
6153  friend class boost::serialization::access;
6154 
6155  template<class S>
6156  void serialize(S &s, const unsigned /*version*/) {
6157  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6158  s & BOOST_SERIALIZATION_NVP(p_entries);
6159  }
6160 #endif
6161 
6162  public:
6165  : SgAsmElfSection(fhdr) {
6166  ctor(strsec);
6167  }
6168 
6237  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6238 
6241  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6242 
6246  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6247 
6249  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6250 
6251  private:
6252  void ctor(SgAsmElfStringSection*);
6253 #endif // SgAsmElfSymverDefinedSection_OTHERS
6254 
6255 #ifdef DOCUMENTATION
6256  };
6257 #endif
6258 
6260 
6261  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6262  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6263 
6264 #ifdef DOCUMENTATION
6265 
6270  public:
6271 #endif
6272 
6273 #ifdef DOCUMENTATION
6274 
6277  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6278  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6280 #else
6281  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6282  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6283  NO_DELETE);
6284 #endif
6285 
6286  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6287 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6288 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6289  private:
6290  friend class boost::serialization::access;
6291 
6292  template<class S>
6293  void serialize(S &s, const unsigned /*version*/) {
6294  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6295  s & BOOST_SERIALIZATION_NVP(p_entries);
6296  }
6297 #endif
6298 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6299 
6300 #ifdef DOCUMENTATION
6301  };
6302 #endif
6303 
6305 
6306  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6307  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6308 
6309 #ifdef DOCUMENTATION
6310 
6312  public:
6313 #endif
6314 
6315 #ifdef DOCUMENTATION
6316 
6321  size_t get_version() const;
6322  void set_version(size_t);
6324 #else
6325  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6326  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6327 #endif
6328 
6329 #ifdef DOCUMENTATION
6330 
6335  int get_flags() const;
6336  void set_flags(int);
6338 #else
6339  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6340  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6341 #endif
6342 
6343 #ifdef DOCUMENTATION
6344 
6349  size_t get_index() const;
6350  void set_index(size_t);
6352 #else
6353  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6354  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6355 #endif
6356 
6357 #ifdef DOCUMENTATION
6358 
6363  uint32_t get_hash() const;
6364  void set_hash(uint32_t);
6366 #else
6367  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6368  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6369 #endif
6370 
6371 #ifdef DOCUMENTATION
6372 
6381 #else
6382  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6383  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6384 #endif
6385 
6386  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6387 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6388 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6389  private:
6390  friend class boost::serialization::access;
6391 
6392  template<class S>
6393  void serialize(S &s, const unsigned /*version*/) {
6394  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6395  s & BOOST_SERIALIZATION_NVP(p_version);
6396  s & BOOST_SERIALIZATION_NVP(p_flags);
6397  s & BOOST_SERIALIZATION_NVP(p_index);
6398  s & BOOST_SERIALIZATION_NVP(p_hash);
6399  s & BOOST_SERIALIZATION_NVP(p_entries);
6400  }
6401 #endif
6402 
6403  public:
6404 #ifdef _MSC_VER
6405 # pragma pack (1)
6406 #endif
6407 
6409  uint16_t vd_version;
6410  uint16_t vd_flags;
6411  uint16_t vd_ndx;
6412  uint16_t vd_cnt;
6413  uint32_t vd_hash;
6414  uint32_t vd_aux;
6415  uint32_t vd_next;
6416  }
6417 #if !defined(SWIG) && !defined(_MSC_VER)
6418  __attribute__((packed))
6419 #endif
6420  ;
6421 
6422 #ifdef _MSC_VER
6423 # pragma pack ()
6424 #endif
6425 
6428  ctor(symver_defined);
6429  }
6430 
6432  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6433 
6435  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6436 
6438  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6439 
6440  private:
6441  void ctor(SgAsmElfSymverDefinedSection*);
6442 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6443 
6444 #ifdef DOCUMENTATION
6445  };
6446 #endif
6447 
6449 
6450  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6451  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6452 
6453 #ifdef DOCUMENTATION
6454 
6459  pbulic:
6460 #endif
6461 
6462 #ifdef DOCUMENTATION
6463 
6466  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6467  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6469 #else
6470  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6471  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6472  NO_DELETE);
6473 #endif
6474 
6475  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6476 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6477 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6478  private:
6479  friend class boost::serialization::access;
6480 
6481  template<class S>
6482  void serialize(S &s, const unsigned /*version*/) {
6483  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6484  s & BOOST_SERIALIZATION_NVP(p_entries);
6485  }
6486 #endif
6487 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6488 
6489 #ifdef DOCUMENTATION
6490  };
6491 #endif
6492 
6494 
6495  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
6496  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
6497 
6498 #ifdef DOCUMENTATION
6500  public:
6501 #endif
6502 
6503 #ifdef DOCUMENTATION
6504 
6507  SgAsmGenericString* get_name() const;
6510 #else
6511  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6512  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6513 #endif
6514 
6515  DECLARE_OTHERS(AsmElfSymverDefinedAux);
6516 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
6517 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6518  private:
6519  friend class boost::serialization::access;
6520 
6521  template<class S>
6522  void serialize(S &s, const unsigned /*version*/) {
6523  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6524  s & BOOST_SERIALIZATION_NVP(p_name);
6525  }
6526 #endif
6527 
6528  public:
6529 #ifdef _MSC_VER
6530 # pragma pack (1)
6531 #endif
6532 
6535  uint32_t vda_name;
6536  uint32_t vda_next;
6537  }
6538 #if !defined(SWIG) && !defined(_MSC_VER)
6539  __attribute__((packed))
6540 #endif
6541  ;
6542 
6543 #ifdef _MSC_VER
6544 # pragma pack ()
6545 #endif
6546 
6551  SgAsmElfSymverDefinedSection *symver_def_sec)
6552  : p_name(NULL) {
6553  ctor(symver_def_entry,symver_def_sec);
6554  }
6555 
6557  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
6558 
6560  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
6561 
6567  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6568 
6569  private:
6570  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
6571 #endif // SgAsmElfSymverDefinedAux_OTHERS
6572 
6573 #ifdef DOCUMENTATION
6574  };
6575 #endif
6576 
6578 
6579  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
6580  IS_SERIALIZABLE(AsmElfSymverNeededSection);
6581 
6582 #ifdef DOCUMENTATION
6583 
6589  public:
6590 #endif
6591 
6592 #ifdef DOCUMENTATION
6593 
6602 #else
6603  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
6604  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6605 #endif
6606 
6607  DECLARE_OTHERS(AsmElfSymverNeededSection);
6608 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
6609 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6610  private:
6611  friend class boost::serialization::access;
6612 
6613  template<class S>
6614  void serialize(S &s, const unsigned /*version*/) {
6615  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6616  s & BOOST_SERIALIZATION_NVP(p_entries);
6617  }
6618 #endif
6619 
6620  public:
6625  : SgAsmElfSection(fhdr) {
6626  ctor(strsec);
6627  }
6628 
6638  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
6639 
6644  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6645 
6649  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6650 
6652  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6653 
6654  private:
6655  void ctor(SgAsmElfStringSection*);
6656 #endif // SgAsmElfSymverNeededSection_OTHERS
6657 
6658 #ifdef DOCUMENTATION
6659  };
6660 #endif
6661 
6663 
6664  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
6665  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
6666 
6667 #ifdef DOCUMENTATION
6668 
6673  public:
6674 #endif
6675 
6676 #ifdef DOCUMENTATION
6677 
6680  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
6681  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
6683 #else
6684  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
6685  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6686  NO_DELETE);
6687 #endif
6688 
6689  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
6690 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
6691 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6692  private:
6693  friend class boost::serialization::access;
6694 
6695  template<class S>
6696  void serialize(S &s, const unsigned /*version*/) {
6697  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6698  s & BOOST_SERIALIZATION_NVP(p_entries);
6699  }
6700 #endif
6701 #endif // SgAsmElfSymverNeededEntryList_OTHERS
6702 
6703 #ifdef DOCUMENTATION
6704  };
6705 #endif
6706 
6708 
6709  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
6710  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
6711 
6712 #ifdef DOCUMENTATION
6713 
6715  public:
6716 #endif
6717 
6718 #ifdef DOCUMENTATION
6719 
6724  size_t get_version() const;
6725  void set_version(size_t);
6727 #else
6728  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
6729  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6730 #endif
6731 
6732 #ifdef DOCUMENTATION
6733 
6739 #else
6740  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
6741  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6742 #endif
6743 
6744 #ifdef DOCUMENTATION
6745 
6754 #else
6755  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
6756  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6757 #endif
6758 
6759  DECLARE_OTHERS(AsmElfSymverNeededEntry);
6760 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
6761 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6762  private:
6763  friend class boost::serialization::access;
6764 
6765  template<class S>
6766  void serialize(S &s, const unsigned /*version*/) {
6767  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6768  s & BOOST_SERIALIZATION_NVP(p_version);
6769  s & BOOST_SERIALIZATION_NVP(p_file_name);
6770  s & BOOST_SERIALIZATION_NVP(p_entries);
6771  }
6772 #endif
6773 
6774  public:
6775 #ifdef _MSC_VER
6776 # pragma pack (1)
6777 #endif
6778 
6781  uint16_t vn_version;
6782  uint16_t vn_cnt;
6783  uint32_t vn_file;
6784  uint32_t vn_aux;
6785  uint32_t vn_next;
6786  }
6787 #if !defined(SWIG) && !defined(_MSC_VER)
6788  __attribute__((packed))
6789 #endif
6790  ;
6791 
6792 #ifdef _MSC_VER
6793 # pragma pack ()
6794 #endif
6795 
6798  : p_file_name(NULL) {
6799  ctor(symver_needed);
6800  }
6801 
6803  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
6804 
6806  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
6807 
6809  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6810 
6811  private:
6812  void ctor(SgAsmElfSymverNeededSection*);
6813 #endif // SgAsmElfSymverNeededEntry_OTHERS
6814 
6815 #ifdef DOCUMENTATION
6816  };
6817 #endif
6818 
6820 
6821  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
6822  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
6823 
6824 #ifdef DOCUMENTATION
6825 
6830  public:
6831 #endif
6832 
6833 #ifdef DOCUMENTATION
6834 
6837  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
6838  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
6840 #else
6841  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
6842  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6843  NO_DELETE);
6844 #endif
6845 
6846  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
6847 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
6848 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6849  private:
6850  friend class boost::serialization::access;
6851 
6852  template<class S>
6853  void serialize(S &s, const unsigned /*version*/) {
6854  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6855  s & BOOST_SERIALIZATION_NVP(p_entries);
6856  }
6857 #endif
6858 #endif // SgAsmElfSymverNeededAuxList_OTHERS
6859 
6860 #ifdef DOCUMENTATION
6861  };
6862 #endif
6863 
6865 
6866  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
6867  IS_SERIALIZABLE(AsmElfSymverNeededAux);
6868 
6869 #ifdef DOCUMENTATION
6870 
6872  public:
6873 #endif
6874 
6875 #ifdef DOCUMENTATION
6876 
6881  uint32_t get_hash() const;
6882  void set_hash(uint32_t);
6884 #else
6885  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
6886  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6887 #endif
6888 
6889 #ifdef DOCUMENTATION
6890 
6895  int get_flags() const;
6896  void set_flags(int);
6898 #else
6899  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
6900  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6901 #endif
6902 
6903 #ifdef DOCUMENTATION
6904 
6909  size_t get_other() const;
6910  void set_other(size_t);
6912 #else
6913  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
6914  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6915 #endif
6916 
6917 #ifdef DOCUMENTATION
6918 
6921  SgAsmGenericString* get_name() const;
6924 #else
6925  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6926  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6927 #endif
6928 
6929  DECLARE_OTHERS(AsmElfSymverNeededAux);
6930 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
6931 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6932  private:
6933  friend class boost::serialization::access;
6934 
6935  template<class S>
6936  void serialize(S &s, const unsigned /*version*/) {
6937  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6938  s & BOOST_SERIALIZATION_NVP(p_hash);
6939  s & BOOST_SERIALIZATION_NVP(p_flags);
6940  s & BOOST_SERIALIZATION_NVP(p_other);
6941  s & BOOST_SERIALIZATION_NVP(p_name);
6942  }
6943 #endif
6944 
6945  public:
6946 #ifdef _MSC_VER
6947 # pragma pack (1)
6948 #endif
6949 
6952  uint32_t vna_hash;
6953  uint16_t vna_flags;
6954  uint16_t vna_other;
6955  uint32_t vna_name;
6956  uint32_t vna_next;
6957  }
6958 #if !defined(SWIG) && !defined(_MSC_VER)
6959  __attribute__((packed))
6960 #endif
6961  ;
6962 
6963 #ifdef _MSC_VER
6964 # pragma pack ()
6965 #endif
6966 
6972  : p_name(NULL) {
6973  ctor(symver_needed_entry,symver_needed_sec);
6974  }
6975 
6977  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
6978 
6980  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
6981 
6987  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6988 
6989  private:
6991 #endif // SgAsmElfSymverNeededAux_OTHERS
6992 
6993 #ifdef DOCUMENTATION
6994  };
6995 #endif
6996 
6997 
6998 
6999 
7001 
7002  /*************************************************************************************************************************
7003  * ELF Relocation Tables
7004  *************************************************************************************************************************/
7005 
7007 
7008  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7009  IS_SERIALIZABLE(AsmElfRelocSection);
7010 
7011 #ifdef DOCUMENTATION
7012 
7014  public:
7015 #endif
7016 
7017 #ifdef DOCUMENTATION
7018 
7021  bool get_uses_addend() const;
7022  void set_uses_addend(bool);
7024 #else
7025  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7026  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7027 #endif
7028 
7029 #ifdef DOCUMENTATION
7030 
7036 #else
7037  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7038  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7039 #endif
7040 
7041 #ifdef DOCUMENTATION
7042 
7050 #else
7051  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7052  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7053 #endif
7054 
7055  DECLARE_OTHERS(AsmElfRelocSection);
7056 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7057 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7058  private:
7059  friend class boost::serialization::access;
7060 
7061  template<class S>
7062  void serialize(S &s, const unsigned /*version*/) {
7063  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7064  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7065  s & BOOST_SERIALIZATION_NVP(p_target_section);
7066  s & BOOST_SERIALIZATION_NVP(p_entries);
7067  }
7068 #endif
7069 
7070  public:
7072  : SgAsmElfSection(fhdr) {
7073  ctor(symsec,targetsec);
7074  }
7075 
7078  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7079 
7081  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7082 
7084  virtual bool reallocate() $ROSE_OVERRIDE;
7085 
7087  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7088 
7090  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7091 
7092  private:
7094 #endif // SgAsmElfRelocSection_OTHERS
7095 
7096 #ifdef DOCUMENTATION
7097  };
7098 #endif
7099 
7101 
7102  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7103  IS_SERIALIZABLE(AsmElfRelocEntryList);
7104 
7105 #ifdef DOCUMENTATION
7106 
7111  public:
7112 #endif
7113 
7114 #ifdef DOCUMENTATION
7115 
7118  const SgAsmElfRelocEntryPtrList& get_entries() const;
7119  void set_entries(const SgAsmElfRelocEntryPtrList&);
7121 #else
7122  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7123  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7124  NO_DELETE);
7125 #endif
7126 
7127  DECLARE_OTHERS(AsmElfRelocEntryList);
7128 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7129 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7130  private:
7131  friend class boost::serialization::access;
7132 
7133  template<class S>
7134  void serialize(S &s, const unsigned /*version*/) {
7135  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7136  s & BOOST_SERIALIZATION_NVP(p_entries);
7137  }
7138 #endif
7139 #endif // SgAsmElfRelocEntryList_OTHERS
7140 
7141 #ifdef DOCUMENTATION
7142  };
7143 #endif
7144 
7146 
7147  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7148  IS_SERIALIZABLE(AsmElfRelocEntry);
7149 
7150 #ifdef DOCUMENTATION
7151 
7153  public:
7154 #endif
7155 
7156 #ifdef DOCUMENTATION
7157 
7162  rose_addr_t get_r_offset() const;
7163  void set_r_offset(rose_addr_t);
7165 #else
7166  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7167  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7168 #endif
7169 
7170 #ifdef DOCUMENTATION
7171 
7176  rose_addr_t get_r_addend() const;
7177  void set_r_addend(rose_addr_t);
7179 #else
7180  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7181  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7182 #endif
7183 
7184 #ifdef DOCUMENTATION
7185 
7190  unsigned long get_sym() const;
7191  void set_sym(unsigned long);
7193 #else
7194  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7195  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7196 #endif
7197 
7198 #ifdef DOCUMENTATION
7199 
7204  RelocType get_type() const;
7205  void set_type(RelocType);
7207 #else
7208  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7209  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7210 #endif
7211 
7212 #ifdef DOCUMENTATION
7213 
7216  const SgUnsignedCharList& get_extra() const;
7217  void set_extra(const SgUnsignedCharList&);
7219 #else
7220  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7221  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7222 #endif
7223 
7224  DECLARE_OTHERS(AsmElfRelocEntry);
7225 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7226 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7227  private:
7228  friend class boost::serialization::access;
7229 
7230  template<class S>
7231  void serialize(S &s, const unsigned /*version*/) {
7232  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7233  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7234  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7235  s & BOOST_SERIALIZATION_NVP(p_sym);
7236  s & BOOST_SERIALIZATION_NVP(p_type);
7237  s & BOOST_SERIALIZATION_NVP(p_extra);
7238  }
7239 #endif
7240 
7241  public:
7244  // Intel 80386 specific definitions.
7256  R_386_32PLT =11,
7263  R_386_16 =20,
7264  R_386_PC16 =21,
7265  R_386_8 =22,
7266  R_386_PC8 =23,
7282  // First Entry for X86-64
7297  R_X86_64_8 =114,
7307  };
7308 
7309 #ifdef _MSC_VER
7310 # pragma pack (1)
7311 #endif
7312 
7314  uint32_t r_offset;
7315  uint32_t r_info;
7316  uint32_t r_addend;
7317  }
7318 #if !defined(SWIG) && !defined(_MSC_VER)
7319  __attribute__((packed))
7320 #endif
7321  ;
7322 
7324  uint64_t r_offset;
7325  uint64_t r_info;
7326  uint64_t r_addend;
7327  }
7328 #if !defined(SWIG) && !defined(_MSC_VER)
7329  __attribute__((packed))
7330 #endif
7331  ;
7332 
7334  uint32_t r_offset;
7335  uint32_t r_info;
7336  }
7337 #if !defined(SWIG) && !defined(_MSC_VER)
7338  __attribute__((packed))
7339 #endif
7340  ;
7341 
7343  uint64_t r_offset;
7344  uint64_t r_info;
7345  }
7346 #if !defined(SWIG) && !defined(_MSC_VER)
7347  __attribute__((packed))
7348 #endif
7349  ;
7350 
7351 #ifdef _MSC_VER
7352 # pragma pack ()
7353 #endif
7354 
7357  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7358  ctor(section);
7359  }
7360 
7364  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7365  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7366  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7367  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7373  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7374  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7375  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7376  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7382  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7383  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7384  dump(f, prefix, idx, NULL);
7385  }
7389  std::string reloc_name() const;
7390 
7391  private:
7392  void ctor(SgAsmElfRelocSection*);
7393 #endif // SgAsmElfRelocEntry_OTHERS
7394 
7395 #ifdef DOCUMENTATION
7396  };
7397 #endif
7398 
7399 
7400 
7402 
7403  /*************************************************************************************************************************
7404  * ELF Dynamic Linking
7405  *************************************************************************************************************************/
7406 
7408 
7409  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7410  IS_SERIALIZABLE(AsmElfDynamicSection);
7411 
7412 #ifdef DOCUMENTATION
7413 
7415  public:
7416 #endif
7417 
7418 #ifdef DOCUMENTATION
7419 
7428 #else
7429  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7430  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7431 #endif
7432 
7433  DECLARE_OTHERS(AsmElfDynamicSection);
7434 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7435 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7436  private:
7437  friend class boost::serialization::access;
7438 
7439  template<class S>
7440  void serialize(S &s, const unsigned /*version*/) {
7441  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7442  s & BOOST_SERIALIZATION_NVP(p_entries);
7443  }
7444 #endif
7445 
7446  public:
7449  : SgAsmElfSection(fhdr) {
7450  ctor(strsec);
7451  }
7452 
7454  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7455 
7457  virtual void finish_parsing() $ROSE_OVERRIDE;
7458 
7461  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7462 
7464  virtual bool reallocate() $ROSE_OVERRIDE;
7465 
7467  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7468 
7470  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7471 
7472  private:
7473  void ctor(SgAsmElfStringSection*);
7474 #endif // SgAsmElfDynamicSection_OTHERS
7475 
7476 #ifdef DOCUMENTATION
7477  };
7478 #endif
7479 
7481 
7482  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7483  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7484 
7485 #ifdef DOCUMENTATION
7486 
7491  public:
7492 #endif
7493 
7494 #ifdef DOCUMENTATION
7495 
7498  const SgAsmElfDynamicEntryPtrList& get_entries() const;
7499  void set_entries(const SgAsmElfDynamicEntryPtrList&);
7501 #else
7502  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
7503  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
7504  NO_DELETE);
7505 #endif
7506 
7507  DECLARE_OTHERS(AsmElfDynamicEntryList);
7508 #if defined(SgAsmElfDynamicEntryList_OTHERS) || defined(DOCUMENTATION)
7509 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7510  private:
7511  friend class boost::serialization::access;
7512 
7513  template<class S>
7514  void serialize(S &s, const unsigned /*version*/) {
7515  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7516  s & BOOST_SERIALIZATION_NVP(p_entries);
7517  }
7518 #endif
7519 #endif // SgAsmElfDynamicEntryList_OTHERS
7520 
7521 #ifdef DOCUMENTATION
7522  };
7523 #endif
7524 
7526 
7527  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
7528  IS_SERIALIZABLE(AsmElfDynamicEntry);
7529 
7530 #ifdef DOCUMENTATION
7531 
7533  public:
7534 #endif
7535 
7536 #ifdef DOCUMENTATION
7537 
7542  EntryType get_d_tag() const;
7543  void set_d_tag(EntryType);
7545 #else
7546  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
7547  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7548 #endif
7549 
7550 #ifdef DOCUMENTATION
7551 
7556  rose_rva_t get_d_val() const;
7557  void set_d_val(rose_rva_t);
7559 #else
7560  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
7561  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7562 #endif
7563 
7564 #ifdef DOCUMENTATION
7565  // declared and documented below
7566 #else
7567  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
7568  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7569 #endif
7570 
7571 #ifdef DOCUMENTATION
7572 
7575  const SgUnsignedCharList& get_extra() const;
7576  void set_extra(const SgUnsignedCharList&);
7578 #else
7579  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7580  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7581 #endif
7582 
7583  DECLARE_OTHERS(AsmElfDynamicEntry);
7584 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
7585 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7586  private:
7587  friend class boost::serialization::access;
7588 
7589  template<class S>
7590  void serialize(S &s, const unsigned /*version*/) {
7591  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7592  s & BOOST_SERIALIZATION_NVP(p_d_tag);
7593  s & BOOST_SERIALIZATION_NVP(p_d_val);
7594  s & BOOST_SERIALIZATION_NVP(p_name);
7595  s & BOOST_SERIALIZATION_NVP(p_extra);
7596  }
7597 #endif
7598 
7599  public:
7600  enum EntryType { /* Type Executable SharedObj Purpose */
7601  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
7602  DT_NEEDED = 1, /* value optional optional Name of needed library */
7603  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
7604  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
7605  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
7606  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
7607  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
7608  DT_RELA = 7, /* pointer mandatory optional Relocation table */
7609  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
7610  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
7611  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
7612  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
7613  DT_INIT = 12, /* pointer optional optional Initialization function */
7614  DT_FINI = 13, /* pointer optional optional Termination function */
7615  DT_SONAME = 14, /* value ignored optional Name of shared object */
7616  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
7617  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
7618  DT_REL = 17, /* pointer mandatory optional Relocation table */
7619  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
7620  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
7621  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
7622  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
7623  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
7624  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
7625  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
7626  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
7627  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
7628  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
7629  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
7630  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
7631  DT_FLAGS = 30, /* value optional ? Bit flags */
7632  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
7633  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
7634  DT_NUM = 34, /* ? ? ? "number used"? */
7635 
7636  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
7637  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
7638  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
7639  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
7640  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
7641  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
7642  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
7643  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
7644  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
7645  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
7646  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
7647 
7648  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
7649  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
7650  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
7651  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
7652  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
7653  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
7654  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
7655  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
7656  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
7657  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
7658  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
7659 
7660  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
7661  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
7662  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
7663  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
7664  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
7665  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
7666  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
7667  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
7668 
7669  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
7670  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
7671  };
7672 
7673 #ifdef _MSC_VER
7674 # pragma pack (1)
7675 #endif
7676 
7679  uint32_t d_tag;
7680  uint32_t d_val;
7681  }
7682 #if !defined(SWIG) && !defined(_MSC_VER)
7683  __attribute__((packed))
7684 #endif
7685  ;
7686 
7688  uint64_t d_tag;
7689  uint64_t d_val;
7690  }
7691 #if !defined(SWIG) && !defined(_MSC_VER)
7692  __attribute__((packed))
7693 #endif
7694  ;
7695 
7696 #ifdef _MSC_VER
7697 # pragma pack ()
7698 #endif
7699 
7702  : p_d_tag(DT_NULL), p_name(NULL) {
7703  ctor(dynsec);
7704  }
7705 
7709  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);
7710  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*);
7716  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*) const;
7717  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*) const;
7721  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
7722 
7724  static std::string to_string(SgAsmElfDynamicEntry::EntryType);
7725 
7729  SgAsmGenericString* get_name() const { return p_name; }
7733  private:
7734  void ctor(SgAsmElfDynamicSection*);
7735 #endif // SgAsmElfDynamicEntry_OTHERS
7736 
7737 #ifdef DOCUMENTATION
7738  };
7739 #endif
7740 
7741 
7742 
7743 
7745 
7746  /*************************************************************************************************************************
7747  * ELF String Tables
7748  *************************************************************************************************************************/
7749 
7751 
7752  DECLARE_LEAF_CLASS(AsmElfStringSection);
7753  IS_SERIALIZABLE(AsmElfStringSection);
7754  AsmElfStringSection.setAutomaticGenerationOfDestructor(false);
7755 
7756 #ifdef DOCUMENTATION
7757 
7761  public:
7762 #endif
7763 
7764 #ifdef DOCUMENTATION
7765 
7770  SgAsmElfStrtab* get_strtab() const;
7771  void set_strtab(SgAsmElfStrtab*);
7773 #else
7774  AsmElfStringSection.setDataPrototype("SgAsmElfStrtab*", "strtab", "= NULL",
7775  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7776 #endif
7777 
7778  DECLARE_OTHERS(AsmElfStringSection);
7779 #if defined(SgAsmElfStringSection_OTHERS) || defined(DOCUMENTATION)
7780 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7781  private:
7782  friend class boost::serialization::access;
7783 
7784  template<class S>
7785  void serialize(S &s, const unsigned /*version*/) {
7786  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7787  s & BOOST_SERIALIZATION_NVP(p_strtab);
7788  }
7789 #endif
7790 
7791  public:
7794  : SgAsmElfSection(fhdr), p_strtab(NULL) {
7795  ctor();
7796  }
7797 
7799  virtual SgAsmElfStringSection *parse() $ROSE_OVERRIDE;
7800 
7802  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7803 
7808  virtual void set_size(rose_addr_t newsize) $ROSE_OVERRIDE;
7809 
7816  virtual bool reallocate() $ROSE_OVERRIDE;
7817 
7819  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7820 
7821  private:
7822  void ctor();
7823  void ctor(SgAsmElfSectionTable*);
7824 #endif // SgAsmElfStringSection_OTHERS
7825 
7826 #ifdef DOCUMENTATION
7827  };
7828 #endif
7829 
7831 
7832  DECLARE_LEAF_CLASS(AsmElfStrtab);
7833  IS_SERIALIZABLE(AsmElfStrtab);
7834  AsmElfStrtab.setAutomaticGenerationOfDestructor(false);
7835 
7836 #ifdef DOCUMENTATION
7837 
7838  class SgAsmElfStrtab: public SgAsmGenericStrtab {
7839  public:
7840 #endif
7841 
7842  DECLARE_OTHERS(AsmElfStrtab);
7843 #if defined(SgAsmElfStrtab_OTHERS) || defined(DOCUMENTATION)
7844 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7845  private:
7846  friend class boost::serialization::access;
7847 
7848  template<class S>
7849  void serialize(S &s, const unsigned /*version*/) {
7850  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericStrtab);
7851  }
7852 #endif
7853 
7854  public:
7858  explicit SgAsmElfStrtab(class SgAsmElfSection *containing_section)
7859  : SgAsmGenericStrtab(containing_section) {
7860  ctor();
7861  }
7862 
7869  virtual ~SgAsmElfStrtab();
7870 
7874  virtual SgAsmElfStrtab *parse() $ROSE_OVERRIDE;
7875 
7879  virtual void unparse(std::ostream&) const;
7880 
7886  virtual SgAsmStringStorage *create_storage(rose_addr_t offset, bool shared) $ROSE_OVERRIDE;
7887 
7891  virtual rose_addr_t get_storage_size(const SgAsmStringStorage*) $ROSE_OVERRIDE;
7892 
7902  virtual void allocate_overlap(SgAsmStringStorage*) $ROSE_OVERRIDE;
7903 
7905  virtual void rebind(SgAsmStringStorage*, rose_addr_t) $ROSE_OVERRIDE;
7906 
7907  private:
7908  void ctor();
7909 #endif // SgAsmElfStrtab_OTHERS
7910 
7911 #ifdef DOCUMENTATION
7912  };
7913 #endif
7914 
7915 
7916 
7917 
7919 
7920  /*************************************************************************************************************************
7921  * ELF Notes
7922  *************************************************************************************************************************/
7923 
7925 
7926  DECLARE_LEAF_CLASS(AsmElfNoteSection);
7927  IS_SERIALIZABLE(AsmElfNoteSection);
7928 
7929 #ifdef DOCUMENTATION
7931  public:
7932 #endif
7933 
7934 #ifdef DOCUMENTATION
7935 
7944 #else
7945  AsmElfNoteSection.setDataPrototype("SgAsmElfNoteEntryList*", "entries", "= NULL",
7946  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7947 #endif
7948 
7949  DECLARE_OTHERS(AsmElfNoteSection);
7950 #if defined(SgAsmElfNoteSection_OTHERS) || defined(DOCUMENTATION)
7951 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7952  private:
7953  friend class boost::serialization::access;
7954 
7955  template<class S>
7956  void serialize(S &s, const unsigned /*version*/) {
7957  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7958  s & BOOST_SERIALIZATION_NVP(p_entries);
7959  }
7960 #endif
7961 
7962  public:
7965  : SgAsmElfSection(fhdr) {
7966  ctor();
7967  }
7968  virtual SgAsmElfNoteSection *parse() $ROSE_OVERRIDE;
7969 
7971  virtual bool reallocate() $ROSE_OVERRIDE;
7972 
7974  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7975 
7977  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7978 
7979  private:
7980  void ctor();
7981 #endif // SgAsmElfNoteSection_OTHERS
7982 
7983 #ifdef DOCUMENTATION
7984  };
7985 #endif
7986 
7988 
7989  DECLARE_LEAF_CLASS(AsmElfNoteEntryList);
7990  IS_SERIALIZABLE(AsmElfNoteEntryList);
7991 
7992 #ifdef DOCUMENTATION
7993 
7998  public:
7999 #endif
8000 
8001 #ifdef DOCUMENTATION
8002 
8005  const SgAsmElfNoteEntryPtrList& get_entries() const;
8006  void set_entries(const SgAsmElfNoteEntryPtrList&);
8008 #else
8009  AsmElfNoteEntryList.setDataPrototype("SgAsmElfNoteEntryPtrList", "entries", "",
8010  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8011 #endif
8012 
8013  DECLARE_OTHERS(AsmElfNoteEntryList);
8014 #if defined(SgAsmElfNoteEntryList_OTHERS) || defined(DOCUMENTATION)
8015 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8016  private:
8017  friend class boost::serialization::access;
8018 
8019  template<class S>
8020  void serialize(S &s, const unsigned /*version*/) {
8021  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8022  s & BOOST_SERIALIZATION_NVP(p_entries);
8023  }
8024 #endif
8025 #endif // SgAsmElfNoteEntryList_OTHERS
8026 
8027 #ifdef DOCUMENTATION
8028  };
8029 #endif
8030 
8032 
8033  DECLARE_LEAF_CLASS(AsmElfNoteEntry);
8034  IS_SERIALIZABLE(AsmElfNoteEntry);
8035 
8036 #ifdef DOCUMENTATION
8037 
8039  public:
8040 #endif
8041 
8042 #ifdef DOCUMENTATION
8043 
8048  unsigned get_type() const;
8049  void set_type(unsigned);
8051 #else
8052  AsmElfNoteEntry.setDataPrototype("unsigned", "type", "= 0",
8053  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8054 #endif
8055 
8056 #ifdef DOCUMENTATION
8057  // documented below
8058 #else
8059  AsmElfNoteEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
8060  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8061 #endif
8062 
8063 #ifdef DOCUMENTATION
8064 
8069  const SgUnsignedCharList& get_payload() const;
8070  void set_payload(const SgUnsignedCharList&);
8072 #else
8073  AsmElfNoteEntry.setDataPrototype("SgUnsignedCharList", "payload", "",
8074  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8075 #endif
8076 
8077  DECLARE_OTHERS(AsmElfNoteEntry);
8078 #if defined(SgAsmElfNoteEntry_OTHERS) || defined(DOCUMENTATION)
8079 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8080  private:
8081  friend class boost::serialization::access;
8082 
8083  template<class S>
8084  void serialize(S &s, const unsigned /*version*/) {
8085  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8086  s & BOOST_SERIALIZATION_NVP(p_type);
8087  s & BOOST_SERIALIZATION_NVP(p_name);
8088  s & BOOST_SERIALIZATION_NVP(p_payload);
8089  }
8090 #endif
8091 
8092  public:
8095  : p_type(0), p_name(NULL) {
8096  ctor(section);
8097  }
8098 
8105  SgAsmGenericString *get_name() const;
8106  void set_name(SgAsmGenericString *name);
8112  rose_addr_t parse(rose_addr_t starting_offset);
8113 
8117  rose_addr_t unparse(std::ostream &f, rose_addr_t starting_offset);
8118 
8120  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
8121 
8125  void set_payload(const void*, size_t nbytes);
8126 
8128  rose_addr_t calculate_size() const;
8129 
8130  private:
8131  void ctor(SgAsmElfNoteSection *section);
8132 #endif // SgAsmElfNoteEntry_OTHERS
8133 
8134 #ifdef DOCUMENTATION
8135  };
8136 #endif
8137 
8138 
8139 
8141 
8142  /*************************************************************************************************************************
8143  * ELF Exception Handling
8144  *************************************************************************************************************************/
8145 
8147 
8148  DECLARE_LEAF_CLASS(AsmElfEHFrameSection);
8149  IS_SERIALIZABLE(AsmElfEHFrameSection);
8150 
8151 #ifdef DOCUMENTATION
8152 
8154  public:
8155 #endif
8156 
8157 #ifdef DOCUMENTATION
8158 
8167 #else
8168  AsmElfEHFrameSection.setDataPrototype("SgAsmElfEHFrameEntryCIList*", "ci_entries", "= NULL",
8169  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8170 #endif
8171 
8172  DECLARE_OTHERS(AsmElfEHFrameSection);
8173 #if defined(SgAsmElfEHFrameSection_OTHERS) || defined(DOCUMENTATION)
8174 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8175  private:
8176  friend class boost::serialization::access;
8177 
8178  template<class S>
8179  void serialize(S &s, const unsigned /*version*/) {
8180  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8181  s & BOOST_SERIALIZATION_NVP(p_ci_entries);
8182  }
8183 #endif
8184 
8185  public:
8188  : SgAsmElfSection(fhdr), p_ci_entries(NULL) {
8189  ctor();
8190  }
8191 
8193  virtual SgAsmElfEHFrameSection *parse() $ROSE_OVERRIDE;
8194 
8199  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
8200 
8202  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8203 
8208  rose_addr_t unparse(std::ostream*) const;
8209 
8211  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8212 
8213  private:
8214  void ctor();
8215 #endif // SgAsmElfEHFrameSection_OTHERS
8216 
8217 #ifdef DOCUMENTATION
8218  };
8219 #endif
8220 
8222 
8223  DECLARE_LEAF_CLASS(AsmElfEHFrameEntryCIList);
8224  IS_SERIALIZABLE(AsmElfEHFrameEntryCIList);
8225 
8226 #ifdef DOCUMENTATION
8227