ROSE  0.9.11.56
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 <InstructionEnumsArm.h>
175 #endif // SgAsmArmInstruction_HEADERS
176 
177 #ifdef DOCUMENTATION
178 
180  public:
181 #endif
182 
183 #ifdef DOCUMENTATION
184 
193 #else
194  AsmArmInstruction.setDataPrototype("Rose::BinaryAnalysis::ArmInstructionKind", "kind",
195  "= Rose::BinaryAnalysis::arm_unknown_instruction",
196  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
197 #endif
198 
199 #ifdef DOCUMENTATION
200 
206 #else
207  AsmArmInstruction.setDataPrototype("Rose::BinaryAnalysis::ArmInstructionCondition", "condition",
208  "= Rose::BinaryAnalysis::arm_cond_unknown",
209  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
210 #endif
211 
212 #ifdef DOCUMENTATION
213 
219 #else
220  AsmArmInstruction.setDataPrototype("int", "positionOfConditionInMnemonic", "= -1",
221  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
222 #endif
223 
224  DECLARE_OTHERS(AsmArmInstruction);
225 #if defined(SgAsmArmInstruction_OTHERS) || defined(DOCUMENTATION)
226 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
227  private:
228  friend class boost::serialization::access;
229 
230  template<class S>
231  void serialize(S &s, const unsigned /*version*/) {
232  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
233  s & BOOST_SERIALIZATION_NVP(p_kind);
234  s & BOOST_SERIALIZATION_NVP(p_condition);
235  s & BOOST_SERIALIZATION_NVP(p_positionOfConditionInMnemonic);
236  }
237 #endif
238 
239  public:
240  // Overrides are documented in the base class
241  virtual std::string description() const $ROSE_OVERRIDE;
242  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
243  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
244  virtual bool isUnknown() const $ROSE_OVERRIDE;
245  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
246 #endif // SgAsmArmInstruction_OTHERS
247 #ifdef DOCUMENTATION
248  };
249 #endif
250 
251 
253 
254  DECLARE_LEAF_CLASS(AsmX86Instruction);
255  IS_SERIALIZABLE(AsmX86Instruction);
256  DECLARE_HEADERS(AsmX86Instruction);
257 #if defined(SgAsmX86Instruction_HEADERS) || defined(DOCUMENTATION)
258  #include <InstructionEnumsX86.h>
259  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
260 #endif // SgAsmX86Instruction_HEADERS
261 
262 #ifdef DOCUMENTATION
263 
265  public:
266 #endif
267 
268 #ifdef DOCUMENTATION
269 
278 #else
279  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionKind", "kind",
280  "= Rose::BinaryAnalysis::x86_unknown_instruction",
281  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
282 #endif
283 
284 #ifdef DOCUMENTATION
285 
291 #else
292  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "baseSize",
293  "= Rose::BinaryAnalysis::x86_insnsize_none",
294  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
295 #endif
296 
297 #ifdef DOCUMENTATION
298 
304 #else
305  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "operandSize",
306  "= Rose::BinaryAnalysis::x86_insnsize_none",
307  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
308 #endif
309 
310 #ifdef DOCUMENTATION
311 
317 #else
318  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "addressSize",
319  "= Rose::BinaryAnalysis::x86_insnsize_none",
320  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
321 #endif
322 
323 #ifdef DOCUMENTATION
324 
329  bool get_lockPrefix() const;
330  void set_lockPrefix(bool);
332 #else
333  AsmX86Instruction.setDataPrototype("bool", "lockPrefix", "= false",
334  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
335 #endif
336 
337 #ifdef DOCUMENTATION
338 
344 #else
345  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86RepeatPrefix", "repeatPrefix",
346  "= Rose::BinaryAnalysis::x86_repeat_none",
347  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
348 #endif
349 
350 #ifdef DOCUMENTATION
351 
357 #else
358  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86BranchPrediction", "branchPrediction",
359  "= Rose::BinaryAnalysis::x86_branch_prediction_none",
360  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
361 #endif
362 
363 #ifdef DOCUMENTATION
364 
373 #else
374  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86SegmentRegister", "segmentOverride",
375  "= Rose::BinaryAnalysis::x86_segreg_none",
376  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
377 #endif
378 
379 
380  DECLARE_OTHERS(AsmX86Instruction);
381 #if defined(SgAsmX86Instruction_OTHERS) || defined(DOCUMENTATION)
382 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
383  private:
384  friend class boost::serialization::access;
385 
386  template<class S>
387  void serialize(S &s, const unsigned /*version*/) {
388  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
389  s & BOOST_SERIALIZATION_NVP(p_kind);
390  s & BOOST_SERIALIZATION_NVP(p_baseSize);
391  s & BOOST_SERIALIZATION_NVP(p_operandSize);
392  s & BOOST_SERIALIZATION_NVP(p_addressSize);
393  s & BOOST_SERIALIZATION_NVP(p_lockPrefix);
394  s & BOOST_SERIALIZATION_NVP(p_repeatPrefix);
395  s & BOOST_SERIALIZATION_NVP(p_branchPrediction);
396  s & BOOST_SERIALIZATION_NVP(p_segmentOverride);
397  }
398 #endif
399 
400  public:
405 
410 
416 
422 
423  // Overrides are documented in the base class
424  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
425  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
426  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
427  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
428  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
429  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
430  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
431  virtual bool getBranchTarget(rose_addr_t *target/*out*/) $ROSE_OVERRIDE;
432  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
433  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*>&,
434  bool* complete,
435  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
436  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
437  virtual bool isUnknown() const $ROSE_OVERRIDE;
438  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
439 #endif // SgAsmX86Instruction_OTHERS
440 #ifdef DOCUMENTATION
441  };
442 #endif
443 
445 
446  DECLARE_LEAF_CLASS(AsmPowerpcInstruction);
447  IS_SERIALIZABLE(AsmPowerpcInstruction);
448  DECLARE_HEADERS(AsmPowerpcInstruction);
449 #if defined(SgAsmPowerpcInstruction_HEADERS) || defined(DOCUMENTATION)
450  #include <InstructionEnumsPowerpc.h>
451 #endif // SgAsmPowerpcInstruction_HEADERS
452 
453 #ifdef DOCUMENTATION
454 
456  public:
457 #endif
458 
459 
460 #ifdef DOCUMENTATION
461 
470 #else
471  AsmPowerpcInstruction.setDataPrototype("Rose::BinaryAnalysis::PowerpcInstructionKind", "kind",
472  "= Rose::BinaryAnalysis::powerpc_unknown_instruction",
473  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
474  COPY_DATA);
475 #endif
476 
477  DECLARE_OTHERS(AsmPowerpcInstruction);
478 #if defined(SgAsmPowerpcInstruction_OTHERS) || defined(DOCUMENTATION)
479 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
480  private:
481  friend class boost::serialization::access;
482 
483  template<class S>
484  void serialize(S &s, const unsigned /*version*/) {
485  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
486  s & BOOST_SERIALIZATION_NVP(p_kind);
487  }
488 #endif
489 
490  public:
496  std::string conditionalBranchDescription() const;
497 
498  // Overrides are documented in the base class
499  virtual std::string description() const $ROSE_OVERRIDE;
500  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
501  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
502  virtual bool isUnknown() const $ROSE_OVERRIDE;
503  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
504  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
505  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
506  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
507  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
508  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
509  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
510 #endif // SgAsmPowerpcInstruction_OTHERS
511 #ifdef DOCUMENTATION
512  };
513 #endif
514 
515 
517 
518  DECLARE_LEAF_CLASS(AsmMipsInstruction);
519  IS_SERIALIZABLE(AsmMipsInstruction);
520  DECLARE_HEADERS(AsmMipsInstruction);
521 #if defined(SgAsmMipsInstruction_HEADERS) || defined(DOCUMENTATION)
522  #include <InstructionEnumsMips.h>
523 #endif // SgAsmMipsInstruction_HEADERS
524 
525 #ifdef DOCUMENTATION
526 
528  public:
529 #endif
530 
531 #ifdef DOCUMENTATION
532 
541 #else
542  AsmMipsInstruction.setDataPrototype("Rose::BinaryAnalysis::MipsInstructionKind", "kind",
543  "= Rose::BinaryAnalysis::mips_unknown_instruction",
544  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
545  COPY_DATA);
546 #endif
547 
548  DECLARE_OTHERS(AsmMipsInstruction);
549 #if defined(SgAsmMipsInstruction_OTHERS) || defined(DOCUMENTATION)
550 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
551  private:
552  friend class boost::serialization::access;
553 
554  template<class S>
555  void serialize(S &s, const unsigned /*version*/) {
556  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
557  s & BOOST_SERIALIZATION_NVP(p_kind);
558  }
559 #endif
560 
561  public:
562  // Overrides are documented in the base class
563  virtual std::string description() const $ROSE_OVERRIDE;
564  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
565  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
566  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
567  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
568  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
569  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
570  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
571  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
572  virtual bool isUnknown() const $ROSE_OVERRIDE;
573  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
574  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
575 #endif // SgAsmMipsInstruction_OTHERS
576 #ifdef DOCUMENTATION
577  };
578 #endif
579 
581 
582  DECLARE_LEAF_CLASS(AsmM68kInstruction);
583  IS_SERIALIZABLE(AsmM68kInstruction);
584  DECLARE_HEADERS(AsmM68kInstruction);
585 #if defined(SgAsmM68kInstruction_HEADERS) || defined(DOCUMENTATION)
586  #include "InstructionEnumsM68k.h"
587 #endif // SgAsmM68kInstruction_HEADERS
588 
589 #ifdef DOCUMENTATION
591  public:
592 #endif
593 
594 #ifdef DOCUMENTATION
595 
604 #else
605  AsmM68kInstruction.setDataPrototype("Rose::BinaryAnalysis::M68kInstructionKind", "kind",
606  " = Rose::BinaryAnalysis::m68k_unknown_instruction",
607  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
608  COPY_DATA);
609 #endif
610 
611  DECLARE_OTHERS(AsmM68kInstruction);
612 #if defined(SgAsmM68kInstruction_OTHERS) || defined(DOCUMENTATION)
613 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
614  private:
615  friend class boost::serialization::access;
616 
617  template<class S>
618  void serialize(S &s, const unsigned /*version*/) {
619  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
620  s & BOOST_SERIALIZATION_NVP(p_kind);
621  }
622 #endif
623 
624  public:
625  // Overrides are documented in the base class
626  virtual std::string description() const $ROSE_OVERRIDE;
627  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
628  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
629  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
630  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
631  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
632  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
633  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
634  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
635  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
636  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*>&,
637  bool* complete,
638  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
639  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
640  virtual bool isUnknown() const $ROSE_OVERRIDE;
641  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
642 #endif // SgAsmM68kInstruction_OTHERS
643 #ifdef DOCUMENTATION
644  };
645 #endif
646 
648 
649  NEW_NONTERMINAL_MACRO(AsmInstruction,
650  AsmX86Instruction | AsmArmInstruction | AsmPowerpcInstruction | AsmMipsInstruction |
651  AsmM68kInstruction,
652  "AsmInstruction", "AsmInstructionTag", true);
653  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
654  IS_SERIALIZABLE(AsmInstruction);
655 
656  DECLARE_HEADERS(AsmInstruction);
657 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
658  #include <MemoryMap.h>
659 #endif // SgAsmInstruction_HEADERS
660 
661 #ifdef DOCUMENTATION
662 
684  public:
685 #endif
686 
687 #ifdef DOCUMENTATION
688 
696  const std::string& get_mnemonic() const;
697  void set_mnemonic(const std::string&);
699 #else
700  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
701  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
702 #endif
703 
704 #ifdef DOCUMENTATION
705 
710  const SgUnsignedList& get_raw_bytes() const;
711  void set_raw_bytes(const SgUnsignedList&);
713 #else
714  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
715  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
716 #endif
717 
718 #ifdef DOCUMENTATION
719 
728 #else
729  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
730  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
731 #endif
732 
733 #ifdef DOCUMENTATION
734  // FIXME[Robb P Matzke 2017-02-13]: unused?
735 #else
736  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
737  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
738 #endif
739 
740 #ifdef DOCUMENTATION
741 
747  int64_t get_stackDeltaIn() const;
748  void set_stackDeltaIn(int64_t);
750 #else
751  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
752  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
753 #endif
754 
755 #ifdef DOCUMENTATION
756  // FIXME[Robb P Matzke 2017-02-13]: unused?
757 #else
758  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
759  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
760 #endif
761 
762  DECLARE_OTHERS(AsmInstruction);
763 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
764 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
765  private:
766  friend class boost::serialization::access;
767 
768  template<class S>
769  void serialize(S &s, const unsigned /*version*/) {
770  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
771  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
772  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
773  s & BOOST_SERIALIZATION_NVP(p_operandList);
774  s & BOOST_SERIALIZATION_NVP(p_sources);
775  }
776 #endif
777 
778  private:
779  struct SemanticFailure {
780  size_t n;
781  SemanticFailure(): n(0) {}
782  };
783  SemanticFailure semanticFailure_;
784 
785  public:
790  static const int64_t INVALID_STACK_DELTA;
791 
797  virtual std::string description() const { return ""; }
798 
799  // FIXME[Robb P Matzke 2017-02-13]: unused?
800  void appendSources( SgAsmInstruction* instruction );
801 
803  size_t nOperands() const;
804 
808  SgAsmExpression* operand(size_t) const;
809 
816  virtual bool terminatesBasicBlock();
817 
831  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
832  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
844  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
845  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
851  bool isFirstInBlock();
852 
856  bool isLastInBlock();
857 
862  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
863 
998  virtual bool hasEffect();
999 
1008  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
1009  bool relax_stack_semantics=false);
1010 
1020  virtual std::vector<std::pair<size_t,size_t> >
1021  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
1022  bool relax_stack_semantics=false);
1023 
1030  virtual std::set<rose_addr_t> getSuccessors(bool* complete); /*subclasses must redefine*/
1031 
1040  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1041  bool *complete,
1042  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1044 
1050  virtual size_t get_size() const;
1051 
1057  virtual bool isUnknown() const;
1058 
1092  virtual unsigned get_anyKind() const;
1093 
1097  virtual std::string toString() const;
1098 
1103  virtual std::set<rose_addr_t> explicitConstants() const;
1104 
1114  size_t semanticFailure() const;
1115  void semanticFailure(size_t);
1116  void incrementSemanticFailure();
1119 #endif // SgAsmInstruction_OTHERS
1120 
1121 #ifdef DOCUMENTATION
1122  };
1123 #endif
1124 
1125 
1126 
1128 
1129  /**************************************************************************************************************************
1130  * Instruction Expressions
1131  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1132  **************************************************************************************************************************/
1133 
1135 
1136  DECLARE_LEAF_CLASS(AsmOperandList);
1137  IS_SERIALIZABLE(AsmOperandList);
1138 
1139 #ifdef DOCUMENTATION
1140 
1141  class SgAsmOperandList: public SgAsmNode {
1142  public:
1143 #endif
1144 
1145 #ifdef DOCUMENTATION
1146 
1152  const SgAsmExpressionPtrList& get_operands() const;
1153  void set_oerands(const SgAsmExpressionPtrList&);
1155 #else
1156  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1157  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1158 #endif
1159 
1160  DECLARE_OTHERS(AsmOperandList);
1161 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1162 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1163  private:
1164  friend class boost::serialization::access;
1165 
1166  template<class S>
1167  void serialize(S &s, const unsigned /*version*/) {
1168  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1169  s & BOOST_SERIALIZATION_NVP(p_operands);
1170  }
1171 #endif
1172 
1173  public:
1175  void append_operand(SgAsmExpression* operand);
1176 #endif // SgAsmOperandList_OTHERS
1177 
1178 #ifdef DOCUMENTATION
1179  };
1180 #endif
1181 
1182  // FIXME[Robb P Matzke 2016-10-31]
1183  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1184 
1186 
1187  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1188  IS_SERIALIZABLE(AsmBinaryAdd);
1189 
1190 #ifdef DOCUMENTATION
1191 
1193  public:
1194 #endif
1195 
1196  DECLARE_OTHERS(AsmBinaryAdd);
1197 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1198 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1199  private:
1200  friend class boost::serialization::access;
1201 
1202  template<class S>
1203  void serialize(S &s, const unsigned /*version*/) {
1204  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1205  }
1206 #endif
1207 #endif // SgAsmBinaryAdd_OTHERS
1208 
1209 #ifdef DOCUMENTATION
1210  };
1211 #endif
1212 
1214 
1215  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1216  IS_SERIALIZABLE(AsmBinarySubtract);
1217 
1218 #ifdef DOCUMENTATION
1219 
1221  public:
1222 #endif
1223 
1224  DECLARE_OTHERS(AsmBinarySubtract);
1225 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1226 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1227  private:
1228  friend class boost::serialization::access;
1229 
1230  template<class S>
1231  void serialize(S &s, const unsigned /*version*/) {
1232  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1233  }
1234 #endif
1235 #endif // SgAsmBinarySubtract_OTHERS
1236 
1237 #ifdef DOCUMENTATION
1238  };
1239 #endif
1240 
1242 
1243  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1244  IS_SERIALIZABLE(AsmBinaryMultiply);
1245 
1246 #ifdef DOCUMENTATION
1247 
1249  public:
1250 #endif
1251 
1252  DECLARE_OTHERS(AsmBinaryMultiply);
1253 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1254 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1255  private:
1256  friend class boost::serialization::access;
1257 
1258  template<class S>
1259  void serialize(S &s, const unsigned /*version*/) {
1260  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1261  }
1262 #endif
1263 #endif // SgAsmBinaryMultiply_OTHERS
1264 
1265 #ifdef DOCUMENTATION
1266  };
1267 #endif
1268 
1270 
1271  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1272  IS_SERIALIZABLE(AsmBinaryDivide);
1273 
1274 #ifdef DOCUMENTATION
1275 
1277  public:
1278 #endif
1279 
1280  DECLARE_OTHERS(AsmBinaryDivide);
1281 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1282 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1283  private:
1284  friend class boost::serialization::access;
1285 
1286  template<class S>
1287  void serialize(S &s, const unsigned /*version*/) {
1288  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1289  }
1290 #endif
1291 #endif // SgAsmBinaryDivide_OTHERS
1292 
1293 #ifdef DOCUMENTATION
1294  };
1295 #endif
1296 
1298 
1299  DECLARE_LEAF_CLASS(AsmBinaryMod);
1300  IS_SERIALIZABLE(AsmBinaryMod);
1301 
1302 #ifdef DOCUMENTATION
1303 
1305  public:
1306 #endif
1307 
1308  DECLARE_OTHERS(AsmBinaryMod);
1309 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1310 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1311  private:
1312  friend class boost::serialization::access;
1313 
1314  template<class S>
1315  void serialize(S &s, const unsigned /*version*/) {
1316  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1317  }
1318 #endif
1319 #endif // SgAsmBinaryMod_OTHERS
1320 
1321 #ifdef DOCUMENTATION
1322  };
1323 #endif
1324 
1326 
1327  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1328  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1329 
1330 #ifdef DOCUMENTATION
1331 
1333  public:
1334 #endif
1335 
1336  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1337 #if defined(SgAsmBinaryAddPreupdate_OTHERS) || defined(DOCUMENTATION)
1338 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1339  private:
1340  friend class boost::serialization::access;
1341 
1342  template<class S>
1343  void serialize(S &s, const unsigned /*version*/) {
1344  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1345  }
1346 #endif
1347 #endif // SgAsmBinaryAddPreupdate_OTHERS
1348 
1349 #ifdef DOCUMENTATION
1350  };
1351 #endif
1352 
1354 
1355  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1356  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1357 
1358 #ifdef DOCUMENTATION
1359 
1361  public:
1362 #endif
1363 
1364  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1365 #if defined(SgAsmBinarySubtractPreupdate_OTHERS) || defined(DOCUMENTATION)
1366 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1367  private:
1368  friend class boost::serialization::access;
1369 
1370  template<class S>
1371  void serialize(S &s, const unsigned /*version*/) {
1372  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1373  }
1374 #endif
1375 #endif // SgAsmBinarySubtractPreupdate_OTHERS
1376 
1377 #ifdef DOCUMENTATION
1378  };
1379 #endif
1380 
1382 
1383  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1384  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1385 
1386 #ifdef DOCUMENTATION
1387 
1389  public:
1390 #endif
1391 
1392  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1393 #if defined(SgAsmBinaryAddPostupdate_OTHERS) || defined(DOCUMENTATION)
1394 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1395  private:
1396  friend class boost::serialization::access;
1397 
1398  template<class S>
1399  void serialize(S &s, const unsigned /*version*/) {
1400  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1401  }
1402 #endif
1403 #endif // SgAsmBinaryAddPostupdate_OTHERS
1404 
1405 #ifdef DOCUMENTATION
1406  };
1407 #endif
1408 
1410 
1411  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1412  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1413 
1414 #ifdef DOCUMENTATION
1415 
1417  public:
1418 #endif
1419 
1420  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1421 #if defined(SgAsmBinarySubtractPostupdate_OTHERS) || defined(DOCUMENTATION)
1422 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1423  private:
1424  friend class boost::serialization::access;
1425 
1426  template<class S>
1427  void serialize(S &s, const unsigned /*version*/) {
1428  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1429  }
1430 #endif
1431 #endif // SgAsmBinarySubtractPostupdate_OTHERS
1432 
1433 #ifdef DOCUMENTATION
1434  };
1435 #endif
1436 
1438 
1439  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1440  IS_SERIALIZABLE(AsmBinaryLsl);
1441 
1442 #ifdef DOCUMENTATION
1443 
1445  public:
1446 #endif
1447 
1448  DECLARE_OTHERS(AsmBinaryLsl);
1449 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1450 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1451  private:
1452  friend class boost::serialization::access;
1453 
1454  template<class S>
1455  void serialize(S &s, const unsigned /*version*/) {
1456  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1457  }
1458 #endif
1459 #endif // SgAsmBinaryLsl_OTHERS
1460 
1461 #ifdef DOCUMENTATION
1462  };
1463 #endif
1464 
1466 
1467  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1468  IS_SERIALIZABLE(AsmBinaryLsr);
1469 
1470 #ifdef DOCUMENTATION
1471 
1473  public:
1474 #endif
1475 
1476  DECLARE_OTHERS(AsmBinaryLsr);
1477 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1478 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1479  private:
1480  friend class boost::serialization::access;
1481 
1482  template<class S>
1483  void serialize(S &s, const unsigned /*version*/) {
1484  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1485  }
1486 #endif
1487 #endif // SgAsmBinaryLsr_OTHERS
1488 
1489 #ifdef DOCUMENTATION
1490  };
1491 #endif
1492 
1494 
1495  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1496  IS_SERIALIZABLE(AsmBinaryAsr);
1497 
1498 #ifdef DOCUMENTATION
1499 
1501  public:
1502 #endif
1503 
1504  DECLARE_OTHERS(AsmBinaryAsr);
1505 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1506 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1507  private:
1508  friend class boost::serialization::access;
1509 
1510  template<class S>
1511  void serialize(S &s, const unsigned /*version*/) {
1512  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1513  }
1514 #endif
1515 #endif // SgAsmBinaryAsr_OTHERS
1516 
1517 #ifdef DOCUMENTATION
1518  };
1519 #endif
1520 
1522 
1523  DECLARE_LEAF_CLASS(AsmBinaryRor);
1524  IS_SERIALIZABLE(AsmBinaryRor);
1525 
1526 #ifdef DOCUMENTATION
1527 
1529  public:
1530 #endif
1531 
1532  DECLARE_OTHERS(AsmBinaryRor);
1533 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1534 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1535  private:
1536  friend class boost::serialization::access;
1537 
1538  template<class S>
1539  void serialize(S &s, const unsigned /*version*/) {
1540  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1541  }
1542 #endif
1543 #endif // SgAsmBinaryRor_OTHERS
1544 
1545 #ifdef DOCUMENTATION
1546  };
1547 #endif
1548 
1550 
1551  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1552  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1553  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1554  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1555  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1556  AsmBinaryRor,
1557  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1558  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1559  IS_SERIALIZABLE(AsmBinaryExpression);
1560 
1561 #ifdef DOCUMENTATION
1562 
1564  public:
1565 #endif
1566 
1567 #ifdef DOCUMENTATION
1568 
1571  SgAsmExpression* get_lhs() const;
1572  void set_lhs(SgAsmExpression*);
1574 #else
1575  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1576  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1577 #endif
1578 
1579 #ifdef DOCUMENTATION
1580 
1583  SgAsmExpression* get_rhs() const;
1584  void set_rhs(SgAsmExpression*);
1586 #else
1587  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1588  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1589 #endif
1590 
1591  DECLARE_OTHERS(AsmBinaryExpression);
1592 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1593 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1594  private:
1595  friend class boost::serialization::access;
1596 
1597  template<class S>
1598  void serialize(S &s, const unsigned /*version*/) {
1599  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1600  s & BOOST_SERIALIZATION_NVP(p_lhs);
1601  s & BOOST_SERIALIZATION_NVP(p_rhs);
1602  }
1603 #endif
1604 #endif // SgAsmBinaryExpression_OTHERS
1605 
1606 #ifdef DOCUMENTATION
1607  };
1608 #endif
1609 
1611 
1612  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1613  IS_SERIALIZABLE(AsmUnaryPlus);
1614 
1615 #ifdef DOCUMENTATION
1616 
1618  public:
1619 #endif
1620 
1621  DECLARE_OTHERS(AsmUnaryPlus);
1622 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1623 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1624  private:
1625  friend class boost::serialization::access;
1626 
1627  template<class S>
1628  void serialize(S &s, const unsigned /*version*/) {
1629  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1630  }
1631 #endif
1632 #endif // SgAsmUnaryPlus_OTHERS
1633 
1634 #ifdef DOCUMENTATION
1635  };
1636 #endif
1637 
1639 
1640  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1641  IS_SERIALIZABLE(AsmUnaryMinus);
1642 
1643 #ifdef DOCUMENTATION
1644 
1646  public:
1647 #endif
1648 
1649  DECLARE_OTHERS(AsmUnaryMinus);
1650 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1651 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1652  private:
1653  friend class boost::serialization::access;
1654 
1655  template<class S>
1656  void serialize(S &s, const unsigned /*version*/) {
1657  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1658  }
1659 #endif
1660 #endif // SgAsmUnaryMinus_OTHERS
1661 
1662 #ifdef DOCUMENTATION
1663  };
1664 #endif
1665 
1667 
1668  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1669  IS_SERIALIZABLE(AsmUnaryRrx);
1670 
1671 #ifdef DOCUMENTATION
1672  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1674  public:
1675 #endif
1676 
1677  DECLARE_OTHERS(AsmUnaryRrx);
1678 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1679 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1680  private:
1681  friend class boost::serialization::access;
1682 
1683  template<class S>
1684  void serialize(S &s, const unsigned /*version*/) {
1685  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1686  }
1687 #endif
1688 #endif // SgAsmUnaryRrx_OTHERS
1689 
1690 #ifdef DOCUMENTATION
1691  };
1692 #endif
1693 
1695 
1696  DECLARE_LEAF_CLASS(AsmUnaryArmSpecialRegisterList);
1697  IS_SERIALIZABLE(AsmUnaryArmSpecialRegisterList);
1698 
1699 #ifdef DOCUMENTATION
1700  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1702  public:
1703 #endif
1704 
1705  DECLARE_OTHERS(AsmUnaryArmSpecialRegisterList);
1706 #if defined(SgAsmUnaryArmSpecialRegisterList_OTHERS) || defined(DOCUMENTATION)
1707 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1708  private:
1709  friend class boost::serialization::access;
1710 
1711  template<class S>
1712  void serialize(S &s, const unsigned /*version*/) {
1713  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1714  }
1715 #endif
1716 #endif // SgAsmUnaryArmSpecialRegisterList_OTHERS
1717 
1718 #ifdef DOCUMENTATION
1719  };
1720 #endif
1721 
1723 
1724  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
1725  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryArmSpecialRegisterList,
1726  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
1727  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1728  IS_SERIALIZABLE(AsmUnaryExpression);
1729 
1730 #ifdef DOCUMENTATION
1731 
1733  public:
1734 #endif
1735 
1736 #ifdef DOCUMENTATION
1737 
1740  SgAsmExpression* get_operand() const;
1743 #else
1744  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
1745  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1746 #endif
1747 
1748  DECLARE_OTHERS(AsmUnaryExpression);
1749 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
1750 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1751  private:
1752  friend class boost::serialization::access;
1753 
1754  template<class S>
1755  void serialize(S &s, const unsigned /*version*/) {
1756  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1757  s & BOOST_SERIALIZATION_NVP(p_operand);
1758  }
1759 #endif
1760 #endif // SgAsmUnaryExpression_OTHERS
1761 
1762 #ifdef DOCUMENTATION
1763  };
1764 #endif
1765 
1767 
1768  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
1769  IS_SERIALIZABLE(AsmDirectRegisterExpression);
1770 
1771 #ifdef DOCUMENTATION
1772 
1774  public:
1775 #endif
1776 
1777 #ifdef DOCUMENTATION
1778 
1781  unsigned get_psr_mask() const;
1782  void set_psr_mask(unsigned);
1784 #else
1785  AsmDirectRegisterExpression.setDataPrototype("unsigned", "psr_mask", "=0", // for ARM
1786  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1787  NO_DELETE);
1788 #endif
1789 
1790  DECLARE_OTHERS(AsmDirectRegisterExpression);
1791 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1792 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1793  private:
1794  friend class boost::serialization::access;
1795 
1796  template<class S>
1797  void serialize(S &s, const unsigned /*version*/) {
1798  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1799  s & BOOST_SERIALIZATION_NVP(p_psr_mask);
1800  }
1801 #endif
1802 
1803  private:
1804  // Default c'tor needed for serialization
1806  : p_psr_mask(0) {}
1807 #endif // SgAsmDirectRegisterExpression_OTHERS
1808 
1809 #ifdef DOCUMENTATION
1810  };
1811 #endif
1812 
1814 
1815  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
1816  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
1817 
1818 #ifdef DOCUMENTATION
1819 
1836  public:
1837 #endif
1838 
1839 #ifdef DOCUMENTATION
1840 
1848 #else
1849  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "stride", "",
1850  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1851 #endif
1852 
1853 #ifdef DOCUMENTATION
1854 
1862 #else
1863  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "offset", "",
1864  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1865 #endif
1866 
1867 #ifdef DOCUMENTATION
1868 
1873  size_t get_index() const;
1874  void set_index(size_t);
1876 #else
1877  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
1878  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1879 #endif
1880 
1881 #ifdef DOCUMENTATION
1882 
1887  size_t get_modulus() const;
1888  void set_modulus(size_t);
1890 #else
1891  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
1892  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1893 #endif
1894 
1895  DECLARE_OTHERS(AsmIndirectRegisterExpression);
1896 #if defined(SgAsmIndirectRegisterExpression_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(SgAsmRegisterReferenceExpression);
1904  s & BOOST_SERIALIZATION_NVP(p_stride);
1905  s & BOOST_SERIALIZATION_NVP(p_offset);
1906  s & BOOST_SERIALIZATION_NVP(p_index);
1907  s & BOOST_SERIALIZATION_NVP(p_modulus);
1908  }
1909 #endif
1910 
1911  private:
1912  // Default c'tor needed for serialization
1914  : p_index(0), p_modulus(0) {}
1915 #endif // SgAsmIndirectRegisterExpression_OTHERS
1916 
1917 #ifdef DOCUMENTATION
1918  };
1919 #endif
1920 
1922 
1923  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
1924  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
1925  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
1926  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
1927 
1928 #ifdef DOCUMENTATION
1929 
1931  public:
1932 #endif
1933 
1934 #ifdef DOCUMENTATION
1935 
1941 #else
1942  AsmRegisterReferenceExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "descriptor", "",
1943  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1944 #endif
1945 
1946 #ifdef DOCUMENTATION
1947 
1952  int get_adjustment() const;
1953  void set_adjustment(int);
1955 #else
1956  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
1957  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1958  NO_DELETE);
1959 #endif
1960 
1961  DECLARE_OTHERS(AsmRegisterReferenceExpression);
1962 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
1963 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1964  private:
1965  friend class boost::serialization::access;
1966 
1967  template<class S>
1968  void serialize(S &s, const unsigned /*version*/) {
1969  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1970  s & BOOST_SERIALIZATION_NVP(p_descriptor);
1971  s & BOOST_SERIALIZATION_NVP(p_adjustment);
1972  }
1973 #endif
1974 
1975  protected:
1976  // Default c'tor needed for serialization
1978  : p_adjustment(0) {}
1979 #endif // SgAsmRegisterReferenceExpression_OTHERS
1980 
1981 #ifdef DOCUMENTATION
1982  };
1983 #endif
1984 
1986 
1987  DECLARE_LEAF_CLASS(AsmRegisterNames);
1988  IS_SERIALIZABLE(AsmRegisterNames);
1989 
1990 #ifdef DOCUMENTATION
1991 
1993  public:
1994 #endif
1995 
1996 #ifdef DOCUMENTATION
1997 
2003  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
2004  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
2006 #else
2007  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
2008  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2009 #endif
2010 
2011 #ifdef DOCUMENTATION
2012 
2018  unsigned get_mask() const;
2019  void set_mask(unsigned);
2021 #else
2022  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
2023  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2024 #endif
2025 
2026  DECLARE_OTHERS(AsmRegisterNames);
2027 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
2028 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2029  private:
2030  friend class boost::serialization::access;
2031 
2032  template<class S>
2033  void serialize(S &s, const unsigned /*version*/) {
2034  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2035  s & BOOST_SERIALIZATION_NVP(p_registers);
2036  s & BOOST_SERIALIZATION_NVP(p_mask);
2037  }
2038 #endif
2039 #endif // SgAsmRegisterNames_OTHERS
2040 
2041 #ifdef DOCUMENTATION
2042  };
2043 #endif
2044 
2046 
2047  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2048  IS_SERIALIZABLE(AsmIntegerValueExpression);
2049 
2050 #ifdef DOCUMENTATION
2051 
2067  public:
2068 #endif
2069 
2070 #ifdef DOCUMENTATION
2071 
2081  SgNode* get_baseNode() const;
2082  void set_baseNode(SgNode*);
2084 #else
2085  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2086  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2087 #endif
2088 
2089  DECLARE_OTHERS(AsmIntegerValueExpression);
2090 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2091 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2092  private:
2093  friend class boost::serialization::access;
2094 
2095  template<class S>
2096  void serialize(S &s, const unsigned /*version*/) {
2097  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2098  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2099  }
2100 #endif
2101 
2102  public:
2107  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2108 
2115 
2117  static uint64_t virtualAddress(SgNode*);
2118 
2138  std::string get_label(bool quiet=false) const;
2139 
2141  size_t get_significantBits() const;
2142 
2148  void makeRelativeTo(SgNode *baseNode);
2149 
2154  uint64_t get_baseAddress() const;
2155 
2161  uint64_t get_absoluteValue(size_t nbits=0) const;
2162 
2166  void set_absoluteValue(uint64_t);
2167 
2169  int64_t get_signedValue() const;
2170 
2174  int64_t get_relativeValue() const;
2175 
2180  void set_relativeValue(int64_t v, size_t nbits=64);
2181 
2182  uint64_t get_value() const { return get_absoluteValue(); }
2183 
2184 #endif // SgAsmIntegerValueExpression_OTHERS
2185 
2186 #ifdef DOCUMENTATION
2187  };
2188 #endif
2189 
2191 
2192  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2193  IS_SERIALIZABLE(AsmFloatValueExpression);
2194 
2195 #ifdef DOCUMENTATION
2196 
2201  public:
2202 #endif
2203 
2204  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2205 
2206  DECLARE_OTHERS(AsmFloatValueExpression);
2207 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2208  private:
2209  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2210  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2211  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2212  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2213  // understand "mutable".
2214  mutable double p_nativeValue;
2215  mutable bool p_nativeValueIsValid;
2216 
2217 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2218  private:
2219  friend class boost::serialization::access;
2220 
2221  template<class S>
2222  void serialize(S &s, const unsigned /*version*/) {
2223  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2224  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2225  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2226  }
2227 #endif
2228 
2229  public:
2234  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2235 
2241  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2242 
2249 
2251  void set_nativeValue(double);
2252 
2254  double get_nativeValue() const;
2255 
2260  void updateBitVector();
2261 
2266  void updateNativeValue() const;
2267 #endif // SgAsmFloatValueExpression_OTHERS
2268 
2269 #ifdef DOCUMENTATION
2270  };
2271 #endif
2272 
2274 
2275  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2276  AsmIntegerValueExpression | AsmFloatValueExpression,
2277  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2278  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2279  IS_SERIALIZABLE(AsmConstantExpression);
2280 
2281  DECLARE_HEADERS(AsmConstantExpression);
2282 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2283  #include <Sawyer/BitVector.h>
2284 #endif // SgAsmConstantExpression_HEADERS
2285 
2286 #ifdef DOCUMENTATION
2287 
2292  public:
2293 #endif
2294 
2295 #ifndef DOCUMENTATION
2296  // Documented below. Implemented below due to ROSETTA limitations.
2297  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2298  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2299 #endif
2300 
2301  DECLARE_OTHERS(AsmConstantExpression);
2302 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2303 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2304  private:
2305  friend class boost::serialization::access;
2306 
2307  template<class S>
2308  void serialize(S &s, const unsigned /*version*/) {
2309  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2310  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2311  }
2312 #endif
2313 
2314  public:
2320  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2321  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2322  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2324 #endif // SgAsmConstantExpression_OTHERS
2325 
2326 #ifdef DOCUMENTATION
2327  };
2328 #endif
2329 
2331 
2332  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2333  AsmConstantExpression,
2334  "AsmValueExpression", "AsmValueExpressionTag", false);
2335  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2336  IS_SERIALIZABLE(AsmValueExpression);
2337 
2338 #ifdef DOCUMENTATION
2339 
2347  public:
2348 #endif
2349 
2350 #ifdef DOCUMENTATION
2351 
2361 #else
2362  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
2363  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2364 #endif
2365 
2366 #ifdef DOCUMENTATION
2367 
2375  unsigned short get_bit_offset() const;
2376  void set_bit_offset(unsigned short);
2378 #else
2379  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
2380  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2381 #endif
2382 
2383 #ifdef DOCUMENTATION
2384 
2390  unsigned short get_bit_size() const;
2391  void set_bit_size(unsigned short);
2393 #else
2394  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
2395  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2396 #endif
2397 
2398 #ifdef DOCUMENTATION
2399 
2405  SgSymbol* get_symbol() const;
2406  void set_symbol(SgSymbol*);
2408 #else
2409  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
2410  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2411 #endif
2412 
2413  DECLARE_OTHERS(AsmValueExpression);
2414 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
2415 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2416  private:
2417  friend class boost::serialization::access;
2418 
2419  template<class S>
2420  void serialize(S &s, const unsigned /*version*/) {
2421  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2422  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
2423  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
2424  s & BOOST_SERIALIZATION_NVP(p_bit_size);
2425 #if 1
2426  ASSERT_require2(p_symbol == NULL, "not implemented yet");
2427 #else
2428  s & BOOST_SERIALIZATION_NVP(p_symbol);
2429 #endif
2430  }
2431 #endif
2432 #endif // SgAsmValueExpression_OTHERS
2433 
2434 #ifdef DOCUMENTATION
2435  };
2436 #endif
2437 
2439 
2440  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
2441  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
2442 
2443 #ifdef DOCUMENTATION
2444 
2446  public:
2447 #endif
2448 
2449 #ifdef DOCUMENTATION
2450 
2457  SgAsmExpression* get_address() const;
2460 #else
2461  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
2462  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2463 #endif
2464 
2465 #ifdef DOCUMENTATION
2466 
2473  SgAsmExpression* get_segment() const;
2476 #else
2477  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
2478  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2479 #endif
2480 
2481  DECLARE_OTHERS(AsmMemoryReferenceExpression);
2482 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2483 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2484  private:
2485  friend class boost::serialization::access;
2486 
2487  template<class S>
2488  void serialize(S &s, const unsigned /*version*/) {
2489  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2490  s & BOOST_SERIALIZATION_NVP(p_address);
2491  s & BOOST_SERIALIZATION_NVP(p_segment);
2492  }
2493 #endif
2494 #endif // SgAsmMemoryReferenceExpression_OTHERS
2495 
2496 #ifdef DOCUMENTATION
2497  };
2498 #endif
2499 
2501 
2502  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
2503  IS_SERIALIZABLE(AsmControlFlagsExpression);
2504 
2505 #ifdef DOCUMENTATION
2506  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2508  public:
2509 #endif
2510 
2511 #ifndef DOCUMENTATION
2512  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
2513  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2514 #endif
2515 
2516  DECLARE_OTHERS(AsmControlFlagsExpression);
2517 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
2518 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2519  private:
2520  friend class boost::serialization::access;
2521 
2522  template<class S>
2523  void serialize(S &s, const unsigned /*version*/) {
2524  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2525  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
2526  }
2527 #endif
2528 #endif // SgAsmControlFlagsExpression_OTHERS
2529 
2530 #ifdef DOCUMENTATION
2531  };
2532 #endif
2533 
2535 
2536  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
2537  IS_SERIALIZABLE(AsmCommonSubExpression);
2538 
2539 #ifdef DOCUMENTATION
2540  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2542  public:
2543 #endif
2544 
2545 #ifndef DOCUMENTATION
2546  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
2547  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2548 #endif
2549 
2550  DECLARE_OTHERS(AsmCommonSubExpression);
2551 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
2552 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2553  private:
2554  friend class boost::serialization::access;
2555 
2556  template<class S>
2557  void serialize(S &s, const unsigned /*version*/) {
2558  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2559  s & BOOST_SERIALIZATION_NVP(p_subexpression);
2560  }
2561 #endif
2562 #endif // SgAsmCommonSubExpression_OTHERS
2563 
2564 #ifdef DOCUMENTATION
2565  };
2566 #endif
2567 
2569 
2570  DECLARE_LEAF_CLASS(AsmRiscOperation);
2571  IS_SERIALIZABLE(AsmRiscOperation);
2572 
2573 #ifdef DOCUMENTATION
2574 
2583  public:
2584 #endif
2585 
2586 #ifdef DOCUMENTATION
2587 
2596 #else
2597  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
2598  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
2599 #endif
2600 
2601 #ifdef DOCUMENTATION
2602 
2608  SgAsmExprListExp* get_operands() const;
2611 #else
2612  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
2613  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2614 #endif
2615 
2616  DECLARE_OTHERS(AsmRiscOperation);
2617 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
2618  public:
2625  OP_NONE,
2626  OP_bottom,
2627  OP_undefined,
2628  OP_unspecified,
2629  OP_filterCallTarget,
2630  OP_filterReturnTarget,
2631  OP_filterIndirectJumpTarget,
2632  OP_hlt,
2633  OP_cpuid,
2634  OP_rdtsc,
2635  OP_and_,
2636  OP_or_,
2637  OP_xor_,
2638  OP_invert,
2639  OP_extract,
2640  OP_concat,
2641  OP_leastSignificantSetBit,
2642  OP_mostSignificantSetBit,
2643  OP_rotateLeft,
2644  OP_rotateRight,
2645  OP_shiftLeft,
2646  OP_shiftRight,
2647  OP_shiftRightArithmetic,
2648  OP_equalToZero,
2649  OP_ite,
2650  OP_isEqual,
2651  OP_isNotEqual,
2652  OP_isUnsignedLessThan,
2653  OP_isUnsignedLessThanOrEqual,
2654  OP_isUnsignedGreaterThan,
2655  OP_isUnsignedGreaterThanOrEqual,
2656  OP_isSignedLessThan,
2657  OP_isSignedLessThanOrEqual,
2658  OP_isSignedGreaterThan,
2659  OP_isSignedGreaterThanOrEqual,
2660  OP_unsignedExtend,
2661  OP_signExtend,
2664  OP_subtract,
2665  OP_negate,
2666  OP_signedDivide,
2667  OP_signedModulo,
2668  OP_signedMultiply,
2669  OP_unsignedDivide,
2670  OP_unsignedModulo,
2671  OP_unsignedMultiply,
2672  OP_interrupt,
2673  OP_readRegister,
2674  OP_peekRegister,
2675  OP_writeRegister,
2677  OP_peekMemory,
2679  OP_N_OPERATORS // MUST BE LAST!
2680  };
2681 
2682 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2683  private:
2684  friend class boost::serialization::access;
2685 
2686  template<class S>
2687  void serialize(S &s, const unsigned /*version*/) {
2688  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2689  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
2690  s & BOOST_SERIALIZATION_NVP(p_operands);
2691  }
2692 #endif
2693 #endif // SgAsmRiscOperation_OTHERS
2694 
2695 #ifdef DOCUMENTATION
2696  };
2697 #endif
2698 
2700 
2701  DECLARE_LEAF_CLASS(AsmExprListExp);
2702  IS_SERIALIZABLE(AsmExprListExp);
2703 
2704 #ifdef DOCUMENTATION
2705 
2707  public:
2708 #endif
2709 
2710 #ifdef DOCUMENTATION
2711 
2717  const SgAsmExpressionPtrList& get_expressions() const;
2718  void set_expressions(const SgAsmExpressionPtrList&);
2720 #else
2721  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
2722  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2723 #endif
2724 
2725  DECLARE_OTHERS(AsmExprListExp);
2726 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
2727 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2728  private:
2729  friend class boost::serialization::access;
2730 
2731  template<class S>
2732  void serialize(S &s, const unsigned /*version*/) {
2733  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2734  s & BOOST_SERIALIZATION_NVP(p_expressions);
2735  }
2736 #endif
2737 #endif // SgAsmExprListExp_OTHERS
2738 
2739 #ifdef DOCUMENTATION
2740  };
2741 #endif
2742 
2744 
2745  NEW_NONTERMINAL_MACRO(AsmExpression,
2746  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
2747  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
2748  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
2749  AsmRiscOperation,
2750  "AsmExpression", "AsmExpressionTag", false);
2751  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
2752  IS_SERIALIZABLE(AsmExpression);
2753 
2754 #ifdef DOCUMENTATION
2755 
2756  class SgAsmExpression: public SgAsmNode {
2757  public:
2758 #endif
2759 
2760 #ifdef DOCUMENTATION
2761 
2766  SgAsmType* get_type() const;
2767  void set_type(SgAsmType*);
2769 #else
2770  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
2771  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2772 #endif
2773 
2774 #ifdef DOCUMENTATION
2775 
2780  const std::string& get_comment() const;
2781  void set_comment(const std::string&);
2783 #else
2784  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
2785  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2786 #endif
2787 
2788  DECLARE_OTHERS(AsmExpression);
2789 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
2790 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2791  private:
2792  friend class boost::serialization::access;
2793 
2794  template<class S>
2795  void serialize(S &s, const unsigned /*version*/) {
2796  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
2797  s & BOOST_SERIALIZATION_NVP(p_type);
2798  s & BOOST_SERIALIZATION_NVP(p_comment);
2799  }
2800 #endif
2801 
2802  public:
2806  size_t get_nBits() const;
2807 
2813 
2819 
2820 #endif // SgAsmExpression_OTHERS
2821 
2822 #ifdef DOCUMENTATION
2823  };
2824 #endif
2825 
2826 
2827 
2828 
2830 
2831  /***************************************************************************************************************************
2832  * Data Types (new interface 2014-07)
2833  *
2834  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
2835  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
2836  * 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
2837  * don't allow types to be modified after they're created.
2838  ***************************************************************************************************************************/
2839 
2841 
2842  DECLARE_LEAF_CLASS(AsmIntegerType);
2843  IS_SERIALIZABLE(AsmIntegerType);
2844 
2845 #ifdef DOCUMENTATION
2846 
2848  public:
2849 #endif
2850 
2851 #ifndef DOCUMENTATION
2852  // Documented below due to ROSETTA limitations
2853  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
2854  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2855 #endif
2856 
2857  DECLARE_OTHERS(AsmIntegerType);
2858 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
2859 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2860  private:
2861  friend class boost::serialization::access;
2862 
2863  template<class S>
2864  void serialize(S &s, const unsigned /*version*/) {
2865  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2866  s & BOOST_SERIALIZATION_NVP(p_isSigned);
2867  }
2868 #endif
2869 
2870  public:
2874  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
2875 
2879  bool get_isSigned() const;
2880 
2881  // Overrides documented in base class
2882  virtual void check() const $ROSE_OVERRIDE;
2883  virtual std::string toString() const $ROSE_OVERRIDE;
2884 #endif // SgAsmIntegerType_OTHERS
2885 
2886 #ifdef DOCUMENTATION
2887  };
2888 #endif
2889 
2891 
2892  DECLARE_LEAF_CLASS(AsmFloatType);
2893  IS_SERIALIZABLE(AsmFloatType);
2894 
2895  DECLARE_HEADERS(AsmFloatType);
2896 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
2897  #include <Sawyer/BitVector.h>
2898 #endif // SgAsmFloatType_HEADERS
2899 
2900 #ifdef DOCUMENTATION
2901 
2903  public:
2904 #endif
2905 
2906 #ifndef DOCUMENTATION
2907  // Documented below because of ROSETTA limitations (they're read-only)
2908  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
2909  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2910  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
2911  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2912  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
2913  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2914  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
2915  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2916  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
2917  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2918  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
2919  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2920  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
2921  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2922 #endif
2923 
2924  DECLARE_OTHERS(AsmFloatType);
2925 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
2926 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2927  private:
2928  friend class boost::serialization::access;
2929 
2930  template<class S>
2931  void serialize(S &s, const unsigned /*version*/) {
2932  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2933  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
2934  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
2935  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
2936  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
2937  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
2938  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
2939  s & BOOST_SERIALIZATION_NVP(p_flags);
2940  }
2941 #endif
2942 
2943  public:
2944  enum {
2945  GRADUAL_UNDERFLOW = 0x00000001,
2946  NORMALIZED_SIGNIFICAND = 0x00000002
2947  };
2948 
2950 
2952  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
2953  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
2954  uint64_t exponentBias, unsigned flags);
2955 
2957  BitRange significandBits() const;
2958 
2960  BitRange exponentBits() const;
2961 
2963  size_t signBit() const;
2964 
2966  uint64_t exponentBias() const;
2967 
2969  unsigned flags() const;
2970 
2972  bool gradualUnderflow() const;
2973 
2975  bool normalizedSignificand() const;
2976 
2977  // Overrides documented in base class
2978  virtual void check() const $ROSE_OVERRIDE;
2979  virtual std::string toString() const $ROSE_OVERRIDE;
2980 #endif // SgAsmFloatType_OTHERS
2981 
2982 #ifdef DOCUMENTATION
2983  };
2984 #endif
2985 
2987 
2988  NEW_NONTERMINAL_MACRO(AsmScalarType,
2989  AsmIntegerType | AsmFloatType,
2990  "AsmScalarType", "AsmScalarTypeTag", false);
2991  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
2992  IS_SERIALIZABLE(AsmScalarType);
2993 
2994 #ifdef DOCUMENTATION
2995 
2996  class SgAsmScalarType: public SgAsmType {
2997  public:
2998 #endif
2999 
3000 #ifndef DOCUMENTATION
3001  // Documented below due to ROSETTA limitations (read-only)
3002  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3003  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3004  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3005  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3006  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
3007  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3008  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
3009  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3010 #endif
3011 
3012  DECLARE_OTHERS(AsmScalarType);
3013 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
3014 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3015  private:
3016  friend class boost::serialization::access;
3017 
3018  template<class S>
3019  void serialize(S &s, const unsigned /*version*/) {
3020  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3021  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
3022  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
3023  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
3024  s & BOOST_SERIALIZATION_NVP(p_nBits);
3025  }
3026 #endif
3027 
3028  protected:
3033  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
3034 
3035  public:
3037  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3038 
3040  ByteOrder::Endianness get_minorOrder() const;
3041 
3043  ByteOrder::Endianness get_majorOrder() const;
3044 
3046  size_t get_majorNBytes() const;
3047 
3048  // Overrides documented in base class
3049  virtual void check() const $ROSE_OVERRIDE;
3050  virtual std::string toString() const $ROSE_OVERRIDE;
3051 #endif // SgAsmScalarType_OTHERS
3052 
3053 #ifdef DOCUMENTATION
3054  };
3055 #endif
3056 
3058 
3059  DECLARE_LEAF_CLASS(AsmVectorType);
3060  IS_SERIALIZABLE(AsmVectorType);
3061 
3062 #ifdef DOCUMENTATION
3063 
3064  class SgAsmVectorType: public SgAsmType {
3065  public:
3066 #endif
3067 
3068 #ifndef DOCUMENTATION
3069  // Documented below due to ROSETTA limitations (read-only)
3070  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3071  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3072  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3073  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3074 #endif
3075 
3076  DECLARE_OTHERS(AsmVectorType);
3077 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3078 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3079  private:
3080  friend class boost::serialization::access;
3081 
3082  template<class S>
3083  void serialize(S &s, const unsigned /*version*/) {
3084  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3085  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3086  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3087  }
3088 #endif
3089 
3090  public:
3092  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3093 
3095  size_t get_nElmts() const;
3096 
3098  SgAsmType* get_elmtType() const;
3099 
3100  // Overrides documented in base class
3101  virtual void check() const $ROSE_OVERRIDE;
3102  virtual std::string toString() const $ROSE_OVERRIDE;
3103  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3104 #endif // SgAsmVectorType_OTHERS
3105 
3106 #ifdef DOCUMENTATION
3107  };
3108 #endif
3109 
3111 
3112  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3113  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3114  IS_SERIALIZABLE(AsmType);
3115 
3116 #ifdef DOCUMENTATION
3117 
3118  class SgAsmType: public SgAsmNode {
3119  public:
3120 #endif
3121 
3122  DECLARE_OTHERS(AsmType);
3123 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3124  private:
3126 
3127 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3128  private:
3129  friend class boost::serialization::access;
3130 
3131  template<class S>
3132  void serialize(S &s, const unsigned /*version*/) {
3133  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3134  }
3135 #endif
3136 
3137  public:
3145  virtual void check() const;
3146 
3152  virtual std::string toString() const {
3153  abort(); // ROSETTA limitation: intended pure virtual
3154  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3155  }
3156 
3158  virtual size_t get_nBits() const {
3159  abort(); // ROSETTA limitation: intended pure virtual
3160  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3161  }
3162 
3164  virtual size_t get_nBytes() const;
3165 
3171  template<class Type> // Type is a subclass of SgAsmType
3172  static Type* registerOrDelete(Type *toInsert) {
3173  ASSERT_not_null(toInsert);
3174  std::string key = toInsert->toString();
3175  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3176  ASSERT_not_null(retval);
3177  if (retval!=toInsert)
3178  delete toInsert;
3179  return retval;
3180  }
3181 #endif // SgAsmType_OTHERS
3182 
3183 #ifdef DOCUMENTATION
3184  };
3185 #endif
3186 
3187 
3188 
3190 
3191  /**************************************************************************************************************************
3192  * Collections of Instructions
3193  **************************************************************************************************************************/
3194 
3196 
3197  DECLARE_LEAF_CLASS(AsmFunction);
3198  IS_SERIALIZABLE(AsmFunction);
3199 
3200 #ifdef DOCUMENTATION
3201 
3217  public:
3218 #endif
3219 
3220 #ifdef DOCUMENTATION
3221 
3226  const std::string& get_name() const;
3227  void set_name(const std::string&);
3229 #else
3230  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3231  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3232 #endif
3233 
3234 #ifdef DOCUMENTATION
3235 
3241  unsigned get_reason() const;
3242  void set_reason(unsigned);
3244 #else
3245  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3246  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3247 #endif
3248 
3249 #ifdef DOCUMENTATION
3250 
3257  const std::string& get_reasonComment() const;
3258  void set_reasonComment(const std::string&);
3260 #else
3261  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
3262  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3263 #endif
3264 
3265 #ifdef DOCUMENTATION
3266 
3274 #else
3275  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3276  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3277 #endif
3278 
3279 #ifdef DOCUMENTATION
3280 
3283  MayReturn get_may_return() const;
3284  void set_may_return(MayReturn);
3286 #else
3287  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3288  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3289 #endif
3290 
3291 #ifdef DOCUMENTATION
3292 
3297  const std::string& get_name_md5() const;
3298  void set_name_md5(const std::string&);
3300 #else
3301  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3302  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3303 #endif
3304 
3305 #ifdef DOCUMENTATION
3306 
3311  const SgAsmStatementPtrList& get_statementList() const;
3312  void set_statementList(const SgAsmStatementPtrList&);
3314 #else
3315  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3316  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3317 #endif
3318 
3319 #ifdef DOCUMENTATION
3320  // FIXME[Robb P Matzke 2017-02-13]: unused?
3321 #else
3322  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3323  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3324 #endif
3325 
3326 #ifdef DOCUMENTATION
3327 
3333  rose_addr_t get_entry_va() const;
3334  void set_entry_va(rose_addr_t);
3336 #else
3337  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3338  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3339 #endif
3340 
3341 #ifdef DOCUMENTATION
3342 
3351 #else
3352  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3353  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3354 #endif
3355 
3356 #ifdef DOCUMENTATION
3357  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3358 #else
3359  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3360  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3361 #endif
3362 
3363 #ifdef DOCUMENTATION
3364 
3373  int64_t get_stackDelta() const;
3374  void set_stackDelta(int64_t);
3376 #else
3377  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3378  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3379 #endif
3380 
3381 #ifdef DOCUMENTATION
3382 
3390  const std::string& get_callingConvention() const;
3391  void set_callingConvention(const std::string&);
3393 #else
3394  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3395  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3396 #endif
3397 
3398  DECLARE_OTHERS(AsmFunction);
3399 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3400 
3401 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3402  private:
3403  friend class boost::serialization::access;
3404 
3405  template<class S>
3406  void serialize(S &s, const unsigned /*version*/) {
3407  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3408  s & BOOST_SERIALIZATION_NVP(p_name);
3409  s & BOOST_SERIALIZATION_NVP(p_reason);
3410  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
3411  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3412  s & BOOST_SERIALIZATION_NVP(p_may_return);
3413  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3414  s & BOOST_SERIALIZATION_NVP(p_statementList);
3415  s & BOOST_SERIALIZATION_NVP(p_dest);
3416  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3417  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3418  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3419  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3420  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3421  }
3422 #endif
3423 
3424  public:
3427 
3431  void remove_statement(SgAsmStatement* statement);
3432 
3437  SgAsmBlock* get_entry_block() const;
3438 
3440  enum MayReturn {
3445  };
3446 
3451  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3452  // Also fix SgAsmFunction::reason_key()
3453  FUNC_NONE = 0x00000000,
3455  = 0x00008000,
3456  FUNC_ENTRY_POINT = 0x00010000,
3457  FUNC_CALL_TARGET = 0x00020000,
3460  FUNC_CALL_INSN = 0x00040000,
3466  FUNC_EH_FRAME = 0x00080000,
3467  FUNC_SYMBOL = 0x00100000,
3468  FUNC_PATTERN = 0x00200000,
3473  FUNC_GRAPH = 0x00400000,
3477  FUNC_USERDEF = 0x00800000,
3478  FUNC_PADDING = 0x01000000,
3483  FUNC_DISCONT = 0x02000000,
3486  FUNC_INSNHEAD = 0x04000000,
3487  FUNC_IMPORT = 0x08000000,
3490  FUNC_LEFTOVERS = 0x10000000,
3494  FUNC_INTRABLOCK = 0x20000000,
3502  FUNC_THUNK = 0x40000000,
3511  FUNC_EXPORT = 0x80000000,
3513  FUNC_DEFAULT = 0xefff80ff,
3515  /*========= Miscellaneous Reasons ===========================================================================
3516  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3517  * availalble for users to use as they see fit. */
3518  FUNC_MISCMASK = 0x000000ff,
3533  };
3534 
3538  static std::string reason_key(const std::string &prefix="");
3539 
3541  std::string reason_str(bool pad) const;
3542 
3546  static std::string reason_str(bool pad, unsigned reason);
3547 
3550  public:
3551  virtual ~NodeSelector() {}
3552  virtual bool operator()(SgNode*) = 0;
3553  };
3554 
3594  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
3595  NodeSelector *selector=NULL);
3596 
3602  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
3603 
3606  e_unknown = 0,
3607  e_standard = 1,
3608  e_library = 2,
3609  e_imported = 3,
3610  e_thunk = 4,
3611  e_last
3612  };
3613 #endif // SgAsmFunction_OTHERS
3614 
3615 
3616 #ifdef DOCUMENTATION
3617  };
3618 #endif
3619 
3620 
3622 
3623  DECLARE_LEAF_CLASS(AsmBlock);
3624  IS_SERIALIZABLE(AsmBlock);
3625 
3626 #ifdef DOCUMENTATION
3627 
3647  class SgAsmBlock: public SgAsmStatement {
3648  public:
3649 #endif
3650 
3651 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3652  // [tps 05Apr07] needed for the control_flow_graph
3653  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
3654  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3655 #endif
3656 
3657 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3658  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
3659  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3660 #endif
3661 
3662 #ifdef DOCUMENTATION
3663 
3668  rose_addr_t get_id() const;
3669  void set_id(rose_addr_t);
3671 #else
3672  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
3673  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3674 #endif
3675 
3676 #ifdef DOCUMENTATION
3677 
3682  unsigned get_reason() const;
3683  void set_reason(unsigned);
3685 #else
3686  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
3687  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3688 #endif
3689 
3690 #ifdef DOCUMENTATION
3691  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3692  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3693  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3694  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3701  const SgAsmStatementPtrList& get_statementList() const;
3702  void set_statementList(const SgAsmStatementPtrList&);
3704 #else
3705  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3706  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3707 #endif
3708 
3709 #ifdef DOCUMENTATION
3710  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3711  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3712  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3713  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3721  const SgAsmIntegerValuePtrList& get_successors() const;
3722  void set_successors(const SgAsmIntegerValuePtrList&);
3724 #else
3725  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
3726  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3727 #endif
3728 
3729 #ifdef DOCUMENTATION
3730 
3740  bool get_successors_complete() const;
3741  void set_successors_complete(bool);
3743 #else
3744  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
3745  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3746 #endif
3747 
3748 #ifdef DOCUMENTATION
3749 
3761 #else
3762  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
3763  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3764 #endif
3765 
3766 #ifdef DOCUMENTATION
3767 
3775  size_t get_cached_vertex() const;
3776  void set_cached_vertex(size_t);
3778 #else
3779  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
3780  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3781 #endif
3782 
3783 #ifdef DOCUMENTATION
3784 
3790  double get_code_likelihood() const;
3791  void set_code_likelihood(double);
3793 #else
3794  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
3795  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3796 #endif
3797 
3798 #ifdef DOCUMENTATION
3799 
3807  int64_t get_stackDeltaOut() const;
3808  void set_stackDeltaOut(int64_t);
3810 #else
3811  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
3812  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3813 #endif
3814 
3815  DECLARE_OTHERS(AsmBlock);
3816 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
3817 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3818  private:
3819  friend class boost::serialization::access;
3820 
3821  template<class S>
3822  void serialize(S &s, const unsigned /*version*/) {
3823  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3824  s & BOOST_SERIALIZATION_NVP(p_reason);
3825  s & BOOST_SERIALIZATION_NVP(p_statementList);
3826  s & BOOST_SERIALIZATION_NVP(p_successors);
3827  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
3828  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
3829  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3830  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
3831  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
3832  }
3833 #endif
3834 
3835  public:
3837  enum Reason {
3838  // Please update SgAsmBlock::reason_str() if you change this enum!
3839  BLK_NONE = 0x00000000,
3840  BLK_ENTRY_POINT = 0x00010000,
3841  BLK_PADDING = 0x00020000,
3842  BLK_FRAGMENT = 0x00080000,
3844  BLK_CFGHEAD = 0x00100000,
3845  BLK_USERDEF = 0x00200000,
3846  BLK_LEFTOVERS = 0x00400000,
3848  BLK_JUMPTABLE = 0x00800000,
3849  BLK_GRAPH1 = 0x01000000,
3850  BLK_GRAPH2 = 0x02000000,
3851  BLK_GRAPH3 = 0x04000000,
3853  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
3854 
3855  // ========= Miscellaneous Reasons ===========================================================================
3856  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3857  // availalble for users to use as they see fit.
3858  BLK_MISCMASK = 0x000000ff,
3860  BLK_FINDDATA = 0x00000001,
3862  BLK_POSTFUNC = 0x00000002
3864  };
3865 
3870 
3875 
3876  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
3881  void remove_children();
3882 
3887  rose_addr_t get_fallthrough_va();
3888 
3893 
3899  bool has_instructions() const;
3900 
3906  bool is_basic_block() const { return has_instructions(); }
3907 
3917  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
3918 
3922  static std::string reason_key(const std::string &prefix="");
3923 
3927  std::string reason_str(bool pad) const;
3928 
3934  static std::string reason_str(bool pad, unsigned reason);
3935 #endif // SgAsmBlock_OTHERS
3936 
3937 #ifdef DOCUMENTATION
3938  };
3939 #endif
3940 
3941 
3943 
3944  DECLARE_LEAF_CLASS(AsmStaticData);
3945  IS_SERIALIZABLE(AsmStaticData);
3946 
3947 #ifdef DOCUMENTATION
3948 
3956  public:
3957 #endif
3958 
3959 #ifdef DOCUMENTATION
3960 
3966  const SgUnsignedCharList& get_raw_bytes() const;
3967  void set_raw_bytes(const SgUnsignedCharList&);
3969 #else
3970  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
3971  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3972 #endif
3973 
3974  DECLARE_OTHERS(AsmStaticData);
3975 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
3976 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3977  private:
3978  friend class boost::serialization::access;
3979 
3980  template<class S>
3981  void serialize(S &s, const unsigned /*version*/) {
3982  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3983  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
3984  }
3985 #endif
3986 
3987  public:
3991  size_t get_size() const { return p_raw_bytes.size(); }
3992 #endif // SgAsmStaticData_OTHERS
3993 
3994 #ifdef DOCUMENTATION
3995  };
3996 #endif
3997 
3998 
4000 
4001  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
4002  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
4003 
4004 #ifdef DOCUMENTATION
4005 
4016  public:
4017 #endif
4018 
4019  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4020 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4021 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4022  private:
4023  friend class boost::serialization::access;
4024 
4025  template<class S>
4026  void serialize(S & s, const unsigned /*version*/) {
4027  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4028  }
4029 #endif
4030  protected:
4031  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4032 
4033  public:
4036  p_declarationList.push_back(declaration);
4037  }
4038 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4039 
4040 #ifdef DOCUMENTATION
4041  };
4042 #endif
4043 
4044 
4046 
4047  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4048  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4049 
4050 #ifdef DOCUMENTATION
4051  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4053  public:
4054 #endif
4055 
4056 #ifdef DOCUMENTATION
4057 
4060  const std::string& get_name() const;
4061  void set_name(const std::string&);
4063 #else
4064  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4065  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4066  NO_DELETE);
4067 #endif
4068 
4069 #ifdef DOCUMENTATION
4070  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4074  uint64_t get_offset() const;
4075  void set_ofset(uint64_t);
4077 #else
4078  // Not clear if we want to store the offset explicitly
4079  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4080  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4081  NO_DELETE);
4082 #endif
4083 
4084  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4085 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4086 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4087  private:
4088  friend class boost::serialization::access;
4089 
4090  template<class S>
4091  void serialize(S &s, const unsigned /*version*/) {
4092  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4093  }
4094 #endif
4095 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4096 
4097 #ifdef DOCUMENTATION
4098  };
4099 #endif
4100 
4101 
4103 
4104  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4105  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4106  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4107  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4108  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4109 
4110 #ifdef DOCUMENTATION
4111 
4118  public:
4119 #endif
4120 
4121  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4122 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4123 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4124  private:
4125  friend class boost::serialization::access;
4126 
4127  template<class S>
4128  void serialize(S &s, const unsigned /*version*/) {
4129  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4130  };
4131 #endif
4132 #endif // SgAsmSynthesizedDeclaration_OTHERS
4133 
4134 #ifdef DOCUMENTATION
4135  };
4136 #endif
4137 
4138 
4140 
4141  NEW_NONTERMINAL_MACRO(AsmStatement,
4142  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4143  "AsmStatement", "AsmStatementTag", false);
4144  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4145  IS_SERIALIZABLE(AsmStatement);
4146 
4147 #ifdef DOCUMENTATION
4148 
4152  class SgAsmStatement: public SgAsmNode {
4153  public:
4154 #endif
4155 
4156 #ifdef DOCUMENTATION
4157 
4162  rose_addr_t get_address() const;
4163  void set_address(rose_addr_t);
4165 #else
4166  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4167  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4168 #endif
4169 
4170 
4171 #ifdef DOCUMENTATION
4172 
4175  const std::string& get_comment() const;
4176  void set_comment(const std::string&);
4178 #else
4179  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4180  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4181 #endif
4182 
4183  DECLARE_OTHERS(AsmStatement);
4184 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4185 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4186  private:
4187  friend class boost::serialization::access;
4188 
4189  template<class S>
4190  void serialize(S &s, const unsigned /*version*/) {
4191  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4192  s & BOOST_SERIALIZATION_NVP(p_address);
4193  s & BOOST_SERIALIZATION_NVP(p_comment);
4194  }
4195 #endif
4196 #endif // SgAsmStatement_OTHERS
4197 
4198 #ifdef DOCUMENTATION
4199  };
4200 #endif
4201 
4202 
4203 
4204 
4206 
4207  /*************************************************************************************************************************
4208  * Binary Interpretations
4209  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4210  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4211  * an AST that represents a single, coherent sub-part of the file.
4212  *************************************************************************************************************************/
4213 
4215 
4216  DECLARE_LEAF_CLASS(AsmInterpretationList);
4217  IS_SERIALIZABLE(AsmInterpretationList);
4218 
4219 #ifdef DOCUMENTATION
4220 
4222  public:
4223 #endif
4224 
4225 #ifdef DOCUMENTATION
4226 
4235 #else
4236  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4237  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4238  NO_DELETE);
4239 #endif
4240 
4241  DECLARE_OTHERS(AsmInterpretationList);
4242 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4243 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4244  private:
4245  friend class boost::serialization::access;
4246 
4247  template<class S>
4248  void serialize(S &s, const unsigned /*version*/) {
4249  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4250  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4251  }
4252 #endif
4253 #endif // SgAsmInterpretationList_OTHERS
4254 
4255 #ifdef DOCUMENTATION
4256  };
4257 #endif
4258 
4260 
4261  DECLARE_LEAF_CLASS(AsmInterpretation);
4262  IS_SERIALIZABLE(AsmInterpretation);
4263 
4264  DECLARE_HEADERS(AsmInterpretation);
4265 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4266  #include <MemoryMap.h>
4267  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
4268 #endif // SgAsmInterpretation_HEADERS
4269 
4270 #ifdef DOCUMENTATION
4271 
4278  public:
4279 #endif
4280 
4281 #ifdef DOCUMENTATION
4282  // documentation and definition are below
4283 #else
4284  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4285 #endif
4286 
4287 #ifdef DOCUMENTATION
4288 
4299 #else
4300  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4301  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4302 #endif
4303 
4304 #ifdef DOCUMENTATION
4305 
4310  SgAsmBlock* get_global_block() const;
4313 #else
4314  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4315  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4316 #endif
4317 
4318  DECLARE_OTHERS(AsmInterpretation);
4319 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4320  private:
4322  const Rose::BinaryAnalysis::RegisterDictionary *p_registers;
4323  bool coverageComputed; // true iff percentageCoverage has been computed
4324  mutable InstructionMap instruction_map; // cached instruction map
4325 
4327  // disassembly into instructions.
4328  double percentageCoverage;
4329 
4330 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4331  private:
4332  friend class boost::serialization::access;
4333 
4334  template<class S>
4335  void serialize(S &s, const unsigned /*version*/) {
4336  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4337  s & BOOST_SERIALIZATION_NVP(p_headers);
4338  s & BOOST_SERIALIZATION_NVP(p_global_block);
4339  s & BOOST_SERIALIZATION_NVP(p_map);
4340  s & BOOST_SERIALIZATION_NVP(p_registers);
4341  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4342  s & BOOST_SERIALIZATION_NVP(instruction_map);
4343  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4344  }
4345 #endif
4346 
4347  public:
4350  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4351  ctor();
4352  }
4353 
4358  SgAsmGenericFilePtrList get_files() const;
4359 
4386  InstructionMap& get_instruction_map(bool recompute=false);
4387  void set_instruction_map(const InstructionMap&);
4394  void insert_instructions(InstructionMap&/*in,out*/);
4395 
4400  void erase_instructions(InstructionMap&/*in,out*/);
4401 
4407  void set_coverageComputed(bool x) { coverageComputed = x; }
4408  void set_percentageCoverage(double x) { percentageCoverage = x; }
4411  private:
4412  void ctor(); // finalize construction
4413 #endif // SgAsmInterpretation_OTHERS
4414 
4415 #ifdef DOCUMENTATION
4416  };
4417 #endif
4418 
4419 
4420 
4422 
4423  /*************************************************************************************************************************
4424  * ELF File Header
4425  *************************************************************************************************************************/
4426 
4428 
4429  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4430  IS_SERIALIZABLE(AsmElfFileHeader);
4431 
4432 #ifdef DOCUMENTATION
4433 
4442  public:
4443 #endif
4444 
4445 #ifdef DOCUMENTATION
4446 
4451  unsigned char get_e_ident_file_class() const;
4452  void set_e_ident_file_class(unsigned char);
4454 #else
4455  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4456  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4457 #endif
4458 
4459 #ifdef DOCUMENTATION
4460 
4465  unsigned char get_e_ident_data_encoding() const;
4466  void set_e_ident_data_encoding(unsigned char);
4468 #else
4469  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4470  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4471 #endif
4472 
4473 #ifdef DOCUMENTATION
4474 
4479  unsigned char get_e_ident_file_version() const;
4480  void set_e_ident_file_version(unsigned char*);
4482 #else
4483  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4484  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4485 #endif
4486 
4487 #ifdef DOCUMENTATION
4488 
4493  const SgUnsignedCharList& get_e_ident_padding() const;
4494  void set_e_ident_padding(const SgUnsignedCharList&);
4496 #else
4497  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4498  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4499 #endif
4500 
4501 #ifdef DOCUMENTATION
4502 
4507  unsigned long get_e_type() const;
4508  void set_e_type(unsigned long);
4510 #else
4511  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4512  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4513 #endif
4514 
4515 #ifdef DOCUMENTATION
4516 
4521  unsigned long get_e_machine() const;
4522  void set_e_machine(unsigned long);
4524 #else
4525  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4526  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4527 #endif
4528 
4529 #ifdef DOCUMENTATION
4530 
4535  unsigned long get_e_flags() const;
4536  void set_e_flags(unsigned long);
4538 #else
4539  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4540  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4541 #endif
4542 
4543 #ifdef DOCUMENTATION
4544 
4549  unsigned long get_e_ehsize() const;
4550  void set_e_ehsize(unsigned long);
4552 #else
4553  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4554  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4555 #endif
4556 
4557 #ifdef DOCUMENTATION
4558 
4563  unsigned long get_phextrasz() const;
4564  void set_phextrasz(unsigned long);
4566 #else
4567  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4568  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4569 #endif
4570 
4571 #ifdef DOCUMENTATION
4572 
4577  unsigned long get_e_phnum() const;
4578  void set_e_phnum(unsigned long);
4580 #else
4581  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
4582  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4583 #endif
4584 
4585 #ifdef DOCUMENTATION
4586 
4591  unsigned long get_shextrasz() const;
4592  void set_shextrasz(unsigned long);
4594 #else
4595  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
4596  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4597 #endif
4598 
4599 #ifdef DOCUMENTATION
4600 
4605  unsigned long get_e_shnum() const;
4606  void set_e_shnum(unsigned long);
4608 #else
4609  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
4610  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4611 #endif
4612 
4613 #ifdef DOCUMENTATION
4614 
4619  unsigned long get_e_shstrndx() const;
4620  void set_e_shstrndx(unsigned long);
4622 #else
4623  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
4624  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4625 #endif
4626 
4627 #ifdef DOCUMENTATION
4628 
4638 #else
4639  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
4640  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4641 #endif
4642 
4643 #ifdef DOCUMENTATION
4644 
4653 #else
4654  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
4655  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4656 #endif
4657 
4658  DECLARE_OTHERS(AsmElfFileHeader);
4659 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
4660 
4661 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4662  private:
4663  friend class boost::serialization::access;
4664 
4665  template<class S>
4666  void serialize(S &s, const unsigned /*version*/) {
4667  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
4668  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
4669  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
4670  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
4671  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
4672  s & BOOST_SERIALIZATION_NVP(p_e_type);
4673  s & BOOST_SERIALIZATION_NVP(p_e_machine);
4674  s & BOOST_SERIALIZATION_NVP(p_e_flags);
4675  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
4676  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
4677  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
4678  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
4679  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
4680  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
4681  s & BOOST_SERIALIZATION_NVP(p_section_table);
4682  s & BOOST_SERIALIZATION_NVP(p_segment_table);
4683  }
4684 #endif
4685 
4686  public:
4688  enum ObjectType {
4689  ET_NONE = 0
4690  ,ET_REL = 1
4691  ,ET_EXEC = 2
4692  ,ET_DYN = 3
4693  ,ET_CORE = 4
4695  ,ET_LOOS = 0xfe00
4696  ,ET_HIOS = 0xfeff
4697  ,ET_LOPROC = 0xff00
4698  ,ET_HIPROC = 0xffff
4699  };
4700 
4701  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
4702  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
4703  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
4704  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
4705  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
4706 #ifdef _MSC_VER
4707 # pragma pack (1)
4708 #endif
4709 
4716  unsigned char e_ident_magic[4];
4717  unsigned char e_ident_file_class;
4718  unsigned char e_ident_data_encoding;
4719  unsigned char e_ident_file_version;
4720  unsigned char e_ident_padding[9];
4721  uint16_t e_type;
4722  uint16_t e_machine;
4723  uint32_t e_version;
4724  uint32_t e_entry;
4725  uint32_t e_phoff;
4726  uint32_t e_shoff;
4727  uint32_t e_flags;
4728  uint16_t e_ehsize;
4729  uint16_t e_phentsize;
4730  uint16_t e_phnum;
4731  uint16_t e_shentsize;
4732  uint16_t e_shnum;
4733  uint16_t e_shstrndx;
4734  }
4735 #if !defined(SWIG) && !defined(_MSC_VER)
4736  __attribute__((packed))
4737 #endif
4738  ;
4739 
4741  unsigned char e_ident_magic[4];
4742  unsigned char e_ident_file_class;
4743  unsigned char e_ident_data_encoding;
4744  unsigned char e_ident_file_version;
4745  unsigned char e_ident_padding[9];
4746  uint16_t e_type;
4747  uint16_t e_machine;
4748  uint32_t e_version;
4749  uint64_t e_entry;
4750  uint64_t e_phoff;
4751  uint64_t e_shoff;
4752  uint32_t e_flags;
4753  uint16_t e_ehsize;
4754  uint16_t e_phentsize;
4755  uint16_t e_phnum;
4756  uint16_t e_shentsize;
4757  uint16_t e_shnum;
4758  uint16_t e_shstrndx;
4759  }
4760 #if !defined(SWIG) && !defined(_MSC_VER)
4761  __attribute__((packed))
4762 #endif
4763  ;
4764 
4765 #ifdef _MSC_VER
4766 # pragma pack ()
4767 #endif
4768 
4776  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
4777  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
4778  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
4779  ctor();
4780  }
4781 
4787  uint64_t max_page_size();
4788 
4791 
4794 
4800  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
4801 
4803  virtual bool reallocate() $ROSE_OVERRIDE;
4804 
4806  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4807 
4809  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4810 
4812  static bool is_ELF(SgAsmGenericFile*);
4813 
4815  SgAsmGenericSectionPtrList get_sectab_sections();
4816 
4818  SgAsmGenericSectionPtrList get_segtab_sections();
4819 
4820  // Overrides documented in base class
4821  virtual const char *format_name() const $ROSE_OVERRIDE;
4822 
4823  private:
4824  void ctor(); // called by constructors
4825  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
4826  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
4827 #endif // SgAsmElfFileHeader_OTHERS
4828 
4829 #ifdef DOCUMENTATION
4830  };
4831 #endif
4832 
4833 
4834 
4836 
4837  /*************************************************************************************************************************
4838  * ELF Section Tables
4839  *************************************************************************************************************************/
4840 
4842 
4843  DECLARE_LEAF_CLASS(AsmElfSectionTable);
4844  IS_SERIALIZABLE(AsmElfSectionTable);
4845 
4846 #ifdef DOCUMENTATION
4847 
4853  public:
4854 #endif
4855 
4856  DECLARE_OTHERS(AsmElfSectionTable);
4857 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
4858 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4859  private:
4860  friend class boost::serialization::access;
4861 
4862  template<class S>
4863  void serialize(S &s, const unsigned /*version*/) {
4864  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
4865  }
4866 #endif
4867 
4868  public:
4871  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
4872  ctor();
4873  }
4874 
4880  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
4881 
4893 
4897  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
4898 
4900  virtual bool reallocate() $ROSE_OVERRIDE;
4901 
4903  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4904 
4906  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4907 
4908  private:
4909  void ctor();
4910 #endif // SgAsmElfSectionTable_OTHERS
4911 
4912 #ifdef DOCUMENTATION
4913  };
4914 #endif
4915 
4916 
4918 
4919  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
4920  IS_SERIALIZABLE(AsmElfSectionTableEntry);
4921 
4922 #ifdef DOCUMENTATION
4923 
4925  public:
4926 #endif
4927 
4928 #ifdef DOCUMENTATION
4929 
4934  unsigned get_sh_name() const;
4935  void set_sh_name(unsigned);
4937 #else
4938  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
4939  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4940 #endif
4941 
4942 #ifdef DOCUMENTATION
4943 
4948  SectionType get_sh_type() const;
4949  void set_sh_type(SectionType);
4951 #else
4952  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
4953  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4954 #endif
4955 
4956 #ifdef DOCUMENTATION
4957 
4962  unsigned long get_sh_link() const;
4963  void set_sh_link(unsigned long);
4965 #else
4966  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
4967  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4968 #endif
4969 
4970 #ifdef DOCUMENTATION
4971 
4976  unsigned long get_sh_info() const;
4977  void set_sh_info(unsigned long);
4979 #else
4980  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
4981  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4982 #endif
4983 
4984 #ifdef DOCUMENTATION
4985 
4990  uint64_t get_sh_flags() const;
4991  void set_sh_flags(uint64_t);
4993 #else
4994  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
4995  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4996 #endif
4997 
4998 #ifdef DOCUMENTATION
4999 
5004  rose_addr_t get_sh_addr() const;
5005  void set_sh_addr(rose_addr_t);
5007 #else
5008  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
5009  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5010 #endif
5011 
5012 #ifdef DOCUMENTATION
5013 
5018  rose_addr_t get_sh_offset() const;
5019  void set_sh_offset(rose_addr_t);
5021 #else
5022  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
5023  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5024 #endif
5025 
5026 #ifdef DOCUMENTATION
5027 
5032  rose_addr_t get_sh_size() const;
5033  void set_sh_size(rose_addr_t);
5035 #else
5036  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
5037  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5038 #endif
5039 
5040 #ifdef DOCUMENTATION
5041 
5046  rose_addr_t get_sh_addralign() const;
5047  void set_sh_addralign(rose_addr_t);
5049 #else
5050  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
5051  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5052 #endif
5053 
5054 #ifdef DOCUMENTATION
5055 
5060  rose_addr_t get_sh_entsize() const;
5061  void set_sh_entsize(rose_addr_t);
5063 #else
5064  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
5065  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5066 #endif
5067 
5068 #ifdef DOCUMENTATION
5069 
5074  const SgUnsignedCharList& get_extra() const;
5075  void set_extra(const SgUnsignedCharLit&);
5077 #else
5078  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5079  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5080  NO_DELETE);
5081 #endif
5082 
5083  DECLARE_OTHERS(AsmElfSectionTableEntry);
5084 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5085 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5086  private:
5087  friend class boost::serialization::access;
5088 
5089  template<class S>
5090  void serialize(S &s, const unsigned /*version*/) {
5091  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5092  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5093  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5094  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5095  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5096  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5097  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5098  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5099  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5100  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5101  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5102  s & BOOST_SERIALIZATION_NVP(p_extra);
5103  }
5104 #endif
5105 
5106  public:
5109  SHT_NULL = 0,
5113  SHT_RELA = 4,
5114  SHT_HASH = 5,
5116  SHT_NOTE = 7,
5118  SHT_REL = 9,
5119  SHT_SHLIB = 10,
5120  SHT_DYNSYM = 11,
5122  SHT_LOOS = 0x60000000,
5123  SHT_GNU_verdef = 0x6ffffffd,
5124  SHT_GNU_verneed = 0x6ffffffe,
5125  SHT_GNU_versym = 0x6fffffff,
5126  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5127 
5128  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5129  SHT_HIPROC = 0x7fffffff,
5130  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5131  SHT_HIUSER = 0xffffffff
5132  };
5133 
5137  SHF_WRITE= (1 << 0),
5138  SHF_ALLOC= (1 << 1),
5139  SHF_EXECINSTR= (1 << 2),
5140  SHF_MERGE= (1 << 4),
5141  SHF_STRINGS= (1 << 5),
5142  SHF_INFO_LINK= (1 << 6),
5143  SHF_LINK_ORDER= (1 << 7),
5145  SHF_GROUP= (1 << 9),
5146  SHF_TLS= (1 << 10),
5147  SHF_MASKOS= 0x0ff00000,
5148  SHF_MASKPROC= 0xf0000000
5149  };
5150 
5157 #ifdef _MSC_VER
5158 # pragma pack (1)
5159 #endif
5161  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5162  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5163  uint32_t sh_flags; /* 0x08 Bit flags */
5164  uint32_t sh_addr; /* 0x0c Desired mapped address */
5165  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5166  uint32_t sh_size; /* 0x14 Section size in bytes */
5167  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5168  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5169  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5170  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5171  } /* 0x28 */
5172 #if !defined(SWIG) && !defined(_MSC_VER)
5173  __attribute__((packed))
5174 #endif
5175  ;
5176 
5178  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5179  uint32_t sh_type; /* 0x04 */
5180  uint64_t sh_flags; /* 0x08 */
5181  uint64_t sh_addr; /* 0x10 */
5182  uint64_t sh_offset; /* 0x18 */
5183  uint64_t sh_size; /* 0x20 */
5184  uint32_t sh_link; /* 0x28 */
5185  uint32_t sh_info; /* 0x2c */
5186  uint64_t sh_addralign; /* 0x30 */
5187  uint64_t sh_entsize; /* 0x38 */
5188  } /* 0x40 */
5189 #if !defined(SWIG) && !defined(_MSC_VER)
5190  __attribute__((packed))
5191 #endif
5192  ;
5193 #ifdef _MSC_VER
5194 # pragma pack ()
5195 #endif
5196 
5198  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5200 
5202  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5204 
5208  void *encode(ByteOrder::Endianness sex,
5210  void *encode(ByteOrder::Endianness sex,
5216 
5218  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5219 
5220  // Use Rose::stringify... function instead.
5221  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5222  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5223 
5224  private:
5225  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5226  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5227 #endif // SgAsmElfSectionTableEntry_OTHERS
5228 
5229 #ifdef DOCUMENTATION
5230  };
5231 #endif
5232 
5233 
5234 
5236 
5237  /*************************************************************************************************************************
5238  * ELF Segment Tables
5239  *************************************************************************************************************************/
5240 
5242 
5243  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5244  IS_SERIALIZABLE(AsmElfSegmentTable);
5245 
5246 #ifdef DOCUMENTATION
5247 
5254  public:
5255 #endif
5256 
5257  DECLARE_OTHERS(AsmElfSegmentTable);
5258 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5259 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5260  private:
5261  friend class boost::serialization::access;
5262 
5263  template<class S>
5264  void serialize(S &s, const unsigned /*version*/) {
5265  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5266  }
5267 #endif
5268 
5269  public:
5272  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5273  ctor();
5274  }
5275 
5280  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5281 
5296 
5300  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5301 
5303  virtual bool reallocate() $ROSE_OVERRIDE;
5304 
5306  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5307 
5309  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5310 
5311  private:
5312  void ctor();
5313 #endif // SgAsmElfSegmentTable_OTHERS
5314 
5315 #ifdef DOCUMENTATION
5316  };
5317 #endif
5318 
5320 
5321  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5322  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5323 
5324 #ifdef DOCUMENTATION
5326  public:
5327 #endif
5328 
5329 #ifdef DOCUMENTATION
5330 
5336  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5337  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5339 #else
5340  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5341  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5342  NO_DELETE);
5343 #endif
5344 
5345  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5346 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5347 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5348  private:
5349  friend class boost::serialization::access;
5350 
5351  template<class S>
5352  void serialize(S &s, const unsigned /*version*/) {
5353  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5354  }
5355 #endif
5356 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5357 
5358 #ifdef DOCUMENTATION
5359  };
5360 #endif
5361 
5362 
5364 
5365  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5366  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5367 
5368 #ifdef DOCUMENTATION
5369 
5371  public:
5372 #endif
5373 
5374 #ifdef DOCUMENTATION
5375 
5380  size_t get_index() const;
5381  void set_index(size_t);
5383 #else
5384  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5385  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5386 #endif
5387 
5388 #ifdef DOCUMENTATION
5389 
5392  SegmentType get_type() const;
5393  void set_type(SegmentType);
5395 #else
5396  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5397  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5398  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5399 #endif
5400 
5401 #ifdef DOCUMENTATION
5402 
5405  SegmentFlags get_flags() const;
5406  void set_flags(SegmentFlags);
5408 #else
5409  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5410  "= SgAsmElfSegmentTableEntry::PF_NONE",
5411  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5412 #endif
5413 
5414 #ifdef DOCUMENTATION
5415 
5420  rose_addr_t get_offset() const;
5421  void set_offset(rose_addr_t);
5423 #else
5424  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5425  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5426 #endif
5427 
5428 #ifdef DOCUMENTATION
5429 
5435  rose_addr_t get_vaddr() const;
5436  void set_vaddr(rose_addr_t);
5438 #else
5439  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5440  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5441 #endif
5442 
5443 #ifdef DOCUMENTATION
5444 
5449  rose_addr_t get_paddr() const;
5450  void set_paddr(rose_addr_t);
5452 #else
5453  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5454  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5455 #endif
5456 
5457 #ifdef DOCUMENTATION
5458 
5463  rose_addr_t get_filesz() const;
5464  void set_filesz(rose_addr_t);
5466 #else
5467  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5468  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5469 #endif
5470 
5471 #ifdef DOCUMENTATION
5472 
5477  rose_addr_t get_memsz() const;
5478  void set_memsz(rose_addr_t);
5480 #else
5481  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5482  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5483 #endif
5484 
5485 #ifdef DOCUMENTATION
5486 
5491  rose_addr_t get_align() const;
5492  void set_align(rose_addr_t);
5494 #else
5495  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5496  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5497 #endif
5498 
5499 #ifdef DOCUMENTATION
5500 
5505  const SgUnsignedCharList& get_extra() const;
5506  void set_extra(const SgUnsignedCharList&);
5508 #else
5509  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5510  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5511 #endif
5512 
5513  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5514 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
5515 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5516  private:
5517  friend class boost::serialization::access;
5518 
5519  template<class S>
5520  void serialize(S &s, const unsigned /*version*/) {
5521  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5522  s & BOOST_SERIALIZATION_NVP(p_index);
5523  s & BOOST_SERIALIZATION_NVP(p_type);
5524  s & BOOST_SERIALIZATION_NVP(p_flags);
5525  s & BOOST_SERIALIZATION_NVP(p_offset);
5526  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5527  s & BOOST_SERIALIZATION_NVP(p_paddr);
5528  s & BOOST_SERIALIZATION_NVP(p_filesz);
5529  s & BOOST_SERIALIZATION_NVP(p_memsz);
5530  s & BOOST_SERIALIZATION_NVP(p_align);
5531  s & BOOST_SERIALIZATION_NVP(p_extra);
5532  }
5533 #endif
5534 
5535  public:
5538  PT_NULL = 0,
5539  PT_LOAD = 1,
5542  PT_NOTE = 4,
5543  PT_SHLIB = 5,
5544  PT_PHDR = 6,
5545  PT_TLS = 7,
5547  // OS- and Processor-specific ranges
5548  PT_LOOS = 0x60000000,
5549  PT_HIOS = 0x6fffffff,
5550  PT_LOPROC = 0x70000000,
5551  PT_HIPROC = 0x7fffffff,
5552 
5553  // OS-specific values for GNU/Linux
5554  PT_GNU_EH_FRAME = 0x6474e550,
5555  PT_GNU_STACK = 0x6474e551,
5556  PT_GNU_RELRO = 0x6474e552,
5557  PT_PAX_FLAGS = 0x65041580,
5559  // OS-specific values for Sun
5560  PT_SUNWBSS = 0x6ffffffa,
5561  PT_SUNWSTACK = 0x6ffffffb
5562  };
5563 
5566  PF_NONE = 0,
5567  PF_RESERVED = 0x000ffff8,
5568  PF_XPERM = 0x00000001,
5569  PF_WPERM = 0x00000002,
5570  PF_RPERM = 0x00000004,
5571  PF_OS_MASK = 0x0ff00000,
5572  PF_PROC_MASK = 0xf0000000
5573  };
5574 
5575 #ifdef _MSC_VER
5576 # pragma pack (1)
5577 #endif
5578 
5586  uint32_t p_type;
5587  uint32_t p_offset;
5588  uint32_t p_vaddr;
5589  uint32_t p_paddr;
5590  uint32_t p_filesz;
5591  uint32_t p_memsz;
5592  uint32_t p_flags;
5593  uint32_t p_align;
5594  } /* 0x30 */
5595 #if !defined(SWIG) && !defined(_MSC_VER)
5596  __attribute__((packed))
5597 #endif
5598  ;
5599 
5601  uint32_t p_type; /* 0x00 */
5602  uint32_t p_flags; /* 0x04 */
5603  uint64_t p_offset; /* 0x08 */
5604  uint64_t p_vaddr; /* 0x10 */
5605  uint64_t p_paddr; /* 0x18 */
5606  uint64_t p_filesz; /* 0x20 */
5607  uint64_t p_memsz; /* 0x28 */
5608  uint64_t p_align; /* 0x30 */
5609  } /* 0x38 */
5610 #if !defined(SWIG) && !defined(_MSC_VER)
5611  __attribute__((packed))
5612 #endif
5613  ;
5614 #ifdef _MSC_VER
5615 # pragma pack ()
5616 #endif
5617 
5619  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5621 
5623  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5625 
5629  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
5630  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
5635 
5637  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5638 
5641 
5644 
5645  private:
5646  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
5647  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
5648 #endif // SgAsmElfSegmentTableEntry_OTHERS
5649 
5650 #ifdef DOCUMENTATION
5651  };
5652 #endif
5653 
5654 
5655 
5657 
5658  /*************************************************************************************************************************
5659  * ELF Symbol Tables
5660  *************************************************************************************************************************/
5661 
5663 
5664  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
5665  IS_SERIALIZABLE(AsmElfSymbolSection);
5666 
5667 #ifdef DOCUMENTATION
5668 
5670  public:
5671 #endif
5672 
5673 #ifdef DOCUMENTATION
5674 
5677  bool get_is_dynamic() const;
5678  void set_is_dynamic(bool);
5680 #else
5681  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
5682  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5683 #endif
5684 
5685 #ifdef DOCUMENTATION
5686 
5695 #else
5696  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
5697  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5698 #endif
5699 
5700  DECLARE_OTHERS(AsmElfSymbolSection);
5701 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
5702 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5703  private:
5704  friend class boost::serialization::access;
5705 
5706  template<class S>
5707  void serialize(S &s, const unsigned /*version*/) {
5708  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5709  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
5710  s & BOOST_SERIALIZATION_NVP(p_symbols);
5711  }
5712 #endif
5713 
5714  public:
5717  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
5718  ctor(strsec);
5719  }
5720 
5722  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
5723 
5736  virtual void finish_parsing() $ROSE_OVERRIDE;
5737 
5739  size_t index_of(SgAsmElfSymbol*);
5740 
5745  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5746 
5750  virtual bool reallocate() $ROSE_OVERRIDE;
5751 
5753  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5754 
5756  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5757 
5758  private:
5759  void ctor(SgAsmElfStringSection*);
5760 #endif // SgAsmElfSymbolSection_OTHERS
5761 
5762 #ifdef DOCUMENTATION
5763  };
5764 #endif
5765 
5767 
5768  DECLARE_LEAF_CLASS(AsmElfSymbolList);
5769  IS_SERIALIZABLE(AsmElfSymbolList);
5770 
5771 #ifdef DOCUMENTATION
5773  public:
5774 #endif
5775 
5776 #ifdef DOCUMENTATION
5777 
5783  const SgAsmElfSymbolPtrList& get_symbols() const;
5784  void set_symbols(const SgAsmElfSymbolPtrList&);
5786 #else
5787  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
5788  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5789 #endif
5790 
5791  DECLARE_OTHERS(AsmElfSymbolList);
5792 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
5793 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5794  private:
5795  friend class boost::serialization::access;
5796 
5797  template<class S>
5798  void serialize(S &s, const unsigned /*version*/) {
5799  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5800  s & BOOST_SERIALIZATION_NVP(p_symbols);
5801  }
5802 #endif
5803 #endif // SgAsmElfSymbolList_OTHERS
5804 
5805 #ifdef DOCUMENTATION
5806  };
5807 #endif
5808 
5810 
5811  DECLARE_LEAF_CLASS(AsmElfSymbol);
5812  IS_SERIALIZABLE(AsmElfSymbol);
5813 
5814 #ifdef DOCUMENTATION
5815 
5820  public:
5821 #endif
5822 
5823 #ifdef DOCUMENTATION
5824 
5829  unsigned char get_st_info() const;
5830  void set_st_info(unsigned char);
5832 #else
5833  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
5834  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5835 #endif
5836 
5837 #ifdef DOCUMENTATION
5838 
5843  unsigned char get_st_res1() const;
5844  void set_st_res1(unsigned char);
5846 #else
5847  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
5848  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5849 #endif
5850 
5851 #ifdef DOCUMENTATION
5852 
5857  unsigned get_st_shndx() const;
5858  void set_st_shndx(unsigned);
5860 #else
5861  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
5862  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5863 #endif
5864 
5865 #ifdef DOCUMENTATION
5866 
5871  rose_addr_t get_st_size() const;
5872  void set_st_size(rose_addr_t);
5874 #else
5875  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
5876  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5877 #endif
5878 
5879 #ifdef DOCUMENTATION
5880 
5885  const SgUnsignedCharList& get_extra() const;
5886  void set_extra(const SgUnsignedCharList&);
5888 #else
5889  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
5890  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5891 #endif
5892 
5893  DECLARE_OTHERS(AsmElfSymbol);
5894 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
5895 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5896  private:
5897  friend class boost::serialization::access;
5898 
5899  template<class S>
5900  void serialize(S &s, const unsigned /*version*/) {
5901  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
5902  s & BOOST_SERIALIZATION_NVP(p_st_info);
5903  s & BOOST_SERIALIZATION_NVP(p_st_res1);
5904  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
5905  s & BOOST_SERIALIZATION_NVP(p_st_size);
5906  s & BOOST_SERIALIZATION_NVP(p_extra);
5907  }
5908 #endif
5909 
5910  public:
5911  enum ElfSymBinding {
5912  STB_LOCAL=0,
5913  STB_GLOBAL=1,
5914  STB_WEAK=2
5915  };
5916 
5917  enum ElfSymType {
5920  STT_FUNC = 2,
5922  STT_FILE = 4,
5924  STT_TLS = 6,
5926  };
5927 
5928 #ifdef _MSC_VER
5929 # pragma pack (1)
5930 #endif
5931 
5934  uint32_t st_name;
5935  uint32_t st_value;
5936  uint32_t st_size;
5937  unsigned char st_info;
5938  unsigned char st_res1;
5939  uint16_t st_shndx;
5940  }
5941 #if !defined(SWIG) && !defined(_MSC_VER)
5942  __attribute__((packed))
5943 #endif
5944  ;
5945 
5947  uint32_t st_name;
5948  unsigned char st_info;
5949  unsigned char st_res1;
5950  uint16_t st_shndx;
5951  uint64_t st_value;
5952  uint64_t st_size;
5953  }
5954 #if !defined(SWIG) && !defined(_MSC_VER)
5955  __attribute__((packed))
5956 #endif
5957  ;
5958 
5959 #ifdef _MSC_VER
5960 # pragma pack ()
5961 #endif
5962 
5964  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
5965 
5969  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
5970 
5974  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
5975 
5979  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
5980  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
5988  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5989  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
5993  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
5994 
5997 
5999  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
6000 
6002  static std::string to_string(SgAsmElfSymbol::ElfSymType);
6003 
6004  private:
6005  void ctor(SgAsmElfSymbolSection*);
6006  void parse_common(); // initialization common to all parse() methods
6007 #endif // SgAsmElfSymbol_OTHERS
6008 
6009 #ifdef DOCUMENTATION
6010  };
6011 #endif
6012 
6013 
6014 
6016 
6017  /*************************************************************************************************************************
6018  * ELF Symbol Version Tables
6019  *************************************************************************************************************************/
6020 
6022 
6023  DECLARE_LEAF_CLASS(AsmElfSymverSection);
6024  IS_SERIALIZABLE(AsmElfSymverSection);
6025 
6026 #ifdef DOCUMENTATION
6027 
6032  public:
6033 #endif
6034 
6035 #ifdef DOCUMENTATION
6036 
6045 #else
6046  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
6047  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6048 #endif
6049 
6050  DECLARE_OTHERS(AsmElfSymverSection);
6051 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
6052 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6053  private:
6054  friend class boost::serialization::access;
6055 
6056  template<class S>
6057  void serialize(S &s, const unsigned /*version*/) {
6058  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6059  s & BOOST_SERIALIZATION_NVP(p_entries);
6060  }
6061 #endif
6062 
6063  public:
6066  : SgAsmElfSection(fhdr) {
6067  ctor();
6068  }
6069 
6071  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
6072 
6077  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6078 
6080  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6081 
6083  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6084  private:
6085  void ctor();
6086 #endif // SgAsmElfSymverSection_OTHERS
6087 
6088 #ifdef DOCUMENTATION
6089  };
6090 #endif
6091 
6093 
6094  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6095  IS_SERIALIZABLE(AsmElfSymverEntry);
6096 
6097 #ifdef DOCUMENTATION
6098 
6100  public:
6101 #endif
6102 
6103 #ifdef DOCUMENTATION
6104 
6109  size_t get_value() const;
6110  void set_value(size_t);
6112 #else
6113  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6114  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6115 #endif
6116 
6117  DECLARE_OTHERS(AsmElfSymverEntry);
6118 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6119 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6120  private:
6121  friend class boost::serialization::access;
6122 
6123  template<class S>
6124  void serialize(S &s, const unsigned /*version*/) {
6125  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6126  s & BOOST_SERIALIZATION_NVP(p_value);
6127  }
6128 #endif
6129 
6130  public:
6133  : p_value(0) {
6134  ctor(symver);
6135  }
6136 
6138  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6139 
6140  private:
6141  void ctor(SgAsmElfSymverSection*);
6142 #endif // SgAsmElfSymverEntry_OTHERS
6143 
6144 #ifdef DOCUMENTATION
6145  };
6146 #endif
6147 
6149 
6150 
6151  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6152  IS_SERIALIZABLE(AsmElfSymverEntryList);
6153 
6154 #ifdef DOCUMENTATION
6155 
6160  public:
6161 #endif
6162 
6163 #ifdef DOCUMENTATION
6164 
6167  const SgAsmElfSymverEntryPtrList& get_entries() const;
6168  void set_entries(const SgAsmElfSymverEntryPtrList&);
6170 #else
6171  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6172  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6173  NO_DELETE);
6174 #endif
6175 
6176  DECLARE_OTHERS(AsmElfSymverEntryList);
6177 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6178 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6179  private:
6180  friend class boost::serialization::access;
6181 
6182  template<class S>
6183  void serialize(S &s, const unsigned /*version*/) {
6184  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6185  s & BOOST_SERIALIZATION_NVP(p_entries);
6186  }
6187 #endif
6188 #endif // SgAsmElfSymverEntryList_OTHERS
6189 
6190 #ifdef DOCUMENTATION
6191  };
6192 #endif
6193 
6195 
6196  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6197  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6198 
6199 #ifdef DOCUMENTATION
6200 
6206  public:
6207 #endif
6208 
6209 #ifdef DOCUMENTATION
6210 
6219 #else
6220  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6221  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6222  NO_DELETE);
6223 #endif
6224 
6225  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6226 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6227 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6228  private:
6229  friend class boost::serialization::access;
6230 
6231  template<class S>
6232  void serialize(S &s, const unsigned /*version*/) {
6233  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6234  s & BOOST_SERIALIZATION_NVP(p_entries);
6235  }
6236 #endif
6237 
6238  public:
6241  : SgAsmElfSection(fhdr) {
6242  ctor(strsec);
6243  }
6244 
6313  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6314 
6317  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6318 
6322  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6323 
6325  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6326 
6327  private:
6328  void ctor(SgAsmElfStringSection*);
6329 #endif // SgAsmElfSymverDefinedSection_OTHERS
6330 
6331 #ifdef DOCUMENTATION
6332  };
6333 #endif
6334 
6336 
6337  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6338  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6339 
6340 #ifdef DOCUMENTATION
6341 
6346  public:
6347 #endif
6348 
6349 #ifdef DOCUMENTATION
6350 
6353  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6354  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6356 #else
6357  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6358  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6359  NO_DELETE);
6360 #endif
6361 
6362  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6363 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6364 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6365  private:
6366  friend class boost::serialization::access;
6367 
6368  template<class S>
6369  void serialize(S &s, const unsigned /*version*/) {
6370  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6371  s & BOOST_SERIALIZATION_NVP(p_entries);
6372  }
6373 #endif
6374 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6375 
6376 #ifdef DOCUMENTATION
6377  };
6378 #endif
6379 
6381 
6382  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6383  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6384 
6385 #ifdef DOCUMENTATION
6386 
6388  public:
6389 #endif
6390 
6391 #ifdef DOCUMENTATION
6392 
6397  size_t get_version() const;
6398  void set_version(size_t);
6400 #else
6401  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6402  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6403 #endif
6404 
6405 #ifdef DOCUMENTATION
6406 
6411  int get_flags() const;
6412  void set_flags(int);
6414 #else
6415  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6416  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6417 #endif
6418 
6419 #ifdef DOCUMENTATION
6420 
6425  size_t get_index() const;
6426  void set_index(size_t);
6428 #else
6429  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6430  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6431 #endif
6432 
6433 #ifdef DOCUMENTATION
6434 
6439  uint32_t get_hash() const;
6440  void set_hash(uint32_t);
6442 #else
6443  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6444  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6445 #endif
6446 
6447 #ifdef DOCUMENTATION
6448 
6457 #else
6458  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6459  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6460 #endif
6461 
6462  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6463 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6464 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6465  private:
6466  friend class boost::serialization::access;
6467 
6468  template<class S>
6469  void serialize(S &s, const unsigned /*version*/) {
6470  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6471  s & BOOST_SERIALIZATION_NVP(p_version);
6472  s & BOOST_SERIALIZATION_NVP(p_flags);
6473  s & BOOST_SERIALIZATION_NVP(p_index);
6474  s & BOOST_SERIALIZATION_NVP(p_hash);
6475  s & BOOST_SERIALIZATION_NVP(p_entries);
6476  }
6477 #endif
6478 
6479  public:
6480 #ifdef _MSC_VER
6481 # pragma pack (1)
6482 #endif
6483 
6485  uint16_t vd_version;
6486  uint16_t vd_flags;
6487  uint16_t vd_ndx;
6488  uint16_t vd_cnt;
6489  uint32_t vd_hash;
6490  uint32_t vd_aux;
6491  uint32_t vd_next;
6492  }
6493 #if !defined(SWIG) && !defined(_MSC_VER)
6494  __attribute__((packed))
6495 #endif
6496  ;
6497 
6498 #ifdef _MSC_VER
6499 # pragma pack ()
6500 #endif
6501 
6504  ctor(symver_defined);
6505  }
6506 
6508  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6509 
6511  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6512 
6514  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6515 
6516  private:
6517  void ctor(SgAsmElfSymverDefinedSection*);
6518 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6519 
6520 #ifdef DOCUMENTATION
6521  };
6522 #endif
6523 
6525 
6526  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6527  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6528 
6529 #ifdef DOCUMENTATION
6530 
6535  pbulic:
6536 #endif
6537 
6538 #ifdef DOCUMENTATION
6539 
6542  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6543  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6545 #else
6546  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6547  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6548  NO_DELETE);
6549 #endif
6550 
6551  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6552 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6553 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6554  private:
6555  friend class boost::serialization::access;
6556 
6557  template<class S>
6558  void serialize(S &s, const unsigned /*version*/) {
6559  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6560  s & BOOST_SERIALIZATION_NVP(p_entries);
6561  }
6562 #endif
6563 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6564 
6565 #ifdef DOCUMENTATION
6566  };
6567 #endif
6568 
6570 
6571  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
6572  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
6573 
6574 #ifdef DOCUMENTATION
6576  public:
6577 #endif
6578 
6579 #ifdef DOCUMENTATION
6580 
6583  SgAsmGenericString* get_name() const;
6586 #else
6587  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6588  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6589 #endif
6590 
6591  DECLARE_OTHERS(AsmElfSymverDefinedAux);
6592 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
6593 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6594  private:
6595  friend class boost::serialization::access;
6596 
6597  template<class S>
6598  void serialize(S &s, const unsigned /*version*/) {
6599  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6600  s & BOOST_SERIALIZATION_NVP(p_name);
6601  }
6602 #endif
6603 
6604  public:
6605 #ifdef _MSC_VER
6606 # pragma pack (1)
6607 #endif
6608 
6611  uint32_t vda_name;
6612  uint32_t vda_next;
6613  }
6614 #if !defined(SWIG) && !defined(_MSC_VER)
6615  __attribute__((packed))
6616 #endif
6617  ;
6618 
6619 #ifdef _MSC_VER
6620 # pragma pack ()
6621 #endif
6622 
6627  SgAsmElfSymverDefinedSection *symver_def_sec)
6628  : p_name(NULL) {
6629  ctor(symver_def_entry,symver_def_sec);
6630  }
6631 
6633  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
6634 
6636  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
6637 
6643  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6644 
6645  private:
6646  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
6647 #endif // SgAsmElfSymverDefinedAux_OTHERS
6648 
6649 #ifdef DOCUMENTATION
6650  };
6651 #endif
6652 
6654 
6655  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
6656  IS_SERIALIZABLE(AsmElfSymverNeededSection);
6657 
6658 #ifdef DOCUMENTATION
6659 
6665  public:
6666 #endif
6667 
6668 #ifdef DOCUMENTATION
6669 
6678 #else
6679  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
6680  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6681 #endif
6682 
6683  DECLARE_OTHERS(AsmElfSymverNeededSection);
6684 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
6685 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6686  private:
6687  friend class boost::serialization::access;
6688 
6689  template<class S>
6690  void serialize(S &s, const unsigned /*version*/) {
6691  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6692  s & BOOST_SERIALIZATION_NVP(p_entries);
6693  }
6694 #endif
6695 
6696  public:
6701  : SgAsmElfSection(fhdr) {
6702  ctor(strsec);
6703  }
6704 
6714  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
6715 
6720  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6721 
6725  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6726 
6728  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6729 
6730  private:
6731  void ctor(SgAsmElfStringSection*);
6732 #endif // SgAsmElfSymverNeededSection_OTHERS
6733 
6734 #ifdef DOCUMENTATION
6735  };
6736 #endif
6737 
6739 
6740  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
6741  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
6742 
6743 #ifdef DOCUMENTATION
6744 
6749  public:
6750 #endif
6751 
6752 #ifdef DOCUMENTATION
6753 
6756  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
6757  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
6759 #else
6760  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
6761  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6762  NO_DELETE);
6763 #endif
6764 
6765  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
6766 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
6767 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6768  private:
6769  friend class boost::serialization::access;
6770 
6771  template<class S>
6772  void serialize(S &s, const unsigned /*version*/) {
6773  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6774  s & BOOST_SERIALIZATION_NVP(p_entries);
6775  }
6776 #endif
6777 #endif // SgAsmElfSymverNeededEntryList_OTHERS
6778 
6779 #ifdef DOCUMENTATION
6780  };
6781 #endif
6782 
6784 
6785  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
6786  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
6787 
6788 #ifdef DOCUMENTATION
6789 
6791  public:
6792 #endif
6793 
6794 #ifdef DOCUMENTATION
6795 
6800  size_t get_version() const;
6801  void set_version(size_t);
6803 #else
6804  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
6805  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6806 #endif
6807 
6808 #ifdef DOCUMENTATION
6809 
6815 #else
6816  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
6817  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6818 #endif
6819 
6820 #ifdef DOCUMENTATION
6821 
6830 #else
6831  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
6832  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6833 #endif
6834 
6835  DECLARE_OTHERS(AsmElfSymverNeededEntry);
6836 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
6837 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6838  private:
6839  friend class boost::serialization::access;
6840 
6841  template<class S>
6842  void serialize(S &s, const unsigned /*version*/) {
6843  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6844  s & BOOST_SERIALIZATION_NVP(p_version);
6845  s & BOOST_SERIALIZATION_NVP(p_file_name);
6846  s & BOOST_SERIALIZATION_NVP(p_entries);
6847  }
6848 #endif
6849 
6850  public:
6851 #ifdef _MSC_VER
6852 # pragma pack (1)
6853 #endif
6854 
6857  uint16_t vn_version;
6858  uint16_t vn_cnt;
6859  uint32_t vn_file;
6860  uint32_t vn_aux;
6861  uint32_t vn_next;
6862  }
6863 #if !defined(SWIG) && !defined(_MSC_VER)
6864  __attribute__((packed))
6865 #endif
6866  ;
6867 
6868 #ifdef _MSC_VER
6869 # pragma pack ()
6870 #endif
6871 
6874  : p_file_name(NULL) {
6875  ctor(symver_needed);
6876  }
6877 
6879  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
6880 
6882  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
6883 
6885  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6886 
6887  private:
6888  void ctor(SgAsmElfSymverNeededSection*);
6889 #endif // SgAsmElfSymverNeededEntry_OTHERS
6890 
6891 #ifdef DOCUMENTATION
6892  };
6893 #endif
6894 
6896 
6897  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
6898  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
6899 
6900 #ifdef DOCUMENTATION
6901 
6906  public:
6907 #endif
6908 
6909 #ifdef DOCUMENTATION
6910 
6913  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
6914  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
6916 #else
6917  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
6918  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6919  NO_DELETE);
6920 #endif
6921 
6922  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
6923 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
6924 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6925  private:
6926  friend class boost::serialization::access;
6927 
6928  template<class S>
6929  void serialize(S &s, const unsigned /*version*/) {
6930  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6931  s & BOOST_SERIALIZATION_NVP(p_entries);
6932  }
6933 #endif
6934 #endif // SgAsmElfSymverNeededAuxList_OTHERS
6935 
6936 #ifdef DOCUMENTATION
6937  };
6938 #endif
6939 
6941 
6942  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
6943  IS_SERIALIZABLE(AsmElfSymverNeededAux);
6944 
6945 #ifdef DOCUMENTATION
6946 
6948  public:
6949 #endif
6950 
6951 #ifdef DOCUMENTATION
6952 
6957  uint32_t get_hash() const;
6958  void set_hash(uint32_t);
6960 #else
6961  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
6962  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6963 #endif
6964 
6965 #ifdef DOCUMENTATION
6966 
6971  int get_flags() const;
6972  void set_flags(int);
6974 #else
6975  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
6976  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6977 #endif
6978 
6979 #ifdef DOCUMENTATION
6980 
6985  size_t get_other() const;
6986  void set_other(size_t);
6988 #else
6989  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
6990  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6991 #endif
6992 
6993 #ifdef DOCUMENTATION
6994 
6997  SgAsmGenericString* get_name() const;
7000 #else
7001  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7002  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7003 #endif
7004 
7005  DECLARE_OTHERS(AsmElfSymverNeededAux);
7006 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
7007 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7008  private:
7009  friend class boost::serialization::access;
7010 
7011  template<class S>
7012  void serialize(S &s, const unsigned /*version*/) {
7013  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7014  s & BOOST_SERIALIZATION_NVP(p_hash);
7015  s & BOOST_SERIALIZATION_NVP(p_flags);
7016  s & BOOST_SERIALIZATION_NVP(p_other);
7017  s & BOOST_SERIALIZATION_NVP(p_name);
7018  }
7019 #endif
7020 
7021  public:
7022 #ifdef _MSC_VER
7023 # pragma pack (1)
7024 #endif
7025 
7028  uint32_t vna_hash;
7029  uint16_t vna_flags;
7030  uint16_t vna_other;
7031  uint32_t vna_name;
7032  uint32_t vna_next;
7033  }
7034 #if !defined(SWIG) && !defined(_MSC_VER)
7035  __attribute__((packed))
7036 #endif
7037  ;
7038 
7039 #ifdef _MSC_VER
7040 # pragma pack ()
7041 #endif
7042 
7048  : p_name(NULL) {
7049  ctor(symver_needed_entry,symver_needed_sec);
7050  }
7051 
7053  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
7054 
7056  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
7057 
7063  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7064 
7065  private:
7067 #endif // SgAsmElfSymverNeededAux_OTHERS
7068 
7069 #ifdef DOCUMENTATION
7070  };
7071 #endif
7072 
7073 
7074 
7075 
7077 
7078  /*************************************************************************************************************************
7079  * ELF Relocation Tables
7080  *************************************************************************************************************************/
7081 
7083 
7084  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7085  IS_SERIALIZABLE(AsmElfRelocSection);
7086 
7087 #ifdef DOCUMENTATION
7088 
7090  public:
7091 #endif
7092 
7093 #ifdef DOCUMENTATION
7094 
7097  bool get_uses_addend() const;
7098  void set_uses_addend(bool);
7100 #else
7101  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7102  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7103 #endif
7104 
7105 #ifdef DOCUMENTATION
7106 
7112 #else
7113  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7114  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7115 #endif
7116 
7117 #ifdef DOCUMENTATION
7118 
7126 #else
7127  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7128  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7129 #endif
7130 
7131  DECLARE_OTHERS(AsmElfRelocSection);
7132 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7133 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7134  private:
7135  friend class boost::serialization::access;
7136 
7137  template<class S>
7138  void serialize(S &s, const unsigned /*version*/) {
7139  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7140  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7141  s & BOOST_SERIALIZATION_NVP(p_target_section);
7142  s & BOOST_SERIALIZATION_NVP(p_entries);
7143  }
7144 #endif
7145 
7146  public:
7148  : SgAsmElfSection(fhdr) {
7149  ctor(symsec,targetsec);
7150  }
7151 
7154  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7155 
7157  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7158 
7160  virtual bool reallocate() $ROSE_OVERRIDE;
7161 
7163  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7164 
7166  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7167 
7168  private:
7170 #endif // SgAsmElfRelocSection_OTHERS
7171 
7172 #ifdef DOCUMENTATION
7173  };
7174 #endif
7175 
7177 
7178  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7179  IS_SERIALIZABLE(AsmElfRelocEntryList);
7180 
7181 #ifdef DOCUMENTATION
7182 
7187  public:
7188 #endif
7189 
7190 #ifdef DOCUMENTATION
7191 
7194  const SgAsmElfRelocEntryPtrList& get_entries() const;
7195  void set_entries(const SgAsmElfRelocEntryPtrList&);
7197 #else
7198  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7199  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7200  NO_DELETE);
7201 #endif
7202 
7203  DECLARE_OTHERS(AsmElfRelocEntryList);
7204 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7205 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7206  private:
7207  friend class boost::serialization::access;
7208 
7209  template<class S>
7210  void serialize(S &s, const unsigned /*version*/) {
7211  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7212  s & BOOST_SERIALIZATION_NVP(p_entries);
7213  }
7214 #endif
7215 #endif // SgAsmElfRelocEntryList_OTHERS
7216 
7217 #ifdef DOCUMENTATION
7218  };
7219 #endif
7220 
7222 
7223  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7224  IS_SERIALIZABLE(AsmElfRelocEntry);
7225 
7226 #ifdef DOCUMENTATION
7227 
7229  public:
7230 #endif
7231 
7232 #ifdef DOCUMENTATION
7233 
7238  rose_addr_t get_r_offset() const;
7239  void set_r_offset(rose_addr_t);
7241 #else
7242  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7243  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7244 #endif
7245 
7246 #ifdef DOCUMENTATION
7247 
7252  rose_addr_t get_r_addend() const;
7253  void set_r_addend(rose_addr_t);
7255 #else
7256  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7257  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7258 #endif
7259 
7260 #ifdef DOCUMENTATION
7261 
7266  unsigned long get_sym() const;
7267  void set_sym(unsigned long);
7269 #else
7270  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7271  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7272 #endif
7273 
7274 #ifdef DOCUMENTATION
7275 
7280  RelocType get_type() const;
7281  void set_type(RelocType);
7283 #else
7284  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7285  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7286 #endif
7287 
7288 #ifdef DOCUMENTATION
7289 
7292  const SgUnsignedCharList& get_extra() const;
7293  void set_extra(const SgUnsignedCharList&);
7295 #else
7296  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7297  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7298 #endif
7299 
7300  DECLARE_OTHERS(AsmElfRelocEntry);
7301 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7302 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7303  private:
7304  friend class boost::serialization::access;
7305 
7306  template<class S>
7307  void serialize(S &s, const unsigned /*version*/) {
7308  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7309  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7310  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7311  s & BOOST_SERIALIZATION_NVP(p_sym);
7312  s & BOOST_SERIALIZATION_NVP(p_type);
7313  s & BOOST_SERIALIZATION_NVP(p_extra);
7314  }
7315 #endif
7316 
7317  public:
7320  // Intel 80386 specific definitions.
7332  R_386_32PLT =11,
7339  R_386_16 =20,
7340  R_386_PC16 =21,
7341  R_386_8 =22,
7342  R_386_PC8 =23,
7358  // First Entry for X86-64
7373  R_X86_64_8 =114,
7383  };
7384 
7385 #ifdef _MSC_VER
7386 # pragma pack (1)
7387 #endif
7388 
7390  uint32_t r_offset;
7391  uint32_t r_info;
7392  uint32_t r_addend;
7393  }
7394 #if !defined(SWIG) && !defined(_MSC_VER)
7395  __attribute__((packed))
7396 #endif
7397  ;
7398 
7400  uint64_t r_offset;
7401  uint64_t r_info;
7402  uint64_t r_addend;
7403  }
7404 #if !defined(SWIG) && !defined(_MSC_VER)
7405  __attribute__((packed))
7406 #endif
7407  ;
7408 
7410  uint32_t r_offset;
7411  uint32_t r_info;
7412  }
7413 #if !defined(SWIG) && !defined(_MSC_VER)
7414  __attribute__((packed))
7415 #endif
7416  ;
7417 
7419  uint64_t r_offset;
7420  uint64_t r_info;
7421  }
7422 #if !defined(SWIG) && !defined(_MSC_VER)
7423  __attribute__((packed))
7424 #endif
7425  ;
7426 
7427 #ifdef _MSC_VER
7428 # pragma pack ()
7429 #endif
7430 
7433  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7434  ctor(section);
7435  }
7436 
7440  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7441  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7442  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7443  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7449  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7450  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7451  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7452  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7458  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7459  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7460  dump(f, prefix, idx, NULL);
7461  }
7465  std::string reloc_name() const;
7466 
7467  private:
7468  void ctor(SgAsmElfRelocSection*);
7469 #endif // SgAsmElfRelocEntry_OTHERS
7470 
7471 #ifdef DOCUMENTATION
7472  };
7473 #endif
7474 
7475 
7476 
7478 
7479  /*************************************************************************************************************************
7480  * ELF Dynamic Linking
7481  *************************************************************************************************************************/
7482 
7484 
7485  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7486  IS_SERIALIZABLE(AsmElfDynamicSection);
7487 
7488 #ifdef DOCUMENTATION
7489 
7491  public:
7492 #endif
7493 
7494 #ifdef DOCUMENTATION
7495 
7504 #else
7505  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7506  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7507 #endif
7508 
7509  DECLARE_OTHERS(AsmElfDynamicSection);
7510 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7511 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7512  private:
7513  friend class boost::serialization::access;
7514 
7515  template<class S>
7516  void serialize(S &s, const unsigned /*version*/) {
7517  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7518  s & BOOST_SERIALIZATION_NVP(p_entries);
7519  }
7520 #endif
7521 
7522  public:
7525  : SgAsmElfSection(fhdr) {
7526  ctor(strsec);
7527  }
7528 
7530  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7531 
7533  virtual void finish_parsing() $ROSE_OVERRIDE;
7534 
7537  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7538 
7540  virtual bool reallocate() $ROSE_OVERRIDE;
7541 
7543  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7544 
7546  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7547 
7548  private:
7549  void ctor(SgAsmElfStringSection*);
7550 #endif // SgAsmElfDynamicSection_OTHERS
7551 
7552 #ifdef DOCUMENTATION
7553  };
7554 #endif
7555 
7557 
7558  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7559  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7560 
7561 #ifdef DOCUMENTATION
7562 
7567  public:
7568 #endif
7569 
7570 #ifdef DOCUMENTATION
7571 
7574  const SgAsmElfDynamicEntryPtrList& get_entries() const;
7575  void set_entries(const SgAsmElfDynamicEntryPtrList&);
7577 #else
7578  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
7579  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
7580  NO_DELETE);
7581 #endif
7582 
7583  DECLARE_OTHERS(AsmElfDynamicEntryList);
7584 #if defined(SgAsmElfDynamicEntryList_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_entries);
7593  }
7594 #endif
7595 #endif // SgAsmElfDynamicEntryList_OTHERS
7596 
7597 #ifdef DOCUMENTATION
7598  };
7599 #endif
7600 
7602 
7603  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
7604  IS_SERIALIZABLE(AsmElfDynamicEntry);
7605 
7606 #ifdef DOCUMENTATION
7607 
7609  public:
7610 #endif
7611 
7612 #ifdef DOCUMENTATION
7613 
7618  EntryType get_d_tag() const;
7619  void set_d_tag(EntryType);
7621 #else
7622  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
7623  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7624 #endif
7625 
7626 #ifdef DOCUMENTATION
7627 
7632  rose_rva_t get_d_val() const;
7633  void set_d_val(rose_rva_t);
7635 #else
7636  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
7637  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7638 #endif
7639 
7640 #ifdef DOCUMENTATION
7641  // declared and documented below
7642 #else
7643  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
7644  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7645 #endif
7646 
7647 #ifdef DOCUMENTATION
7648 
7651  const SgUnsignedCharList& get_extra() const;
7652  void set_extra(const SgUnsignedCharList&);
7654 #else
7655  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7656  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7657 #endif
7658 
7659  DECLARE_OTHERS(AsmElfDynamicEntry);
7660 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
7661 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7662  private:
7663  friend class boost::serialization::access;
7664 
7665  template<class S>
7666  void serialize(S &s, const unsigned /*version*/) {
7667  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7668  s & BOOST_SERIALIZATION_NVP(p_d_tag);
7669  s & BOOST_SERIALIZATION_NVP(p_d_val);
7670  s & BOOST_SERIALIZATION_NVP(p_name);
7671  s & BOOST_SERIALIZATION_NVP(p_extra);
7672  }
7673 #endif
7674 
7675  public:
7676  enum EntryType { /* Type Executable SharedObj Purpose */
7677  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
7678  DT_NEEDED = 1, /* value optional optional Name of needed library */
7679  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
7680  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
7681  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
7682  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
7683  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
7684  DT_RELA = 7, /* pointer mandatory optional Relocation table */
7685  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
7686  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
7687  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
7688  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
7689  DT_INIT = 12, /* pointer optional optional Initialization function */
7690  DT_FINI = 13, /* pointer optional optional Termination function */
7691  DT_SONAME = 14, /* value ignored optional Name of shared object */
7692  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
7693  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
7694  DT_REL = 17, /* pointer mandatory optional Relocation table */
7695  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
7696  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
7697  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
7698  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
7699  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
7700  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
7701  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
7702  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
7703  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
7704  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
7705  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
7706  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
7707  DT_FLAGS = 30, /* value optional ? Bit flags */
7708  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
7709  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
7710  DT_NUM = 34, /* ? ? ? "number used"? */
7711 
7712  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
7713  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
7714  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
7715  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
7716  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
7717  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
7718  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
7719  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
7720  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
7721  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
7722  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
7723 
7724  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
7725  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
7726  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
7727  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
7728  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
7729  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
7730  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
7731  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
7732  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
7733  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
7734  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
7735 
7736  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
7737  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
7738  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
7739  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
7740  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
7741  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
7742  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
7743  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
7744 
7745  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
7746  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
7747  };
7748 
7749 #ifdef _MSC_VER
7750 # pragma pack (1)
7751 #endif
7752 
7755  uint32_t d_tag;
7756  uint32_t d_val;
7757  }
7758 #if !defined(SWIG) && !defined(_MSC_VER)
7759  __attribute__((packed))
7760 #endif
7761  ;
7762 
7764  uint64_t d_tag;
7765  uint64_t d_val;
7766  }
7767 #if !defined(SWIG) && !defined(_MSC_VER)
7768  __attribute__((packed))
7769 #endif
7770  ;
7771 
7772 #ifdef _MSC_VER
7773 # pragma pack ()
7774 #endif
7775 
7778  : p_d_tag(DT_NULL), p_name(NULL) {
7779  ctor(dynsec);
7780  }
7781 
7785  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);
7786  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*);
7792  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*) const;
7793  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*) const;
7797  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
7798 
7800  static std::string to_string(SgAsmElfDynamicEntry::EntryType);
7801 
7805  SgAsmGenericString* get_name() const { return p_name; }
7809  private:
7810  void ctor(SgAsmElfDynamicSection*);
7811 #endif // SgAsmElfDynamicEntry_OTHERS
7812 
7813 #ifdef DOCUMENTATION
7814  };
7815 #endif
7816 
7817 
7818 
7819 
7821 
7822  /*************************************************************************************************************************
7823  * ELF String Tables
7824  *************************************************************************************************************************/
7825 
7827 
7828  DECLARE_LEAF_CLASS(AsmElfStringSection);
7829  IS_SERIALIZABLE(AsmElfStringSection);
7830  AsmElfStringSection.setAutomaticGenerationOfDestructor(false);
7831 
7832 #ifdef DOCUMENTATION
7833 
7837  public:
7838 #endif
7839 
7840 #ifdef DOCUMENTATION
7841 
7846  SgAsmElfStrtab* get_strtab() const;
7847  void set_strtab(SgAsmElfStrtab*);
7849 #else
7850  AsmElfStringSection.setDataPrototype("SgAsmElfStrtab*", "strtab", "= NULL",
7851  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7852 #endif
7853 
7854  DECLARE_OTHERS(AsmElfStringSection);
7855 #if defined(SgAsmElfStringSection_OTHERS) || defined(DOCUMENTATION)
7856 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7857  private:
7858  friend class boost::serialization::access;
7859 
7860  template<class S>
7861  void serialize(S &s, const unsigned /*version*/) {
7862  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7863  s & BOOST_SERIALIZATION_NVP(p_strtab);
7864  }
7865 #endif
7866 
7867  public:
7870  : SgAsmElfSection(fhdr), p_strtab(NULL) {
7871  ctor();
7872  }
7873 
7875  virtual SgAsmElfStringSection *parse() $ROSE_OVERRIDE;
7876 
7878  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7879 
7884  virtual void set_size(rose_addr_t newsize) $ROSE_OVERRIDE;
7885 
7892  virtual bool reallocate() $ROSE_OVERRIDE;
7893 
7895  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7896 
7897  private:
7898  void ctor();
7899  void ctor(SgAsmElfSectionTable*);
7900 #endif // SgAsmElfStringSection_OTHERS
7901 
7902 #ifdef DOCUMENTATION
7903  };
7904 #endif
7905 
7907 
7908  DECLARE_LEAF_CLASS(AsmElfStrtab);
7909  IS_SERIALIZABLE(AsmElfStrtab);
7910  AsmElfStrtab.setAutomaticGenerationOfDestructor(false);
7911 
7912 #ifdef DOCUMENTATION
7913 
7914  class SgAsmElfStrtab: public SgAsmGenericStrtab {
7915  public:
7916 #endif
7917 
7918  DECLARE_OTHERS(AsmElfStrtab);
7919 #if defined(SgAsmElfStrtab_OTHERS) || defined(DOCUMENTATION)
7920 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7921  private:
7922  friend class boost::serialization::access;
7923 
7924  template<class S>
7925  void serialize(S &s, const unsigned /*version*/) {
7926  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericStrtab);
7927  }
7928 #endif
7929 
7930  public:
7934  explicit SgAsmElfStrtab(class SgAsmElfSection *containing_section)
7935  : SgAsmGenericStrtab(containing_section) {
7936  ctor();
7937  }
7938 
7945  virtual ~SgAsmElfStrtab();
7946 
7950  virtual SgAsmElfStrtab *parse() $ROSE_OVERRIDE;
7951 
7955  virtual void unparse(std::ostream&) const;
7956 
7962  virtual SgAsmStringStorage *create_storage(rose_addr_t offset, bool shared) $ROSE_OVERRIDE;
7963 
7967  virtual rose_addr_t get_storage_size(const SgAsmStringStorage*) $ROSE_OVERRIDE;
7968 
7978  virtual void allocate_overlap(SgAsmStringStorage*) $ROSE_OVERRIDE;
7979 
7981  virtual void rebind(SgAsmStringStorage*, rose_addr_t) $ROSE_OVERRIDE;
7982 
7983  private:
7984  void ctor();
7985 #endif // SgAsmElfStrtab_OTHERS
7986 
7987 #ifdef DOCUMENTATION
7988  };
7989 #endif
7990 
7991 
7992 
7993 
7995 
7996  /*************************************************************************************************************************
7997  * ELF Notes
7998  *************************************************************************************************************************/
7999 
8001 
8002  DECLARE_LEAF_CLASS(AsmElfNoteSection);
8003  IS_SERIALIZABLE(AsmElfNoteSection);
8004 
8005 #ifdef DOCUMENTATION
8007  public:
8008 #endif
8009 
8010 #ifdef DOCUMENTATION
8011 
8020 #else
8021  AsmElfNoteSection.setDataPrototype("SgAsmElfNoteEntryList*", "entries", "= NULL",
8022  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8023 #endif
8024 
8025  DECLARE_OTHERS(AsmElfNoteSection);
8026 #if defined(SgAsmElfNoteSection_OTHERS) || defined(DOCUMENTATION)
8027 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8028  private:
8029  friend class boost::serialization::access;
8030 
8031  template<class S>
8032  void serialize(S &s, const unsigned /*version*/) {
8033  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8034  s & BOOST_SERIALIZATION_NVP(p_entries);
8035  }
8036 #endif
8037 
8038  public:
8041  : SgAsmElfSection(fhdr) {
8042  ctor();
8043  }
8044  virtual SgAsmElfNoteSection *parse() $ROSE_OVERRIDE;
8045 
8047  virtual bool reallocate() $ROSE_OVERRIDE;
8048 
8050  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8051 
8053  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8054 
8055  private:
8056  void ctor();
8057 #endif // SgAsmElfNoteSection_OTHERS
8058 
8059 #ifdef DOCUMENTATION
8060  };
8061 #endif
8062 
8064 
8065  DECLARE_LEAF_CLASS(AsmElfNoteEntryList);
8066  IS_SERIALIZABLE(AsmElfNoteEntryList);
8067 
8068 #ifdef DOCUMENTATION
8069 
8074  public:
8075 #endif
8076 
8077 #ifdef DOCUMENTATION
8078 
8081  const SgAsmElfNoteEntryPtrList& get_entries() const;
8082  void set_entries(const SgAsmElfNoteEntryPtrList&);
8084 #else
8085  AsmElfNoteEntryList.setDataPrototype("SgAsmElfNoteEntryPtrList", "entries", "",
8086  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8087 #endif
8088 
8089  DECLARE_OTHERS(AsmElfNoteEntryList);
8090 #if defined(SgAsmElfNoteEntryList_OTHERS) || defined(DOCUMENTATION)
8091 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8092  private:
8093  friend class boost::serialization::access;
8094 
8095  template<class S>
8096  void serialize(S &s, const unsigned /*version*/) {
8097  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8098  s & BOOST_SERIALIZATION_NVP(p_entries);
8099  }
8100 #endif
8101 #endif // SgAsmElfNoteEntryList_OTHERS
8102 
8103 #ifdef DOCUMENTATION
8104  };
8105 #endif
8106 
8108 
8109  DECLARE_LEAF_CLASS(AsmElfNoteEntry);
8110  IS_SERIALIZABLE(AsmElfNoteEntry);
8111 
8112 #ifdef DOCUMENTATION
8113 
8115  public:
8116 #endif
8117 
8118 #ifdef DOCUMENTATION
8119 
8124  unsigned get_type() const;
8125  void set_type(unsigned);
8127 #else
8128  AsmElfNoteEntry.setDataPrototype("unsigned", "type", "= 0",
8129  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8130 #endif
8131 
8132 #ifdef DOCUMENTATION
8133  // documented below
8134 #else
8135  AsmElfNoteEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
8136  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8137 #endif
8138 
8139 #ifdef DOCUMENTATION
8140 
8145  const SgUnsignedCharList& get_payload() const;
8146  void set_payload(const SgUnsignedCharList&);
8148 #else
8149  AsmElfNoteEntry.setDataPrototype("SgUnsignedCharList", "payload", "",
8150  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8151 #endif
8152 
8153  DECLARE_OTHERS(AsmElfNoteEntry);
8154 #if defined(SgAsmElfNoteEntry_OTHERS) || defined(DOCUMENTATION)
8155 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8156  private:
8157  friend class boost::serialization::access;
8158 
8159  template<class S>
8160  void serialize(S &s, const unsigned /*version*/) {
8161  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8162  s & BOOST_SERIALIZATION_NVP(p_type);
8163  s & BOOST_SERIALIZATION_NVP(p_name);
8164  s & BOOST_SERIALIZATION_NVP(p_payload);
8165  }
8166 #endif
8167 
8168  public:
8171  : p_type(0), p_name(NULL) {
8172  ctor(section);
8173  }
8174 
8181  SgAsmGenericString *get_name() const;
8182  void set_name(SgAsmGenericString *name);
8188  rose_addr_t parse(rose_addr_t starting_offset);
8189 
8193  rose_addr_t unparse(std::ostream &f, rose_addr_t starting_offset);
8194 
8196  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
8197 
8201  void set_payload(const void*, size_t nbytes);
8202 
8204  rose_addr_t calculate_size() const;
8205 
8206  private:
8207  void ctor(SgAsmElfNoteSection *section);
8208 #endif // SgAsmElfNoteEntry_OTHERS
8209 
8210 #ifdef DOCUMENTATION
8211  };
8212 #endif
8213 
8214