ROSE  0.11.5.0
binaryInstruction.C
1 #include <featureTests.h>
2 #ifdef ROSE_BUILD_BINARY_ANALYSIS_SUPPORT
3 
4 /******************************************************************************************************************************
5  * NOTE: For any given IR class, please keep all its parts as close together as possible. Its bad enough that we're
6  * defining classes in a non-C-like language -- and it's painful when a definition is scattered all over this file. We
7  * already have four places to look to get the definition of an IR class:
8  * (1) here, in this source file, built with ROSETTA functions
9  * (2) additional declarations between HEADER_* markers in ../Grammar/BinaryInstruction.code (which we can't
10  * even parse as a C++ file, making IDEs useless there).
11  * (3) function definitions between SOURCE_* markers in ../Grammar/BinaryInstruction.code, which for some
12  * reason are not next to the corresponding HEADER_ markers. Please migrate these definitions to *.C files
13  * whenever you have an opportunity, so that IDEs can see the definitions.
14  * (4) Doxygen documentation in ../../../docs/testDoxygen directory since doxygen can't parse the IR classes
15  * from this source file. Documented entities are marked with a "DOXYGEN" comment here to make it more
16  * obvious when documentation is present.
17  *
18  * NOTE: First part of the file is for classes describing instructions. Middle part is for classes describing binary
19  * containers (organized by container type: ELF, DOS, PE, ...) Last part is the base classes. Unlike C++, the classes
20  * defined in this file need to be defined from the most specific (derived classes) to the most general (base class).
21  *
22  * NOTE: Please use three blank lines between IR node definitions to help make this file more readable. Unless those IR
23  * nodes are so closely related to one another that it's better to keep them close.
24  *
25  * UPDATE: Instead of splitting class declarations into five separate places, we can now use the macros defined below to
26  * put everything but the node name into one place in this file. The node name still needs a line in the
27  * "astNodeList" file. My goal is to eventually remove the src/ROSETTA/Grammar/BinaryInstruction.code file and
28  * the related docs/testDoxygen/xxx.docs files and to add documentation here for all property accessors.
29  *
30  * ROSETTA FAILURE MODES:
31  *
32  * + If you get thousands of compile errors in Cxx_Grammar.h that seem to have absolutely nothing to do with the node
33  * you just added, then double check that the new node type is listed as the descendant of some other node type in a
34  * NEW_NONTERMINAL_MACRO macro expansion.
35  *
36  * + If CxxGrammarMetaProgram uses gigabytes and gigabytes of memory and never terminates then check that all the new
37  * IR node types have a correctly spelled entry in the astNodeList file.
38  *-----------------------------------------------------------------------------------------------------------------------------*/
39 
40 #include "ROSETTA_macros.h"
41 #include "grammar.h"
42 #include "AstNodeClass.h"
43 
44 // 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
45 // of doing things required the class declarations to be split into four places:
46 // (1) The #include files necessary to declare the class were at the top of a src/ROSETTA/Grammar/*.code file
47 // (2) The class declaration and properties were built in src/ROSETTA/src/*.C
48 // (3) The documentation for the class and its properties were in docs/testDoxygen/*.docs files
49 // (4) Additional non-ROSETTA members were in src/ROSETTA/Grammar/*.code files
50 // Implementations were originally also in the src/ROSETTA/Grammar/*.code files but have since been moved to *.C files. The
51 // problem with *.code files is no IDE understands them.
52 //
53 // The following macros take a CLASS_WITHOUT_Sg parameter, which is the name of the Sage node class but without the leading
54 // "Sg". I'm not sure why ROSETTA was written this way. For instance, use "AsmInstruction" instead of "SgAsmInstruction". Most
55 // other things will use the full class name.
56 //
57 // The macros are:
58 // DOCUMENTATION is never defined when compiling, but will be defined when generating documentation and can be used to help
59 // IDE's figure out the indentation and as commentary. We don't use "#if 0" because some IDEs figure out that the code is
60 // never possible and don't indent it properly. For instance, most of the classes are defined like this:
61 // #ifdef DOCUMENTATION
62 // class SgAsmA64Instruction: public SgAsmInstruction {
63 // #endif
64 //
65 // ...
66 //
67 // #ifdef DOCUMENTATION
68 // };
69 // #endif
70 //
71 //
72 // DECLARE_LEAF_CLASS is the simpler way to declare a Sage class that has no subclasses. This must be the first macro
73 // invoked when starting a new class declaration. Example, to declare the SgMyClass node, say:
74 // DECLARE_LEAF_CLASS(MyClass);
75 // #ifdef DOCUMENTATION
76 // class SgMyClass: public ...base-classes... {
77 // #endif
78 //
79 //
80 // DECLARE_HEADERS is used to indicate what header files need to be included. Note that due to limitations of ROSETTA
81 // (specifically, not having any portable regular expression library due to prohibition against using boost), the #ifdef and
82 // #endif lines must be *exactly* as written here -- they are sensitive to white space.
83 // DECLARE_HEADERS(MyClass);
84 // #if defined(SgMyClass_HEADERS) || defined(DOCUMENTATION)
85 // #include <someHeader>
86 // #endif // SgMyClass_HEADERS
87 //
88 //
89 // DECLARE_OTHERS is for declaring other class members that don't need to be processed by ROSETTA. Due to limitations of
90 // ROSETTA (specifically, not having any portable regular expression library due to prohibition against using boost), the
91 // #ifdef and #endif lines must be *exactly* as written here -- they are sensitive to white space.
92 // DECLARE_OTHERS(MyClass);
93 // #if defined(SgMyClass_OTHERS) || defined(DOCUMENTATION)
94 // // other declarations here
95 // #endif // SgMyClass_OTHERS
96 
97 //#undef DOCUMENTATION -- commented out so IDEs can't figure it out
98 #ifdef DOCUMENTATION
99 DOCUMENTATION_should_never_be_defined;
100 #endif
101 
102 #ifdef DOCUMENTATION
103 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) /*void*/
104 #else
105 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) \
106  NEW_TERMINAL_MACRO(CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg "Tag"); \
107  CLASS_WITHOUT_Sg.setCppCondition("!defined(DOCUMENTATION)")
108 #endif
109 
110 #ifdef DOCUMENTATION
111 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) /*void*/
112 #else
113 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) \
114  CLASS_WITHOUT_Sg.setPredeclarationString("Sg" #CLASS_WITHOUT_Sg "_HEADERS", \
115  ROSE_AUTOMAKE_ABSOLUTE_PATH_TOP_SRCDIR + "/src/ROSETTA/src/binaryInstruction.C")
116 #endif
117 
118 #ifdef DOCUMENTATION
119 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) /*void*/
120 #else
121 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) \
122  CLASS_WITHOUT_Sg.setFunctionPrototype("Sg" #CLASS_WITHOUT_Sg "_OTHERS", \
123  ROSE_AUTOMAKE_ABSOLUTE_PATH_TOP_SRCDIR + "/src/ROSETTA/src/binaryInstruction.C")
124 #endif
125 
126 #ifdef DOCUMENTATION
127 #define IS_SERIALIZABLE() /*void*/
128 #else
129 #define IS_SERIALIZABLE(CLASS_WITHOUT_Sg) \
130  CLASS_WITHOUT_Sg.isBoostSerializable(true)
131 #endif
132 
133 // Since ROSETTA builds classes from the leaves up to the base, and C++ builds classes from the base down to the leaves, we
134 // need to make sure that doxygen sees the base classes before the derived classes. So just list all the non-leaf classes here.
135 #ifdef DOCUMENTATION
138 class SgAsmDwarfConstruct;
140 class SgAsmElfSection;
142 class SgAsmExpression;
143 class SgAsmGenericHeader;
144 class SgAsmGenericSection;
145 class SgAsmGenericString;
146 class SgAsmGenericStrtab;
147 class SgAsmGenericSymbol;
148 class SgAsmInstruction;
149 class SgAsmNode;
150 class SgAsmPESection;
152 class SgAsmScalarType;
153 class SgAsmStatement;
154 class AsmSynthesizedFieldDeclaration;
155 class SgAsmType;
158 class SgNode;
159 #endif
160 
161 #ifndef DOCUMENTATION
162 void Grammar::setUpBinaryInstructions() {
163 #endif
164 
166 
167  /**************************************************************************************************************************
168  * Instructions.
169  * Base class (SgAsmInstruction) and various subclasses, one per architecture.
170  **************************************************************************************************************************/
171 
173 
174 #ifdef ROSE_ENABLE_ASM_A64
175  DECLARE_LEAF_CLASS(AsmA64Instruction);
176  IS_SERIALIZABLE(AsmA64Instruction);
177 
178  DECLARE_HEADERS(AsmA64Instruction);
179 #if defined(SgAsmA64Instruction_HEADERS) || defined(DOCUMENTATION)
180  #include <InstructionEnumsA64.h>
181 #endif // SgAsmA64Instruction_HEADERS
182 
183 #ifdef DOCUMENTATION
184 
185  class SgAsmA64Instruction: public SgAsmInstruction {
186  public:
187 #endif
188 
189 #ifdef DOCUMENTATION
190 
196  Rose::BinaryAnalysis::A64InstructionKind get_kind() const;
197  void set_kind(Rose::BinaryAnalysis::A64InstructionKind);
199 #else
200  AsmA64Instruction.setDataPrototype("Rose::BinaryAnalysis::A64InstructionKind", "kind",
201  "= Rose::BinaryAnalysis::A64InstructionKind::ARM64_INS_INVALID",
202  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
203 #endif
204 
205 #ifdef DOCUMENTATION
206 
209  Rose::BinaryAnalysis::A64InstructionCondition get_condition() const;
210  void set_condition(Rose::BinaryAnalysis::A64InstructionCondition);
212 #else
213  AsmA64Instruction.setDataPrototype("Rose::BinaryAnalysis::A64InstructionCondition", "condition",
214  "= Rose::BinaryAnalysis::A64InstructionCondition::ARM64_CC_INVALID",
215  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
216 #endif
217 
218 #ifdef DOCUMENTATION
219 
222  bool get_updatesFlags() const;
223  void set_updatesFlags(bool);
225 #else
226  AsmA64Instruction.setDataPrototype("bool", "updatesFlags", "= false",
227  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
228 #endif
229 
230  DECLARE_OTHERS(AsmA64Instruction);
231 #if defined(SgAsmA64Instruction_OTHERS) || defined(DOCUMENTATION)
232 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
233  private:
234  friend class boost::serialization::access;
235 
236  template<class S>
237  void serialize(S &s, const unsigned /*version*/) {
238  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
239  s & BOOST_SERIALIZATION_NVP(p_kind);
240  s & BOOST_SERIALIZATION_NVP(p_condition);
241  }
242 #endif
243 
244  public:
245  // Overrides are documented in the base class
246  virtual std::string description() const $ROSE_OVERRIDE;
247  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
248  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
249  virtual bool isUnknown() const $ROSE_OVERRIDE;
250  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
251  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
252  rose_addr_t *return_va) $ROSE_OVERRIDE;
253  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
254  rose_addr_t *return_va) $ROSE_OVERRIDE;
255  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
256  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
257  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
258 
259 #endif // SgAsmA64Instruction_OTHERS
260 #ifdef DOCUMENTATION
261  };
262 #endif
263 #endif
264 
266 
267  DECLARE_LEAF_CLASS(AsmX86Instruction);
268  IS_SERIALIZABLE(AsmX86Instruction);
269  DECLARE_HEADERS(AsmX86Instruction);
270 #if defined(SgAsmX86Instruction_HEADERS) || defined(DOCUMENTATION)
271  #include <InstructionEnumsX86.h>
272  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
273 #endif // SgAsmX86Instruction_HEADERS
274 
275 #ifdef DOCUMENTATION
276 
278  public:
279 #endif
280 
281 #ifdef DOCUMENTATION
282 
291 #else
292  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionKind", "kind",
293  "= Rose::BinaryAnalysis::x86_unknown_instruction",
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", "baseSize",
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", "operandSize",
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 
330 #else
331  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "addressSize",
332  "= Rose::BinaryAnalysis::x86_insnsize_none",
333  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
334 #endif
335 
336 #ifdef DOCUMENTATION
337 
342  bool get_lockPrefix() const;
343  void set_lockPrefix(bool);
345 #else
346  AsmX86Instruction.setDataPrototype("bool", "lockPrefix", "= false",
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::X86RepeatPrefix", "repeatPrefix",
359  "= Rose::BinaryAnalysis::x86_repeat_none",
360  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
361 #endif
362 
363 #ifdef DOCUMENTATION
364 
370 #else
371  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86BranchPrediction", "branchPrediction",
372  "= Rose::BinaryAnalysis::x86_branch_prediction_none",
373  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
374 #endif
375 
376 #ifdef DOCUMENTATION
377 
386 #else
387  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86SegmentRegister", "segmentOverride",
388  "= Rose::BinaryAnalysis::x86_segreg_none",
389  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
390 #endif
391 
392 
393  DECLARE_OTHERS(AsmX86Instruction);
394 #if defined(SgAsmX86Instruction_OTHERS) || defined(DOCUMENTATION)
395 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
396  private:
397  friend class boost::serialization::access;
398 
399  template<class S>
400  void serialize(S &s, const unsigned /*version*/) {
401  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
402  s & BOOST_SERIALIZATION_NVP(p_kind);
403  s & BOOST_SERIALIZATION_NVP(p_baseSize);
404  s & BOOST_SERIALIZATION_NVP(p_operandSize);
405  s & BOOST_SERIALIZATION_NVP(p_addressSize);
406  s & BOOST_SERIALIZATION_NVP(p_lockPrefix);
407  s & BOOST_SERIALIZATION_NVP(p_repeatPrefix);
408  s & BOOST_SERIALIZATION_NVP(p_branchPrediction);
409  s & BOOST_SERIALIZATION_NVP(p_segmentOverride);
410  }
411 #endif
412 
413  public:
418 
423 
429 
435 
436  // Overrides are documented in the base class
437  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
438  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
439  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
440  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
441  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
442  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
443  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
444  virtual bool getBranchTarget(rose_addr_t *target/*out*/) $ROSE_OVERRIDE;
445  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
446  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
447  bool &complete,
448  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
449  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
450  virtual bool isUnknown() const $ROSE_OVERRIDE;
451  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
452 #endif // SgAsmX86Instruction_OTHERS
453 #ifdef DOCUMENTATION
454  };
455 #endif
456 
458 
459  DECLARE_LEAF_CLASS(AsmPowerpcInstruction);
460  IS_SERIALIZABLE(AsmPowerpcInstruction);
461  DECLARE_HEADERS(AsmPowerpcInstruction);
462 #if defined(SgAsmPowerpcInstruction_HEADERS) || defined(DOCUMENTATION)
463  #include <InstructionEnumsPowerpc.h>
464 #endif // SgAsmPowerpcInstruction_HEADERS
465 
466 #ifdef DOCUMENTATION
467 
469  public:
470 #endif
471 
472 
473 #ifdef DOCUMENTATION
474 
483 #else
484  AsmPowerpcInstruction.setDataPrototype("Rose::BinaryAnalysis::PowerpcInstructionKind", "kind",
485  "= Rose::BinaryAnalysis::powerpc_unknown_instruction",
486  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
487  COPY_DATA);
488 #endif
489 
490  DECLARE_OTHERS(AsmPowerpcInstruction);
491 #if defined(SgAsmPowerpcInstruction_OTHERS) || defined(DOCUMENTATION)
492 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
493  private:
494  friend class boost::serialization::access;
495 
496  template<class S>
497  void serialize(S &s, const unsigned /*version*/) {
498  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
499  s & BOOST_SERIALIZATION_NVP(p_kind);
500  }
501 #endif
502 
503  public:
509  std::string conditionalBranchDescription() const;
510 
516 
517  // Overrides are documented in the base class
518  virtual std::string description() const $ROSE_OVERRIDE;
519  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
520  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
521  virtual bool isUnknown() const $ROSE_OVERRIDE;
522  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
523  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
524  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
525  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
526  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
527  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
528  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
529 #endif // SgAsmPowerpcInstruction_OTHERS
530 #ifdef DOCUMENTATION
531  };
532 #endif
533 
534 
536 
537  DECLARE_LEAF_CLASS(AsmMipsInstruction);
538  IS_SERIALIZABLE(AsmMipsInstruction);
539  DECLARE_HEADERS(AsmMipsInstruction);
540 #if defined(SgAsmMipsInstruction_HEADERS) || defined(DOCUMENTATION)
541  #include <InstructionEnumsMips.h>
542 #endif // SgAsmMipsInstruction_HEADERS
543 
544 #ifdef DOCUMENTATION
545 
547  public:
548 #endif
549 
550 #ifdef DOCUMENTATION
551 
560 #else
561  AsmMipsInstruction.setDataPrototype("Rose::BinaryAnalysis::MipsInstructionKind", "kind",
562  "= Rose::BinaryAnalysis::mips_unknown_instruction",
563  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
564  COPY_DATA);
565 #endif
566 
567  DECLARE_OTHERS(AsmMipsInstruction);
568 #if defined(SgAsmMipsInstruction_OTHERS) || defined(DOCUMENTATION)
569 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
570  private:
571  friend class boost::serialization::access;
572 
573  template<class S>
574  void serialize(S &s, const unsigned /*version*/) {
575  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
576  s & BOOST_SERIALIZATION_NVP(p_kind);
577  }
578 #endif
579 
580  public:
581  // Overrides are documented in the base class
582  virtual std::string description() const $ROSE_OVERRIDE;
583  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
584  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
585  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
586  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
587  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
588  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
589  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
590  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
591  virtual bool isUnknown() const $ROSE_OVERRIDE;
592  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
593  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
594 #endif // SgAsmMipsInstruction_OTHERS
595 #ifdef DOCUMENTATION
596  };
597 #endif
598 
600 
601  DECLARE_LEAF_CLASS(AsmM68kInstruction);
602  IS_SERIALIZABLE(AsmM68kInstruction);
603  DECLARE_HEADERS(AsmM68kInstruction);
604 #if defined(SgAsmM68kInstruction_HEADERS) || defined(DOCUMENTATION)
605  #include "InstructionEnumsM68k.h"
606 #endif // SgAsmM68kInstruction_HEADERS
607 
608 #ifdef DOCUMENTATION
610  public:
611 #endif
612 
613 #ifdef DOCUMENTATION
614 
623 #else
624  AsmM68kInstruction.setDataPrototype("Rose::BinaryAnalysis::M68kInstructionKind", "kind",
625  " = Rose::BinaryAnalysis::m68k_unknown_instruction",
626  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
627  COPY_DATA);
628 #endif
629 
630  DECLARE_OTHERS(AsmM68kInstruction);
631 #if defined(SgAsmM68kInstruction_OTHERS) || defined(DOCUMENTATION)
632 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
633  private:
634  friend class boost::serialization::access;
635 
636  template<class S>
637  void serialize(S &s, const unsigned /*version*/) {
638  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
639  s & BOOST_SERIALIZATION_NVP(p_kind);
640  }
641 #endif
642 
643  public:
644  // Overrides are documented in the base class
645  virtual std::string description() const $ROSE_OVERRIDE;
646  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
647  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
648  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
649  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
650  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
651  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
652  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
653  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
654  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
655  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
656  bool &complete,
657  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
658  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
659  virtual bool isUnknown() const $ROSE_OVERRIDE;
660  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
661 #endif // SgAsmM68kInstruction_OTHERS
662 #ifdef DOCUMENTATION
663  };
664 #endif
665 
667 
668  NEW_NONTERMINAL_MACRO(AsmInstruction,
669  AsmX86Instruction
670 #ifdef ROSE_ENABLE_ASM_A64
671  | AsmA64Instruction
672 #endif
673  | AsmPowerpcInstruction | AsmMipsInstruction |
674  AsmM68kInstruction,
675  "AsmInstruction", "AsmInstructionTag", true);
676  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
677  IS_SERIALIZABLE(AsmInstruction);
678 
679  DECLARE_HEADERS(AsmInstruction);
680 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
681  #include <MemoryMap.h>
682 #endif // SgAsmInstruction_HEADERS
683 
684 #ifdef DOCUMENTATION
685 
707  public:
708 #endif
709 
710 #ifdef DOCUMENTATION
711 
719  const std::string& get_mnemonic() const;
720  void set_mnemonic(const std::string&);
722 #else
723  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
724  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
725 #endif
726 
727 #ifdef DOCUMENTATION
728 
733  const SgUnsignedList& get_raw_bytes() const;
734  void set_raw_bytes(const SgUnsignedList&);
736 #else
737  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
738  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
739 #endif
740 
741 #ifdef DOCUMENTATION
742 
751 #else
752  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
753  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
754 #endif
755 
756 #ifdef DOCUMENTATION
757  // Documentation is below because it uses different names than normal. Functions are not automatically generated because
758  // we need to synchronize access to the private p_cacheLockCount data member. However, we still use ROSETTA to generate
759  // the data member because we need to make sure it gets initialized to zero in the constructors. What a mess.
760 #else
761  AsmInstruction.setDataPrototype("size_t", "cacheLockCount", "= 0",
762  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
763 #endif
764 
765 #ifdef DOCUMENTATION
766  // FIXME[Robb P Matzke 2017-02-13]: unused?
767 #else
768  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
769  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
770 #endif
771 
772 #ifdef DOCUMENTATION
773 
779  int64_t get_stackDeltaIn() const;
780  void set_stackDeltaIn(int64_t);
782 #else
783  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
784  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
785 #endif
786 
787 #ifdef DOCUMENTATION
788  // FIXME[Robb P Matzke 2017-02-13]: unused?
789 #else
790  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
791  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
792 #endif
793 
794  DECLARE_OTHERS(AsmInstruction);
795 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
796 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
797  private:
798  friend class boost::serialization::access;
799 
800  template<class S>
801  void serialize(S &s, const unsigned version) {
802  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
803  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
804  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
805  s & BOOST_SERIALIZATION_NVP(p_operandList);
806  s & BOOST_SERIALIZATION_NVP(p_sources);
807  if (version >= 1)
808  s & BOOST_SERIALIZATION_NVP(semanticFailure_);
809  //s & BOOST_SERIALIZATION_NVP(p_cacheLockCount); -- definitely not!
810  }
811 #endif
812 
813  private:
814  struct SemanticFailure {
815  size_t n;
816  SemanticFailure(): n(0) {}
817 
818 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
819  private:
820  friend class boost::serialization::access;
821  template<class S>
822  void serialize(S &s, const unsigned /*version*/) {
823  s & BOOST_SERIALIZATION_NVP(n);
824  }
825 #endif
826  };
827  SemanticFailure semanticFailure_;
828 
829  // Synchronized data members. All the following data members (as listed in binaryInstruction.C, not the ROSETTA-generated
830  // code) should be procted by the mutex_. Additionally, the p_cacheLockCount data member is synchronized.
831  mutable SAWYER_THREAD_TRAITS::Mutex mutex_;
832 
833  public:
838  static const int64_t INVALID_STACK_DELTA;
839 
845  virtual std::string description() const { return ""; }
846 
847  // FIXME[Robb P Matzke 2017-02-13]: unused?
848  void appendSources( SgAsmInstruction* instruction );
849 
851  size_t nOperands() const;
852 
856  SgAsmExpression* operand(size_t) const;
857 
864  virtual bool terminatesBasicBlock();
865 
879  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
880  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
892  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
893  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
899  bool isFirstInBlock();
900 
904  bool isLastInBlock();
905 
910  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
911 
1046  virtual bool hasEffect();
1047 
1056  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
1057  bool relax_stack_semantics=false);
1058 
1068  virtual std::vector<std::pair<size_t,size_t> >
1069  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
1070  bool relax_stack_semantics=false);
1071 
1078  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete); /*subclasses must redefine*/
1079 
1088  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1089  bool &complete,
1090  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1092 
1098  virtual size_t get_size() const;
1099 
1105  virtual bool isUnknown() const;
1106 
1140  virtual unsigned get_anyKind() const;
1141 
1145  virtual std::string toString() const;
1146 
1151  virtual std::set<rose_addr_t> explicitConstants() const;
1152 
1162  size_t semanticFailure() const;
1163  void semanticFailure(size_t);
1164  void incrementSemanticFailure();
1174  size_t cacheLockCount() const;
1175  void adjustCacheLockCount(int increment);
1177 #endif // SgAsmInstruction_OTHERS
1178 
1179 #ifdef DOCUMENTATION
1180  };
1181 #endif
1182 
1183 
1184 
1186 
1187  /**************************************************************************************************************************
1188  * Instruction Expressions
1189  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1190  **************************************************************************************************************************/
1191 
1193 
1194  DECLARE_LEAF_CLASS(AsmOperandList);
1195  IS_SERIALIZABLE(AsmOperandList);
1196 
1197 #ifdef DOCUMENTATION
1198 
1199  class SgAsmOperandList: public SgAsmNode {
1200  public:
1201 #endif
1202 
1203 #ifdef DOCUMENTATION
1204 
1210  const SgAsmExpressionPtrList& get_operands() const;
1211  void set_oerands(const SgAsmExpressionPtrList&);
1213 #else
1214  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1215  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1216 #endif
1217 
1218  DECLARE_OTHERS(AsmOperandList);
1219 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1220 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1221  private:
1222  friend class boost::serialization::access;
1223 
1224  template<class S>
1225  void serialize(S &s, const unsigned /*version*/) {
1226  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1227  s & BOOST_SERIALIZATION_NVP(p_operands);
1228  }
1229 #endif
1230 
1231  public:
1233  void append_operand(SgAsmExpression* operand);
1234 #endif // SgAsmOperandList_OTHERS
1235 
1236 #ifdef DOCUMENTATION
1237  };
1238 #endif
1239 
1240  // FIXME[Robb P Matzke 2016-10-31]
1241  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1242 
1244 
1245  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1246  IS_SERIALIZABLE(AsmBinaryAdd);
1247 
1248 #ifdef DOCUMENTATION
1249 
1251  public:
1252 #endif
1253 
1254  DECLARE_OTHERS(AsmBinaryAdd);
1255 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1256 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1257  private:
1258  friend class boost::serialization::access;
1259 
1260  template<class S>
1261  void serialize(S &s, const unsigned /*version*/) {
1262  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1263  }
1264 #endif
1265 #endif // SgAsmBinaryAdd_OTHERS
1266 
1267 #ifdef DOCUMENTATION
1268  };
1269 #endif
1270 
1272 
1273  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1274  IS_SERIALIZABLE(AsmBinarySubtract);
1275 
1276 #ifdef DOCUMENTATION
1277 
1279  public:
1280 #endif
1281 
1282  DECLARE_OTHERS(AsmBinarySubtract);
1283 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1284 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1285  private:
1286  friend class boost::serialization::access;
1287 
1288  template<class S>
1289  void serialize(S &s, const unsigned /*version*/) {
1290  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1291  }
1292 #endif
1293 #endif // SgAsmBinarySubtract_OTHERS
1294 
1295 #ifdef DOCUMENTATION
1296  };
1297 #endif
1298 
1300 
1301  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1302  IS_SERIALIZABLE(AsmBinaryMultiply);
1303 
1304 #ifdef DOCUMENTATION
1305 
1307  public:
1308 #endif
1309 
1310  DECLARE_OTHERS(AsmBinaryMultiply);
1311 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1312 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1313  private:
1314  friend class boost::serialization::access;
1315 
1316  template<class S>
1317  void serialize(S &s, const unsigned /*version*/) {
1318  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1319  }
1320 #endif
1321 #endif // SgAsmBinaryMultiply_OTHERS
1322 
1323 #ifdef DOCUMENTATION
1324  };
1325 #endif
1326 
1328 
1329  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1330  IS_SERIALIZABLE(AsmBinaryDivide);
1331 
1332 #ifdef DOCUMENTATION
1333 
1335  public:
1336 #endif
1337 
1338  DECLARE_OTHERS(AsmBinaryDivide);
1339 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1340 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1341  private:
1342  friend class boost::serialization::access;
1343 
1344  template<class S>
1345  void serialize(S &s, const unsigned /*version*/) {
1346  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1347  }
1348 #endif
1349 #endif // SgAsmBinaryDivide_OTHERS
1350 
1351 #ifdef DOCUMENTATION
1352  };
1353 #endif
1354 
1356 
1357  DECLARE_LEAF_CLASS(AsmBinaryMod);
1358  IS_SERIALIZABLE(AsmBinaryMod);
1359 
1360 #ifdef DOCUMENTATION
1361 
1363  public:
1364 #endif
1365 
1366  DECLARE_OTHERS(AsmBinaryMod);
1367 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1368 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1369  private:
1370  friend class boost::serialization::access;
1371 
1372  template<class S>
1373  void serialize(S &s, const unsigned /*version*/) {
1374  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1375  }
1376 #endif
1377 #endif // SgAsmBinaryMod_OTHERS
1378 
1379 #ifdef DOCUMENTATION
1380  };
1381 #endif
1382 
1384 
1385  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1386  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1387 
1388 #ifdef DOCUMENTATION
1389 
1391  public:
1392 #endif
1393 
1394  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1395 #if defined(SgAsmBinaryAddPreupdate_OTHERS) || defined(DOCUMENTATION)
1396 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1397  private:
1398  friend class boost::serialization::access;
1399 
1400  template<class S>
1401  void serialize(S &s, const unsigned /*version*/) {
1402  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1403  }
1404 #endif
1405 #endif // SgAsmBinaryAddPreupdate_OTHERS
1406 
1407 #ifdef DOCUMENTATION
1408  };
1409 #endif
1410 
1412 
1413  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1414  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1415 
1416 #ifdef DOCUMENTATION
1417 
1419  public:
1420 #endif
1421 
1422  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1423 #if defined(SgAsmBinarySubtractPreupdate_OTHERS) || defined(DOCUMENTATION)
1424 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1425  private:
1426  friend class boost::serialization::access;
1427 
1428  template<class S>
1429  void serialize(S &s, const unsigned /*version*/) {
1430  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1431  }
1432 #endif
1433 #endif // SgAsmBinarySubtractPreupdate_OTHERS
1434 
1435 #ifdef DOCUMENTATION
1436  };
1437 #endif
1438 
1440 
1441  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1442  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1443 
1444 #ifdef DOCUMENTATION
1445 
1447  public:
1448 #endif
1449 
1450  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1451 #if defined(SgAsmBinaryAddPostupdate_OTHERS) || defined(DOCUMENTATION)
1452 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1453  private:
1454  friend class boost::serialization::access;
1455 
1456  template<class S>
1457  void serialize(S &s, const unsigned /*version*/) {
1458  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1459  }
1460 #endif
1461 #endif // SgAsmBinaryAddPostupdate_OTHERS
1462 
1463 #ifdef DOCUMENTATION
1464  };
1465 #endif
1466 
1468 
1469  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1470  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1471 
1472 #ifdef DOCUMENTATION
1473 
1475  public:
1476 #endif
1477 
1478  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1479 #if defined(SgAsmBinarySubtractPostupdate_OTHERS) || defined(DOCUMENTATION)
1480 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1481  private:
1482  friend class boost::serialization::access;
1483 
1484  template<class S>
1485  void serialize(S &s, const unsigned /*version*/) {
1486  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1487  }
1488 #endif
1489 #endif // SgAsmBinarySubtractPostupdate_OTHERS
1490 
1491 #ifdef DOCUMENTATION
1492  };
1493 #endif
1494 
1496 
1497  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1498  IS_SERIALIZABLE(AsmBinaryLsl);
1499 
1500 #ifdef DOCUMENTATION
1501 
1503  public:
1504 #endif
1505 
1506  DECLARE_OTHERS(AsmBinaryLsl);
1507 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1508 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1509  private:
1510  friend class boost::serialization::access;
1511 
1512  template<class S>
1513  void serialize(S &s, const unsigned /*version*/) {
1514  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1515  }
1516 #endif
1517 #endif // SgAsmBinaryLsl_OTHERS
1518 
1519 #ifdef DOCUMENTATION
1520  };
1521 #endif
1522 
1524 
1525  DECLARE_LEAF_CLASS(AsmBinaryMsl);
1526  IS_SERIALIZABLE(AsmBinaryMsl);
1527 
1528 #ifdef DOCUMENTATION
1529 
1533  public:
1534 #endif
1535 
1536  DECLARE_OTHERS(AsmBinaryMsl);
1537 #if defined(SgAsmBinaryMsl_OTHERS) || defined(DOCUMENTATION)
1538 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1539  private:
1540  friend class boost::serialization::access;
1541 
1542  template<class S>
1543  void serialize(S &s, const unsigned /*version*/) {
1544  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1545  }
1546 #endif
1547 #endif // SgAsmBinaryMsl_OTHERS
1548 
1549 #ifdef DOCUMENTATION
1550  };
1551 #endif
1552 
1554 
1555  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1556  IS_SERIALIZABLE(AsmBinaryLsr);
1557 
1558 #ifdef DOCUMENTATION
1559 
1561  public:
1562 #endif
1563 
1564  DECLARE_OTHERS(AsmBinaryLsr);
1565 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1566 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1567  private:
1568  friend class boost::serialization::access;
1569 
1570  template<class S>
1571  void serialize(S &s, const unsigned /*version*/) {
1572  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1573  }
1574 #endif
1575 #endif // SgAsmBinaryLsr_OTHERS
1576 
1577 #ifdef DOCUMENTATION
1578  };
1579 #endif
1580 
1582 
1583  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1584  IS_SERIALIZABLE(AsmBinaryAsr);
1585 
1586 #ifdef DOCUMENTATION
1587 
1589  public:
1590 #endif
1591 
1592  DECLARE_OTHERS(AsmBinaryAsr);
1593 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1594 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1595  private:
1596  friend class boost::serialization::access;
1597 
1598  template<class S>
1599  void serialize(S &s, const unsigned /*version*/) {
1600  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1601  }
1602 #endif
1603 #endif // SgAsmBinaryAsr_OTHERS
1604 
1605 #ifdef DOCUMENTATION
1606  };
1607 #endif
1608 
1610 
1611  DECLARE_LEAF_CLASS(AsmBinaryRor);
1612  IS_SERIALIZABLE(AsmBinaryRor);
1613 
1614 #ifdef DOCUMENTATION
1615 
1617  public:
1618 #endif
1619 
1620  DECLARE_OTHERS(AsmBinaryRor);
1621 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1622 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1623  private:
1624  friend class boost::serialization::access;
1625 
1626  template<class S>
1627  void serialize(S &s, const unsigned /*version*/) {
1628  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1629  }
1630 #endif
1631 #endif // SgAsmBinaryRor_OTHERS
1632 
1633 #ifdef DOCUMENTATION
1634  };
1635 #endif
1636 
1638 
1639  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1640  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1641  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1642  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1643  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1644  AsmBinaryRor | AsmBinaryMsl,
1645  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1646  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1647  IS_SERIALIZABLE(AsmBinaryExpression);
1648 
1649 #ifdef DOCUMENTATION
1650 
1652  public:
1653 #endif
1654 
1655 #ifdef DOCUMENTATION
1656 
1659  SgAsmExpression* get_lhs() const;
1660  void set_lhs(SgAsmExpression*);
1662 #else
1663  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1664  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1665 #endif
1666 
1667 #ifdef DOCUMENTATION
1668 
1671  SgAsmExpression* get_rhs() const;
1672  void set_rhs(SgAsmExpression*);
1674 #else
1675  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1676  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1677 #endif
1678 
1679  DECLARE_OTHERS(AsmBinaryExpression);
1680 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1681 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1682  private:
1683  friend class boost::serialization::access;
1684 
1685  template<class S>
1686  void serialize(S &s, const unsigned /*version*/) {
1687  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1688  s & BOOST_SERIALIZATION_NVP(p_lhs);
1689  s & BOOST_SERIALIZATION_NVP(p_rhs);
1690  }
1691 #endif
1692 #endif // SgAsmBinaryExpression_OTHERS
1693 
1694 #ifdef DOCUMENTATION
1695  };
1696 #endif
1697 
1699 
1700  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1701  IS_SERIALIZABLE(AsmUnaryPlus);
1702 
1703 #ifdef DOCUMENTATION
1704 
1706  public:
1707 #endif
1708 
1709  DECLARE_OTHERS(AsmUnaryPlus);
1710 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1711 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1712  private:
1713  friend class boost::serialization::access;
1714 
1715  template<class S>
1716  void serialize(S &s, const unsigned /*version*/) {
1717  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1718  }
1719 #endif
1720 #endif // SgAsmUnaryPlus_OTHERS
1721 
1722 #ifdef DOCUMENTATION
1723  };
1724 #endif
1725 
1727 
1728  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1729  IS_SERIALIZABLE(AsmUnaryMinus);
1730 
1731 #ifdef DOCUMENTATION
1732 
1734  public:
1735 #endif
1736 
1737  DECLARE_OTHERS(AsmUnaryMinus);
1738 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1739 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1740  private:
1741  friend class boost::serialization::access;
1742 
1743  template<class S>
1744  void serialize(S &s, const unsigned /*version*/) {
1745  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1746  }
1747 #endif
1748 #endif // SgAsmUnaryMinus_OTHERS
1749 
1750 #ifdef DOCUMENTATION
1751  };
1752 #endif
1753 
1755 
1756  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1757  IS_SERIALIZABLE(AsmUnaryRrx);
1758 
1759 #ifdef DOCUMENTATION
1760  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1762  public:
1763 #endif
1764 
1765  DECLARE_OTHERS(AsmUnaryRrx);
1766 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1767 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1768  private:
1769  friend class boost::serialization::access;
1770 
1771  template<class S>
1772  void serialize(S &s, const unsigned /*version*/) {
1773  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1774  }
1775 #endif
1776 #endif // SgAsmUnaryRrx_OTHERS
1777 
1778 #ifdef DOCUMENTATION
1779  };
1780 #endif
1781 
1783 
1784  DECLARE_LEAF_CLASS(AsmUnaryTruncate);
1785  IS_SERIALIZABLE(AsmUnaryTruncate);
1786 
1787 #ifdef DOCUMENTATION
1788 
1794  public:
1795 #endif
1796 
1797  DECLARE_OTHERS(AsmUnaryTruncate);
1798 #if defined(SgAsmUnaryTruncate_OTHERS) || defined(DOCUMENTATION)
1799 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1800  private:
1801  friend class boost::serialization::access;
1802 
1803  template<class S>
1804  void serialize(S &s, const unsigned /*version*/) {
1805  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1806  }
1807 #endif
1808 #endif // SgAsmUnaryTruncate_OTHERS
1809 
1810 #ifdef DOCUMENTATION
1811  };
1812 #endif
1813 
1815 
1816  DECLARE_LEAF_CLASS(AsmUnarySignedExtend);
1817  IS_SERIALIZABLE(AsmUnarySignedExtend);
1818 
1819 #ifdef DOCUMENTATION
1820 
1826  public:
1827 #endif
1828 
1829  DECLARE_OTHERS(AsmUnarySignedExtend);
1830 #if defined(SgAsmUnarySignedExtend_OTHERS) || defined(DOCUMENTATION)
1831 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1832  private:
1833  friend class boost::serialization::access;
1834 
1835  template<class S>
1836  void serialize(S &s, const unsigned /*version*/) {
1837  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1838  }
1839 #endif
1840 #endif // SgAsmUnarySignedExtend_OTHERS
1841 
1842 #ifdef DOCUMENTATION
1843  };
1844 #endif
1845 
1847 
1848  DECLARE_LEAF_CLASS(AsmUnaryUnsignedExtend);
1849  IS_SERIALIZABLE(AsmUnaryUnsignedExtend);
1850 
1851 #ifdef DOCUMENTATION
1852 
1858  public:
1859 #endif
1860 
1861  DECLARE_OTHERS(AsmUnaryUnsignedExtend);
1862 #if defined(SgAsmUnaryUnsignedExtend_OTHERS) || defined(DOCUMENTATION)
1863 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1864  private:
1865  friend class boost::serialization::access;
1866 
1867  template<class S>
1868  void serialize(S &s, const unsigned /*version*/) {
1869  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1870  }
1871 #endif
1872 #endif // SgAsmUnaryUnsignedExtend_OTHERS
1873 
1874 #ifdef DOCUMENTATION
1875  };
1876 #endif
1877 
1879 
1880 #ifdef ROSE_ENABLE_ASM_A64
1881  DECLARE_LEAF_CLASS(AsmA64AtOperand);
1882  IS_SERIALIZABLE(AsmA64AtOperand);
1883 
1884 #ifdef DOCUMENTATION
1885 
1886  class SgAsmA64AtOperand: public SgAsmUnaryExpression {
1887  public:
1888 #endif
1889 
1890  DECLARE_OTHERS(AsmA64AtOperand);
1891 #if defined(SgAsmA64AtOperand_OTHERS) || defined(DOCUMENTATION)
1892 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1893  private:
1894  friend class boost::serialization::access;
1895 
1896  template<class S>
1897  void serialize(S &s, const unsigned /*version*/) {
1898  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1899  s & BOOST_SERIALIZATION_NVP(operation_);
1900  }
1901 #endif
1902 
1903  private:
1904  Rose::BinaryAnalysis::A64AtOperation operation_;
1905 
1906  public:
1908  explicit SgAsmA64AtOperand(Rose::BinaryAnalysis::A64AtOperation op)
1909  : operation_(op) {}
1910 
1916  Rose::BinaryAnalysis::A64AtOperation operation() const {
1917  return operation_;
1918  }
1919  void operation(Rose::BinaryAnalysis::A64AtOperation op) {
1920  operation_ = op;
1921  }
1923 #endif // SgAsmA64AtOperand_OTHERS
1924 
1925 #ifdef DOCUMENTATION
1926  };
1927 #endif
1928 #endif
1929 
1931 
1932 #ifdef ROSE_ENABLE_ASM_A64
1933  DECLARE_LEAF_CLASS(AsmA64PrefetchOperand);
1934  IS_SERIALIZABLE(AsmA64PrefetchOperand);
1935 
1936 #ifdef DOCUMENTATION
1937 
1938  class SgAsmA64PrefetchOperand: public SgAsmUnaryExpression {
1939  public:
1940 #endif
1941 
1942  DECLARE_OTHERS(AsmA64PrefetchOperand);
1943 #if defined(SgAsmA64PrefetchOperand_OTHERS) || defined(DOCUMENTATION)
1944 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1945  private:
1946  friend class boost::serialization::access;
1947 
1948  template<class S>
1949  void serialize(S &s, const unsigned /*version*/) {
1950  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1951  s & BOOST_SERIALIZATION_NVP(operation_);
1952  }
1953 #endif
1954 
1955  private:
1956  Rose::BinaryAnalysis::A64PrefetchOperation operation_;
1957 
1958  public:
1960  explicit SgAsmA64PrefetchOperand(Rose::BinaryAnalysis::A64PrefetchOperation op)
1961  : operation_(op) {}
1962 
1968  Rose::BinaryAnalysis::A64PrefetchOperation operation() const {
1969  return operation_;
1970  }
1971  void operation(Rose::BinaryAnalysis::A64PrefetchOperation op) {
1972  operation_ = op;
1973  }
1975 #endif // SgAsmA64PrefetchOperand_OTHERS
1976 
1977 #ifdef DOCUMENTATION
1978  };
1979 #endif
1980 #endif
1981 
1983 
1984 #ifdef ROSE_ENABLE_ASM_A64
1985  DECLARE_LEAF_CLASS(AsmA64SysMoveOperand);
1986  IS_SERIALIZABLE(AsmA64SysMoveOperand);
1987 
1988 #ifdef DOCUMENTATION
1989 
1990  class SgAsmA64SysMoveOperand: public SgAsmUnaryExpression {
1991  public:
1992 #endif
1993 
1994  DECLARE_OTHERS(AsmA64SysMoveOperand);
1995 #if defined(SgAsmA64SysMoveOperand_OTHERS) || defined(DOCUMENTATION)
1996 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1997  private:
1998  friend class boost::serialization::access;
1999 
2000  template<class S>
2001  void serialize(S &s, const unsigned /*version*/) {
2002  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2003  s & BOOST_SERIALIZATION_NVP(access_);
2004  }
2005 #endif
2006 
2007  private:
2008  unsigned access_;
2009 
2010  public:
2012  explicit SgAsmA64SysMoveOperand(unsigned access)
2013  : access_(access) {}
2014 
2020  unsigned access() const {
2021  return access_;
2022  }
2023  void access(unsigned ac) {
2024  access_ = ac;
2025  }
2027 #endif // SgAsmA64SysMoveOperand_OTHERS
2028 
2029 #ifdef DOCUMENTATION
2030  };
2031 #endif
2032 #endif
2033 
2035 
2036 #ifdef ROSE_ENABLE_ASM_A64
2037  DECLARE_LEAF_CLASS(AsmA64CImmediateOperand);
2038  IS_SERIALIZABLE(AsmA64CImmediateOperand);
2039 
2040 #ifdef DOCUMENTATION
2041 
2042  class SgAsmA64CImmediateOperand: public SgAsmUnaryExpression {
2043  public:
2044 #endif
2045 
2046  DECLARE_OTHERS(AsmA64CImmediateOperand);
2047 #if defined(SgAsmA64CImmediateOperand_OTHERS) || defined(DOCUMENTATION)
2048 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2049  private:
2050  friend class boost::serialization::access;
2051 
2052  template<class S>
2053  void serialize(S &s, const unsigned /*version*/) {
2054  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2055  s & BOOST_SERIALIZATION_NVP(imm_);
2056  }
2057 #endif
2058 
2059  private:
2060  unsigned imm_;
2061 
2062  public:
2064  explicit SgAsmA64CImmediateOperand(unsigned imm)
2065  : imm_(imm) {}
2066 
2072  unsigned immediate() const {
2073  return imm_;
2074  }
2075  void immediate(unsigned imm) {
2076  imm_ = imm;
2077  }
2079 #endif // SgAsmA64CImmediateOperand_OTHERS
2080 
2081 #ifdef DOCUMENTATION
2082  };
2083 #endif
2084 #endif
2085 
2087 
2088 #ifdef ROSE_ENABLE_ASM_A64
2089  DECLARE_LEAF_CLASS(AsmA64BarrierOperand);
2090  IS_SERIALIZABLE(AsmA64BarrierOperand);
2091 
2092 #ifdef DOCUMENTATION
2093 
2094  class SgAsmA64BarrierOperand: public SgAsmUnaryExpression {
2095  public:
2096 #endif
2097 
2098  DECLARE_OTHERS(AsmA64BarrierOperand);
2099 #if defined(SgAsmA64BarrierOperand_OTHERS) || defined(DOCUMENTATION)
2100 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2101  private:
2102  friend class boost::serialization::access;
2103 
2104  template<class S>
2105  void serialize(S &s, const unsigned /*version*/) {
2106  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2107  s & BOOST_SERIALIZATION_NVP(operation_);
2108  }
2109 #endif
2110 
2111  private:
2112  Rose::BinaryAnalysis::A64BarrierOperation operation_;
2113 
2114  public:
2116  explicit SgAsmA64BarrierOperand(Rose::BinaryAnalysis::A64BarrierOperation operation)
2117  : operation_(operation) {}
2118 
2122  Rose::BinaryAnalysis::A64BarrierOperation operation() const {
2123  return operation_;
2124  }
2125  void operation(Rose::BinaryAnalysis::A64BarrierOperation op) {
2126  operation_ = op;
2127  }
2129 #endif // SgAsmA64BarrierOperand_OTHERS
2130 
2131 #ifdef DOCUMENTATION
2132  };
2133 #endif
2134 #endif
2135 
2137 
2138  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
2139  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryTruncate | AsmUnarySignedExtend
2140  | AsmUnaryUnsignedExtend
2141 #ifdef ROSE_ENABLE_ASM_A64
2142  | AsmA64AtOperand | AsmA64PrefetchOperand | AsmA64SysMoveOperand | AsmA64CImmediateOperand
2143  | AsmA64BarrierOperand
2144 #endif
2145  , "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
2146  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
2147  IS_SERIALIZABLE(AsmUnaryExpression);
2148 
2149 #ifdef DOCUMENTATION
2150 
2152  public:
2153 #endif
2154 
2155 #ifdef DOCUMENTATION
2156 
2159  SgAsmExpression* get_operand() const;
2162 #else
2163  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
2164  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2165 #endif
2166 
2167  DECLARE_OTHERS(AsmUnaryExpression);
2168 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
2169 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2170  private:
2171  friend class boost::serialization::access;
2172 
2173  template<class S>
2174  void serialize(S &s, const unsigned /*version*/) {
2175  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2176  s & BOOST_SERIALIZATION_NVP(p_operand);
2177  }
2178 #endif
2179 #endif // SgAsmUnaryExpression_OTHERS
2180 
2181 #ifdef DOCUMENTATION
2182  };
2183 #endif
2184 
2186 
2187  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
2188  IS_SERIALIZABLE(AsmDirectRegisterExpression);
2189 
2190 #ifdef DOCUMENTATION
2191 
2193  public:
2194 #endif
2195 
2196  DECLARE_OTHERS(AsmDirectRegisterExpression);
2197 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
2198 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2199  private:
2200  friend class boost::serialization::access;
2201 
2202  template<class S>
2203  void serialize(S &s, const unsigned /*version*/) {
2204  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
2205  }
2206 #endif
2207 
2208  private:
2209  // Default c'tor needed for serialization
2211 #endif // SgAsmDirectRegisterExpression_OTHERS
2212 
2213 #ifdef DOCUMENTATION
2214  };
2215 #endif
2216 
2218 
2219  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
2220  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
2221 
2222 #ifdef DOCUMENTATION
2223 
2240  public:
2241 #endif
2242 
2243 #ifdef DOCUMENTATION
2244 
2252 #else
2253  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "stride", "",
2254  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2255 #endif
2256 
2257 #ifdef DOCUMENTATION
2258 
2266 #else
2267  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "offset", "",
2268  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2269 #endif
2270 
2271 #ifdef DOCUMENTATION
2272 
2277  size_t get_index() const;
2278  void set_index(size_t);
2280 #else
2281  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
2282  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2283 #endif
2284 
2285 #ifdef DOCUMENTATION
2286 
2291  size_t get_modulus() const;
2292  void set_modulus(size_t);
2294 #else
2295  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
2296  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2297 #endif
2298 
2299  DECLARE_OTHERS(AsmIndirectRegisterExpression);
2300 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
2301 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2302  private:
2303  friend class boost::serialization::access;
2304 
2305  template<class S>
2306  void serialize(S &s, const unsigned /*version*/) {
2307  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
2308  s & BOOST_SERIALIZATION_NVP(p_stride);
2309  s & BOOST_SERIALIZATION_NVP(p_offset);
2310  s & BOOST_SERIALIZATION_NVP(p_index);
2311  s & BOOST_SERIALIZATION_NVP(p_modulus);
2312  }
2313 #endif
2314 
2315  private:
2316  // Default c'tor needed for serialization
2318  : p_index(0), p_modulus(0) {}
2319 #endif // SgAsmIndirectRegisterExpression_OTHERS
2320 
2321 #ifdef DOCUMENTATION
2322  };
2323 #endif
2324 
2326 
2327  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
2328  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
2329  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
2330  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
2331 
2332 #ifdef DOCUMENTATION
2333 
2335  public:
2336 #endif
2337 
2338 #ifdef DOCUMENTATION
2339 
2345 #else
2346  AsmRegisterReferenceExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "descriptor", "",
2347  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2348 #endif
2349 
2350 #ifdef DOCUMENTATION
2351 
2356  int get_adjustment() const;
2357  void set_adjustment(int);
2359 #else
2360  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
2361  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
2362  NO_DELETE);
2363 #endif
2364 
2365  DECLARE_OTHERS(AsmRegisterReferenceExpression);
2366 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2367 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2368  private:
2369  friend class boost::serialization::access;
2370 
2371  template<class S>
2372  void serialize(S &s, const unsigned /*version*/) {
2373  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2374  s & BOOST_SERIALIZATION_NVP(p_descriptor);
2375  s & BOOST_SERIALIZATION_NVP(p_adjustment);
2376  }
2377 #endif
2378 
2379  protected:
2380  // Default c'tor needed for serialization
2382  : p_adjustment(0) {}
2383 #endif // SgAsmRegisterReferenceExpression_OTHERS
2384 
2385 #ifdef DOCUMENTATION
2386  };
2387 #endif
2388 
2390 
2391  DECLARE_LEAF_CLASS(AsmRegisterNames);
2392  IS_SERIALIZABLE(AsmRegisterNames);
2393 
2394 #ifdef DOCUMENTATION
2395 
2397  public:
2398 #endif
2399 
2400 #ifdef DOCUMENTATION
2401 
2407  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
2408  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
2410 #else
2411  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
2412  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2413 #endif
2414 
2415 #ifdef DOCUMENTATION
2416 
2422  unsigned get_mask() const;
2423  void set_mask(unsigned);
2425 #else
2426  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
2427  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2428 #endif
2429 
2430  DECLARE_OTHERS(AsmRegisterNames);
2431 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
2432 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2433  private:
2434  friend class boost::serialization::access;
2435 
2436  template<class S>
2437  void serialize(S &s, const unsigned /*version*/) {
2438  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2439  s & BOOST_SERIALIZATION_NVP(p_registers);
2440  s & BOOST_SERIALIZATION_NVP(p_mask);
2441  }
2442 #endif
2443 #endif // SgAsmRegisterNames_OTHERS
2444 
2445 #ifdef DOCUMENTATION
2446  };
2447 #endif
2448 
2450 
2451  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2452  IS_SERIALIZABLE(AsmIntegerValueExpression);
2453 
2454 #ifdef DOCUMENTATION
2455 
2471  public:
2472 #endif
2473 
2474 #ifdef DOCUMENTATION
2475 
2485  SgNode* get_baseNode() const;
2486  void set_baseNode(SgNode*);
2488 #else
2489  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2490  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2491 #endif
2492 
2493  DECLARE_OTHERS(AsmIntegerValueExpression);
2494 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2495 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2496  private:
2497  friend class boost::serialization::access;
2498 
2499  template<class S>
2500  void serialize(S &s, const unsigned /*version*/) {
2501  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2502  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2503  }
2504 #endif
2505 
2506  public:
2511  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2512 
2519 
2521  static uint64_t virtualAddress(SgNode*);
2522 
2542  std::string get_label(bool quiet=false) const;
2543 
2545  size_t get_significantBits() const;
2546 
2552  void makeRelativeTo(SgNode *baseNode);
2553 
2558  uint64_t get_baseAddress() const;
2559 
2565  uint64_t get_absoluteValue(size_t nbits=0) const;
2566 
2570  void set_absoluteValue(uint64_t);
2571 
2573  int64_t get_signedValue() const;
2574 
2578  int64_t get_relativeValue() const;
2579 
2584  void set_relativeValue(int64_t v, size_t nbits=64);
2585 
2586  uint64_t get_value() const { return get_absoluteValue(); }
2587 
2588 #endif // SgAsmIntegerValueExpression_OTHERS
2589 
2590 #ifdef DOCUMENTATION
2591  };
2592 #endif
2593 
2595 
2596  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2597  IS_SERIALIZABLE(AsmFloatValueExpression);
2598 
2599 #ifdef DOCUMENTATION
2600 
2605  public:
2606 #endif
2607 
2608  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2609 
2610  DECLARE_OTHERS(AsmFloatValueExpression);
2611 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2612  private:
2613  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2614  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2615  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2616  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2617  // understand "mutable".
2618  mutable double p_nativeValue;
2619  mutable bool p_nativeValueIsValid;
2620 
2621 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2622  private:
2623  friend class boost::serialization::access;
2624 
2625  template<class S>
2626  void serialize(S &s, const unsigned /*version*/) {
2627  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2628  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2629  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2630  }
2631 #endif
2632 
2633  public:
2638  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2639 
2645  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2646 
2653 
2655  void set_nativeValue(double);
2656 
2658  double get_nativeValue() const;
2659 
2664  void updateBitVector();
2665 
2670  void updateNativeValue() const;
2671 #endif // SgAsmFloatValueExpression_OTHERS
2672 
2673 #ifdef DOCUMENTATION
2674  };
2675 #endif
2676 
2678 
2679  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2680  AsmIntegerValueExpression | AsmFloatValueExpression,
2681  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2682  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2683  IS_SERIALIZABLE(AsmConstantExpression);
2684 
2685  DECLARE_HEADERS(AsmConstantExpression);
2686 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2687  #include <Sawyer/BitVector.h>
2688 #endif // SgAsmConstantExpression_HEADERS
2689 
2690 #ifdef DOCUMENTATION
2691 
2696  public:
2697 #endif
2698 
2699 #ifndef DOCUMENTATION
2700  // Documented below. Implemented below due to ROSETTA limitations.
2701  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2702  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2703 #endif
2704 
2705  DECLARE_OTHERS(AsmConstantExpression);
2706 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2707 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2708  private:
2709  friend class boost::serialization::access;
2710 
2711  template<class S>
2712  void serialize(S &s, const unsigned /*version*/) {
2713  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2714  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2715  }
2716 #endif
2717 
2718  public:
2724  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2725  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2726  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2728 #endif // SgAsmConstantExpression_OTHERS
2729 
2730 #ifdef DOCUMENTATION
2731  };
2732 #endif
2733 
2735 
2736  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2737  AsmConstantExpression,
2738  "AsmValueExpression", "AsmValueExpressionTag", false);
2739  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2740  IS_SERIALIZABLE(AsmValueExpression);
2741 
2742 #ifdef DOCUMENTATION
2743 
2751  public:
2752 #endif
2753 
2754 #ifdef DOCUMENTATION
2755 
2765 #else
2766  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
2767  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2768 #endif
2769 
2770 #ifdef DOCUMENTATION
2771 
2779  unsigned short get_bit_offset() const;
2780  void set_bit_offset(unsigned short);
2782 #else
2783  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
2784  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2785 #endif
2786 
2787 #ifdef DOCUMENTATION
2788 
2794  unsigned short get_bit_size() const;
2795  void set_bit_size(unsigned short);
2797 #else
2798  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
2799  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2800 #endif
2801 
2802 #ifdef DOCUMENTATION
2803 
2809  SgSymbol* get_symbol() const;
2810  void set_symbol(SgSymbol*);
2812 #else
2813  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
2814  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2815 #endif
2816 
2817  DECLARE_OTHERS(AsmValueExpression);
2818 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
2819 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2820  private:
2821  friend class boost::serialization::access;
2822 
2823  template<class S>
2824  void serialize(S &s, const unsigned /*version*/) {
2825  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2826  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
2827  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
2828  s & BOOST_SERIALIZATION_NVP(p_bit_size);
2829 #if 1
2830  ASSERT_require2(p_symbol == NULL, "not implemented yet");
2831 #else
2832  s & BOOST_SERIALIZATION_NVP(p_symbol);
2833 #endif
2834  }
2835 #endif
2836 #endif // SgAsmValueExpression_OTHERS
2837 
2838 #ifdef DOCUMENTATION
2839  };
2840 #endif
2841 
2843 
2844  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
2845  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
2846 
2847 #ifdef DOCUMENTATION
2848 
2850  public:
2851 #endif
2852 
2853 #ifdef DOCUMENTATION
2854 
2861  SgAsmExpression* get_address() const;
2864 #else
2865  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
2866  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2867 #endif
2868 
2869 #ifdef DOCUMENTATION
2870 
2877  SgAsmExpression* get_segment() const;
2880 #else
2881  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
2882  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2883 #endif
2884 
2885  DECLARE_OTHERS(AsmMemoryReferenceExpression);
2886 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2887 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2888  private:
2889  friend class boost::serialization::access;
2890 
2891  template<class S>
2892  void serialize(S &s, const unsigned /*version*/) {
2893  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2894  s & BOOST_SERIALIZATION_NVP(p_address);
2895  s & BOOST_SERIALIZATION_NVP(p_segment);
2896  }
2897 #endif
2898 #endif // SgAsmMemoryReferenceExpression_OTHERS
2899 
2900 #ifdef DOCUMENTATION
2901  };
2902 #endif
2903 
2905 
2906  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
2907  IS_SERIALIZABLE(AsmControlFlagsExpression);
2908 
2909 #ifdef DOCUMENTATION
2910  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2912  public:
2913 #endif
2914 
2915 #ifndef DOCUMENTATION
2916  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
2917  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2918 #endif
2919 
2920  DECLARE_OTHERS(AsmControlFlagsExpression);
2921 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
2922 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2923  private:
2924  friend class boost::serialization::access;
2925 
2926  template<class S>
2927  void serialize(S &s, const unsigned /*version*/) {
2928  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2929  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
2930  }
2931 #endif
2932 #endif // SgAsmControlFlagsExpression_OTHERS
2933 
2934 #ifdef DOCUMENTATION
2935  };
2936 #endif
2937 
2939 
2940  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
2941  IS_SERIALIZABLE(AsmCommonSubExpression);
2942 
2943 #ifdef DOCUMENTATION
2944  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2946  public:
2947 #endif
2948 
2949 #ifndef DOCUMENTATION
2950  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
2951  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2952 #endif
2953 
2954  DECLARE_OTHERS(AsmCommonSubExpression);
2955 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
2956 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2957  private:
2958  friend class boost::serialization::access;
2959 
2960  template<class S>
2961  void serialize(S &s, const unsigned /*version*/) {
2962  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2963  s & BOOST_SERIALIZATION_NVP(p_subexpression);
2964  }
2965 #endif
2966 #endif // SgAsmCommonSubExpression_OTHERS
2967 
2968 #ifdef DOCUMENTATION
2969  };
2970 #endif
2971 
2973 
2974  DECLARE_LEAF_CLASS(AsmRiscOperation);
2975  IS_SERIALIZABLE(AsmRiscOperation);
2976 
2977 #ifdef DOCUMENTATION
2978 
2987  public:
2988 #endif
2989 
2990 #ifdef DOCUMENTATION
2991 
3000 #else
3001  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
3002  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3003 #endif
3004 
3005 #ifdef DOCUMENTATION
3006 
3012  SgAsmExprListExp* get_operands() const;
3015 #else
3016  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
3017  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3018 #endif
3019 
3020  DECLARE_OTHERS(AsmRiscOperation);
3021 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
3022  public:
3029  OP_NONE,
3030  OP_bottom,
3031  OP_undefined,
3032  OP_unspecified,
3033  OP_filterCallTarget,
3034  OP_filterReturnTarget,
3035  OP_filterIndirectJumpTarget,
3036  OP_hlt,
3037  OP_cpuid,
3038  OP_rdtsc,
3039  OP_and_,
3040  OP_or_,
3041  OP_xor_,
3042  OP_invert,
3043  OP_extract,
3044  OP_concat,
3045  OP_leastSignificantSetBit,
3046  OP_mostSignificantSetBit,
3047  OP_rotateLeft,
3048  OP_rotateRight,
3049  OP_shiftLeft,
3050  OP_shiftRight,
3051  OP_shiftRightArithmetic,
3052  OP_equalToZero,
3053  OP_ite,
3054  OP_isEqual,
3055  OP_isNotEqual,
3056  OP_isUnsignedLessThan,
3057  OP_isUnsignedLessThanOrEqual,
3058  OP_isUnsignedGreaterThan,
3059  OP_isUnsignedGreaterThanOrEqual,
3060  OP_isSignedLessThan,
3061  OP_isSignedLessThanOrEqual,
3062  OP_isSignedGreaterThan,
3063  OP_isSignedGreaterThanOrEqual,
3064  OP_unsignedExtend,
3065  OP_signExtend,
3068  OP_subtract,
3069  OP_negate,
3070  OP_signedDivide,
3071  OP_signedModulo,
3072  OP_signedMultiply,
3073  OP_unsignedDivide,
3074  OP_unsignedModulo,
3075  OP_unsignedMultiply,
3076  OP_interrupt,
3077  OP_readRegister,
3078  OP_peekRegister,
3079  OP_writeRegister,
3081  OP_peekMemory,
3083  OP_N_OPERATORS // MUST BE LAST!
3084  };
3085 
3086 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3087  private:
3088  friend class boost::serialization::access;
3089 
3090  template<class S>
3091  void serialize(S &s, const unsigned /*version*/) {
3092  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3093  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
3094  s & BOOST_SERIALIZATION_NVP(p_operands);
3095  }
3096 #endif
3097 #endif // SgAsmRiscOperation_OTHERS
3098 
3099 #ifdef DOCUMENTATION
3100  };
3101 #endif
3102 
3104 
3105  DECLARE_LEAF_CLASS(AsmExprListExp);
3106  IS_SERIALIZABLE(AsmExprListExp);
3107 
3108 #ifdef DOCUMENTATION
3109 
3111  public:
3112 #endif
3113 
3114 #ifdef DOCUMENTATION
3115 
3121  const SgAsmExpressionPtrList& get_expressions() const;
3122  void set_expressions(const SgAsmExpressionPtrList&);
3124 #else
3125  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
3126  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3127 #endif
3128 
3129  DECLARE_OTHERS(AsmExprListExp);
3130 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
3131 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3132  private:
3133  friend class boost::serialization::access;
3134 
3135  template<class S>
3136  void serialize(S &s, const unsigned /*version*/) {
3137  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3138  s & BOOST_SERIALIZATION_NVP(p_expressions);
3139  }
3140 #endif
3141 #endif // SgAsmExprListExp_OTHERS
3142 
3143 #ifdef DOCUMENTATION
3144  };
3145 #endif
3146 
3148 
3149  NEW_NONTERMINAL_MACRO(AsmExpression,
3150  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
3151  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
3152  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
3153  AsmRiscOperation,
3154  "AsmExpression", "AsmExpressionTag", false);
3155  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
3156  IS_SERIALIZABLE(AsmExpression);
3157 
3158 #ifdef DOCUMENTATION
3159 
3160  class SgAsmExpression: public SgAsmNode {
3161  public:
3162 #endif
3163 
3164 #ifdef DOCUMENTATION
3165 
3170  SgAsmType* get_type() const;
3171  void set_type(SgAsmType*);
3173 #else
3174  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
3175  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3176 #endif
3177 
3178 #ifdef DOCUMENTATION
3179 
3184  const std::string& get_comment() const;
3185  void set_comment(const std::string&);
3187 #else
3188  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
3189  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3190 #endif
3191 
3192  DECLARE_OTHERS(AsmExpression);
3193 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
3194 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3195  private:
3196  friend class boost::serialization::access;
3197 
3198  template<class S>
3199  void serialize(S &s, const unsigned /*version*/) {
3200  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3201  s & BOOST_SERIALIZATION_NVP(p_type);
3202  s & BOOST_SERIALIZATION_NVP(p_comment);
3203  }
3204 #endif
3205 
3206  public:
3210  size_t get_nBits() const;
3211 
3217 
3223 
3224 #endif // SgAsmExpression_OTHERS
3225 
3226 #ifdef DOCUMENTATION
3227  };
3228 #endif
3229 
3230 
3231 
3232 
3234 
3235  /***************************************************************************************************************************
3236  * Data Types (new interface 2014-07)
3237  *
3238  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
3239  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
3240  * 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
3241  * don't allow types to be modified after they're created.
3242  ***************************************************************************************************************************/
3243 
3245 
3246  DECLARE_LEAF_CLASS(AsmIntegerType);
3247  IS_SERIALIZABLE(AsmIntegerType);
3248 
3249 #ifdef DOCUMENTATION
3250 
3252  public:
3253 #endif
3254 
3255 #ifndef DOCUMENTATION
3256  // Documented below due to ROSETTA limitations
3257  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
3258  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3259 #endif
3260 
3261  DECLARE_OTHERS(AsmIntegerType);
3262 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
3263 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3264  private:
3265  friend class boost::serialization::access;
3266 
3267  template<class S>
3268  void serialize(S &s, const unsigned /*version*/) {
3269  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
3270  s & BOOST_SERIALIZATION_NVP(p_isSigned);
3271  }
3272 #endif
3273 
3274  public:
3278  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
3279 
3283  bool get_isSigned() const;
3284 
3285  // Overrides documented in base class
3286  virtual void check() const $ROSE_OVERRIDE;
3287  virtual std::string toString() const $ROSE_OVERRIDE;
3288 #endif // SgAsmIntegerType_OTHERS
3289 
3290 #ifdef DOCUMENTATION
3291  };
3292 #endif
3293 
3295 
3296  DECLARE_LEAF_CLASS(AsmFloatType);
3297  IS_SERIALIZABLE(AsmFloatType);
3298 
3299  DECLARE_HEADERS(AsmFloatType);
3300 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
3301  #include <Sawyer/BitVector.h>
3302  #include <BitFlags.h>
3303 #endif // SgAsmFloatType_HEADERS
3304 
3305 #ifdef DOCUMENTATION
3306 
3308  public:
3309 #endif
3310 
3311 #ifndef DOCUMENTATION
3312  // Documented below because of ROSETTA limitations (they're read-only)
3313  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
3314  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3315  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
3316  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3317  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
3318  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3319  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
3320  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3321  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
3322  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3323  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
3324  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3325  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
3326  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3327 #endif
3328 
3329  DECLARE_OTHERS(AsmFloatType);
3330 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
3331 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3332  private:
3333  friend class boost::serialization::access;
3334 
3335  template<class S>
3336  void serialize(S &s, const unsigned /*version*/) {
3337  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
3338  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
3339  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
3340  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
3341  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
3342  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
3343  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
3344  s & BOOST_SERIALIZATION_NVP(p_flags);
3345  }
3346 #endif
3347 
3348  public:
3350  enum Flag {
3351  GRADUAL_UNDERFLOW = 0x00000001,
3353  };
3354 
3357 
3360 
3362  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
3363  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
3364  uint64_t exponentBias, Flags flags);
3365 
3367  BitRange significandBits() const;
3368 
3370  BitRange exponentBits() const;
3371 
3373  size_t signBit() const;
3374 
3376  uint64_t exponentBias() const;
3377 
3379  Flags flags() const;
3380 
3385  static Flags ieeeFlags();
3386 
3392  bool gradualUnderflow() const;
3393 
3401  bool implicitBitConvention() const;
3402 
3405  // Overrides documented in base class
3406  virtual void check() const $ROSE_OVERRIDE;
3407  virtual std::string toString() const $ROSE_OVERRIDE;
3408 #endif // SgAsmFloatType_OTHERS
3409 
3410 #ifdef DOCUMENTATION
3411  };
3412 #endif
3413 
3415 
3416  NEW_NONTERMINAL_MACRO(AsmScalarType,
3417  AsmIntegerType | AsmFloatType,
3418  "AsmScalarType", "AsmScalarTypeTag", false);
3419  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
3420  IS_SERIALIZABLE(AsmScalarType);
3421 
3422 #ifdef DOCUMENTATION
3423 
3424  class SgAsmScalarType: public SgAsmType {
3425  public:
3426 #endif
3427 
3428 #ifndef DOCUMENTATION
3429  // Documented below due to ROSETTA limitations (read-only)
3430  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3431  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3432  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3433  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3434  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
3435  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3436  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
3437  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3438 #endif
3439 
3440  DECLARE_OTHERS(AsmScalarType);
3441 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
3442 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3443  private:
3444  friend class boost::serialization::access;
3445 
3446  template<class S>
3447  void serialize(S &s, const unsigned /*version*/) {
3448  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3449  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
3450  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
3451  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
3452  s & BOOST_SERIALIZATION_NVP(p_nBits);
3453  }
3454 #endif
3455 
3456  protected:
3461  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
3462 
3463  public:
3465  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3466 
3468  ByteOrder::Endianness get_minorOrder() const;
3469 
3471  ByteOrder::Endianness get_majorOrder() const;
3472 
3474  size_t get_majorNBytes() const;
3475 
3476  // Overrides documented in base class
3477  virtual void check() const $ROSE_OVERRIDE;
3478  virtual std::string toString() const $ROSE_OVERRIDE;
3479 #endif // SgAsmScalarType_OTHERS
3480 
3481 #ifdef DOCUMENTATION
3482  };
3483 #endif
3484 
3486 
3487  DECLARE_LEAF_CLASS(AsmVectorType);
3488  IS_SERIALIZABLE(AsmVectorType);
3489 
3490 #ifdef DOCUMENTATION
3491 
3492  class SgAsmVectorType: public SgAsmType {
3493  public:
3494 #endif
3495 
3496 #ifndef DOCUMENTATION
3497  // Documented below due to ROSETTA limitations (read-only)
3498  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3499  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3500  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3501  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3502 #endif
3503 
3504  DECLARE_OTHERS(AsmVectorType);
3505 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3506 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3507  private:
3508  friend class boost::serialization::access;
3509 
3510  template<class S>
3511  void serialize(S &s, const unsigned /*version*/) {
3512  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3513  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3514  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3515  }
3516 #endif
3517 
3518  public:
3520  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3521 
3523  size_t get_nElmts() const;
3524 
3526  SgAsmType* get_elmtType() const;
3527 
3528  // Overrides documented in base class
3529  virtual void check() const $ROSE_OVERRIDE;
3530  virtual std::string toString() const $ROSE_OVERRIDE;
3531  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3532 #endif // SgAsmVectorType_OTHERS
3533 
3534 #ifdef DOCUMENTATION
3535  };
3536 #endif
3537 
3539 
3540  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3541  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3542  IS_SERIALIZABLE(AsmType);
3543 
3544 #ifdef DOCUMENTATION
3545 
3546  class SgAsmType: public SgAsmNode {
3547  public:
3548 #endif
3549 
3550  DECLARE_OTHERS(AsmType);
3551 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3552  private:
3554 
3555 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3556  private:
3557  friend class boost::serialization::access;
3558 
3559  template<class S>
3560  void serialize(S &s, const unsigned /*version*/) {
3561  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3562  }
3563 #endif
3564 
3565  public:
3573  virtual void check() const;
3574 
3580  virtual std::string toString() const {
3581  abort(); // ROSETTA limitation: intended pure virtual
3582  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3583  }
3584 
3586  virtual size_t get_nBits() const {
3587  abort(); // ROSETTA limitation: intended pure virtual
3588  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3589  }
3590 
3592  virtual size_t get_nBytes() const;
3593 
3599  template<class Type> // Type is a subclass of SgAsmType
3600  static Type* registerOrDelete(Type *toInsert) {
3601  ASSERT_not_null(toInsert);
3602  std::string key = toInsert->toString();
3603  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3604  ASSERT_not_null(retval);
3605  if (retval!=toInsert)
3606  delete toInsert;
3607  return retval;
3608  }
3609 #endif // SgAsmType_OTHERS
3610 
3611 #ifdef DOCUMENTATION
3612  };
3613 #endif
3614 
3615 
3616 
3618 
3619  /**************************************************************************************************************************
3620  * Collections of Instructions
3621  **************************************************************************************************************************/
3622 
3624 
3625  DECLARE_LEAF_CLASS(AsmFunction);
3626  IS_SERIALIZABLE(AsmFunction);
3627 
3628 #ifdef DOCUMENTATION
3629 
3645  public:
3646 #endif
3647 
3648 #ifdef DOCUMENTATION
3649 
3654  const std::string& get_name() const;
3655  void set_name(const std::string&);
3657 #else
3658  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3659  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3660 #endif
3661 
3662 #ifdef DOCUMENTATION
3663 
3669  unsigned get_reason() const;
3670  void set_reason(unsigned);
3672 #else
3673  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3674  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3675 #endif
3676 
3677 #ifdef DOCUMENTATION
3678 
3685  const std::string& get_reasonComment() const;
3686  void set_reasonComment(const std::string&);
3688 #else
3689  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
3690  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3691 #endif
3692 
3693 #ifdef DOCUMENTATION
3694 
3702 #else
3703  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3704  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3705 #endif
3706 
3707 #ifdef DOCUMENTATION
3708 
3711  MayReturn get_may_return() const;
3712  void set_may_return(MayReturn);
3714 #else
3715  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3716  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3717 #endif
3718 
3719 #ifdef DOCUMENTATION
3720 
3725  const std::string& get_name_md5() const;
3726  void set_name_md5(const std::string&);
3728 #else
3729  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3730  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3731 #endif
3732 
3733 #ifdef DOCUMENTATION
3734 
3739  const SgAsmStatementPtrList& get_statementList() const;
3740  void set_statementList(const SgAsmStatementPtrList&);
3742 #else
3743  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3744  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3745 #endif
3746 
3747 #ifdef DOCUMENTATION
3748  // FIXME[Robb P Matzke 2017-02-13]: unused?
3749 #else
3750  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3751  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3752 #endif
3753 
3754 #ifdef DOCUMENTATION
3755 
3761  rose_addr_t get_entry_va() const;
3762  void set_entry_va(rose_addr_t);
3764 #else
3765  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3766  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3767 #endif
3768 
3769 #ifdef DOCUMENTATION
3770 
3779 #else
3780  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3781  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3782 #endif
3783 
3784 #ifdef DOCUMENTATION
3785  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3786 #else
3787  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3788  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3789 #endif
3790 
3791 #ifdef DOCUMENTATION
3792 
3801  int64_t get_stackDelta() const;
3802  void set_stackDelta(int64_t);
3804 #else
3805  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3806  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3807 #endif
3808 
3809 #ifdef DOCUMENTATION
3810 
3818  const std::string& get_callingConvention() const;
3819  void set_callingConvention(const std::string&);
3821 #else
3822  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3823  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3824 #endif
3825 
3826  DECLARE_OTHERS(AsmFunction);
3827 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3828 
3829 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3830  private:
3831  friend class boost::serialization::access;
3832 
3833  template<class S>
3834  void serialize(S &s, const unsigned /*version*/) {
3835  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3836  s & BOOST_SERIALIZATION_NVP(p_name);
3837  s & BOOST_SERIALIZATION_NVP(p_reason);
3838  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
3839  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3840  s & BOOST_SERIALIZATION_NVP(p_may_return);
3841  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3842  s & BOOST_SERIALIZATION_NVP(p_statementList);
3843  s & BOOST_SERIALIZATION_NVP(p_dest);
3844  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3845  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3846  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3847  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3848  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3849  }
3850 #endif
3851 
3852  public:
3855 
3859  void remove_statement(SgAsmStatement* statement);
3860 
3865  SgAsmBlock* get_entry_block() const;
3866 
3868  enum MayReturn {
3873  };
3874 
3879  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3880  // Also fix SgAsmFunction::reason_key()
3881  FUNC_NONE = 0x00000000,
3882  FUNC_THUNK_TARGET= 0x00004000,
3884  = 0x00008000,
3885  FUNC_ENTRY_POINT = 0x00010000,
3886  FUNC_CALL_TARGET = 0x00020000,
3889  FUNC_CALL_INSN = 0x00040000,
3895  FUNC_EH_FRAME = 0x00080000,
3896  FUNC_SYMBOL = 0x00100000,
3897  FUNC_PATTERN = 0x00200000,
3902  FUNC_GRAPH = 0x00400000,
3906  FUNC_USERDEF = 0x00800000,
3907  FUNC_PADDING = 0x01000000,
3912  FUNC_DISCONT = 0x02000000,
3915  FUNC_INSNHEAD = 0x04000000,
3916  FUNC_IMPORT = 0x08000000,
3919  FUNC_LEFTOVERS = 0x10000000,
3923  FUNC_INTRABLOCK = 0x20000000,
3931  FUNC_THUNK = 0x40000000,
3940  FUNC_EXPORT = 0x80000000,
3942  FUNC_DEFAULT = 0xefff80ff,
3944  /*========= Miscellaneous Reasons ===========================================================================
3945  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3946  * availalble for users to use as they see fit. */
3947  FUNC_MISCMASK = 0x000000ff,
3962  };
3963 
3967  static std::string reason_key(const std::string &prefix="");
3968 
3970  std::string reason_str(bool pad) const;
3971 
3975  static std::string reason_str(bool pad, unsigned reason);
3976 
3979  public:
3980  virtual ~NodeSelector() {}
3981  virtual bool operator()(SgNode*) = 0;
3982  };
3983 
4023  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
4024  NodeSelector *selector=NULL);
4025 
4031  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
4032 
4035  e_unknown = 0,
4036  e_standard = 1,
4037  e_library = 2,
4038  e_imported = 3,
4039  e_thunk = 4,
4040  e_last
4041  };
4042 #endif // SgAsmFunction_OTHERS
4043 
4044 
4045 #ifdef DOCUMENTATION
4046  };
4047 #endif
4048 
4049 
4051 
4052  DECLARE_LEAF_CLASS(AsmBlock);
4053  IS_SERIALIZABLE(AsmBlock);
4054 
4055 #ifdef DOCUMENTATION
4056 
4076  class SgAsmBlock: public SgAsmStatement {
4077  public:
4078 #endif
4079 
4080 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
4081  // [tps 05Apr07] needed for the control_flow_graph
4082  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
4083  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4084 #endif
4085 
4086 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
4087  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
4088  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4089 #endif
4090 
4091 #ifdef DOCUMENTATION
4092 
4097  rose_addr_t get_id() const;
4098  void set_id(rose_addr_t);
4100 #else
4101  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
4102  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4103 #endif
4104 
4105 #ifdef DOCUMENTATION
4106 
4111  unsigned get_reason() const;
4112  void set_reason(unsigned);
4114 #else
4115  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
4116  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4117 #endif
4118 
4119 #ifdef DOCUMENTATION
4120  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
4121  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
4122  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
4123  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
4130  const SgAsmStatementPtrList& get_statementList() const;
4131  void set_statementList(const SgAsmStatementPtrList&);
4133 #else
4134  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
4135  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4136 #endif
4137 
4138 #ifdef DOCUMENTATION
4139  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
4140  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
4141  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
4142  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
4150  const SgAsmIntegerValuePtrList& get_successors() const;
4151  void set_successors(const SgAsmIntegerValuePtrList&);
4153 #else
4154  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
4155  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4156 #endif
4157 
4158 #ifdef DOCUMENTATION
4159 
4169  bool get_successors_complete() const;
4170  void set_successors_complete(bool);
4172 #else
4173  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
4174  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4175 #endif
4176 
4177 #ifdef DOCUMENTATION
4178 
4190 #else
4191  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
4192  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4193 #endif
4194 
4195 #ifdef DOCUMENTATION
4196 
4204  size_t get_cached_vertex() const;
4205  void set_cached_vertex(size_t);
4207 #else
4208  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
4209  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4210 #endif
4211 
4212 #ifdef DOCUMENTATION
4213 
4219  double get_code_likelihood() const;
4220  void set_code_likelihood(double);
4222 #else
4223  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
4224  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4225 #endif
4226 
4227 #ifdef DOCUMENTATION
4228 
4236  int64_t get_stackDeltaOut() const;
4237  void set_stackDeltaOut(int64_t);
4239 #else
4240  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
4241  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4242 #endif
4243 
4244  DECLARE_OTHERS(AsmBlock);
4245 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
4246 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4247  private:
4248  friend class boost::serialization::access;
4249 
4250  template<class S>
4251  void serialize(S &s, const unsigned /*version*/) {
4252  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4253  s & BOOST_SERIALIZATION_NVP(p_reason);
4254  s & BOOST_SERIALIZATION_NVP(p_statementList);
4255  s & BOOST_SERIALIZATION_NVP(p_successors);
4256  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
4257  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
4258  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
4259  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
4260  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
4261  }
4262 #endif
4263 
4264  public:
4266  enum Reason {
4267  // Please update SgAsmBlock::reason_str() if you change this enum!
4268  BLK_NONE = 0x00000000,
4269  BLK_ENTRY_POINT = 0x00010000,
4270  BLK_PADDING = 0x00020000,
4271  BLK_FRAGMENT = 0x00080000,
4273  BLK_CFGHEAD = 0x00100000,
4274  BLK_USERDEF = 0x00200000,
4275  BLK_LEFTOVERS = 0x00400000,
4277  BLK_JUMPTABLE = 0x00800000,
4278  BLK_GRAPH1 = 0x01000000,
4279  BLK_GRAPH2 = 0x02000000,
4280  BLK_GRAPH3 = 0x04000000,
4282  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
4283 
4284  // ========= Miscellaneous Reasons ===========================================================================
4285  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
4286  // availalble for users to use as they see fit.
4287  BLK_MISCMASK = 0x000000ff,
4289  BLK_FINDDATA = 0x00000001,
4291  BLK_POSTFUNC = 0x00000002
4293  };
4294 
4299 
4304 
4305  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
4310  void remove_children();
4311 
4316  rose_addr_t get_fallthrough_va();
4317 
4322 
4328  bool has_instructions() const;
4329 
4335  bool is_basic_block() const { return has_instructions(); }
4336 
4346  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
4347 
4351  static std::string reason_key(const std::string &prefix="");
4352 
4356  std::string reason_str(bool pad) const;
4357 
4363  static std::string reason_str(bool pad, unsigned reason);
4364 #endif // SgAsmBlock_OTHERS
4365 
4366 #ifdef DOCUMENTATION
4367  };
4368 #endif
4369 
4370 
4372 
4373  DECLARE_LEAF_CLASS(AsmStaticData);
4374  IS_SERIALIZABLE(AsmStaticData);
4375 
4376 #ifdef DOCUMENTATION
4377 
4385  public:
4386 #endif
4387 
4388 #ifdef DOCUMENTATION
4389 
4395  const SgUnsignedCharList& get_raw_bytes() const;
4396  void set_raw_bytes(const SgUnsignedCharList&);
4398 #else
4399  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
4400  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4401 #endif
4402 
4403  DECLARE_OTHERS(AsmStaticData);
4404 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
4405 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4406  private:
4407  friend class boost::serialization::access;
4408 
4409  template<class S>
4410  void serialize(S &s, const unsigned /*version*/) {
4411  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4412  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
4413  }
4414 #endif
4415 
4416  public:
4420  size_t get_size() const { return p_raw_bytes.size(); }
4421 #endif // SgAsmStaticData_OTHERS
4422 
4423 #ifdef DOCUMENTATION
4424  };
4425 #endif
4426 
4427 
4429 
4430  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
4431  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
4432 
4433 #ifdef DOCUMENTATION
4434 
4445  public:
4446 #endif
4447 
4448  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4449 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4450 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4451  private:
4452  friend class boost::serialization::access;
4453 
4454  template<class S>
4455  void serialize(S & s, const unsigned /*version*/) {
4456  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4457  }
4458 #endif
4459  protected:
4460  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4461 
4462  public:
4465  p_declarationList.push_back(declaration);
4466  }
4467 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4468 
4469 #ifdef DOCUMENTATION
4470  };
4471 #endif
4472 
4473 
4475 
4476  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4477  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4478 
4479 #ifdef DOCUMENTATION
4480  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4482  public:
4483 #endif
4484 
4485 #ifdef DOCUMENTATION
4486 
4489  const std::string& get_name() const;
4490  void set_name(const std::string&);
4492 #else
4493  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4494  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4495  NO_DELETE);
4496 #endif
4497 
4498 #ifdef DOCUMENTATION
4499  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4503  uint64_t get_offset() const;
4504  void set_ofset(uint64_t);
4506 #else
4507  // Not clear if we want to store the offset explicitly
4508  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4509  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4510  NO_DELETE);
4511 #endif
4512 
4513  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4514 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4515 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4516  private:
4517  friend class boost::serialization::access;
4518 
4519  template<class S>
4520  void serialize(S &s, const unsigned /*version*/) {
4521  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4522  }
4523 #endif
4524 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4525 
4526 #ifdef DOCUMENTATION
4527  };
4528 #endif
4529 
4530 
4532 
4533  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4534  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4535  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4536  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4537  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4538 
4539 #ifdef DOCUMENTATION
4540 
4547  public:
4548 #endif
4549 
4550  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4551 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4552 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4553  private:
4554  friend class boost::serialization::access;
4555 
4556  template<class S>
4557  void serialize(S &s, const unsigned /*version*/) {
4558  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4559  };
4560 #endif
4561 #endif // SgAsmSynthesizedDeclaration_OTHERS
4562 
4563 #ifdef DOCUMENTATION
4564  };
4565 #endif
4566 
4567 
4569 
4570  NEW_NONTERMINAL_MACRO(AsmStatement,
4571  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4572  "AsmStatement", "AsmStatementTag", false);
4573  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4574  IS_SERIALIZABLE(AsmStatement);
4575 
4576 #ifdef DOCUMENTATION
4577 
4581  class SgAsmStatement: public SgAsmNode {
4582  public:
4583 #endif
4584 
4585 #ifdef DOCUMENTATION
4586 
4591  rose_addr_t get_address() const;
4592  void set_address(rose_addr_t);
4594 #else
4595  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4596  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4597 #endif
4598 
4599 
4600 #ifdef DOCUMENTATION
4601 
4604  const std::string& get_comment() const;
4605  void set_comment(const std::string&);
4607 #else
4608  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4609  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4610 #endif
4611 
4612  DECLARE_OTHERS(AsmStatement);
4613 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4614 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4615  private:
4616  friend class boost::serialization::access;
4617 
4618  template<class S>
4619  void serialize(S &s, const unsigned /*version*/) {
4620  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4621  s & BOOST_SERIALIZATION_NVP(p_address);
4622  s & BOOST_SERIALIZATION_NVP(p_comment);
4623  }
4624 #endif
4625 #endif // SgAsmStatement_OTHERS
4626 
4627 #ifdef DOCUMENTATION
4628  };
4629 #endif
4630 
4631 
4632 
4633 
4635 
4636  /*************************************************************************************************************************
4637  * Binary Interpretations
4638  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4639  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4640  * an AST that represents a single, coherent sub-part of the file.
4641  *************************************************************************************************************************/
4642 
4644 
4645  DECLARE_LEAF_CLASS(AsmInterpretationList);
4646  IS_SERIALIZABLE(AsmInterpretationList);
4647 
4648 #ifdef DOCUMENTATION
4649 
4651  public:
4652 #endif
4653 
4654 #ifdef DOCUMENTATION
4655 
4664 #else
4665  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4666  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4667  NO_DELETE);
4668 #endif
4669 
4670  DECLARE_OTHERS(AsmInterpretationList);
4671 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4672 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4673  private:
4674  friend class boost::serialization::access;
4675 
4676  template<class S>
4677  void serialize(S &s, const unsigned /*version*/) {
4678  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4679  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4680  }
4681 #endif
4682 #endif // SgAsmInterpretationList_OTHERS
4683 
4684 #ifdef DOCUMENTATION
4685  };
4686 #endif
4687 
4689 
4690  DECLARE_LEAF_CLASS(AsmInterpretation);
4691  IS_SERIALIZABLE(AsmInterpretation);
4692 
4693  DECLARE_HEADERS(AsmInterpretation);
4694 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4695  #include <MemoryMap.h>
4696  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
4697 #endif // SgAsmInterpretation_HEADERS
4698 
4699 #ifdef DOCUMENTATION
4700 
4707  public:
4708 #endif
4709 
4710 #ifdef DOCUMENTATION
4711  // documentation and definition are below
4712 #else
4713  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4714 #endif
4715 
4716 #ifdef DOCUMENTATION
4717 
4728 #else
4729  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4730  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4731 #endif
4732 
4733 #ifdef DOCUMENTATION
4734 
4739  SgAsmBlock* get_global_block() const;
4742 #else
4743  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4744  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4745 #endif
4746 
4747  DECLARE_OTHERS(AsmInterpretation);
4748 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4749  private:
4751  const Rose::BinaryAnalysis::RegisterDictionary *p_registers;
4752  bool coverageComputed; // true iff percentageCoverage has been computed
4753  mutable InstructionMap instruction_map; // cached instruction map
4754 
4756  // disassembly into instructions.
4757  double percentageCoverage;
4758 
4759 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4760  private:
4761  friend class boost::serialization::access;
4762 
4763  template<class S>
4764  void serialize(S &s, const unsigned /*version*/) {
4765  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4766  s & BOOST_SERIALIZATION_NVP(p_headers);
4767  s & BOOST_SERIALIZATION_NVP(p_global_block);
4768  s & BOOST_SERIALIZATION_NVP(p_map);
4769  s & BOOST_SERIALIZATION_NVP(p_registers);
4770  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4771  s & BOOST_SERIALIZATION_NVP(instruction_map);
4772  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4773  }
4774 #endif
4775 
4776  public:
4779  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4780  ctor();
4781  }
4782 
4787  SgAsmGenericFilePtrList get_files() const;
4788 
4815  InstructionMap& get_instruction_map(bool recompute=false);
4816  void set_instruction_map(const InstructionMap&);
4823  void insert_instructions(InstructionMap&/*in,out*/);
4824 
4829  void erase_instructions(InstructionMap&/*in,out*/);
4830 
4836  void set_coverageComputed(bool x) { coverageComputed = x; }
4837  void set_percentageCoverage(double x) { percentageCoverage = x; }
4840  private:
4841  void ctor(); // finalize construction
4842 #endif // SgAsmInterpretation_OTHERS
4843 
4844 #ifdef DOCUMENTATION
4845  };
4846 #endif
4847 
4848 
4849 
4851 
4852  /*************************************************************************************************************************
4853  * ELF File Header
4854  *************************************************************************************************************************/
4855 
4857 
4858  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4859  IS_SERIALIZABLE(AsmElfFileHeader);
4860 
4861 #ifdef DOCUMENTATION
4862 
4871  public:
4872 #endif
4873 
4874 #ifdef DOCUMENTATION
4875 
4880  unsigned char get_e_ident_file_class() const;
4881  void set_e_ident_file_class(unsigned char);
4883 #else
4884  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4885  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4886 #endif
4887 
4888 #ifdef DOCUMENTATION
4889 
4894  unsigned char get_e_ident_data_encoding() const;
4895  void set_e_ident_data_encoding(unsigned char);
4897 #else
4898  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4899  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4900 #endif
4901 
4902 #ifdef DOCUMENTATION
4903 
4908  unsigned char get_e_ident_file_version() const;
4909  void set_e_ident_file_version(unsigned char*);
4911 #else
4912  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4913  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4914 #endif
4915 
4916 #ifdef DOCUMENTATION
4917 
4922  const SgUnsignedCharList& get_e_ident_padding() const;
4923  void set_e_ident_padding(const SgUnsignedCharList&);
4925 #else
4926  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4927  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4928 #endif
4929 
4930 #ifdef DOCUMENTATION
4931 
4936  unsigned long get_e_type() const;
4937  void set_e_type(unsigned long);
4939 #else
4940  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4941  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4942 #endif
4943 
4944 #ifdef DOCUMENTATION
4945 
4950  unsigned long get_e_machine() const;
4951  void set_e_machine(unsigned long);
4953 #else
4954  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4955  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4956 #endif
4957 
4958 #ifdef DOCUMENTATION
4959 
4964  unsigned long get_e_flags() const;
4965  void set_e_flags(unsigned long);
4967 #else
4968  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4969  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4970 #endif
4971 
4972 #ifdef DOCUMENTATION
4973 
4978  unsigned long get_e_ehsize() const;
4979  void set_e_ehsize(unsigned long);
4981 #else
4982  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4983  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4984 #endif
4985 
4986 #ifdef DOCUMENTATION
4987 
4992  unsigned long get_phextrasz() const;
4993  void set_phextrasz(unsigned long);
4995 #else
4996  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4997  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4998 #endif
4999 
5000 #ifdef DOCUMENTATION
5001 
5006  unsigned long get_e_phnum() const;
5007  void set_e_phnum(unsigned long);
5009 #else
5010  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
5011  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5012 #endif
5013 
5014 #ifdef DOCUMENTATION
5015 
5020  unsigned long get_shextrasz() const;
5021  void set_shextrasz(unsigned long);
5023 #else
5024  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
5025  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5026 #endif
5027 
5028 #ifdef DOCUMENTATION
5029 
5034  unsigned long get_e_shnum() const;
5035  void set_e_shnum(unsigned long);
5037 #else
5038  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
5039  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5040 #endif
5041 
5042 #ifdef DOCUMENTATION
5043 
5048  unsigned long get_e_shstrndx() const;
5049  void set_e_shstrndx(unsigned long);
5051 #else
5052  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
5053  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5054 #endif
5055 
5056 #ifdef DOCUMENTATION
5057 
5067 #else
5068  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
5069  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5070 #endif
5071 
5072 #ifdef DOCUMENTATION
5073 
5082 #else
5083  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
5084  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5085 #endif
5086 
5087  DECLARE_OTHERS(AsmElfFileHeader);
5088 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
5089 
5090 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5091  private:
5092  friend class boost::serialization::access;
5093 
5094  template<class S>
5095  void serialize(S &s, const unsigned /*version*/) {
5096  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
5097  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
5098  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
5099  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
5100  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
5101  s & BOOST_SERIALIZATION_NVP(p_e_type);
5102  s & BOOST_SERIALIZATION_NVP(p_e_machine);
5103  s & BOOST_SERIALIZATION_NVP(p_e_flags);
5104  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
5105  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
5106  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
5107  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
5108  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
5109  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
5110  s & BOOST_SERIALIZATION_NVP(p_section_table);
5111  s & BOOST_SERIALIZATION_NVP(p_segment_table);
5112  }
5113 #endif
5114 
5115  public:
5117  enum ObjectType {
5118  ET_NONE = 0
5119  ,ET_REL = 1
5120  ,ET_EXEC = 2
5121  ,ET_DYN = 3
5122  ,ET_CORE = 4
5124  ,ET_LOOS = 0xfe00
5125  ,ET_HIOS = 0xfeff
5126  ,ET_LOPROC = 0xff00
5127  ,ET_HIPROC = 0xffff
5128  };
5129 
5130  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
5131  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
5132  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
5133  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
5134  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
5135 #ifdef _MSC_VER
5136 # pragma pack (1)
5137 #endif
5138 
5145  unsigned char e_ident_magic[4];
5146  unsigned char e_ident_file_class;
5147  unsigned char e_ident_data_encoding;
5148  unsigned char e_ident_file_version;
5149  unsigned char e_ident_padding[9];
5150  uint16_t e_type;
5151  uint16_t e_machine;
5152  uint32_t e_version;
5153  uint32_t e_entry;
5154  uint32_t e_phoff;
5155  uint32_t e_shoff;
5156  uint32_t e_flags;
5157  uint16_t e_ehsize;
5158  uint16_t e_phentsize;
5159  uint16_t e_phnum;
5160  uint16_t e_shentsize;
5161  uint16_t e_shnum;
5162  uint16_t e_shstrndx;
5163  }
5164 #if !defined(SWIG) && !defined(_MSC_VER)
5165  __attribute__((packed))
5166 #endif
5167  ;
5168 
5170  unsigned char e_ident_magic[4];
5171  unsigned char e_ident_file_class;
5172  unsigned char e_ident_data_encoding;
5173  unsigned char e_ident_file_version;
5174  unsigned char e_ident_padding[9];
5175  uint16_t e_type;
5176  uint16_t e_machine;
5177  uint32_t e_version;
5178  uint64_t e_entry;
5179  uint64_t e_phoff;
5180  uint64_t e_shoff;
5181  uint32_t e_flags;
5182  uint16_t e_ehsize;
5183  uint16_t e_phentsize;
5184  uint16_t e_phnum;
5185  uint16_t e_shentsize;
5186  uint16_t e_shnum;
5187  uint16_t e_shstrndx;
5188  }
5189 #if !defined(SWIG) && !defined(_MSC_VER)
5190  __attribute__((packed))
5191 #endif
5192  ;
5193 
5194 #ifdef _MSC_VER
5195 # pragma pack ()
5196 #endif
5197 
5205  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
5206  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
5207  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
5208  ctor();
5209  }
5210 
5216  uint64_t max_page_size();
5217 
5220 
5223 
5229  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
5230 
5232  virtual bool reallocate() $ROSE_OVERRIDE;
5233 
5235  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5236 
5238  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5239 
5241  static bool is_ELF(SgAsmGenericFile*);
5242 
5244  SgAsmGenericSectionPtrList get_sectab_sections();
5245 
5247  SgAsmGenericSectionPtrList get_segtab_sections();
5248 
5249  // Overrides documented in base class
5250  virtual const char *format_name() const $ROSE_OVERRIDE;
5251 
5252  private:
5253  void ctor(); // called by constructors
5254  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
5255  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
5256 #endif // SgAsmElfFileHeader_OTHERS
5257 
5258 #ifdef DOCUMENTATION
5259  };
5260 #endif
5261 
5262 
5263 
5265 
5266  /*************************************************************************************************************************
5267  * ELF Section Tables
5268  *************************************************************************************************************************/
5269 
5271 
5272  DECLARE_LEAF_CLASS(AsmElfSectionTable);
5273  IS_SERIALIZABLE(AsmElfSectionTable);
5274 
5275 #ifdef DOCUMENTATION
5276 
5282  public:
5283 #endif
5284 
5285  DECLARE_OTHERS(AsmElfSectionTable);
5286 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
5287 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5288  private:
5289  friend class boost::serialization::access;
5290 
5291  template<class S>
5292  void serialize(S &s, const unsigned /*version*/) {
5293  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5294  }
5295 #endif
5296 
5297  public:
5300  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5301  ctor();
5302  }
5303 
5309  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
5310 
5322 
5326  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5327 
5329  virtual bool reallocate() $ROSE_OVERRIDE;
5330 
5332  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5333 
5335  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5336 
5337  private:
5338  void ctor();
5339 #endif // SgAsmElfSectionTable_OTHERS
5340 
5341 #ifdef DOCUMENTATION
5342  };
5343 #endif
5344 
5345 
5347 
5348  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
5349  IS_SERIALIZABLE(AsmElfSectionTableEntry);
5350 
5351 #ifdef DOCUMENTATION
5352 
5354  public:
5355 #endif
5356 
5357 #ifdef DOCUMENTATION
5358 
5363  unsigned get_sh_name() const;
5364  void set_sh_name(unsigned);
5366 #else
5367  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
5368  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5369 #endif
5370 
5371 #ifdef DOCUMENTATION
5372 
5377  SectionType get_sh_type() const;
5378  void set_sh_type(SectionType);
5380 #else
5381  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
5382  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5383 #endif
5384 
5385 #ifdef DOCUMENTATION
5386 
5391  unsigned long get_sh_link() const;
5392  void set_sh_link(unsigned long);
5394 #else
5395  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
5396  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5397 #endif
5398 
5399 #ifdef DOCUMENTATION
5400 
5405  unsigned long get_sh_info() const;
5406  void set_sh_info(unsigned long);
5408 #else
5409  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
5410  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5411 #endif
5412 
5413 #ifdef DOCUMENTATION
5414 
5419  uint64_t get_sh_flags() const;
5420  void set_sh_flags(uint64_t);
5422 #else
5423  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
5424  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5425 #endif
5426 
5427 #ifdef DOCUMENTATION
5428 
5433  rose_addr_t get_sh_addr() const;
5434  void set_sh_addr(rose_addr_t);
5436 #else
5437  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
5438  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5439 #endif
5440 
5441 #ifdef DOCUMENTATION
5442 
5447  rose_addr_t get_sh_offset() const;
5448  void set_sh_offset(rose_addr_t);
5450 #else
5451  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
5452  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5453 #endif
5454 
5455 #ifdef DOCUMENTATION
5456 
5461  rose_addr_t get_sh_size() const;
5462  void set_sh_size(rose_addr_t);
5464 #else
5465  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
5466  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5467 #endif
5468 
5469 #ifdef DOCUMENTATION
5470 
5475  rose_addr_t get_sh_addralign() const;
5476  void set_sh_addralign(rose_addr_t);
5478 #else
5479  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
5480  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5481 #endif
5482 
5483 #ifdef DOCUMENTATION
5484 
5489  rose_addr_t get_sh_entsize() const;
5490  void set_sh_entsize(rose_addr_t);
5492 #else
5493  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
5494  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5495 #endif
5496 
5497 #ifdef DOCUMENTATION
5498 
5503  const SgUnsignedCharList& get_extra() const;
5504  void set_extra(const SgUnsignedCharLit&);
5506 #else
5507  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5508  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5509  NO_DELETE);
5510 #endif
5511 
5512  DECLARE_OTHERS(AsmElfSectionTableEntry);
5513 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5514 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5515  private:
5516  friend class boost::serialization::access;
5517 
5518  template<class S>
5519  void serialize(S &s, const unsigned /*version*/) {
5520  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5521  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5522  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5523  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5524  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5525  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5526  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5527  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5528  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5529  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5530  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5531  s & BOOST_SERIALIZATION_NVP(p_extra);
5532  }
5533 #endif
5534 
5535  public:
5538  SHT_NULL = 0,
5542  SHT_RELA = 4,
5543  SHT_HASH = 5,
5545  SHT_NOTE = 7,
5547  SHT_REL = 9,
5548  SHT_SHLIB = 10,
5549  SHT_DYNSYM = 11,
5551  SHT_LOOS = 0x60000000,
5552  SHT_GNU_verdef = 0x6ffffffd,
5553  SHT_GNU_verneed = 0x6ffffffe,
5554  SHT_GNU_versym = 0x6fffffff,
5555  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5556 
5557  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5558  SHT_HIPROC = 0x7fffffff,
5559  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5560  SHT_HIUSER = 0xffffffff
5561  };
5562 
5566  SHF_WRITE= (1 << 0),
5567  SHF_ALLOC= (1 << 1),
5568  SHF_EXECINSTR= (1 << 2),
5569  SHF_MERGE= (1 << 4),
5570  SHF_STRINGS= (1 << 5),
5571  SHF_INFO_LINK= (1 << 6),
5572  SHF_LINK_ORDER= (1 << 7),
5574  SHF_GROUP= (1 << 9),
5575  SHF_TLS= (1 << 10),
5576  SHF_MASKOS= 0x0ff00000,
5577  SHF_MASKPROC= 0xf0000000
5578  };
5579 
5586 #ifdef _MSC_VER
5587 # pragma pack (1)
5588 #endif
5590  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5591  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5592  uint32_t sh_flags; /* 0x08 Bit flags */
5593  uint32_t sh_addr; /* 0x0c Desired mapped address */
5594  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5595  uint32_t sh_size; /* 0x14 Section size in bytes */
5596  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5597  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5598  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5599  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5600  } /* 0x28 */
5601 #if !defined(SWIG) && !defined(_MSC_VER)
5602  __attribute__((packed))
5603 #endif
5604  ;
5605 
5607  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5608  uint32_t sh_type; /* 0x04 */
5609  uint64_t sh_flags; /* 0x08 */
5610  uint64_t sh_addr; /* 0x10 */
5611  uint64_t sh_offset; /* 0x18 */
5612  uint64_t sh_size; /* 0x20 */
5613  uint32_t sh_link; /* 0x28 */
5614  uint32_t sh_info; /* 0x2c */
5615  uint64_t sh_addralign; /* 0x30 */
5616  uint64_t sh_entsize; /* 0x38 */
5617  } /* 0x40 */
5618 #if !defined(SWIG) && !defined(_MSC_VER)
5619  __attribute__((packed))
5620 #endif
5621  ;
5622 #ifdef _MSC_VER
5623 # pragma pack ()
5624 #endif
5625 
5627  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5629 
5631  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5633 
5637  void *encode(ByteOrder::Endianness sex,
5639  void *encode(ByteOrder::Endianness sex,
5645 
5647  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5648 
5649  // Use Rose::stringify... function instead.
5650  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5651  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5652 
5653  private:
5654  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5655  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5656 #endif // SgAsmElfSectionTableEntry_OTHERS
5657 
5658 #ifdef DOCUMENTATION
5659  };
5660 #endif
5661 
5662 
5663 
5665 
5666  /*************************************************************************************************************************
5667  * ELF Segment Tables
5668  *************************************************************************************************************************/
5669 
5671 
5672  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5673  IS_SERIALIZABLE(AsmElfSegmentTable);
5674 
5675 #ifdef DOCUMENTATION
5676 
5683  public:
5684 #endif
5685 
5686  DECLARE_OTHERS(AsmElfSegmentTable);
5687 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5688 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5689  private:
5690  friend class boost::serialization::access;
5691 
5692  template<class S>
5693  void serialize(S &s, const unsigned /*version*/) {
5694  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5695  }
5696 #endif
5697 
5698  public:
5701  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5702  ctor();
5703  }
5704 
5709  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5710 
5725 
5729  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5730 
5732  virtual bool reallocate() $ROSE_OVERRIDE;
5733 
5735  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5736 
5738  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5739 
5740  private:
5741  void ctor();
5742 #endif // SgAsmElfSegmentTable_OTHERS
5743 
5744 #ifdef DOCUMENTATION
5745  };
5746 #endif
5747 
5749 
5750  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5751  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5752 
5753 #ifdef DOCUMENTATION
5755  public:
5756 #endif
5757 
5758 #ifdef DOCUMENTATION
5759 
5765  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5766  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5768 #else
5769  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5770  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5771  NO_DELETE);
5772 #endif
5773 
5774  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5775 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5776 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5777  private:
5778  friend class boost::serialization::access;
5779 
5780  template<class S>
5781  void serialize(S &s, const unsigned /*version*/) {
5782  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5783  }
5784 #endif
5785 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5786 
5787 #ifdef DOCUMENTATION
5788  };
5789 #endif
5790 
5791 
5793 
5794  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5795  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5796 
5797 #ifdef DOCUMENTATION
5798 
5800  public:
5801 #endif
5802 
5803 #ifdef DOCUMENTATION
5804 
5809  size_t get_index() const;
5810  void set_index(size_t);
5812 #else
5813  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5814  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5815 #endif
5816 
5817 #ifdef DOCUMENTATION
5818 
5821  SegmentType get_type() const;
5822  void set_type(SegmentType);
5824 #else
5825  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5826  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5827  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5828 #endif
5829 
5830 #ifdef DOCUMENTATION
5831 
5834  SegmentFlags get_flags() const;
5835  void set_flags(SegmentFlags);
5837 #else
5838  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5839  "= SgAsmElfSegmentTableEntry::PF_NONE",
5840  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5841 #endif
5842 
5843 #ifdef DOCUMENTATION
5844 
5849  rose_addr_t get_offset() const;
5850  void set_offset(rose_addr_t);
5852 #else
5853  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5854  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5855 #endif
5856 
5857 #ifdef DOCUMENTATION
5858 
5864  rose_addr_t get_vaddr() const;
5865  void set_vaddr(rose_addr_t);
5867 #else
5868  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5869  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5870 #endif
5871 
5872 #ifdef DOCUMENTATION
5873 
5878  rose_addr_t get_paddr() const;
5879  void set_paddr(rose_addr_t);
5881 #else
5882  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5883  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5884 #endif
5885 
5886 #ifdef DOCUMENTATION
5887 
5892  rose_addr_t get_filesz() const;
5893  void set_filesz(rose_addr_t);
5895 #else
5896  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5897  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5898 #endif
5899 
5900 #ifdef DOCUMENTATION
5901 
5906  rose_addr_t get_memsz() const;
5907  void set_memsz(rose_addr_t);
5909 #else
5910  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5911  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5912 #endif
5913 
5914 #ifdef DOCUMENTATION
5915 
5920  rose_addr_t get_align() const;
5921  void set_align(rose_addr_t);
5923 #else
5924  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5925  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5926 #endif
5927 
5928 #ifdef DOCUMENTATION
5929 
5934  const SgUnsignedCharList& get_extra() const;
5935  void set_extra(const SgUnsignedCharList&);
5937 #else
5938  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5939  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5940 #endif
5941 
5942  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5943 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
5944 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5945  private:
5946  friend class boost::serialization::access;
5947 
5948  template<class S>
5949  void serialize(S &s, const unsigned /*version*/) {
5950  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5951  s & BOOST_SERIALIZATION_NVP(p_index);
5952  s & BOOST_SERIALIZATION_NVP(p_type);
5953  s & BOOST_SERIALIZATION_NVP(p_flags);
5954  s & BOOST_SERIALIZATION_NVP(p_offset);
5955  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5956  s & BOOST_SERIALIZATION_NVP(p_paddr);
5957  s & BOOST_SERIALIZATION_NVP(p_filesz);
5958  s & BOOST_SERIALIZATION_NVP(p_memsz);
5959  s & BOOST_SERIALIZATION_NVP(p_align);
5960  s & BOOST_SERIALIZATION_NVP(p_extra);
5961  }
5962 #endif
5963 
5964  public:
5967  PT_NULL = 0,
5968  PT_LOAD = 1,
5971  PT_NOTE = 4,
5972  PT_SHLIB = 5,
5973  PT_PHDR = 6,
5974  PT_TLS = 7,
5976  // OS- and Processor-specific ranges
5977  PT_LOOS = 0x60000000,
5978  PT_HIOS = 0x6fffffff,
5979  PT_LOPROC = 0x70000000,
5980  PT_HIPROC = 0x7fffffff,
5981 
5982  // OS-specific values for GNU/Linux
5983  PT_GNU_EH_FRAME = 0x6474e550,
5984  PT_GNU_STACK = 0x6474e551,
5985  PT_GNU_RELRO = 0x6474e552,
5986  PT_PAX_FLAGS = 0x65041580,
5988  // OS-specific values for Sun
5989  PT_SUNWBSS = 0x6ffffffa,
5990  PT_SUNWSTACK = 0x6ffffffb
5991  };
5992 
5995  PF_NONE = 0,
5996  PF_RESERVED = 0x000ffff8,
5997  PF_XPERM = 0x00000001,
5998  PF_WPERM = 0x00000002,
5999  PF_RPERM = 0x00000004,
6000  PF_OS_MASK = 0x0ff00000,
6001  PF_PROC_MASK = 0xf0000000
6002  };
6003 
6004 #ifdef _MSC_VER
6005 # pragma pack (1)
6006 #endif
6007 
6015  uint32_t p_type;
6016  uint32_t p_offset;
6017  uint32_t p_vaddr;
6018  uint32_t p_paddr;
6019  uint32_t p_filesz;
6020  uint32_t p_memsz;
6021  uint32_t p_flags;
6022  uint32_t p_align;
6023  } /* 0x30 */
6024 #if !defined(SWIG) && !defined(_MSC_VER)
6025  __attribute__((packed))
6026 #endif
6027  ;
6028 
6030  uint32_t p_type; /* 0x00 */
6031  uint32_t p_flags; /* 0x04 */
6032  uint64_t p_offset; /* 0x08 */
6033  uint64_t p_vaddr; /* 0x10 */
6034  uint64_t p_paddr; /* 0x18 */
6035  uint64_t p_filesz; /* 0x20 */
6036  uint64_t p_memsz; /* 0x28 */
6037  uint64_t p_align; /* 0x30 */
6038  } /* 0x38 */
6039 #if !defined(SWIG) && !defined(_MSC_VER)
6040  __attribute__((packed))
6041 #endif
6042  ;
6043 #ifdef _MSC_VER
6044 # pragma pack ()
6045 #endif
6046 
6048  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6050 
6052  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6054 
6058  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
6059  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
6064 
6066  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
6067 
6070 
6073 
6074  private:
6075  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
6076  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
6077 #endif // SgAsmElfSegmentTableEntry_OTHERS
6078 
6079 #ifdef DOCUMENTATION
6080  };
6081 #endif
6082 
6083 
6084 
6086 
6087  /*************************************************************************************************************************
6088  * ELF Symbol Tables
6089  *************************************************************************************************************************/
6090 
6092 
6093  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
6094  IS_SERIALIZABLE(AsmElfSymbolSection);
6095 
6096 #ifdef DOCUMENTATION
6097 
6099  public:
6100 #endif
6101 
6102 #ifdef DOCUMENTATION
6103 
6106  bool get_is_dynamic() const;
6107  void set_is_dynamic(bool);
6109 #else
6110  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
6111  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6112 #endif
6113 
6114 #ifdef DOCUMENTATION
6115 
6124 #else
6125  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
6126  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6127 #endif
6128 
6129  DECLARE_OTHERS(AsmElfSymbolSection);
6130 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
6131 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6132  private:
6133  friend class boost::serialization::access;
6134 
6135  template<class S>
6136  void serialize(S &s, const unsigned /*version*/) {
6137  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6138  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
6139  s & BOOST_SERIALIZATION_NVP(p_symbols);
6140  }
6141 #endif
6142 
6143  public:
6146  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
6147  ctor(strsec);
6148  }
6149 
6151  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
6152 
6165  virtual void finish_parsing() $ROSE_OVERRIDE;
6166 
6168  size_t index_of(SgAsmElfSymbol*);
6169 
6174  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6175 
6179  virtual bool reallocate() $ROSE_OVERRIDE;
6180 
6182  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6183 
6185  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6186 
6187  private:
6188  void ctor(SgAsmElfStringSection*);
6189 #endif // SgAsmElfSymbolSection_OTHERS
6190 
6191 #ifdef DOCUMENTATION
6192  };
6193 #endif
6194 
6196 
6197  DECLARE_LEAF_CLASS(AsmElfSymbolList);
6198  IS_SERIALIZABLE(AsmElfSymbolList);
6199 
6200 #ifdef DOCUMENTATION
6202  public:
6203 #endif
6204 
6205 #ifdef DOCUMENTATION
6206 
6212  const SgAsmElfSymbolPtrList& get_symbols() const;
6213  void set_symbols(const SgAsmElfSymbolPtrList&);
6215 #else
6216  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
6217  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6218 #endif
6219 
6220  DECLARE_OTHERS(AsmElfSymbolList);
6221 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
6222 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6223  private:
6224  friend class boost::serialization::access;
6225 
6226  template<class S>
6227  void serialize(S &s, const unsigned /*version*/) {
6228  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6229  s & BOOST_SERIALIZATION_NVP(p_symbols);
6230  }
6231 #endif
6232 #endif // SgAsmElfSymbolList_OTHERS
6233 
6234 #ifdef DOCUMENTATION
6235  };
6236 #endif
6237 
6239 
6240  DECLARE_LEAF_CLASS(AsmElfSymbol);
6241  IS_SERIALIZABLE(AsmElfSymbol);
6242 
6243 #ifdef DOCUMENTATION
6244 
6249  public:
6250 #endif
6251 
6252 #ifdef DOCUMENTATION
6253 
6258  unsigned char get_st_info() const;
6259  void set_st_info(unsigned char);
6261 #else
6262  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
6263  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6264 #endif
6265 
6266 #ifdef DOCUMENTATION
6267 
6272  unsigned char get_st_res1() const;
6273  void set_st_res1(unsigned char);
6275 #else
6276  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
6277  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6278 #endif
6279 
6280 #ifdef DOCUMENTATION
6281 
6286  unsigned get_st_shndx() const;
6287  void set_st_shndx(unsigned);
6289 #else
6290  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
6291  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6292 #endif
6293 
6294 #ifdef DOCUMENTATION
6295 
6300  rose_addr_t get_st_size() const;
6301  void set_st_size(rose_addr_t);
6303 #else
6304  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
6305  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6306 #endif
6307 
6308 #ifdef DOCUMENTATION
6309 
6314  const SgUnsignedCharList& get_extra() const;
6315  void set_extra(const SgUnsignedCharList&);
6317 #else
6318  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
6319  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6320 #endif
6321 
6322  DECLARE_OTHERS(AsmElfSymbol);
6323 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
6324 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6325  private:
6326  friend class boost::serialization::access;
6327 
6328  template<class S>
6329  void serialize(S &s, const unsigned /*version*/) {
6330  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
6331  s & BOOST_SERIALIZATION_NVP(p_st_info);
6332  s & BOOST_SERIALIZATION_NVP(p_st_res1);
6333  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
6334  s & BOOST_SERIALIZATION_NVP(p_st_size);
6335  s & BOOST_SERIALIZATION_NVP(p_extra);
6336  }
6337 #endif
6338 
6339  public:
6340  enum ElfSymBinding {
6341  STB_LOCAL=0,
6342  STB_GLOBAL=1,
6343  STB_WEAK=2
6344  };
6345 
6346  enum ElfSymType {
6349  STT_FUNC = 2,
6351  STT_FILE = 4,
6353  STT_TLS = 6,
6355  };
6356 
6357 #ifdef _MSC_VER
6358 # pragma pack (1)
6359 #endif
6360 
6363  uint32_t st_name;
6364  uint32_t st_value;
6365  uint32_t st_size;
6366  unsigned char st_info;
6367  unsigned char st_res1;
6368  uint16_t st_shndx;
6369  }
6370 #if !defined(SWIG) && !defined(_MSC_VER)
6371  __attribute__((packed))
6372 #endif
6373  ;
6374 
6376  uint32_t st_name;
6377  unsigned char st_info;
6378  unsigned char st_res1;
6379  uint16_t st_shndx;
6380  uint64_t st_value;
6381  uint64_t st_size;
6382  }
6383 #if !defined(SWIG) && !defined(_MSC_VER)
6384  __attribute__((packed))
6385 #endif
6386  ;
6387 
6388 #ifdef _MSC_VER
6389 # pragma pack ()
6390 #endif
6391 
6393  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
6394 
6398  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
6399 
6403  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
6404 
6408  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
6409  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
6417  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6418  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
6422  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
6423 
6426 
6428  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
6429 
6431  static std::string to_string(SgAsmElfSymbol::ElfSymType);
6432 
6433  private:
6434  void ctor(SgAsmElfSymbolSection*);
6435  void parse_common(); // initialization common to all parse() methods
6436 #endif // SgAsmElfSymbol_OTHERS
6437 
6438 #ifdef DOCUMENTATION
6439  };
6440 #endif
6441 
6442 
6443 
6445 
6446  /*************************************************************************************************************************
6447  * ELF Symbol Version Tables
6448  *************************************************************************************************************************/
6449 
6451 
6452  DECLARE_LEAF_CLASS(AsmElfSymverSection);
6453  IS_SERIALIZABLE(AsmElfSymverSection);
6454 
6455 #ifdef DOCUMENTATION
6456 
6461  public:
6462 #endif
6463 
6464 #ifdef DOCUMENTATION
6465 
6474 #else
6475  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
6476  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6477 #endif
6478 
6479  DECLARE_OTHERS(AsmElfSymverSection);
6480 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
6481 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6482  private:
6483  friend class boost::serialization::access;
6484 
6485  template<class S>
6486  void serialize(S &s, const unsigned /*version*/) {
6487  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6488  s & BOOST_SERIALIZATION_NVP(p_entries);
6489  }
6490 #endif
6491 
6492  public:
6495  : SgAsmElfSection(fhdr) {
6496  ctor();
6497  }
6498 
6500  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
6501 
6506  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6507 
6509  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6510 
6512  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6513  private:
6514  void ctor();
6515 #endif // SgAsmElfSymverSection_OTHERS
6516 
6517 #ifdef DOCUMENTATION
6518  };
6519 #endif
6520 
6522 
6523  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6524  IS_SERIALIZABLE(AsmElfSymverEntry);
6525 
6526 #ifdef DOCUMENTATION
6527 
6529  public:
6530 #endif
6531 
6532 #ifdef DOCUMENTATION
6533 
6538  size_t get_value() const;
6539  void set_value(size_t);
6541 #else
6542  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6543  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6544 #endif
6545 
6546  DECLARE_OTHERS(AsmElfSymverEntry);
6547 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6548 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6549  private:
6550  friend class boost::serialization::access;
6551 
6552  template<class S>
6553  void serialize(S &s, const unsigned /*version*/) {
6554  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6555  s & BOOST_SERIALIZATION_NVP(p_value);
6556  }
6557 #endif
6558 
6559  public:
6562  : p_value(0) {
6563  ctor(symver);
6564  }
6565 
6567  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6568 
6569  private:
6570  void ctor(SgAsmElfSymverSection*);
6571 #endif // SgAsmElfSymverEntry_OTHERS
6572 
6573 #ifdef DOCUMENTATION
6574  };
6575 #endif
6576 
6578 
6579 
6580  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6581  IS_SERIALIZABLE(AsmElfSymverEntryList);
6582 
6583 #ifdef DOCUMENTATION
6584 
6589  public:
6590 #endif
6591 
6592 #ifdef DOCUMENTATION
6593 
6596  const SgAsmElfSymverEntryPtrList& get_entries() const;
6597  void set_entries(const SgAsmElfSymverEntryPtrList&);
6599 #else
6600  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6601  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6602  NO_DELETE);
6603 #endif
6604 
6605  DECLARE_OTHERS(AsmElfSymverEntryList);
6606 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6607 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6608  private:
6609  friend class boost::serialization::access;
6610 
6611  template<class S>
6612  void serialize(S &s, const unsigned /*version*/) {
6613  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6614  s & BOOST_SERIALIZATION_NVP(p_entries);
6615  }
6616 #endif
6617 #endif // SgAsmElfSymverEntryList_OTHERS
6618 
6619 #ifdef DOCUMENTATION
6620  };
6621 #endif
6622 
6624 
6625  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6626  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6627 
6628 #ifdef DOCUMENTATION
6629 
6635  public:
6636 #endif
6637 
6638 #ifdef DOCUMENTATION
6639 
6648 #else
6649  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6650  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6651  NO_DELETE);
6652 #endif
6653 
6654  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6655 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6656 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6657  private:
6658  friend class boost::serialization::access;
6659 
6660  template<class S>
6661  void serialize(S &s, const unsigned /*version*/) {
6662  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6663  s & BOOST_SERIALIZATION_NVP(p_entries);
6664  }
6665 #endif
6666 
6667  public:
6670  : SgAsmElfSection(fhdr) {
6671  ctor(strsec);
6672  }
6673 
6742  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6743 
6746  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6747 
6751  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6752 
6754  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6755 
6756  private:
6757  void ctor(SgAsmElfStringSection*);
6758 #endif // SgAsmElfSymverDefinedSection_OTHERS
6759 
6760 #ifdef DOCUMENTATION
6761  };
6762 #endif
6763 
6765 
6766  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6767  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6768 
6769 #ifdef DOCUMENTATION
6770 
6775  public:
6776 #endif
6777 
6778 #ifdef DOCUMENTATION
6779 
6782  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6783  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6785 #else
6786  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6787  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6788  NO_DELETE);
6789 #endif
6790 
6791  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6792 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6793 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6794  private:
6795  friend class boost::serialization::access;
6796 
6797  template<class S>
6798  void serialize(S &s, const unsigned /*version*/) {
6799  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6800  s & BOOST_SERIALIZATION_NVP(p_entries);
6801  }
6802 #endif
6803 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6804 
6805 #ifdef DOCUMENTATION
6806  };
6807 #endif
6808 
6810 
6811  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6812  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6813 
6814 #ifdef DOCUMENTATION
6815 
6817  public:
6818 #endif
6819 
6820 #ifdef DOCUMENTATION
6821 
6826  size_t get_version() const;
6827  void set_version(size_t);
6829 #else
6830  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6831  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6832 #endif
6833 
6834 #ifdef DOCUMENTATION
6835 
6840  int get_flags() const;
6841  void set_flags(int);
6843 #else
6844  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6845  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6846 #endif
6847 
6848 #ifdef DOCUMENTATION
6849 
6854  size_t get_index() const;
6855  void set_index(size_t);
6857 #else
6858  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6859  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6860 #endif
6861 
6862 #ifdef DOCUMENTATION
6863 
6868  uint32_t get_hash() const;
6869  void set_hash(uint32_t);
6871 #else
6872  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6873  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6874 #endif
6875 
6876 #ifdef DOCUMENTATION
6877 
6886 #else
6887  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6888  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6889 #endif
6890 
6891  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6892 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6893 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6894  private:
6895  friend class boost::serialization::access;
6896 
6897  template<class S>
6898  void serialize(S &s, const unsigned /*version*/) {
6899  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6900  s & BOOST_SERIALIZATION_NVP(p_version);
6901  s & BOOST_SERIALIZATION_NVP(p_flags);
6902  s & BOOST_SERIALIZATION_NVP(p_index);
6903  s & BOOST_SERIALIZATION_NVP(p_hash);
6904  s & BOOST_SERIALIZATION_NVP(p_entries);
6905  }
6906 #endif
6907 
6908  public:
6909 #ifdef _MSC_VER
6910 # pragma pack (1)
6911 #endif
6912 
6914  uint16_t vd_version;
6915  uint16_t vd_flags;
6916  uint16_t vd_ndx;
6917  uint16_t vd_cnt;
6918  uint32_t vd_hash;
6919  uint32_t vd_aux;
6920  uint32_t vd_next;
6921  }
6922 #if !defined(SWIG) && !defined(_MSC_VER)
6923  __attribute__((packed))
6924 #endif
6925  ;
6926 
6927 #ifdef _MSC_VER
6928 # pragma pack ()
6929 #endif
6930 
6933  ctor(symver_defined);
6934  }
6935 
6937  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6938 
6940  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6941 
6943  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6944 
6945  private:
6946  void ctor(SgAsmElfSymverDefinedSection*);
6947 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6948 
6949 #ifdef DOCUMENTATION
6950  };
6951 #endif
6952 
6954 
6955  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6956  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6957 
6958 #ifdef DOCUMENTATION
6959 
6964  pbulic:
6965 #endif
6966 
6967 #ifdef DOCUMENTATION
6968 
6971  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6972  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6974 #else
6975  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6976  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6977  NO_DELETE);
6978 #endif
6979 
6980  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6981 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6982 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6983  private:
6984  friend class boost::serialization::access;
6985 
6986  template<class S>
6987  void serialize(S &s, const unsigned /*version*/) {
6988  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6989  s & BOOST_SERIALIZATION_NVP(p_entries);
6990  }
6991 #endif
6992 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6993 
6994 #ifdef DOCUMENTATION
6995  };
6996 #endif
6997 
6999 
7000  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
7001  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
7002 
7003 #ifdef DOCUMENTATION
7005  public:
7006 #endif
7007 
7008 #ifdef DOCUMENTATION
7009 
7012  SgAsmGenericString* get_name() const;
7015 #else
7016  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7017  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7018 #endif
7019 
7020  DECLARE_OTHERS(AsmElfSymverDefinedAux);
7021 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
7022 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7023  private:
7024  friend class boost::serialization::access;
7025 
7026  template<class S>
7027  void serialize(S &s, const unsigned /*version*/) {
7028  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7029  s & BOOST_SERIALIZATION_NVP(p_name);
7030  }
7031 #endif
7032 
7033  public:
7034 #ifdef _MSC_VER
7035 # pragma pack (1)
7036 #endif
7037 
7040  uint32_t vda_name;
7041  uint32_t vda_next;
7042  }
7043 #if !defined(SWIG) && !defined(_MSC_VER)
7044  __attribute__((packed))
7045 #endif
7046  ;
7047 
7048 #ifdef _MSC_VER
7049 # pragma pack ()
7050 #endif
7051 
7056  SgAsmElfSymverDefinedSection *symver_def_sec)
7057  : p_name(NULL) {
7058  ctor(symver_def_entry,symver_def_sec);
7059  }
7060 
7062  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
7063 
7065  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
7066 
7072  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7073 
7074  private:
7075  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
7076 #endif // SgAsmElfSymverDefinedAux_OTHERS
7077 
7078 #ifdef DOCUMENTATION
7079  };
7080 #endif
7081 
7083 
7084  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
7085  IS_SERIALIZABLE(AsmElfSymverNeededSection);
7086 
7087 #ifdef DOCUMENTATION
7088 
7094  public:
7095 #endif
7096 
7097 #ifdef DOCUMENTATION
7098 
7107 #else
7108  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
7109  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7110 #endif
7111 
7112  DECLARE_OTHERS(AsmElfSymverNeededSection);
7113 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
7114 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7115  private:
7116  friend class boost::serialization::access;
7117 
7118  template<class S>
7119  void serialize(S &s, const unsigned /*version*/) {
7120  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7121  s & BOOST_SERIALIZATION_NVP(p_entries);
7122  }
7123 #endif
7124 
7125  public:
7130  : SgAsmElfSection(fhdr) {
7131  ctor(strsec);
7132  }
7133 
7143  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
7144 
7149  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
7150 
7154  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7155 
7157  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7158 
7159  private:
7160  void ctor(SgAsmElfStringSection*);
7161 #endif // SgAsmElfSymverNeededSection_OTHERS
7162 
7163 #ifdef DOCUMENTATION
7164  };
7165 #endif
7166 
7168 
7169  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
7170  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
7171 
7172 #ifdef DOCUMENTATION
7173 
7178  public:
7179 #endif
7180 
7181 #ifdef DOCUMENTATION
7182 
7185  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
7186  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
7188 #else
7189  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
7190  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7191  NO_DELETE);
7192 #endif
7193 
7194  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
7195 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
7196 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7197  private:
7198  friend class boost::serialization::access;
7199 
7200  template<class S>
7201  void serialize(S &s, const unsigned /*version*/) {
7202  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7203  s & BOOST_SERIALIZATION_NVP(p_entries);
7204  }
7205 #endif
7206 #endif // SgAsmElfSymverNeededEntryList_OTHERS
7207 
7208 #ifdef DOCUMENTATION
7209  };
7210 #endif
7211 
7213 
7214  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
7215  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
7216 
7217 #ifdef DOCUMENTATION
7218 
7220  public:
7221 #endif
7222 
7223 #ifdef DOCUMENTATION
7224 
7229  size_t get_version() const;
7230  void set_version(size_t);
7232 #else
7233  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
7234  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7235 #endif
7236 
7237 #ifdef DOCUMENTATION
7238 
7244 #else
7245  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
7246  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7247 #endif
7248 
7249 #ifdef DOCUMENTATION
7250 
7259 #else
7260  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
7261  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7262 #endif
7263 
7264  DECLARE_OTHERS(AsmElfSymverNeededEntry);
7265 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
7266 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7267  private:
7268  friend class boost::serialization::access;
7269 
7270  template<class S>
7271  void serialize(S &s, const unsigned /*version*/) {
7272  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7273  s & BOOST_SERIALIZATION_NVP(p_version);
7274  s & BOOST_SERIALIZATION_NVP(p_file_name);
7275  s & BOOST_SERIALIZATION_NVP(p_entries);
7276  }
7277 #endif
7278 
7279  public:
7280 #ifdef _MSC_VER
7281 # pragma pack (1)
7282 #endif
7283 
7286  uint16_t vn_version;
7287  uint16_t vn_cnt;
7288  uint32_t vn_file;
7289  uint32_t vn_aux;
7290  uint32_t vn_next;
7291  }
7292 #if !defined(SWIG) && !defined(_MSC_VER)
7293  __attribute__((packed))
7294 #endif
7295  ;
7296 
7297 #ifdef _MSC_VER
7298 # pragma pack ()
7299 #endif
7300 
7303  : p_file_name(NULL) {
7304  ctor(symver_needed);
7305  }
7306 
7308  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
7309 
7311  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
7312 
7314  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7315 
7316  private:
7317  void ctor(SgAsmElfSymverNeededSection*);
7318 #endif // SgAsmElfSymverNeededEntry_OTHERS
7319 
7320 #ifdef DOCUMENTATION
7321  };
7322 #endif
7323 
7325 
7326  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
7327  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
7328 
7329 #ifdef DOCUMENTATION
7330 
7335  public:
7336 #endif
7337 
7338 #ifdef DOCUMENTATION
7339 
7342  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
7343  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
7345 #else
7346  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
7347  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7348  NO_DELETE);
7349 #endif
7350 
7351  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
7352 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
7353 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7354  private:
7355  friend class boost::serialization::access;
7356 
7357  template<class S>
7358  void serialize(S &s, const unsigned /*version*/) {
7359  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7360  s & BOOST_SERIALIZATION_NVP(p_entries);
7361  }
7362 #endif
7363 #endif // SgAsmElfSymverNeededAuxList_OTHERS
7364 
7365 #ifdef DOCUMENTATION
7366  };
7367 #endif
7368 
7370 
7371  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
7372  IS_SERIALIZABLE(AsmElfSymverNeededAux);
7373 
7374 #ifdef DOCUMENTATION
7375 
7377  public:
7378 #endif
7379 
7380 #ifdef DOCUMENTATION
7381 
7386  uint32_t get_hash() const;
7387  void set_hash(uint32_t);
7389 #else
7390  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
7391  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7392 #endif
7393 
7394 #ifdef DOCUMENTATION
7395 
7400  int get_flags() const;
7401  void set_flags(int);
7403 #else
7404  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
7405  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7406 #endif
7407 
7408 #ifdef DOCUMENTATION
7409 
7414  size_t get_other() const;
7415  void set_other(size_t);
7417 #else
7418  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
7419  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7420 #endif
7421 
7422 #ifdef DOCUMENTATION
7423 
7426  SgAsmGenericString* get_name() const;
7429 #else
7430  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7431  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7432 #endif
7433 
7434  DECLARE_OTHERS(AsmElfSymverNeededAux);
7435 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
7436 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7437  private:
7438  friend class boost::serialization::access;
7439 
7440  template<class S>
7441  void serialize(S &s, const unsigned /*version*/) {
7442  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7443  s & BOOST_SERIALIZATION_NVP(p_hash);
7444  s & BOOST_SERIALIZATION_NVP(p_flags);
7445  s & BOOST_SERIALIZATION_NVP(p_other);
7446  s & BOOST_SERIALIZATION_NVP(p_name);
7447  }
7448 #endif
7449 
7450  public:
7451 #ifdef _MSC_VER
7452 # pragma pack (1)
7453 #endif
7454 
7457  uint32_t vna_hash;
7458  uint16_t vna_flags;
7459  uint16_t vna_other;
7460  uint32_t vna_name;
7461  uint32_t vna_next;
7462  }
7463 #if !defined(SWIG) && !defined(_MSC_VER)
7464  __attribute__((packed))
7465 #endif
7466  ;
7467 
7468 #ifdef _MSC_VER
7469 # pragma pack ()
7470 #endif
7471 
7477  : p_name(NULL) {
7478  ctor(symver_needed_entry,symver_needed_sec);
7479  }
7480 
7482  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
7483 
7485  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
7486 
7492  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7493 
7494  private:
7496 #endif // SgAsmElfSymverNeededAux_OTHERS
7497 
7498 #ifdef DOCUMENTATION
7499  };
7500 #endif
7501 
7502 
7503 
7504 
7506 
7507  /*************************************************************************************************************************
7508  * ELF Relocation Tables
7509  *************************************************************************************************************************/
7510 
7512 
7513  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7514  IS_SERIALIZABLE(AsmElfRelocSection);
7515 
7516 #ifdef DOCUMENTATION
7517 
7519  public:
7520 #endif
7521 
7522 #ifdef DOCUMENTATION
7523 
7526  bool get_uses_addend() const;
7527  void set_uses_addend(bool);
7529 #else
7530  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7531  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7532 #endif
7533 
7534 #ifdef DOCUMENTATION
7535 
7541 #else
7542  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7543  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7544 #endif
7545 
7546 #ifdef DOCUMENTATION
7547 
7555 #else
7556  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7557  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7558 #endif
7559 
7560  DECLARE_OTHERS(AsmElfRelocSection);
7561 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7562 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7563  private:
7564  friend class boost::serialization::access;
7565 
7566  template<class S>
7567  void serialize(S &s, const unsigned /*version*/) {
7568  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7569  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7570  s & BOOST_SERIALIZATION_NVP(p_target_section);
7571  s & BOOST_SERIALIZATION_NVP(p_entries);
7572  }
7573 #endif
7574 
7575  public:
7577  : SgAsmElfSection(fhdr) {
7578  ctor(symsec,targetsec);
7579  }
7580 
7583  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7584 
7586  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7587 
7589  virtual bool reallocate() $ROSE_OVERRIDE;
7590 
7592  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7593 
7595  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7596 
7597  private:
7599 #endif // SgAsmElfRelocSection_OTHERS
7600 
7601 #ifdef DOCUMENTATION
7602  };
7603 #endif
7604 
7606 
7607  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7608  IS_SERIALIZABLE(AsmElfRelocEntryList);
7609 
7610 #ifdef DOCUMENTATION
7611 
7616  public:
7617 #endif
7618 
7619 #ifdef DOCUMENTATION
7620 
7623  const SgAsmElfRelocEntryPtrList& get_entries() const;
7624  void set_entries(const SgAsmElfRelocEntryPtrList&);
7626 #else
7627  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7628  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7629  NO_DELETE);
7630 #endif
7631 
7632  DECLARE_OTHERS(AsmElfRelocEntryList);
7633 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7634 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7635  private:
7636  friend class boost::serialization::access;
7637 
7638  template<class S>
7639  void serialize(S &s, const unsigned /*version*/) {
7640  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7641  s & BOOST_SERIALIZATION_NVP(p_entries);
7642  }
7643 #endif
7644 #endif // SgAsmElfRelocEntryList_OTHERS
7645 
7646 #ifdef DOCUMENTATION
7647  };
7648 #endif
7649 
7651 
7652  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7653  IS_SERIALIZABLE(AsmElfRelocEntry);
7654 
7655 #ifdef DOCUMENTATION
7656 
7658  public:
7659 #endif
7660 
7661 #ifdef DOCUMENTATION
7662 
7667  rose_addr_t get_r_offset() const;
7668  void set_r_offset(rose_addr_t);
7670 #else
7671  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7672  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7673 #endif
7674 
7675 #ifdef DOCUMENTATION
7676 
7681  rose_addr_t get_r_addend() const;
7682  void set_r_addend(rose_addr_t);
7684 #else
7685  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7686  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7687 #endif
7688 
7689 #ifdef DOCUMENTATION
7690 
7695  unsigned long get_sym() const;
7696  void set_sym(unsigned long);
7698 #else
7699  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7700  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7701 #endif
7702 
7703 #ifdef DOCUMENTATION
7704 
7709  RelocType get_type() const;
7710  void set_type(RelocType);
7712 #else
7713  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7714  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7715 #endif
7716 
7717 #ifdef DOCUMENTATION
7718 
7721  const SgUnsignedCharList& get_extra() const;
7722  void set_extra(const SgUnsignedCharList&);
7724 #else
7725  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7726  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7727 #endif
7728 
7729  DECLARE_OTHERS(AsmElfRelocEntry);
7730 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7731 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7732  private:
7733  friend class boost::serialization::access;
7734 
7735  template<class S>
7736  void serialize(S &s, const unsigned /*version*/) {
7737  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7738  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7739  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7740  s & BOOST_SERIALIZATION_NVP(p_sym);
7741  s & BOOST_SERIALIZATION_NVP(p_type);
7742  s & BOOST_SERIALIZATION_NVP(p_extra);
7743  }
7744 #endif
7745 
7746  public:
7749  // Intel 80386 specific definitions.
7761  R_386_32PLT =11,
7768  R_386_16 =20,
7769  R_386_PC16 =21,
7770  R_386_8 =22,
7771  R_386_PC8 =23,
7787  // First Entry for X86-64
7802  R_X86_64_8 =114,
7812  };
7813 
7814 #ifdef _MSC_VER
7815 # pragma pack (1)
7816 #endif
7817 
7819  uint32_t r_offset;
7820  uint32_t r_info;
7821  uint32_t r_addend;
7822  }
7823 #if !defined(SWIG) && !defined(_MSC_VER)
7824  __attribute__((packed))
7825 #endif
7826  ;
7827 
7829  uint64_t r_offset;
7830  uint64_t r_info;
7831  uint64_t r_addend;
7832  }
7833 #if !defined(SWIG) && !defined(_MSC_VER)
7834  __attribute__((packed))
7835 #endif
7836  ;
7837 
7839  uint32_t r_offset;
7840  uint32_t r_info;
7841  }
7842 #if !defined(SWIG) && !defined(_MSC_VER)
7843  __attribute__((packed))
7844 #endif
7845  ;
7846 
7848  uint64_t r_offset;
7849  uint64_t r_info;
7850  }
7851 #if !defined(SWIG) && !defined(_MSC_VER)
7852  __attribute__((packed))
7853 #endif
7854  ;
7855 
7856 #ifdef _MSC_VER
7857 # pragma pack ()
7858 #endif
7859 
7862  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7863  ctor(section);
7864  }
7865 
7869  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7870  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7871  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7872  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7878  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7879  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7880  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7881  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7887  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7888  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7889  dump(f, prefix, idx, NULL);
7890  }
7894  std::string reloc_name() const;
7895 
7896  private:
7897  void ctor(SgAsmElfRelocSection*);
7898 #endif // SgAsmElfRelocEntry_OTHERS
7899 
7900 #ifdef DOCUMENTATION
7901  };
7902 #endif
7903 
7904 
7905 
7907 
7908  /*************************************************************************************************************************
7909  * ELF Dynamic Linking
7910  *************************************************************************************************************************/
7911 
7913 
7914  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7915  IS_SERIALIZABLE(AsmElfDynamicSection);
7916 
7917 #ifdef DOCUMENTATION
7918 
7920  public:
7921 #endif
7922 
7923 #ifdef DOCUMENTATION
7924 
7933 #else
7934  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7935  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7936 #endif
7937 
7938  DECLARE_OTHERS(AsmElfDynamicSection);
7939 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7940 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7941  private:
7942  friend class boost::serialization::access;
7943 
7944  template<class S>
7945  void serialize(S &s, const unsigned /*version*/) {
7946  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7947  s & BOOST_SERIALIZATION_NVP(p_entries);
7948  }
7949 #endif
7950 
7951  public:
7954  : SgAsmElfSection(fhdr) {
7955  ctor(strsec);
7956  }
7957 
7959  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7960 
7962  virtual void finish_parsing() $ROSE_OVERRIDE;
7963 
7966  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7967 
7969  virtual bool reallocate() $ROSE_OVERRIDE;
7970 
7972  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7973 
7975  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7976 
7977  private:
7978  void ctor(SgAsmElfStringSection*);
7979 #endif // SgAsmElfDynamicSection_OTHERS
7980 
7981 #ifdef DOCUMENTATION
7982  };
7983 #endif
7984 
7986 
7987  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7988  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7989 
7990 #ifdef DOCUMENTATION
7991 
7996  public:
7997 #endif
7998 
7999 #ifdef DOCUMENTATION
8000 
8003  const SgAsmElfDynamicEntryPtrList& get_entries() const;
8004  void set_entries(const SgAsmElfDynamicEntryPtrList&);
8006 #else
8007  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
8008  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
8009  NO_DELETE);
8010 #endif
8011 
8012  DECLARE_OTHERS(AsmElfDynamicEntryList);
8013 #if defined(SgAsmElfDynamicEntryList_OTHERS) || defined(DOCUMENTATION)
8014 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8015  private:
8016  friend class boost::serialization::access;
8017 
8018  template<class S>
8019  void serialize(S &s, const unsigned /*version*/) {
8020  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8021  s & BOOST_SERIALIZATION_NVP(p_entries);
8022  }
8023 #endif
8024 #endif // SgAsmElfDynamicEntryList_OTHERS
8025 
8026 #ifdef DOCUMENTATION
8027  };
8028 #endif
8029 
8031 
8032  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
8033  IS_SERIALIZABLE(AsmElfDynamicEntry);
8034 
8035 #ifdef DOCUMENTATION
8036 
8038  public:
8039 #endif
8040 
8041 #ifdef DOCUMENTATION
8042 
8047  EntryType get_d_tag() const;
8048  void set_d_tag(EntryType);
8050 #else
8051  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
8052  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8053 #endif
8054 
8055 #ifdef DOCUMENTATION
8056 
8061  rose_rva_t get_d_val() const;
8062  void set_d_val(rose_rva_t);
8064 #else
8065  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
8066  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8067 #endif
8068 
8069 #ifdef DOCUMENTATION
8070  // declared and documented below
8071 #else
8072  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
8073  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8074 #endif
8075 
8076 #ifdef DOCUMENTATION
8077 
8080  const SgUnsignedCharList& get_extra() const;
8081  void set_extra(const SgUnsignedCharList&);
8083 #else
8084  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
8085  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8086 #endif
8087 
8088  DECLARE_OTHERS(AsmElfDynamicEntry);
8089 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
8090 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8091  private:
8092  friend class boost::serialization::access;
8093 
8094  template<class S>
8095  void serialize(S &s, const unsigned /*version*/) {
8096  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8097  s & BOOST_SERIALIZATION_NVP(p_d_tag);
8098  s & BOOST_SERIALIZATION_NVP(p_d_val);
8099  s & BOOST_SERIALIZATION_NVP(p_name);
8100  s & BOOST_SERIALIZATION_NVP(p_extra);
8101  }
8102 #endif
8103 
8104  public:
8105  enum EntryType { /* Type Executable SharedObj Purpose */
8106  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
8107  DT_NEEDED = 1, /* value optional optional Name of needed library */
8108  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
8109  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
8110  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
8111  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
8112  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
8113  DT_RELA = 7, /* pointer mandatory optional Relocation table */
8114  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
8115  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
8116  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
8117  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
8118  DT_INIT = 12, /* pointer optional optional Initialization function */
8119  DT_FINI = 13, /* pointer optional optional Termination function */
8120  DT_SONAME = 14, /* value ignored optional Name of shared object */
8121  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
8122  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
8123  DT_REL = 17, /* pointer mandatory optional Relocation table */
8124  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
8125  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
8126  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
8127  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
8128  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
8129  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
8130  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
8131  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
8132  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
8133  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
8134  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
8135  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
8136  DT_FLAGS = 30, /* value optional ? Bit flags */
8137  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
8138  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
8139  DT_NUM = 34, /* ? ? ? "number used"? */
8140 
8141  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
8142  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
8143  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
8144  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
8145  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
8146  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
8147  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
8148  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
8149  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
8150  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
8151  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
8152 
8153  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
8154  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
8155  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
8156  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
8157  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
8158  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
8159  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
8160  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
8161  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
8162  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
8163  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
8164 
8165  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
8166  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
8167  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
8168  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
8169  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
8170  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
8171  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
8172  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
8173 
8174  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
8175  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
8176  };
8177 
8178 #ifdef _MSC_VER
8179 # pragma pack (1)
8180 #endif
8181 
8184  uint32_t d_tag;
8185  uint32_t d_val;
8186  }
8187 #if !defined(SWIG) && !defined(_MSC_VER)
8188  __attribute__((packed))
8189 #endif
8190  ;
8191 
8193  uint64_t d_tag;
8194  uint64_t d_val;
8195  }
8196 #if !defined(SWIG) && !defined(_MSC_VER)
8197  __attribute__((packed))
8198 #endif
8199  ;
8200 
8201 #ifdef _MSC_VER
8202 # pragma pack ()
8203 #endif
8204 
8207  : p_d_tag(DT_NULL), p_name(NULL) {
8208  ctor(dynsec);
8209  }
8210 
8214  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);