ROSE  0.11.50.0
binaryInstruction.C
1 #include <featureTests.h>
2 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
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 SgAsmAarch64Instruction: 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_AARCH32
175  DECLARE_LEAF_CLASS(AsmAarch32Instruction);
176  IS_SERIALIZABLE(AsmAarch32Instruction);
177 
178  DECLARE_HEADERS(AsmAarch32Instruction);
179 #if defined(SgAsmAarch32Instruction_HEADERS) || defined(DOCUMENTATION)
180  #include <Rose/BinaryAnalysis/InstructionEnumsAarch32.h>
181 #endif // SgAsmAarch32Instruction_HEADERS
182 
183 #ifdef DOCUMENTATION
184 
185  class SgAsmAarch32Instruction: public SgAsmInstruction {
186  public:
187 #endif
188 
189 #ifdef DOCUMENTATION
190 
196  Rose::BinaryAnalysis::AArch32InstructionKind get_kind() const;
197  void set_kind(Rose::BinaryAnalysis::Aarch32InstructionKind);
199 #else
200  AsmAarch32Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch32InstructionKind", "kind",
201  "= Rose::BinaryAnalysis::Aarch32InstructionKind::ARM_INS_INVALID",
202  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
203 #endif
204 
205 #ifdef DOCUMENTATION
206 
211  Rose::BinaryAnalysis::Aarch32InstructionCondition get_condition() const;
212  void set_condition(Rose::BinaryAnalysis::Aarch32InstructionCondition);
214 #else
215  AsmAarch32Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch32InstructionCondition", "condition",
216  "= Rose::BinaryAnalysis::Aarch32InstructionCondition::ARM_CC_INVALID",
217  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
218 #endif
219 
220 #ifdef DOCUMENTATION
221 
224  bool get_updatesFlags() const;
225  void set_updatesFlags(bool);
227 #else
228  AsmAarch32Instruction.setDataPrototype("bool", "updatesFlags", "= false",
229  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
230 #endif
231 
232 #ifdef DOCUMENTATION
233 
236  bool get_writesBack() const;
237  void set_writesBack(bool);
239 #else
240  AsmAarch32Instruction.setDataPrototype("bool", "writesBack", "= false",
241  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
242 #endif
243 
244 #ifdef DOCUMENTATION
245 
251  bool get_writesToIp() const;
252  void set_writesToIp(bool);
254 #else
255  AsmAarch32Instruction.setDataPrototype("bool", "writesToIp", "= false",
256  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
257 #endif
258 
259  DECLARE_OTHERS(AsmAarch32Instruction);
260 #if defined(SgAsmAarch32Instruction_OTHERS) || defined(DOCUMENTATION)
261 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
262  private:
263  friend class boost::serialization::access;
264 
265  template<class S>
266  void serialize(S &s, const unsigned /*version*/) {
267  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
268  s & BOOST_SERIALIZATION_NVP(p_kind);
269  s & BOOST_SERIALIZATION_NVP(p_condition);
270  s & BOOST_SERIALIZATION_NVP(p_updatesFlags);
271  s & BOOST_SERIALIZATION_NVP(p_writesBack);
272  }
273 #endif
274 
275  public:
276  // Overrides are documented in the base class
277  virtual std::string description() const $ROSE_OVERRIDE;
278  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
279  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
280  virtual bool isUnknown() const $ROSE_OVERRIDE;
281  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
282  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
283  rose_addr_t *return_va) $ROSE_OVERRIDE;
284  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
285  rose_addr_t *return_va) $ROSE_OVERRIDE;
286  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
287  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
288  virtual Sawyer::Optional<rose_addr_t> branchTarget() $ROSE_OVERRIDE;
289 
290 #endif // SgAsmAarch32Instruction_OTHERS
291 #ifdef DOCUMENTATION
292  };
293 #endif
294 #endif
295 
297 
298 #ifdef ROSE_ENABLE_ASM_AARCH64
299  DECLARE_LEAF_CLASS(AsmAarch64Instruction);
300  IS_SERIALIZABLE(AsmAarch64Instruction);
301 
302  DECLARE_HEADERS(AsmAarch64Instruction);
303 #if defined(SgAsmAarch64Instruction_HEADERS) || defined(DOCUMENTATION)
304  #include <Rose/BinaryAnalysis/InstructionEnumsAarch64.h>
305 #endif // SgAsmAarch64Instruction_HEADERS
306 
307 #ifdef DOCUMENTATION
308 
309  class SgAsmAarch64Instruction: public SgAsmInstruction {
310  public:
311 #endif
312 
313 #ifdef DOCUMENTATION
314 
320  Rose::BinaryAnalysis::Aarch64InstructionKind get_kind() const;
321  void set_kind(Rose::BinaryAnalysis::Aarch64InstructionKind);
323 #else
324  AsmAarch64Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch64InstructionKind", "kind",
325  "= Rose::BinaryAnalysis::Aarch64InstructionKind::ARM64_INS_INVALID",
326  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
327 #endif
328 
329 #ifdef DOCUMENTATION
330 
333  Rose::BinaryAnalysis::Aarch64InstructionCondition get_condition() const;
334  void set_condition(Rose::BinaryAnalysis::Aarch64InstructionCondition);
336 #else
337  AsmAarch64Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch64InstructionCondition", "condition",
338  "= Rose::BinaryAnalysis::Aarch64InstructionCondition::ARM64_CC_INVALID",
339  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
340 #endif
341 
342 #ifdef DOCUMENTATION
343 
346  bool get_updatesFlags() const;
347  void set_updatesFlags(bool);
349 #else
350  AsmAarch64Instruction.setDataPrototype("bool", "updatesFlags", "= false",
351  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
352 #endif
353 
354  DECLARE_OTHERS(AsmAarch64Instruction);
355 #if defined(SgAsmAarch64Instruction_OTHERS) || defined(DOCUMENTATION)
356 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
357  private:
358  friend class boost::serialization::access;
359 
360  template<class S>
361  void serialize(S &s, const unsigned /*version*/) {
362  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
363  s & BOOST_SERIALIZATION_NVP(p_kind);
364  s & BOOST_SERIALIZATION_NVP(p_condition);
365  }
366 #endif
367 
368  public:
369  // Overrides are documented in the base class
370  virtual std::string description() const $ROSE_OVERRIDE;
371  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
372  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
373  virtual bool isUnknown() const $ROSE_OVERRIDE;
374  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
375  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
376  rose_addr_t *return_va) $ROSE_OVERRIDE;
377  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
378  rose_addr_t *return_va) $ROSE_OVERRIDE;
379  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
380  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
381  virtual Sawyer::Optional<rose_addr_t> branchTarget() $ROSE_OVERRIDE;
382 
383 #endif // SgAsmAarch64Instruction_OTHERS
384 #ifdef DOCUMENTATION
385  };
386 #endif
387 #endif
388 
390 
391  DECLARE_LEAF_CLASS(AsmX86Instruction);
392  IS_SERIALIZABLE(AsmX86Instruction);
393  DECLARE_HEADERS(AsmX86Instruction);
394 #if defined(SgAsmX86Instruction_HEADERS) || defined(DOCUMENTATION)
395  #include <Rose/BinaryAnalysis/InstructionEnumsX86.h>
396  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
397 #endif // SgAsmX86Instruction_HEADERS
398 
399 #ifdef DOCUMENTATION
400 
402  public:
403 #endif
404 
405 #ifdef DOCUMENTATION
406 
415 #else
416  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionKind", "kind",
417  "= Rose::BinaryAnalysis::x86_unknown_instruction",
418  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
419 #endif
420 
421 #ifdef DOCUMENTATION
422 
428 #else
429  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "baseSize",
430  "= Rose::BinaryAnalysis::x86_insnsize_none",
431  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
432 #endif
433 
434 #ifdef DOCUMENTATION
435 
441 #else
442  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "operandSize",
443  "= Rose::BinaryAnalysis::x86_insnsize_none",
444  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
445 #endif
446 
447 #ifdef DOCUMENTATION
448 
454 #else
455  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "addressSize",
456  "= Rose::BinaryAnalysis::x86_insnsize_none",
457  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
458 #endif
459 
460 #ifdef DOCUMENTATION
461 
466  bool get_lockPrefix() const;
467  void set_lockPrefix(bool);
469 #else
470  AsmX86Instruction.setDataPrototype("bool", "lockPrefix", "= false",
471  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
472 #endif
473 
474 #ifdef DOCUMENTATION
475 
481 #else
482  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86RepeatPrefix", "repeatPrefix",
483  "= Rose::BinaryAnalysis::x86_repeat_none",
484  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
485 #endif
486 
487 #ifdef DOCUMENTATION
488 
494 #else
495  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86BranchPrediction", "branchPrediction",
496  "= Rose::BinaryAnalysis::x86_branch_prediction_none",
497  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
498 #endif
499 
500 #ifdef DOCUMENTATION
501 
510 #else
511  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86SegmentRegister", "segmentOverride",
512  "= Rose::BinaryAnalysis::x86_segreg_none",
513  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
514 #endif
515 
516 
517  DECLARE_OTHERS(AsmX86Instruction);
518 #if defined(SgAsmX86Instruction_OTHERS) || defined(DOCUMENTATION)
519 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
520  private:
521  friend class boost::serialization::access;
522 
523  template<class S>
524  void serialize(S &s, const unsigned /*version*/) {
525  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
526  s & BOOST_SERIALIZATION_NVP(p_kind);
527  s & BOOST_SERIALIZATION_NVP(p_baseSize);
528  s & BOOST_SERIALIZATION_NVP(p_operandSize);
529  s & BOOST_SERIALIZATION_NVP(p_addressSize);
530  s & BOOST_SERIALIZATION_NVP(p_lockPrefix);
531  s & BOOST_SERIALIZATION_NVP(p_repeatPrefix);
532  s & BOOST_SERIALIZATION_NVP(p_branchPrediction);
533  s & BOOST_SERIALIZATION_NVP(p_segmentOverride);
534  }
535 #endif
536 
537  public:
542 
547 
553 
559 
560  // Overrides are documented in the base class
561  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
562  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
563  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
564  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
565  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
566  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
567  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
568  virtual Sawyer::Optional<rose_addr_t> branchTarget() $ROSE_OVERRIDE;
569  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
570  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
571  bool &complete,
572  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
573  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
574  virtual bool isUnknown() const $ROSE_OVERRIDE;
575  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
576 #endif // SgAsmX86Instruction_OTHERS
577 #ifdef DOCUMENTATION
578  };
579 #endif
580 
582 
583  DECLARE_LEAF_CLASS(AsmPowerpcInstruction);
584  IS_SERIALIZABLE(AsmPowerpcInstruction);
585  DECLARE_HEADERS(AsmPowerpcInstruction);
586 #if defined(SgAsmPowerpcInstruction_HEADERS) || defined(DOCUMENTATION)
587  #include <Rose/BinaryAnalysis/InstructionEnumsPowerpc.h>
588 #endif // SgAsmPowerpcInstruction_HEADERS
589 
590 #ifdef DOCUMENTATION
591 
593  public:
594 #endif
595 
596 
597 #ifdef DOCUMENTATION
598 
607 #else
608  AsmPowerpcInstruction.setDataPrototype("Rose::BinaryAnalysis::PowerpcInstructionKind", "kind",
609  "= Rose::BinaryAnalysis::powerpc_unknown_instruction",
610  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
611  COPY_DATA);
612 #endif
613 
614  DECLARE_OTHERS(AsmPowerpcInstruction);
615 #if defined(SgAsmPowerpcInstruction_OTHERS) || defined(DOCUMENTATION)
616 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
617  private:
618  friend class boost::serialization::access;
619 
620  template<class S>
621  void serialize(S &s, const unsigned /*version*/) {
622  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
623  s & BOOST_SERIALIZATION_NVP(p_kind);
624  }
625 #endif
626 
627  public:
633  std::string conditionalBranchDescription() const;
634 
640 
641  // Overrides are documented in the base class
642  virtual std::string description() const $ROSE_OVERRIDE;
643  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
644  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
645  virtual bool isUnknown() const $ROSE_OVERRIDE;
646  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
647  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
648  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
649  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
650  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
651  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
652  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
653 #endif // SgAsmPowerpcInstruction_OTHERS
654 #ifdef DOCUMENTATION
655  };
656 #endif
657 
658 
660 
661  DECLARE_LEAF_CLASS(AsmMipsInstruction);
662  IS_SERIALIZABLE(AsmMipsInstruction);
663  DECLARE_HEADERS(AsmMipsInstruction);
664 #if defined(SgAsmMipsInstruction_HEADERS) || defined(DOCUMENTATION)
665  #include <Rose/BinaryAnalysis/InstructionEnumsMips.h>
666 #endif // SgAsmMipsInstruction_HEADERS
667 
668 #ifdef DOCUMENTATION
669 
671  public:
672 #endif
673 
674 #ifdef DOCUMENTATION
675 
684 #else
685  AsmMipsInstruction.setDataPrototype("Rose::BinaryAnalysis::MipsInstructionKind", "kind",
686  "= Rose::BinaryAnalysis::mips_unknown_instruction",
687  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
688  COPY_DATA);
689 #endif
690 
691  DECLARE_OTHERS(AsmMipsInstruction);
692 #if defined(SgAsmMipsInstruction_OTHERS) || defined(DOCUMENTATION)
693 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
694  private:
695  friend class boost::serialization::access;
696 
697  template<class S>
698  void serialize(S &s, const unsigned /*version*/) {
699  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
700  s & BOOST_SERIALIZATION_NVP(p_kind);
701  }
702 #endif
703 
704  public:
705  // Overrides are documented in the base class
706  virtual std::string description() const $ROSE_OVERRIDE;
707  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
708  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
709  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
710  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
711  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
712  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
713  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
714  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
715  virtual bool isUnknown() const $ROSE_OVERRIDE;
716  virtual Sawyer::Optional<rose_addr_t> branchTarget() $ROSE_OVERRIDE;
717  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
718 #endif // SgAsmMipsInstruction_OTHERS
719 #ifdef DOCUMENTATION
720  };
721 #endif
722 
724 
725  DECLARE_LEAF_CLASS(AsmM68kInstruction);
726  IS_SERIALIZABLE(AsmM68kInstruction);
727  DECLARE_HEADERS(AsmM68kInstruction);
728 #if defined(SgAsmM68kInstruction_HEADERS) || defined(DOCUMENTATION)
729  #include <Rose/BinaryAnalysis/InstructionEnumsM68k.h>
730 #endif // SgAsmM68kInstruction_HEADERS
731 
732 #ifdef DOCUMENTATION
734  public:
735 #endif
736 
737 #ifdef DOCUMENTATION
738 
747 #else
748  AsmM68kInstruction.setDataPrototype("Rose::BinaryAnalysis::M68kInstructionKind", "kind",
749  " = Rose::BinaryAnalysis::m68k_unknown_instruction",
750  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
751  COPY_DATA);
752 #endif
753 
754  DECLARE_OTHERS(AsmM68kInstruction);
755 #if defined(SgAsmM68kInstruction_OTHERS) || defined(DOCUMENTATION)
756 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
757  private:
758  friend class boost::serialization::access;
759 
760  template<class S>
761  void serialize(S &s, const unsigned /*version*/) {
762  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
763  s & BOOST_SERIALIZATION_NVP(p_kind);
764  }
765 #endif
766 
767  public:
768  // Overrides are documented in the base class
769  virtual std::string description() const $ROSE_OVERRIDE;
770  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
771  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
772  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
773  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
774  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
775  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
776  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
777  virtual Sawyer::Optional<rose_addr_t> branchTarget() $ROSE_OVERRIDE;
778  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
779  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
780  bool &complete,
781  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
782  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
783  virtual bool isUnknown() const $ROSE_OVERRIDE;
784  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
785 #endif // SgAsmM68kInstruction_OTHERS
786 #ifdef DOCUMENTATION
787  };
788 #endif
789 
791 
792  DECLARE_LEAF_CLASS(AsmNullInstruction);
793  IS_SERIALIZABLE(AsmNullInstruction);
794 
795 #ifdef DOCUMENTATION
797  public:
798 #endif
799 
800  DECLARE_OTHERS(AsmNullInstruction);
801 #if defined(SgAsmNullInstruction_OTHERS) || defined(DOCUMENTATION)
802 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
803  private:
804  friend class boost::serialization::access;
805 
806  template<class S>
807  void serialize(S & s, const unsigned /*version*/) {
808  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
809  }
810 #endif
811 
812  public:
813  // there's only one kind of null instruction
814  enum Kind { null_unknown };
815 
816  public: // overrides
817  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
818  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
819  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
820  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
821  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
822  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
823  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
824  virtual Sawyer::Optional<rose_addr_t> branchTarget() $ROSE_OVERRIDE;
825  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) $ROSE_OVERRIDE;
826  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
827  bool &complete,
828  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
829  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
830  virtual bool isUnknown() const $ROSE_OVERRIDE;
831  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
832 #endif // SgAsmNullInstruction_OTHERS
833 #ifdef DOCUMENTATION
834  };
835 #endif
836 
838 
839  NEW_NONTERMINAL_MACRO(AsmInstruction,
840  AsmX86Instruction
841 #ifdef ROSE_ENABLE_ASM_AARCH32
842  | AsmAarch32Instruction
843 #endif
844 #ifdef ROSE_ENABLE_ASM_AARCH64
845  | AsmAarch64Instruction
846 #endif
847  | AsmPowerpcInstruction | AsmMipsInstruction | AsmM68kInstruction | AsmNullInstruction,
848  "AsmInstruction", "AsmInstructionTag", true);
849  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
850  IS_SERIALIZABLE(AsmInstruction);
851 
852  DECLARE_HEADERS(AsmInstruction);
853 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
854  #include <Rose/BinaryAnalysis/MemoryMap.h>
855 #endif // SgAsmInstruction_HEADERS
856 
857 #ifdef DOCUMENTATION
858 
880  public:
881 #endif
882 
883 #ifdef DOCUMENTATION
884 
892  const std::string& get_mnemonic() const;
893  void set_mnemonic(const std::string&);
895 #else
896  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
897  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
898 #endif
899 
900 #ifdef DOCUMENTATION
901 
906  const SgUnsignedList& get_raw_bytes() const;
907  void set_raw_bytes(const SgUnsignedList&);
909 #else
910  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
911  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
912 #endif
913 
914 #ifdef DOCUMENTATION
915 
924 #else
925  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
926  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
927 #endif
928 
929 #ifdef DOCUMENTATION
930  // Documentation is below because it uses different names than normal. Functions are not automatically generated because
931  // we need to synchronize access to the private p_cacheLockCount data member. However, we still use ROSETTA to generate
932  // the data member because we need to make sure it gets initialized to zero in the constructors. What a mess.
933 #else
934  AsmInstruction.setDataPrototype("size_t", "cacheLockCount", "= 0",
935  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
936 #endif
937 
938 #ifdef DOCUMENTATION
939  // FIXME[Robb P Matzke 2017-02-13]: unused?
940 #else
941  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
942  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
943 #endif
944 
945 #ifdef DOCUMENTATION
946 
952  int64_t get_stackDeltaIn() const;
953  void set_stackDeltaIn(int64_t);
955 #else
956  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
957  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
958 #endif
959 
960 #ifdef DOCUMENTATION
961 
966 #else
967  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
968  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
969 #endif
970 
971  DECLARE_OTHERS(AsmInstruction);
972 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
973 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
974  private:
975  friend class boost::serialization::access;
976 
977  template<class S>
978  void serialize(S &s, const unsigned version) {
979  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
980  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
981  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
982  s & BOOST_SERIALIZATION_NVP(p_operandList);
983  s & BOOST_SERIALIZATION_NVP(p_sources);
984  if (version >= 1)
985  s & BOOST_SERIALIZATION_NVP(semanticFailure_);
986  //s & BOOST_SERIALIZATION_NVP(p_cacheLockCount); -- definitely not!
987  }
988 #endif
989 
990  private:
991  struct SemanticFailure {
992  size_t n;
993  SemanticFailure(): n(0) {}
994 
995 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
996  private:
997  friend class boost::serialization::access;
998  template<class S>
999  void serialize(S &s, const unsigned /*version*/) {
1000  s & BOOST_SERIALIZATION_NVP(n);
1001  }
1002 #endif
1003  };
1004  SemanticFailure semanticFailure_;
1005 
1006  // Synchronized data members. All the following data members (as listed in binaryInstruction.C, not the ROSETTA-generated
1007  // code) should be procted by the mutex_. Additionally, the p_cacheLockCount data member is synchronized.
1008  mutable SAWYER_THREAD_TRAITS::Mutex mutex_;
1009 
1010  public:
1015  static const int64_t INVALID_STACK_DELTA;
1016 
1022  virtual std::string description() const { return ""; }
1023 
1024  // FIXME[Robb P Matzke 2017-02-13]: unused?
1025  void appendSources( SgAsmInstruction* instruction );
1026 
1028  size_t nOperands() const;
1029 
1033  SgAsmExpression* operand(size_t) const;
1034 
1041  virtual bool terminatesBasicBlock();
1042 
1056  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
1057  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
1069  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
1070  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
1076  bool isFirstInBlock();
1077 
1081  bool isLastInBlock();
1082 
1088 
1089  // FIXME[Robb Matzke 2021-03-02]: deprecated
1090  bool getBranchTarget(rose_addr_t *target /*out*/) ROSE_DEPRECATED("use branchTarget instead");
1091 
1226  virtual bool hasEffect();
1227 
1236  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
1237  bool relax_stack_semantics=false);
1238 
1248  virtual std::vector<std::pair<size_t,size_t> >
1249  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
1250  bool relax_stack_semantics=false);
1251 
1258  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete); /*subclasses must redefine*/
1259 
1268  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1269  bool &complete,
1270  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1272 
1278  virtual size_t get_size() const;
1279 
1285  virtual bool isUnknown() const;
1286 
1320  virtual unsigned get_anyKind() const;
1321 
1325  virtual std::string toString() const;
1326 
1331  virtual std::set<rose_addr_t> explicitConstants() const;
1332 
1342  size_t semanticFailure() const;
1343  void semanticFailure(size_t);
1344  void incrementSemanticFailure();
1354  size_t cacheLockCount() const;
1355  void adjustCacheLockCount(int increment);
1357 #endif // SgAsmInstruction_OTHERS
1358 
1359 #ifdef DOCUMENTATION
1360  };
1361 #endif
1362 
1363 
1364 
1366 
1367  /**************************************************************************************************************************
1368  * Instruction Expressions
1369  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1370  **************************************************************************************************************************/
1371 
1373 
1374  DECLARE_LEAF_CLASS(AsmOperandList);
1375  IS_SERIALIZABLE(AsmOperandList);
1376 
1377 #ifdef DOCUMENTATION
1378 
1379  class SgAsmOperandList: public SgAsmNode {
1380  public:
1381 #endif
1382 
1383 #ifdef DOCUMENTATION
1384 
1390  const SgAsmExpressionPtrList& get_operands() const;
1391  void set_oerands(const SgAsmExpressionPtrList&);
1393 #else
1394  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1395  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1396 #endif
1397 
1398  DECLARE_OTHERS(AsmOperandList);
1399 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1400 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1401  private:
1402  friend class boost::serialization::access;
1403 
1404  template<class S>
1405  void serialize(S &s, const unsigned /*version*/) {
1406  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1407  s & BOOST_SERIALIZATION_NVP(p_operands);
1408  }
1409 #endif
1410 
1411  public:
1413  void append_operand(SgAsmExpression* operand);
1414 #endif // SgAsmOperandList_OTHERS
1415 
1416 #ifdef DOCUMENTATION
1417  };
1418 #endif
1419 
1420  // FIXME[Robb P Matzke 2016-10-31]
1421  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1422 
1424 
1425  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1426  IS_SERIALIZABLE(AsmBinaryAdd);
1427 
1428 #ifdef DOCUMENTATION
1429 
1431  public:
1432 #endif
1433 
1434  DECLARE_OTHERS(AsmBinaryAdd);
1435 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1436 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1437  private:
1438  friend class boost::serialization::access;
1439 
1440  template<class S>
1441  void serialize(S &s, const unsigned /*version*/) {
1442  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1443  }
1444 #endif
1445 #endif // SgAsmBinaryAdd_OTHERS
1446 
1447 #ifdef DOCUMENTATION
1448  };
1449 #endif
1450 
1452 
1453  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1454  IS_SERIALIZABLE(AsmBinarySubtract);
1455 
1456 #ifdef DOCUMENTATION
1457 
1459  public:
1460 #endif
1461 
1462  DECLARE_OTHERS(AsmBinarySubtract);
1463 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1464 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1465  private:
1466  friend class boost::serialization::access;
1467 
1468  template<class S>
1469  void serialize(S &s, const unsigned /*version*/) {
1470  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1471  }
1472 #endif
1473 #endif // SgAsmBinarySubtract_OTHERS
1474 
1475 #ifdef DOCUMENTATION
1476  };
1477 #endif
1478 
1480 
1481  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1482  IS_SERIALIZABLE(AsmBinaryMultiply);
1483 
1484 #ifdef DOCUMENTATION
1485 
1487  public:
1488 #endif
1489 
1490  DECLARE_OTHERS(AsmBinaryMultiply);
1491 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1492 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1493  private:
1494  friend class boost::serialization::access;
1495 
1496  template<class S>
1497  void serialize(S &s, const unsigned /*version*/) {
1498  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1499  }
1500 #endif
1501 #endif // SgAsmBinaryMultiply_OTHERS
1502 
1503 #ifdef DOCUMENTATION
1504  };
1505 #endif
1506 
1508 
1509  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1510  IS_SERIALIZABLE(AsmBinaryDivide);
1511 
1512 #ifdef DOCUMENTATION
1513 
1515  public:
1516 #endif
1517 
1518  DECLARE_OTHERS(AsmBinaryDivide);
1519 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1520 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1521  private:
1522  friend class boost::serialization::access;
1523 
1524  template<class S>
1525  void serialize(S &s, const unsigned /*version*/) {
1526  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1527  }
1528 #endif
1529 #endif // SgAsmBinaryDivide_OTHERS
1530 
1531 #ifdef DOCUMENTATION
1532  };
1533 #endif
1534 
1536 
1537  DECLARE_LEAF_CLASS(AsmBinaryMod);
1538  IS_SERIALIZABLE(AsmBinaryMod);
1539 
1540 #ifdef DOCUMENTATION
1541 
1543  public:
1544 #endif
1545 
1546  DECLARE_OTHERS(AsmBinaryMod);
1547 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1548 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1549  private:
1550  friend class boost::serialization::access;
1551 
1552  template<class S>
1553  void serialize(S &s, const unsigned /*version*/) {
1554  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1555  }
1556 #endif
1557 #endif // SgAsmBinaryMod_OTHERS
1558 
1559 #ifdef DOCUMENTATION
1560  };
1561 #endif
1562 
1564 
1565  DECLARE_LEAF_CLASS(AsmBinaryPreupdate);
1566  IS_SERIALIZABLE(AsmBinaryPreupdate);
1567 
1568 #ifdef DOCUMENTATION
1569 
1574  public:
1575 #endif
1576 
1577  DECLARE_OTHERS(AsmBinaryPreupdate);
1578 #if defined(SgAsmBinaryPreupdate_OTHERS) || defined(DOCUMENTATION)
1579 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1580  private:
1581  friend class boost::serialization::access;
1582 
1583  template<class S>
1584  void serialize(S &s, const unsigned /*version*/) {
1585  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1586  }
1587 #endif
1588 #endif // SgAsmBinaryPreupdate_OTHERS
1589 
1590 #ifdef DOCUMENTATION
1591  };
1592 #endif
1593 
1595 
1596  DECLARE_LEAF_CLASS(AsmBinaryPostupdate);
1597  IS_SERIALIZABLE(AsmBinaryPostupdate);
1598 
1599 #ifdef DOCUMENTATION
1600 
1605  public:
1606 #endif
1607 
1608  DECLARE_OTHERS(AsmBinaryPostupdate);
1609 #if defined(SgAsmBinaryPostupdate_OTHERS) || defined(DOCUMENTATION)
1610 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1611  private:
1612  friend class boost::serialization::access;
1613 
1614  template<class S>
1615  void serialize(S &s, const unsigned /*version*/) {
1616  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1617  }
1618 #endif
1619 #endif // SgAsmBinaryPostupdate_OTHERS
1620 
1621 #ifdef DOCUMENTATION
1622  };
1623 #endif
1624 
1626 
1627  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1628  IS_SERIALIZABLE(AsmBinaryLsl);
1629 
1630 #ifdef DOCUMENTATION
1631 
1633  public:
1634 #endif
1635 
1636  DECLARE_OTHERS(AsmBinaryLsl);
1637 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1638 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1639  private:
1640  friend class boost::serialization::access;
1641 
1642  template<class S>
1643  void serialize(S &s, const unsigned /*version*/) {
1644  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1645  }
1646 #endif
1647 #endif // SgAsmBinaryLsl_OTHERS
1648 
1649 #ifdef DOCUMENTATION
1650  };
1651 #endif
1652 
1654 
1655  DECLARE_LEAF_CLASS(AsmBinaryMsl);
1656  IS_SERIALIZABLE(AsmBinaryMsl);
1657 
1658 #ifdef DOCUMENTATION
1659 
1663  public:
1664 #endif
1665 
1666  DECLARE_OTHERS(AsmBinaryMsl);
1667 #if defined(SgAsmBinaryMsl_OTHERS) || defined(DOCUMENTATION)
1668 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1669  private:
1670  friend class boost::serialization::access;
1671 
1672  template<class S>
1673  void serialize(S &s, const unsigned /*version*/) {
1674  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1675  }
1676 #endif
1677 #endif // SgAsmBinaryMsl_OTHERS
1678 
1679 #ifdef DOCUMENTATION
1680  };
1681 #endif
1682 
1684 
1685  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1686  IS_SERIALIZABLE(AsmBinaryLsr);
1687 
1688 #ifdef DOCUMENTATION
1689 
1691  public:
1692 #endif
1693 
1694  DECLARE_OTHERS(AsmBinaryLsr);
1695 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1696 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1697  private:
1698  friend class boost::serialization::access;
1699 
1700  template<class S>
1701  void serialize(S &s, const unsigned /*version*/) {
1702  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1703  }
1704 #endif
1705 #endif // SgAsmBinaryLsr_OTHERS
1706 
1707 #ifdef DOCUMENTATION
1708  };
1709 #endif
1710 
1712 
1713  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1714  IS_SERIALIZABLE(AsmBinaryAsr);
1715 
1716 #ifdef DOCUMENTATION
1717 
1719  public:
1720 #endif
1721 
1722  DECLARE_OTHERS(AsmBinaryAsr);
1723 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1724 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1725  private:
1726  friend class boost::serialization::access;
1727 
1728  template<class S>
1729  void serialize(S &s, const unsigned /*version*/) {
1730  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1731  }
1732 #endif
1733 #endif // SgAsmBinaryAsr_OTHERS
1734 
1735 #ifdef DOCUMENTATION
1736  };
1737 #endif
1738 
1740 
1741  DECLARE_LEAF_CLASS(AsmBinaryRor);
1742  IS_SERIALIZABLE(AsmBinaryRor);
1743 
1744 #ifdef DOCUMENTATION
1745 
1747  public:
1748 #endif
1749 
1750  DECLARE_OTHERS(AsmBinaryRor);
1751 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1752 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1753  private:
1754  friend class boost::serialization::access;
1755 
1756  template<class S>
1757  void serialize(S &s, const unsigned /*version*/) {
1758  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1759  }
1760 #endif
1761 #endif // SgAsmBinaryRor_OTHERS
1762 
1763 #ifdef DOCUMENTATION
1764  };
1765 #endif
1766 
1768 
1769  DECLARE_LEAF_CLASS(AsmBinaryConcat);
1770  IS_SERIALIZABLE(AsmBinaryConcat);
1771 
1772 #ifdef DOCUMENTATION
1773 
1775  public:
1776 #endif
1777 
1778  DECLARE_OTHERS(AsmBinaryConcat);
1779 #if defined(SgAsmBinaryConcat_OTHERS) || defined(DOCUMENTATION)
1780 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1781  private:
1782  friend class boost::serialization::access;
1783 
1784  template<class S>
1785  void serialize(S &s, const unsigned /*version*/) {
1786  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1787  }
1788 #endif
1789 #endif // SgAsmBinaryConcat_OTHERS
1790 
1791 #ifdef DOCUMENTATION
1792  };
1793 #endif
1794 
1796 
1797  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1798  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1799  AsmBinaryDivide | AsmBinaryMod | AsmBinaryPreupdate |
1800  AsmBinaryPostupdate |
1801  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1802  AsmBinaryRor | AsmBinaryMsl | AsmBinaryConcat,
1803  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1804  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1805  IS_SERIALIZABLE(AsmBinaryExpression);
1806 
1807 #ifdef DOCUMENTATION
1808 
1810  public:
1811 #endif
1812 
1813 #ifdef DOCUMENTATION
1814 
1817  SgAsmExpression* get_lhs() const;
1818  void set_lhs(SgAsmExpression*);
1820 #else
1821  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1822  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1823 #endif
1824 
1825 #ifdef DOCUMENTATION
1826 
1829  SgAsmExpression* get_rhs() const;
1830  void set_rhs(SgAsmExpression*);
1832 #else
1833  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1834  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1835 #endif
1836 
1837  DECLARE_OTHERS(AsmBinaryExpression);
1838 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1839 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1840  private:
1841  friend class boost::serialization::access;
1842 
1843  template<class S>
1844  void serialize(S &s, const unsigned /*version*/) {
1845  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1846  s & BOOST_SERIALIZATION_NVP(p_lhs);
1847  s & BOOST_SERIALIZATION_NVP(p_rhs);
1848  }
1849 #endif
1850 #endif // SgAsmBinaryExpression_OTHERS
1851 
1852 #ifdef DOCUMENTATION
1853  };
1854 #endif
1855 
1857 
1858  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1859  IS_SERIALIZABLE(AsmUnaryPlus);
1860 
1861 #ifdef DOCUMENTATION
1862 
1864  public:
1865 #endif
1866 
1867  DECLARE_OTHERS(AsmUnaryPlus);
1868 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1869 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1870  private:
1871  friend class boost::serialization::access;
1872 
1873  template<class S>
1874  void serialize(S &s, const unsigned /*version*/) {
1875  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1876  }
1877 #endif
1878 #endif // SgAsmUnaryPlus_OTHERS
1879 
1880 #ifdef DOCUMENTATION
1881  };
1882 #endif
1883 
1885 
1886  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1887  IS_SERIALIZABLE(AsmUnaryMinus);
1888 
1889 #ifdef DOCUMENTATION
1890 
1892  public:
1893 #endif
1894 
1895  DECLARE_OTHERS(AsmUnaryMinus);
1896 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1897 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1898  private:
1899  friend class boost::serialization::access;
1900 
1901  template<class S>
1902  void serialize(S &s, const unsigned /*version*/) {
1903  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1904  }
1905 #endif
1906 #endif // SgAsmUnaryMinus_OTHERS
1907 
1908 #ifdef DOCUMENTATION
1909  };
1910 #endif
1911 
1913 
1914  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1915  IS_SERIALIZABLE(AsmUnaryRrx);
1916 
1917 #ifdef DOCUMENTATION
1918  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1920  public:
1921 #endif
1922 
1923  DECLARE_OTHERS(AsmUnaryRrx);
1924 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1925 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1926  private:
1927  friend class boost::serialization::access;
1928 
1929  template<class S>
1930  void serialize(S &s, const unsigned /*version*/) {
1931  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1932  }
1933 #endif
1934 #endif // SgAsmUnaryRrx_OTHERS
1935 
1936 #ifdef DOCUMENTATION
1937  };
1938 #endif
1939 
1941 
1942  DECLARE_LEAF_CLASS(AsmUnaryTruncate);
1943  IS_SERIALIZABLE(AsmUnaryTruncate);
1944 
1945 #ifdef DOCUMENTATION
1946 
1952  public:
1953 #endif
1954 
1955  DECLARE_OTHERS(AsmUnaryTruncate);
1956 #if defined(SgAsmUnaryTruncate_OTHERS) || defined(DOCUMENTATION)
1957 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1958  private:
1959  friend class boost::serialization::access;
1960 
1961  template<class S>
1962  void serialize(S &s, const unsigned /*version*/) {
1963  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1964  }
1965 #endif
1966 #endif // SgAsmUnaryTruncate_OTHERS
1967 
1968 #ifdef DOCUMENTATION
1969  };
1970 #endif
1971 
1973 
1974  DECLARE_LEAF_CLASS(AsmUnarySignedExtend);
1975  IS_SERIALIZABLE(AsmUnarySignedExtend);
1976 
1977 #ifdef DOCUMENTATION
1978 
1984  public:
1985 #endif
1986 
1987  DECLARE_OTHERS(AsmUnarySignedExtend);
1988 #if defined(SgAsmUnarySignedExtend_OTHERS) || defined(DOCUMENTATION)
1989 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1990  private:
1991  friend class boost::serialization::access;
1992 
1993  template<class S>
1994  void serialize(S &s, const unsigned /*version*/) {
1995  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1996  }
1997 #endif
1998 #endif // SgAsmUnarySignedExtend_OTHERS
1999 
2000 #ifdef DOCUMENTATION
2001  };
2002 #endif
2003 
2005 
2006  DECLARE_LEAF_CLASS(AsmUnaryUnsignedExtend);
2007  IS_SERIALIZABLE(AsmUnaryUnsignedExtend);
2008 
2009 #ifdef DOCUMENTATION
2010 
2016  public:
2017 #endif
2018 
2019  DECLARE_OTHERS(AsmUnaryUnsignedExtend);
2020 #if defined(SgAsmUnaryUnsignedExtend_OTHERS) || defined(DOCUMENTATION)
2021 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2022  private:
2023  friend class boost::serialization::access;
2024 
2025  template<class S>
2026  void serialize(S &s, const unsigned /*version*/) {
2027  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2028  }
2029 #endif
2030 #endif // SgAsmUnaryUnsignedExtend_OTHERS
2031 
2032 #ifdef DOCUMENTATION
2033  };
2034 #endif
2035 
2037 
2038 #ifdef ROSE_ENABLE_ASM_AARCH64
2039  DECLARE_LEAF_CLASS(AsmAarch64AtOperand);
2040  IS_SERIALIZABLE(AsmAarch64AtOperand);
2041 
2042 #ifdef DOCUMENTATION
2043 
2044  class SgAsmAarch64AtOperand: public SgAsmExpression {
2045  public:
2046 #endif
2047 
2048  DECLARE_OTHERS(AsmAarch64AtOperand);
2049 #if defined(SgAsmAarch64AtOperand_OTHERS) || defined(DOCUMENTATION)
2050 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2051  private:
2052  friend class boost::serialization::access;
2053 
2054  template<class S>
2055  void serialize(S &s, const unsigned /*version*/) {
2056  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2057  s & BOOST_SERIALIZATION_NVP(operation_);
2058  }
2059 #endif
2060 
2061  private:
2062  Rose::BinaryAnalysis::Aarch64AtOperation operation_;
2063 
2064  public:
2066  explicit SgAsmAarch64AtOperand(Rose::BinaryAnalysis::Aarch64AtOperation op)
2067  : operation_(op) {}
2068 
2074  Rose::BinaryAnalysis::Aarch64AtOperation operation() const {
2075  return operation_;
2076  }
2077  void operation(Rose::BinaryAnalysis::Aarch64AtOperation op) {
2078  operation_ = op;
2079  }
2081 #endif // SgAsmAarch64AtOperand_OTHERS
2082 
2083 #ifdef DOCUMENTATION
2084  };
2085 #endif
2086 #endif
2087 
2089 
2090 #ifdef ROSE_ENABLE_ASM_AARCH64
2091  DECLARE_LEAF_CLASS(AsmAarch64PrefetchOperand);
2092  IS_SERIALIZABLE(AsmAarch64PrefetchOperand);
2093 
2094 #ifdef DOCUMENTATION
2095 
2096  class SgAsmAarch64PrefetchOperand: public SgAsmExpression {
2097  public:
2098 #endif
2099 
2100  DECLARE_OTHERS(AsmAarch64PrefetchOperand);
2101 #if defined(SgAsmAarch64PrefetchOperand_OTHERS) || defined(DOCUMENTATION)
2102 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2103  private:
2104  friend class boost::serialization::access;
2105 
2106  template<class S>
2107  void serialize(S &s, const unsigned /*version*/) {
2108  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2109  s & BOOST_SERIALIZATION_NVP(operation_);
2110  }
2111 #endif
2112 
2113  private:
2114  Rose::BinaryAnalysis::Aarch64PrefetchOperation operation_;
2115 
2116  public:
2118  explicit SgAsmAarch64PrefetchOperand(Rose::BinaryAnalysis::Aarch64PrefetchOperation op)
2119  : operation_(op) {}
2120 
2126  Rose::BinaryAnalysis::Aarch64PrefetchOperation operation() const {
2127  return operation_;
2128  }
2129  void operation(Rose::BinaryAnalysis::Aarch64PrefetchOperation op) {
2130  operation_ = op;
2131  }
2133 #endif // SgAsmAarch64PrefetchOperand_OTHERS
2134 
2135 #ifdef DOCUMENTATION
2136  };
2137 #endif
2138 #endif
2139 
2141 
2142 #ifdef ROSE_ENABLE_ASM_AARCH64
2143  DECLARE_LEAF_CLASS(AsmAarch64SysMoveOperand);
2144  IS_SERIALIZABLE(AsmAarch64SysMoveOperand);
2145 
2146 #ifdef DOCUMENTATION
2147 
2148  class SgAsmAarch64SysMoveOperand: public SgAsmExpression {
2149  public:
2150 #endif
2151 
2152  DECLARE_OTHERS(AsmAarch64SysMoveOperand);
2153 #if defined(SgAsmAarch64SysMoveOperand_OTHERS) || defined(DOCUMENTATION)
2154 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2155  private:
2156  friend class boost::serialization::access;
2157 
2158  template<class S>
2159  void serialize(S &s, const unsigned /*version*/) {
2160  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2161  s & BOOST_SERIALIZATION_NVP(access_);
2162  }
2163 #endif
2164 
2165  private:
2166  unsigned access_;
2167 
2168  public:
2170  explicit SgAsmAarch64SysMoveOperand(unsigned access)
2171  : access_(access) {}
2172 
2178  unsigned access() const {
2179  return access_;
2180  }
2181  void access(unsigned ac) {
2182  access_ = ac;
2183  }
2185 #endif // SgAsmAarch64SysMoveOperand_OTHERS
2186 
2187 #ifdef DOCUMENTATION
2188  };
2189 #endif
2190 #endif
2191 
2193 
2194 #ifdef ROSE_ENABLE_ASM_AARCH64
2195  DECLARE_LEAF_CLASS(AsmAarch64CImmediateOperand);
2196  IS_SERIALIZABLE(AsmAarch64CImmediateOperand);
2197 
2198 #ifdef DOCUMENTATION
2199 
2200  class SgAsmAarch64CImmediateOperand: public SgAsmExpression {
2201  public:
2202 #endif
2203 
2204  DECLARE_OTHERS(AsmAarch64CImmediateOperand);
2205 #if defined(SgAsmAarch64CImmediateOperand_OTHERS) || defined(DOCUMENTATION)
2206 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2207  private:
2208  friend class boost::serialization::access;
2209 
2210  template<class S>
2211  void serialize(S &s, const unsigned /*version*/) {
2212  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2213  s & BOOST_SERIALIZATION_NVP(imm_);
2214  }
2215 #endif
2216 
2217  private:
2218  unsigned imm_;
2219 
2220  public:
2222  explicit SgAsmAarch64CImmediateOperand(unsigned imm)
2223  : imm_(imm) {}
2224 
2230  unsigned immediate() const {
2231  return imm_;
2232  }
2233  void immediate(unsigned imm) {
2234  imm_ = imm;
2235  }
2237 #endif // SgAsmAarch64CImmediateOperand_OTHERS
2238 
2239 #ifdef DOCUMENTATION
2240  };
2241 #endif
2242 #endif
2243 
2245 
2246 #ifdef ROSE_ENABLE_ASM_AARCH64
2247  DECLARE_LEAF_CLASS(AsmAarch64BarrierOperand);
2248  IS_SERIALIZABLE(AsmAarch64BarrierOperand);
2249 
2250 #ifdef DOCUMENTATION
2251 
2252  class SgAsmAarch64BarrierOperand: public SgAsmExpression {
2253  public:
2254 #endif
2255 
2256  DECLARE_OTHERS(AsmAarch64BarrierOperand);
2257 #if defined(SgAsmAarch64BarrierOperand_OTHERS) || defined(DOCUMENTATION)
2258 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2259  private:
2260  friend class boost::serialization::access;
2261 
2262  template<class S>
2263  void serialize(S &s, const unsigned /*version*/) {
2264  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2265  s & BOOST_SERIALIZATION_NVP(operation_);
2266  }
2267 #endif
2268 
2269  private:
2270  Rose::BinaryAnalysis::Aarch64BarrierOperation operation_;
2271 
2272  public:
2274  explicit SgAsmAarch64BarrierOperand(Rose::BinaryAnalysis::Aarch64BarrierOperation operation)
2275  : operation_(operation) {}
2276 
2280  Rose::BinaryAnalysis::Aarch64BarrierOperation operation() const {
2281  return operation_;
2282  }
2283  void operation(Rose::BinaryAnalysis::Aarch64BarrierOperation op) {
2284  operation_ = op;
2285  }
2287 #endif // SgAsmAarch64BarrierOperand_OTHERS
2288 
2289 #ifdef DOCUMENTATION
2290  };
2291 #endif
2292 #endif
2293 
2295 
2296  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
2297  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryTruncate | AsmUnarySignedExtend
2298  | AsmUnaryUnsignedExtend,
2299  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
2300  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
2301  IS_SERIALIZABLE(AsmUnaryExpression);
2302 
2303 #ifdef DOCUMENTATION
2304 
2306  public:
2307 #endif
2308 
2309 #ifdef DOCUMENTATION
2310 
2313  SgAsmExpression* get_operand() const;
2316 #else
2317  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
2318  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2319 #endif
2320 
2321  DECLARE_OTHERS(AsmUnaryExpression);
2322 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
2323 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2324  private:
2325  friend class boost::serialization::access;
2326 
2327  template<class S>
2328  void serialize(S &s, const unsigned /*version*/) {
2329  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2330  s & BOOST_SERIALIZATION_NVP(p_operand);
2331  }
2332 #endif
2333 #endif // SgAsmUnaryExpression_OTHERS
2334 
2335 #ifdef DOCUMENTATION
2336  };
2337 #endif
2338 
2340 
2341  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
2342  IS_SERIALIZABLE(AsmDirectRegisterExpression);
2343 
2344 #ifdef DOCUMENTATION
2345 
2347  public:
2348 #endif
2349 
2350  DECLARE_OTHERS(AsmDirectRegisterExpression);
2351 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
2352 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2353  private:
2354  friend class boost::serialization::access;
2355 
2356  template<class S>
2357  void serialize(S &s, const unsigned /*version*/) {
2358  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
2359  }
2360 #endif
2361 
2362  private:
2363  // Default c'tor needed for serialization
2365 #endif // SgAsmDirectRegisterExpression_OTHERS
2366 
2367 #ifdef DOCUMENTATION
2368  };
2369 #endif
2370 
2372 
2373  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
2374  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
2375 
2376 #ifdef DOCUMENTATION
2377 
2394  public:
2395 #endif
2396 
2397 #ifdef DOCUMENTATION
2398 
2406 #else
2407  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "stride", "",
2408  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2409 #endif
2410 
2411 #ifdef DOCUMENTATION
2412 
2420 #else
2421  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "offset", "",
2422  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2423 #endif
2424 
2425 #ifdef DOCUMENTATION
2426 
2431  size_t get_index() const;
2432  void set_index(size_t);
2434 #else
2435  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
2436  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2437 #endif
2438 
2439 #ifdef DOCUMENTATION
2440 
2445  size_t get_modulus() const;
2446  void set_modulus(size_t);
2448 #else
2449  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
2450  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2451 #endif
2452 
2453  DECLARE_OTHERS(AsmIndirectRegisterExpression);
2454 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
2455 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2456  private:
2457  friend class boost::serialization::access;
2458 
2459  template<class S>
2460  void serialize(S &s, const unsigned /*version*/) {
2461  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
2462  s & BOOST_SERIALIZATION_NVP(p_stride);
2463  s & BOOST_SERIALIZATION_NVP(p_offset);
2464  s & BOOST_SERIALIZATION_NVP(p_index);
2465  s & BOOST_SERIALIZATION_NVP(p_modulus);
2466  }
2467 #endif
2468 
2469  private:
2470  // Default c'tor needed for serialization
2472  : p_index(0), p_modulus(0) {}
2473 #endif // SgAsmIndirectRegisterExpression_OTHERS
2474 
2475 #ifdef DOCUMENTATION
2476  };
2477 #endif
2478 
2480 
2481  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
2482  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
2483  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
2484  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
2485 
2486 #ifdef DOCUMENTATION
2487 
2489  public:
2490 #endif
2491 
2492 #ifdef DOCUMENTATION
2493 
2499 #else
2500  AsmRegisterReferenceExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "descriptor", "",
2501  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2502 #endif
2503 
2504 #ifdef DOCUMENTATION
2505 
2510  int get_adjustment() const;
2511  void set_adjustment(int);
2513 #else
2514  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
2515  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
2516  NO_DELETE);
2517 #endif
2518 
2519  DECLARE_OTHERS(AsmRegisterReferenceExpression);
2520 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2521 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2522  private:
2523  friend class boost::serialization::access;
2524 
2525  template<class S>
2526  void serialize(S &s, const unsigned /*version*/) {
2527  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2528  s & BOOST_SERIALIZATION_NVP(p_descriptor);
2529  s & BOOST_SERIALIZATION_NVP(p_adjustment);
2530  }
2531 #endif
2532 
2533  protected:
2534  // Default c'tor needed for serialization
2536  : p_adjustment(0) {}
2537 #endif // SgAsmRegisterReferenceExpression_OTHERS
2538 
2539 #ifdef DOCUMENTATION
2540  };
2541 #endif
2542 
2544 
2545  DECLARE_LEAF_CLASS(AsmRegisterNames);
2546  IS_SERIALIZABLE(AsmRegisterNames);
2547 
2548 #ifdef DOCUMENTATION
2549 
2551  public:
2552 #endif
2553 
2554 #ifdef DOCUMENTATION
2555 
2561  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
2562  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
2564 #else
2565  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
2566  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2567 #endif
2568 
2569 #ifdef DOCUMENTATION
2570 
2576  unsigned get_mask() const;
2577  void set_mask(unsigned);
2579 #else
2580  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
2581  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2582 #endif
2583 
2584  DECLARE_OTHERS(AsmRegisterNames);
2585 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
2586 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2587  private:
2588  friend class boost::serialization::access;
2589 
2590  template<class S>
2591  void serialize(S &s, const unsigned /*version*/) {
2592  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2593  s & BOOST_SERIALIZATION_NVP(p_registers);
2594  s & BOOST_SERIALIZATION_NVP(p_mask);
2595  }
2596 #endif
2597 #endif // SgAsmRegisterNames_OTHERS
2598 
2599 #ifdef DOCUMENTATION
2600  };
2601 #endif
2602 
2604 
2605  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2606  IS_SERIALIZABLE(AsmIntegerValueExpression);
2607 
2608 #ifdef DOCUMENTATION
2609 
2625  public:
2626 #endif
2627 
2628 #ifdef DOCUMENTATION
2629 
2639  SgNode* get_baseNode() const;
2640  void set_baseNode(SgNode*);
2642 #else
2643  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2644  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2645 #endif
2646 
2647  DECLARE_OTHERS(AsmIntegerValueExpression);
2648 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2649 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2650  private:
2651  friend class boost::serialization::access;
2652 
2653  template<class S>
2654  void serialize(S &s, const unsigned /*version*/) {
2655  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2656  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2657  }
2658 #endif
2659 
2660  public:
2665  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2666 
2673 
2675  static uint64_t virtualAddress(SgNode*);
2676 
2696  std::string get_label(bool quiet=false) const;
2697 
2699  size_t get_significantBits() const;
2700 
2706  void makeRelativeTo(SgNode *baseNode);
2707 
2712  uint64_t get_baseAddress() const;
2713 
2719  uint64_t get_absoluteValue(size_t nbits=0) const;
2720 
2724  void set_absoluteValue(uint64_t);
2725 
2727  int64_t get_signedValue() const;
2728 
2732  int64_t get_relativeValue() const;
2733 
2738  void set_relativeValue(int64_t v, size_t nbits=64);
2739 
2740  uint64_t get_value() const { return get_absoluteValue(); }
2741 
2742 #endif // SgAsmIntegerValueExpression_OTHERS
2743 
2744 #ifdef DOCUMENTATION
2745  };
2746 #endif
2747 
2749 
2750  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2751  IS_SERIALIZABLE(AsmFloatValueExpression);
2752 
2753 #ifdef DOCUMENTATION
2754 
2759  public:
2760 #endif
2761 
2762  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2763 
2764  DECLARE_OTHERS(AsmFloatValueExpression);
2765 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2766  private:
2767  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2768  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2769  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2770  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2771  // understand "mutable".
2772  mutable double p_nativeValue;
2773  mutable bool p_nativeValueIsValid;
2774 
2775 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2776  private:
2777  friend class boost::serialization::access;
2778 
2779  template<class S>
2780  void serialize(S &s, const unsigned /*version*/) {
2781  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2782  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2783  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2784  }
2785 #endif
2786 
2787  public:
2792  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2793 
2799  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2800 
2807 
2809  void set_nativeValue(double);
2810 
2812  double get_nativeValue() const;
2813 
2818  void updateBitVector();
2819 
2824  void updateNativeValue() const;
2825 #endif // SgAsmFloatValueExpression_OTHERS
2826 
2827 #ifdef DOCUMENTATION
2828  };
2829 #endif
2830 
2832 #ifdef ROSE_ENABLE_ASM_AARCH32
2833  DECLARE_LEAF_CLASS(AsmAarch32Coprocessor);
2834  IS_SERIALIZABLE(AsmAarch32Coprocessor);
2835 
2836 #ifdef DOCUMENTATION
2837 
2838  class SgAsmAarch32Coprocessor: public SgAsmExpression {
2839  public:
2840 #endif
2841 
2842  DECLARE_OTHERS(AsmAarch32Coprocessor);
2843 #if defined(SgAsmAarch32Coprocessor_OTHERS) || defined(DOCUMENTATION)
2844 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2845  private:
2846  friend class boost::serialization::access;
2847 
2848  template<class S>
2849  void serialize(S & s, const unsigned /*version*/) {
2850  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2851  s & BOOST_SERIALIZATION_NVP(coprocessor_);
2852  }
2853 #endif
2854 
2855  private:
2856  int coprocessor_;
2857 
2858  public:
2859  explicit SgAsmAarch32Coprocessor(int coprocessor)
2860  : coprocessor_(coprocessor) {}
2861 
2865  int coprocessor() const { return coprocessor_; }
2866  void coprocessor(int n) { coprocessor_ = n; }
2868 #endif // SgAsmAarch32Coprocessor_OTHERS
2869 
2870 #ifdef DOCUMENTATION
2871  };
2872 #endif
2873 #endif
2874 
2876  DECLARE_LEAF_CLASS(AsmByteOrder);
2877  IS_SERIALIZABLE(AsmByteOrder);
2878 
2879 #ifdef DOCUMENTATION
2880 
2882  public:
2883 #endif
2884 
2885  DECLARE_OTHERS(AsmByteOrder);
2886 #if defined(SgAsmByteOrder_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(byteOrder_);
2895  }
2896 #endif
2897 
2898  private:
2899  ByteOrder::Endianness byteOrder_;
2900 
2901  public:
2902  explicit SgAsmByteOrder(ByteOrder::Endianness byteOrder)
2903  : byteOrder_(byteOrder) {}
2904 
2908  ByteOrder::Endianness byteOrder() const { return byteOrder_; }
2909  void byteOrder(ByteOrder::Endianness sex) { byteOrder_ = sex; }
2911 #endif // SgAsmByteOrder_OTHERS
2912 
2913 #ifdef DOCUMENTATION
2914  };
2915 #endif
2916 
2918 
2919  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2920  AsmIntegerValueExpression | AsmFloatValueExpression,
2921  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2922  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2923  IS_SERIALIZABLE(AsmConstantExpression);
2924 
2925  DECLARE_HEADERS(AsmConstantExpression);
2926 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2927  #include <Sawyer/BitVector.h>
2928 #endif // SgAsmConstantExpression_HEADERS
2929 
2930 #ifdef DOCUMENTATION
2931 
2936  public:
2937 #endif
2938 
2939 #ifndef DOCUMENTATION
2940  // Documented below. Implemented below due to ROSETTA limitations.
2941  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2942  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2943 #endif
2944 
2945  DECLARE_OTHERS(AsmConstantExpression);
2946 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2947 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2948  private:
2949  friend class boost::serialization::access;
2950 
2951  template<class S>
2952  void serialize(S &s, const unsigned /*version*/) {
2953  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2954  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2955  }
2956 #endif
2957 
2958  public:
2964  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2965  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2966  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2968 #endif // SgAsmConstantExpression_OTHERS
2969 
2970 #ifdef DOCUMENTATION
2971  };
2972 #endif
2973 
2975 
2976  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2977  AsmConstantExpression,
2978  "AsmValueExpression", "AsmValueExpressionTag", false);
2979  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2980  IS_SERIALIZABLE(AsmValueExpression);
2981 
2982 #ifdef DOCUMENTATION
2983 
2991  public:
2992 #endif
2993 
2994 #ifdef DOCUMENTATION
2995 
3005 #else
3006  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
3007  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3008 #endif
3009 
3010 #ifdef DOCUMENTATION
3011 
3019  unsigned short get_bit_offset() const;
3020  void set_bit_offset(unsigned short);
3022 #else
3023  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
3024  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3025 #endif
3026 
3027 #ifdef DOCUMENTATION
3028 
3034  unsigned short get_bit_size() const;
3035  void set_bit_size(unsigned short);
3037 #else
3038  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
3039  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3040 #endif
3041 
3042 #ifdef DOCUMENTATION
3043 
3049  SgSymbol* get_symbol() const;
3050  void set_symbol(SgSymbol*);
3052 #else
3053  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
3054  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3055 #endif
3056 
3057  DECLARE_OTHERS(AsmValueExpression);
3058 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
3059 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3060  private:
3061  friend class boost::serialization::access;
3062 
3063  template<class S>
3064  void serialize(S &s, const unsigned /*version*/) {
3065  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3066  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
3067  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
3068  s & BOOST_SERIALIZATION_NVP(p_bit_size);
3069 #if 1
3070  ASSERT_require2(p_symbol == NULL, "not implemented yet");
3071 #else
3072  s & BOOST_SERIALIZATION_NVP(p_symbol);
3073 #endif
3074  }
3075 #endif
3076 #endif // SgAsmValueExpression_OTHERS
3077 
3078 #ifdef DOCUMENTATION
3079  };
3080 #endif
3081 
3083 
3084  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
3085  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
3086 
3087 #ifdef DOCUMENTATION
3088 
3090  public:
3091 #endif
3092 
3093 #ifdef DOCUMENTATION
3094 
3101  SgAsmExpression* get_address() const;
3104 #else
3105  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
3106  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3107 #endif
3108 
3109 #ifdef DOCUMENTATION
3110 
3117  SgAsmExpression* get_segment() const;
3120 #else
3121  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
3122  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3123 #endif
3124 
3125  DECLARE_OTHERS(AsmMemoryReferenceExpression);
3126 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
3127 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3128  private:
3129  friend class boost::serialization::access;
3130 
3131  template<class S>
3132  void serialize(S &s, const unsigned /*version*/) {
3133  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3134  s & BOOST_SERIALIZATION_NVP(p_address);
3135  s & BOOST_SERIALIZATION_NVP(p_segment);
3136  }
3137 #endif
3138 #endif // SgAsmMemoryReferenceExpression_OTHERS
3139 
3140 #ifdef DOCUMENTATION
3141  };
3142 #endif
3143 
3145 
3146  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
3147  IS_SERIALIZABLE(AsmControlFlagsExpression);
3148 
3149 #ifdef DOCUMENTATION
3150  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
3152  public:
3153 #endif
3154 
3155 #ifndef DOCUMENTATION
3156  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
3157  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3158 #endif
3159 
3160  DECLARE_OTHERS(AsmControlFlagsExpression);
3161 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
3162 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3163  private:
3164  friend class boost::serialization::access;
3165 
3166  template<class S>
3167  void serialize(S &s, const unsigned /*version*/) {
3168  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3169  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
3170  }
3171 #endif
3172 #endif // SgAsmControlFlagsExpression_OTHERS
3173 
3174 #ifdef DOCUMENTATION
3175  };
3176 #endif
3177 
3179 
3180  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
3181  IS_SERIALIZABLE(AsmCommonSubExpression);
3182 
3183 #ifdef DOCUMENTATION
3184  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
3186  public:
3187 #endif
3188 
3189 #ifndef DOCUMENTATION
3190  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
3191  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3192 #endif
3193 
3194  DECLARE_OTHERS(AsmCommonSubExpression);
3195 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
3196 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3197  private:
3198  friend class boost::serialization::access;
3199 
3200  template<class S>
3201  void serialize(S &s, const unsigned /*version*/) {
3202  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3203  s & BOOST_SERIALIZATION_NVP(p_subexpression);
3204  }
3205 #endif
3206 #endif // SgAsmCommonSubExpression_OTHERS
3207 
3208 #ifdef DOCUMENTATION
3209  };
3210 #endif
3211 
3213 
3214  DECLARE_LEAF_CLASS(AsmRiscOperation);
3215  IS_SERIALIZABLE(AsmRiscOperation);
3216 
3217 #ifdef DOCUMENTATION
3218 
3227  public:
3228 #endif
3229 
3230 #ifdef DOCUMENTATION
3231 
3240 #else
3241  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
3242  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3243 #endif
3244 
3245 #ifdef DOCUMENTATION
3246 
3252  SgAsmExprListExp* get_operands() const;
3255 #else
3256  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
3257  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3258 #endif
3259 
3260  DECLARE_OTHERS(AsmRiscOperation);
3261 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
3262  public:
3269  OP_NONE,
3270  OP_bottom,
3271  OP_undefined,
3272  OP_unspecified,
3273  OP_filterCallTarget,
3274  OP_filterReturnTarget,
3275  OP_filterIndirectJumpTarget,
3276  OP_hlt,
3277  OP_cpuid,
3278  OP_rdtsc,
3279  OP_and_,
3280  OP_or_,
3281  OP_xor_,
3282  OP_invert,
3283  OP_extract,
3284  OP_concat,
3285  OP_leastSignificantSetBit,
3286  OP_mostSignificantSetBit,
3287  OP_rotateLeft,
3288  OP_rotateRight,
3289  OP_shiftLeft,
3290  OP_shiftRight,
3291  OP_shiftRightArithmetic,
3292  OP_equalToZero,
3293  OP_ite,
3294  OP_isEqual,
3295  OP_isNotEqual,
3296  OP_isUnsignedLessThan,
3297  OP_isUnsignedLessThanOrEqual,
3298  OP_isUnsignedGreaterThan,
3299  OP_isUnsignedGreaterThanOrEqual,
3300  OP_isSignedLessThan,
3301  OP_isSignedLessThanOrEqual,
3302  OP_isSignedGreaterThan,
3303  OP_isSignedGreaterThanOrEqual,
3304  OP_unsignedExtend,
3305  OP_signExtend,
3308  OP_subtract,
3309  OP_negate,
3310  OP_signedDivide,
3311  OP_signedModulo,
3312  OP_signedMultiply,
3313  OP_unsignedDivide,
3314  OP_unsignedModulo,
3315  OP_unsignedMultiply,
3316  OP_interrupt,
3317  OP_readRegister,
3318  OP_peekRegister,
3319  OP_writeRegister,
3321  OP_peekMemory,
3323  OP_N_OPERATORS // MUST BE LAST!
3324  };
3325 
3326 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3327  private:
3328  friend class boost::serialization::access;
3329 
3330  template<class S>
3331  void serialize(S &s, const unsigned /*version*/) {
3332  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3333  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
3334  s & BOOST_SERIALIZATION_NVP(p_operands);
3335  }
3336 #endif
3337 #endif // SgAsmRiscOperation_OTHERS
3338 
3339 #ifdef DOCUMENTATION
3340  };
3341 #endif
3342 
3344 
3345  DECLARE_LEAF_CLASS(AsmExprListExp);
3346  IS_SERIALIZABLE(AsmExprListExp);
3347 
3348 #ifdef DOCUMENTATION
3349 
3351  public:
3352 #endif
3353 
3354 #ifdef DOCUMENTATION
3355 
3361  const SgAsmExpressionPtrList& get_expressions() const;
3362  void set_expressions(const SgAsmExpressionPtrList&);
3364 #else
3365  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
3366  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3367 #endif
3368 
3369  DECLARE_OTHERS(AsmExprListExp);
3370 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
3371 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3372  private:
3373  friend class boost::serialization::access;
3374 
3375  template<class S>
3376  void serialize(S &s, const unsigned /*version*/) {
3377  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3378  s & BOOST_SERIALIZATION_NVP(p_expressions);
3379  }
3380 #endif
3381 #endif // SgAsmExprListExp_OTHERS
3382 
3383 #ifdef DOCUMENTATION
3384  };
3385 #endif
3386 
3388 
3389  NEW_NONTERMINAL_MACRO(AsmExpression,
3390  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
3391  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
3392  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
3393  AsmRiscOperation
3394 #ifdef ROSE_ENABLE_ASM_AARCH64
3395  | AsmAarch64AtOperand | AsmAarch64PrefetchOperand | AsmAarch64SysMoveOperand
3396  | AsmAarch64CImmediateOperand | AsmAarch64BarrierOperand
3397 #endif
3398 #ifdef ROSE_ENABLE_ASM_AARCH32
3399  | AsmAarch32Coprocessor
3400 #endif
3401  | AsmByteOrder,
3402  "AsmExpression", "AsmExpressionTag", false);
3403  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
3404  IS_SERIALIZABLE(AsmExpression);
3405 
3406 #ifdef DOCUMENTATION
3407 
3408  class SgAsmExpression: public SgAsmNode {
3409  public:
3410 #endif
3411 
3412 #ifdef DOCUMENTATION
3413 
3418  SgAsmType* get_type() const;
3419  void set_type(SgAsmType*);
3421 #else
3422  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
3423  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3424 #endif
3425 
3426 #ifdef DOCUMENTATION
3427 
3432  const std::string& get_comment() const;
3433  void set_comment(const std::string&);
3435 #else
3436  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
3437  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3438 #endif
3439 
3440  DECLARE_OTHERS(AsmExpression);
3441 #if defined(SgAsmExpression_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(SgAsmNode);
3449  s & BOOST_SERIALIZATION_NVP(p_type);
3450  s & BOOST_SERIALIZATION_NVP(p_comment);
3451  }
3452 #endif
3453 
3454  public:
3458  size_t get_nBits() const;
3459 
3465 
3471 
3472 #endif // SgAsmExpression_OTHERS
3473 
3474 #ifdef DOCUMENTATION
3475  };
3476 #endif
3477 
3478 
3479 
3480 
3482 
3483  /***************************************************************************************************************************
3484  * Data Types (new interface 2014-07)
3485  *
3486  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
3487  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
3488  * 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
3489  * don't allow types to be modified after they're created.
3490  ***************************************************************************************************************************/
3491 
3493 
3494  DECLARE_LEAF_CLASS(AsmIntegerType);
3495  IS_SERIALIZABLE(AsmIntegerType);
3496 
3497 #ifdef DOCUMENTATION
3498 
3500  public:
3501 #endif
3502 
3503 #ifndef DOCUMENTATION
3504  // Documented below due to ROSETTA limitations
3505  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
3506  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3507 #endif
3508 
3509  DECLARE_OTHERS(AsmIntegerType);
3510 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
3511 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3512  private:
3513  friend class boost::serialization::access;
3514 
3515  template<class S>
3516  void serialize(S &s, const unsigned /*version*/) {
3517  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
3518  s & BOOST_SERIALIZATION_NVP(p_isSigned);
3519  }
3520 #endif
3521 
3522  public:
3526  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
3527 
3531  bool get_isSigned() const;
3532 
3533  // Overrides documented in base class
3534  virtual void check() const $ROSE_OVERRIDE;
3535  virtual std::string toString() const $ROSE_OVERRIDE;
3536 #endif // SgAsmIntegerType_OTHERS
3537 
3538 #ifdef DOCUMENTATION
3539  };
3540 #endif
3541 
3543 
3544  DECLARE_LEAF_CLASS(AsmFloatType);
3545  IS_SERIALIZABLE(AsmFloatType);
3546 
3547  DECLARE_HEADERS(AsmFloatType);
3548 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
3549  #include <Sawyer/BitVector.h>
3550  #include <Rose/BitFlags.h>
3551 #endif // SgAsmFloatType_HEADERS
3552 
3553 #ifdef DOCUMENTATION
3554 
3556  public:
3557 #endif
3558 
3559 #ifndef DOCUMENTATION
3560  // Documented below because of ROSETTA limitations (they're read-only)
3561  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
3562  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3563  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
3564  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3565  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
3566  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3567  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
3568  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3569  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
3570  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3571  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
3572  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3573  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
3574  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3575 #endif
3576 
3577  DECLARE_OTHERS(AsmFloatType);
3578 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
3579 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3580  private:
3581  friend class boost::serialization::access;
3582 
3583  template<class S>
3584  void serialize(S &s, const unsigned /*version*/) {
3585  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
3586  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
3587  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
3588  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
3589  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
3590  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
3591  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
3592  s & BOOST_SERIALIZATION_NVP(p_flags);
3593  }
3594 #endif
3595 
3596  public:
3598  enum Flag {
3599  GRADUAL_UNDERFLOW = 0x00000001,
3601  };
3602 
3605 
3608 
3610  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
3611  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
3612  uint64_t exponentBias, Flags flags);
3613 
3615  BitRange significandBits() const;
3616 
3618  BitRange exponentBits() const;
3619 
3621  size_t signBit() const;
3622 
3624  uint64_t exponentBias() const;
3625 
3627  Flags flags() const;
3628 
3633  static Flags ieeeFlags();
3634 
3640  bool gradualUnderflow() const;
3641 
3649  bool implicitBitConvention() const;
3650 
3653  // Overrides documented in base class
3654  virtual void check() const $ROSE_OVERRIDE;
3655  virtual std::string toString() const $ROSE_OVERRIDE;
3656 #endif // SgAsmFloatType_OTHERS
3657 
3658 #ifdef DOCUMENTATION
3659  };
3660 #endif
3661 
3663 
3664  NEW_NONTERMINAL_MACRO(AsmScalarType,
3665  AsmIntegerType | AsmFloatType,
3666  "AsmScalarType", "AsmScalarTypeTag", false);
3667  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
3668  IS_SERIALIZABLE(AsmScalarType);
3669 
3670 #ifdef DOCUMENTATION
3671 
3672  class SgAsmScalarType: public SgAsmType {
3673  public:
3674 #endif
3675 
3676 #ifndef DOCUMENTATION
3677  // Documented below due to ROSETTA limitations (read-only)
3678  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3679  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3680  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3681  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3682  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
3683  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3684  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
3685  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3686 #endif
3687 
3688  DECLARE_OTHERS(AsmScalarType);
3689 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
3690 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3691  private:
3692  friend class boost::serialization::access;
3693 
3694  template<class S>
3695  void serialize(S &s, const unsigned /*version*/) {
3696  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3697  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
3698  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
3699  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
3700  s & BOOST_SERIALIZATION_NVP(p_nBits);
3701  }
3702 #endif
3703 
3704  protected:
3709  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
3710 
3711  public:
3713  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3714 
3716  ByteOrder::Endianness get_minorOrder() const;
3717 
3719  ByteOrder::Endianness get_majorOrder() const;
3720 
3722  size_t get_majorNBytes() const;
3723 
3724  // Overrides documented in base class
3725  virtual void check() const $ROSE_OVERRIDE;
3726  virtual std::string toString() const $ROSE_OVERRIDE;
3727 #endif // SgAsmScalarType_OTHERS
3728 
3729 #ifdef DOCUMENTATION
3730  };
3731 #endif
3732 
3734 
3735  DECLARE_LEAF_CLASS(AsmVectorType);
3736  IS_SERIALIZABLE(AsmVectorType);
3737 
3738 #ifdef DOCUMENTATION
3739 
3740  class SgAsmVectorType: public SgAsmType {
3741  public:
3742 #endif
3743 
3744 #ifndef DOCUMENTATION
3745  // Documented below due to ROSETTA limitations (read-only)
3746  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3747  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3748  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3749  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3750 #endif
3751 
3752  DECLARE_OTHERS(AsmVectorType);
3753 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3754 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3755  private:
3756  friend class boost::serialization::access;
3757 
3758  template<class S>
3759  void serialize(S &s, const unsigned /*version*/) {
3760  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3761  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3762  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3763  }
3764 #endif
3765 
3766  public:
3768  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3769 
3771  size_t get_nElmts() const;
3772 
3774  SgAsmType* get_elmtType() const;
3775 
3776  // Overrides documented in base class
3777  virtual void check() const $ROSE_OVERRIDE;
3778  virtual std::string toString() const $ROSE_OVERRIDE;
3779  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3780 #endif // SgAsmVectorType_OTHERS
3781 
3782 #ifdef DOCUMENTATION
3783  };
3784 #endif
3785 
3787 
3788  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3789  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3790  IS_SERIALIZABLE(AsmType);
3791 
3792 #ifdef DOCUMENTATION
3793 
3794  class SgAsmType: public SgAsmNode {
3795  public:
3796 #endif
3797 
3798  DECLARE_OTHERS(AsmType);
3799 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3800  private:
3802 
3803 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3804  private:
3805  friend class boost::serialization::access;
3806 
3807  template<class S>
3808  void serialize(S &s, const unsigned /*version*/) {
3809  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3810  }
3811 #endif
3812 
3813  public:
3821  virtual void check() const;
3822 
3828  virtual std::string toString() const {
3829  abort(); // ROSETTA limitation: intended pure virtual
3830  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3831  }
3832 
3834  virtual size_t get_nBits() const {
3835  abort(); // ROSETTA limitation: intended pure virtual
3836  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3837  }
3838 
3840  virtual size_t get_nBytes() const;
3841 
3847  template<class Type> // Type is a subclass of SgAsmType
3848  static Type* registerOrDelete(Type *toInsert) {
3849  ASSERT_not_null(toInsert);
3850  std::string key = toInsert->toString();
3851  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3852  ASSERT_not_null(retval);
3853  if (retval!=toInsert)
3854  delete toInsert;
3855  return retval;
3856  }
3857 #endif // SgAsmType_OTHERS
3858 
3859 #ifdef DOCUMENTATION
3860  };
3861 #endif
3862 
3863 
3864 
3866 
3867  /**************************************************************************************************************************
3868  * Collections of Instructions
3869  **************************************************************************************************************************/
3870 
3872 
3873  DECLARE_LEAF_CLASS(AsmFunction);
3874  IS_SERIALIZABLE(AsmFunction);
3875 
3876 #ifdef DOCUMENTATION
3877 
3893  public:
3894 #endif
3895 
3896 #ifdef DOCUMENTATION
3897 
3902  const std::string& get_name() const;
3903  void set_name(const std::string&);
3905 #else
3906  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3907  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3908 #endif
3909 
3910 #ifdef DOCUMENTATION
3911 
3917  unsigned get_reason() const;
3918  void set_reason(unsigned);
3920 #else
3921  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3922  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3923 #endif
3924 
3925 #ifdef DOCUMENTATION
3926 
3933  const std::string& get_reasonComment() const;
3934  void set_reasonComment(const std::string&);
3936 #else
3937  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
3938  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3939 #endif
3940 
3941 #ifdef DOCUMENTATION
3942 
3950 #else
3951  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3952  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3953 #endif
3954 
3955 #ifdef DOCUMENTATION
3956 
3959  MayReturn get_may_return() const;
3960  void set_may_return(MayReturn);
3962 #else
3963  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3964  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3965 #endif
3966 
3967 #ifdef DOCUMENTATION
3968 
3973  const std::string& get_name_md5() const;
3974  void set_name_md5(const std::string&);
3976 #else
3977  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3978  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3979 #endif
3980 
3981 #ifdef DOCUMENTATION
3982 
3987  const SgAsmStatementPtrList& get_statementList() const;
3988  void set_statementList(const SgAsmStatementPtrList&);
3990 #else
3991  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3992  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3993 #endif
3994 
3995 #ifdef DOCUMENTATION
3996  // FIXME[Robb P Matzke 2017-02-13]: unused?
3997 #else
3998  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3999  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4000 #endif
4001 
4002 #ifdef DOCUMENTATION
4003 
4009  rose_addr_t get_entry_va() const;
4010  void set_entry_va(rose_addr_t);
4012 #else
4013  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
4014  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4015 #endif
4016 
4017 #ifdef DOCUMENTATION
4018 
4027 #else
4028  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
4029  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
4030 #endif
4031 
4032 #ifdef DOCUMENTATION
4033  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4034 #else
4035  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
4036  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4037 #endif
4038 
4039 #ifdef DOCUMENTATION
4040 
4049  int64_t get_stackDelta() const;
4050  void set_stackDelta(int64_t);
4052 #else
4053  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
4054  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4055 #endif
4056 
4057 #ifdef DOCUMENTATION
4058 
4066  const std::string& get_callingConvention() const;
4067  void set_callingConvention(const std::string&);
4069 #else
4070  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
4071  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4072 #endif
4073 
4074  DECLARE_OTHERS(AsmFunction);
4075 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
4076 
4077 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4078  private:
4079  friend class boost::serialization::access;
4080 
4081  template<class S>
4082  void serialize(S &s, const unsigned /*version*/) {
4083  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4084  s & BOOST_SERIALIZATION_NVP(p_name);
4085  s & BOOST_SERIALIZATION_NVP(p_reason);
4086  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
4087  s & BOOST_SERIALIZATION_NVP(p_function_kind);
4088  s & BOOST_SERIALIZATION_NVP(p_may_return);
4089  s & BOOST_SERIALIZATION_NVP(p_name_md5);
4090  s & BOOST_SERIALIZATION_NVP(p_statementList);
4091  s & BOOST_SERIALIZATION_NVP(p_dest);
4092  s & BOOST_SERIALIZATION_NVP(p_entry_va);
4093  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
4094  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
4095  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
4096  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
4097  }
4098 #endif
4099 
4100  public:
4103 
4107  void remove_statement(SgAsmStatement* statement);
4108 
4113  SgAsmBlock* get_entry_block() const;
4114 
4116  enum MayReturn {
4121  };
4122 
4127  // NOTE: If you add more here, then fix Partitioner::parse_switches()
4128  // Also fix SgAsmFunction::reason_key()
4129  FUNC_NONE = 0x00000000,
4130  FUNC_THUNK_TARGET= 0x00004000,
4132  = 0x00008000,
4133  FUNC_ENTRY_POINT = 0x00010000,
4134  FUNC_CALL_TARGET = 0x00020000,
4137  FUNC_CALL_INSN = 0x00040000,
4143  FUNC_EH_FRAME = 0x00080000,
4144  FUNC_SYMBOL = 0x00100000,
4145  FUNC_PATTERN = 0x00200000,
4150  FUNC_GRAPH = 0x00400000,
4154  FUNC_USERDEF = 0x00800000,
4155  FUNC_PADDING = 0x01000000,
4160  FUNC_DISCONT = 0x02000000,
4163  FUNC_INSNHEAD = 0x04000000,
4164  FUNC_IMPORT = 0x08000000,
4167  FUNC_LEFTOVERS = 0x10000000,
4171  FUNC_INTRABLOCK = 0x20000000,
4179  FUNC_THUNK = 0x40000000,
4188  FUNC_EXPORT = 0x80000000,
4190  FUNC_DEFAULT = 0xefff80ff,
4192  /*========= Miscellaneous Reasons ===========================================================================
4193  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
4194  * availalble for users to use as they see fit. */
4195  FUNC_MISCMASK = 0x000000ff,
4210  };
4211 
4215  static std::string reason_key(const std::string &prefix="");
4216 
4218  std::string reason_str(bool pad) const;
4219 
4223  static std::string reason_str(bool pad, unsigned reason);
4224 
4227  public:
4228  virtual ~NodeSelector() {}
4229  virtual bool operator()(SgNode*) = 0;
4230  };
4231 
4271  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
4272  NodeSelector *selector=NULL);
4273 
4279  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
4280 
4283  e_unknown = 0,
4284  e_standard = 1,
4285  e_library = 2,
4286  e_imported = 3,
4287  e_thunk = 4,
4288  e_last
4289  };
4290 #endif // SgAsmFunction_OTHERS
4291 
4292 
4293 #ifdef DOCUMENTATION
4294  };
4295 #endif
4296 
4297 
4299 
4300  DECLARE_LEAF_CLASS(AsmBlock);
4301  IS_SERIALIZABLE(AsmBlock);
4302 
4303 #ifdef DOCUMENTATION
4304 
4324  class SgAsmBlock: public SgAsmStatement {
4325  public:
4326 #endif
4327 
4328 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
4329  // [tps 05Apr07] needed for the control_flow_graph
4330  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
4331  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4332 #endif
4333 
4334 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
4335  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
4336  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4337 #endif
4338 
4339 #ifdef DOCUMENTATION
4340 
4345  rose_addr_t get_id() const;
4346  void set_id(rose_addr_t);
4348 #else
4349  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
4350  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4351 #endif
4352 
4353 #ifdef DOCUMENTATION
4354 
4359  unsigned get_reason() const;
4360  void set_reason(unsigned);
4362 #else
4363  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
4364  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4365 #endif
4366 
4367 #ifdef DOCUMENTATION
4368  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
4369  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
4370  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
4371  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
4378  const SgAsmStatementPtrList& get_statementList() const;
4379  void set_statementList(const SgAsmStatementPtrList&);
4381 #else
4382  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
4383  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4384 #endif
4385 
4386 #ifdef DOCUMENTATION
4387  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
4388  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
4389  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
4390  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
4398  const SgAsmIntegerValuePtrList& get_successors() const;
4399  void set_successors(const SgAsmIntegerValuePtrList&);
4401 #else
4402  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
4403  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4404 #endif
4405 
4406 #ifdef DOCUMENTATION
4407 
4417  bool get_successors_complete() const;
4418  void set_successors_complete(bool);
4420 #else
4421  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
4422  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4423 #endif
4424 
4425 #ifdef DOCUMENTATION
4426 
4438 #else
4439  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
4440  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4441 #endif
4442 
4443 #ifdef DOCUMENTATION
4444 
4452  size_t get_cached_vertex() const;
4453  void set_cached_vertex(size_t);
4455 #else
4456  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
4457  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4458 #endif
4459 
4460 #ifdef DOCUMENTATION
4461 
4467  double get_code_likelihood() const;
4468  void set_code_likelihood(double);
4470 #else
4471  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
4472  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4473 #endif
4474 
4475 #ifdef DOCUMENTATION
4476 
4484  int64_t get_stackDeltaOut() const;
4485  void set_stackDeltaOut(int64_t);
4487 #else
4488  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
4489  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4490 #endif
4491 
4492  DECLARE_OTHERS(AsmBlock);
4493 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
4494 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4495  private:
4496  friend class boost::serialization::access;
4497 
4498  template<class S>
4499  void serialize(S &s, const unsigned /*version*/) {
4500  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4501  s & BOOST_SERIALIZATION_NVP(p_reason);
4502  s & BOOST_SERIALIZATION_NVP(p_statementList);
4503  s & BOOST_SERIALIZATION_NVP(p_successors);
4504  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
4505  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
4506  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
4507  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
4508  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
4509  }
4510 #endif
4511 
4512  public:
4514  enum Reason {
4515  // Please update SgAsmBlock::reason_str() if you change this enum!
4516  BLK_NONE = 0x00000000,
4517  BLK_ENTRY_POINT = 0x00010000,
4518  BLK_PADDING = 0x00020000,
4519  BLK_FRAGMENT = 0x00080000,
4521  BLK_CFGHEAD = 0x00100000,
4522  BLK_USERDEF = 0x00200000,
4523  BLK_LEFTOVERS = 0x00400000,
4525  BLK_JUMPTABLE = 0x00800000,
4526  BLK_GRAPH1 = 0x01000000,
4527  BLK_GRAPH2 = 0x02000000,
4528  BLK_GRAPH3 = 0x04000000,
4530  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
4531 
4532  // ========= Miscellaneous Reasons ===========================================================================
4533  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
4534  // availalble for users to use as they see fit.
4535  BLK_MISCMASK = 0x000000ff,
4537  BLK_FINDDATA = 0x00000001,
4539  BLK_POSTFUNC = 0x00000002
4541  };
4542 
4547 
4552 
4553  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
4558  void remove_children();
4559 
4564  rose_addr_t get_fallthrough_va();
4565 
4570 
4576  bool has_instructions() const;
4577 
4583  bool is_basic_block() const { return has_instructions(); }
4584 
4594  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
4595 
4599  static std::string reason_key(const std::string &prefix="");
4600 
4604  std::string reason_str(bool pad) const;
4605 
4611  static std::string reason_str(bool pad, unsigned reason);
4612 #endif // SgAsmBlock_OTHERS
4613 
4614 #ifdef DOCUMENTATION
4615  };
4616 #endif
4617 
4618 
4620 
4621  DECLARE_LEAF_CLASS(AsmStaticData);
4622  IS_SERIALIZABLE(AsmStaticData);
4623 
4624 #ifdef DOCUMENTATION
4625 
4633  public:
4634 #endif
4635 
4636 #ifdef DOCUMENTATION
4637 
4643  const SgUnsignedCharList& get_raw_bytes() const;
4644  void set_raw_bytes(const SgUnsignedCharList&);
4646 #else
4647  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
4648  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4649 #endif
4650 
4651  DECLARE_OTHERS(AsmStaticData);
4652 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
4653 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4654  private:
4655  friend class boost::serialization::access;
4656 
4657  template<class S>
4658  void serialize(S &s, const unsigned /*version*/) {
4659  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4660  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
4661  }
4662 #endif
4663 
4664  public:
4668  size_t get_size() const { return p_raw_bytes.size(); }
4669 #endif // SgAsmStaticData_OTHERS
4670 
4671 #ifdef DOCUMENTATION
4672  };
4673 #endif
4674 
4675 
4677 
4678  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
4679  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
4680 
4681 #ifdef DOCUMENTATION
4682 
4693  public:
4694 #endif
4695 
4696  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4697 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4698 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4699  private:
4700  friend class boost::serialization::access;
4701 
4702  template<class S>
4703  void serialize(S & s, const unsigned /*version*/) {
4704  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4705  }
4706 #endif
4707  protected:
4708  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4709 
4710  public:
4713  p_declarationList.push_back(declaration);
4714  }
4715 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4716 
4717 #ifdef DOCUMENTATION
4718  };
4719 #endif
4720 
4721 
4723 
4724  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4725  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4726 
4727 #ifdef DOCUMENTATION
4728  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4730  public:
4731 #endif
4732 
4733 #ifdef DOCUMENTATION
4734 
4737  const std::string& get_name() const;
4738  void set_name(const std::string&);
4740 #else
4741  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4742  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4743  NO_DELETE);
4744 #endif
4745 
4746 #ifdef DOCUMENTATION
4747  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4751  uint64_t get_offset() const;
4752  void set_ofset(uint64_t);
4754 #else
4755  // Not clear if we want to store the offset explicitly
4756  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4757  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4758  NO_DELETE);
4759 #endif
4760 
4761  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4762 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4763 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4764  private:
4765  friend class boost::serialization::access;
4766 
4767  template<class S>
4768  void serialize(S &s, const unsigned /*version*/) {
4769  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4770  }
4771 #endif
4772 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4773 
4774 #ifdef DOCUMENTATION
4775  };
4776 #endif
4777 
4778 
4780 
4781  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4782  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4783  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4784  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4785  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4786 
4787 #ifdef DOCUMENTATION
4788 
4795  public:
4796 #endif
4797 
4798  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4799 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4800 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4801  private:
4802  friend class boost::serialization::access;
4803 
4804  template<class S>
4805  void serialize(S &s, const unsigned /*version*/) {
4806  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4807  };
4808 #endif
4809 #endif // SgAsmSynthesizedDeclaration_OTHERS
4810 
4811 #ifdef DOCUMENTATION
4812  };
4813 #endif
4814 
4815 
4817 
4818  NEW_NONTERMINAL_MACRO(AsmStatement,
4819  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4820  "AsmStatement", "AsmStatementTag", false);
4821  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4822  IS_SERIALIZABLE(AsmStatement);
4823 
4824 #ifdef DOCUMENTATION
4825 
4829  class SgAsmStatement: public SgAsmNode {
4830  public:
4831 #endif
4832 
4833 #ifdef DOCUMENTATION
4834 
4839  rose_addr_t get_address() const;
4840  void set_address(rose_addr_t);
4842 #else
4843  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4844  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4845 #endif
4846 
4847 
4848 #ifdef DOCUMENTATION
4849 
4852  const std::string& get_comment() const;
4853  void set_comment(const std::string&);
4855 #else
4856  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4857  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4858 #endif
4859 
4860  DECLARE_OTHERS(AsmStatement);
4861 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4862 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4863  private:
4864  friend class boost::serialization::access;
4865 
4866  template<class S>
4867  void serialize(S &s, const unsigned /*version*/) {
4868  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4869  s & BOOST_SERIALIZATION_NVP(p_address);
4870  s & BOOST_SERIALIZATION_NVP(p_comment);
4871  }
4872 #endif
4873 #endif // SgAsmStatement_OTHERS
4874 
4875 #ifdef DOCUMENTATION
4876  };
4877 #endif
4878 
4879 
4880 
4881 
4883 
4884  /*************************************************************************************************************************
4885  * Binary Interpretations
4886  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4887  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4888  * an AST that represents a single, coherent sub-part of the file.
4889  *************************************************************************************************************************/
4890 
4892 
4893  DECLARE_LEAF_CLASS(AsmInterpretationList);
4894  IS_SERIALIZABLE(AsmInterpretationList);
4895 
4896 #ifdef DOCUMENTATION
4897 
4899  public:
4900 #endif
4901 
4902 #ifdef DOCUMENTATION
4903 
4912 #else
4913  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4914  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4915  NO_DELETE);
4916 #endif
4917 
4918  DECLARE_OTHERS(AsmInterpretationList);
4919 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4920 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4921  private:
4922  friend class boost::serialization::access;
4923 
4924  template<class S>
4925  void serialize(S &s, const unsigned /*version*/) {
4926  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4927  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4928  }
4929 #endif
4930 #endif // SgAsmInterpretationList_OTHERS
4931 
4932 #ifdef DOCUMENTATION
4933  };
4934 #endif
4935 
4937 
4938  DECLARE_LEAF_CLASS(AsmInterpretation);
4939  IS_SERIALIZABLE(AsmInterpretation);
4940 
4941  DECLARE_HEADERS(AsmInterpretation);
4942 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4943  #include <Rose/BinaryAnalysis/MemoryMap.h>
4944  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
4945 #endif // SgAsmInterpretation_HEADERS
4946 
4947 #ifdef DOCUMENTATION
4948 
4955  public:
4956 #endif
4957 
4958 #ifdef DOCUMENTATION
4959  // documentation and definition are below
4960 #else
4961  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4962 #endif
4963 
4964 #ifdef DOCUMENTATION
4965 
4976 #else
4977  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4978  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4979 #endif
4980 
4981 #ifdef DOCUMENTATION
4982 
4987  SgAsmBlock* get_global_block() const;
4990 #else
4991  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4992  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4993 #endif
4994 
4995  DECLARE_OTHERS(AsmInterpretation);
4996 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4997  private:
4999  const Rose::BinaryAnalysis::RegisterDictionary *p_registers;
5000  bool coverageComputed; // true iff percentageCoverage has been computed
5001  mutable InstructionMap instruction_map; // cached instruction map
5002 
5004  // disassembly into instructions.
5005  double percentageCoverage;
5006 
5007 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5008  private:
5009  friend class boost::serialization::access;
5010 
5011  template<class S>
5012  void serialize(S &s, const unsigned /*version*/) {
5013  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
5014  s & BOOST_SERIALIZATION_NVP(p_headers);
5015  s & BOOST_SERIALIZATION_NVP(p_global_block);
5016  s & BOOST_SERIALIZATION_NVP(p_map);
5017  s & BOOST_SERIALIZATION_NVP(p_registers);
5018  s & BOOST_SERIALIZATION_NVP(coverageComputed);
5019  s & BOOST_SERIALIZATION_NVP(instruction_map);
5020  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
5021  }
5022 #endif
5023 
5024  public:
5027  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
5028  ctor();
5029  }
5030 
5035  SgAsmGenericFilePtrList get_files() const;
5036 
5063  InstructionMap& get_instruction_map(bool recompute=false);
5064  void set_instruction_map(const InstructionMap&);
5071  void insert_instructions(InstructionMap&/*in,out*/);
5072 
5077  void erase_instructions(InstructionMap&/*in,out*/);
5078 
5084  void set_coverageComputed(bool x) { coverageComputed = x; }
5085  void set_percentageCoverage(double x) { percentageCoverage = x; }
5088  private:
5089  void ctor(); // finalize construction
5090 #endif // SgAsmInterpretation_OTHERS
5091 
5092 #ifdef DOCUMENTATION
5093  };
5094 #endif
5095 
5096 
5097 
5099 
5100  /*************************************************************************************************************************
5101  * ELF File Header
5102  *************************************************************************************************************************/
5103 
5105 
5106  DECLARE_LEAF_CLASS(AsmElfFileHeader);
5107  IS_SERIALIZABLE(AsmElfFileHeader);
5108 
5109 #ifdef DOCUMENTATION
5110 
5119  public:
5120 #endif
5121 
5122 #ifdef DOCUMENTATION
5123 
5128  unsigned char get_e_ident_file_class() const;
5129  void set_e_ident_file_class(unsigned char);
5131 #else
5132  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
5133  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5134 #endif
5135 
5136 #ifdef DOCUMENTATION
5137 
5142  unsigned char get_e_ident_data_encoding() const;
5143  void set_e_ident_data_encoding(unsigned char);
5145 #else
5146  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
5147  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5148 #endif
5149 
5150 #ifdef DOCUMENTATION
5151 
5156  unsigned char get_e_ident_file_version() const;
5157  void set_e_ident_file_version(unsigned char*);
5159 #else
5160  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
5161  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5162 #endif
5163 
5164 #ifdef DOCUMENTATION
5165 
5170  const SgUnsignedCharList& get_e_ident_padding() const;
5171  void set_e_ident_padding(const SgUnsignedCharList&);
5173 #else
5174  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
5175  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5176 #endif
5177 
5178 #ifdef DOCUMENTATION
5179 
5184  unsigned long get_e_type() const;
5185  void set_e_type(unsigned long);
5187 #else
5188  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
5189  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5190 #endif
5191 
5192 #ifdef DOCUMENTATION
5193 
5198  unsigned long get_e_machine() const;
5199  void set_e_machine(unsigned long);
5201 #else
5202  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
5203  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5204 #endif
5205 
5206 #ifdef DOCUMENTATION
5207 
5212  unsigned long get_e_flags() const;
5213  void set_e_flags(unsigned long);
5215 #else
5216  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
5217  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5218 #endif
5219 
5220 #ifdef DOCUMENTATION
5221 
5226  unsigned long get_e_ehsize() const;
5227  void set_e_ehsize(unsigned long);
5229 #else
5230  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
5231  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5232 #endif
5233 
5234 #ifdef DOCUMENTATION
5235 
5240  unsigned long get_phextrasz() const;
5241  void set_phextrasz(unsigned long);
5243 #else
5244  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
5245  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5246 #endif
5247 
5248 #ifdef DOCUMENTATION
5249 
5254  unsigned long get_e_phnum() const;
5255  void set_e_phnum(unsigned long);
5257 #else
5258  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
5259  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5260 #endif
5261 
5262 #ifdef DOCUMENTATION
5263 
5268  unsigned long get_shextrasz() const;
5269  void set_shextrasz(unsigned long);
5271 #else
5272  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
5273  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5274 #endif
5275 
5276 #ifdef DOCUMENTATION
5277 
5282  unsigned long get_e_shnum() const;
5283  void set_e_shnum(unsigned long);
5285 #else
5286  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
5287  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5288 #endif
5289 
5290 #ifdef DOCUMENTATION
5291 
5296  unsigned long get_e_shstrndx() const;
5297  void set_e_shstrndx(unsigned long);
5299 #else
5300  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
5301  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5302 #endif
5303 
5304 #ifdef DOCUMENTATION
5305 
5315 #else
5316  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
5317  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5318 #endif
5319 
5320 #ifdef DOCUMENTATION
5321 
5330 #else
5331  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
5332  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5333 #endif
5334 
5335  DECLARE_OTHERS(AsmElfFileHeader);
5336 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
5337 
5338 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5339  private:
5340  friend class boost::serialization::access;
5341 
5342  template<class S>
5343  void serialize(S &s, const unsigned /*version*/) {
5344  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
5345  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
5346  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
5347  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
5348  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
5349  s & BOOST_SERIALIZATION_NVP(p_e_type);
5350  s & BOOST_SERIALIZATION_NVP(p_e_machine);
5351  s & BOOST_SERIALIZATION_NVP(p_e_flags);
5352  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
5353  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
5354  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
5355  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
5356  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
5357  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
5358  s & BOOST_SERIALIZATION_NVP(p_section_table);
5359  s & BOOST_SERIALIZATION_NVP(p_segment_table);
5360  }
5361 #endif
5362 
5363  public:
5365  enum ObjectType {
5366  ET_NONE = 0
5367  ,ET_REL = 1
5368  ,ET_EXEC = 2
5369  ,ET_DYN = 3
5370  ,ET_CORE = 4
5372  ,ET_LOOS = 0xfe00
5373  ,ET_HIOS = 0xfeff
5374  ,ET_LOPROC = 0xff00
5375  ,ET_HIPROC = 0xffff
5376  };
5377 
5378  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
5379  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
5380  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
5381  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
5382  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
5383 #ifdef _MSC_VER
5384 # pragma pack (1)
5385 #endif
5386 
5393  unsigned char e_ident_magic[4];
5394  unsigned char e_ident_file_class;
5395  unsigned char e_ident_data_encoding;
5396  unsigned char e_ident_file_version;
5397  unsigned char e_ident_padding[9];
5398  uint16_t e_type;
5399  uint16_t e_machine;
5400  uint32_t e_version;
5401  uint32_t e_entry;
5402  uint32_t e_phoff;
5403  uint32_t e_shoff;
5404  uint32_t e_flags;
5405  uint16_t e_ehsize;
5406  uint16_t e_phentsize;
5407  uint16_t e_phnum;
5408  uint16_t e_shentsize;
5409  uint16_t e_shnum;
5410  uint16_t e_shstrndx;
5411  }
5412 #if !defined(SWIG) && !defined(_MSC_VER)
5413  __attribute__((packed))
5414 #endif
5415  ;
5416 
5418  unsigned char e_ident_magic[4];
5419  unsigned char e_ident_file_class;
5420  unsigned char e_ident_data_encoding;
5421  unsigned char e_ident_file_version;
5422  unsigned char e_ident_padding[9];
5423  uint16_t e_type;
5424  uint16_t e_machine;
5425  uint32_t e_version;
5426  uint64_t e_entry;
5427  uint64_t e_phoff;
5428  uint64_t e_shoff;
5429  uint32_t e_flags;
5430  uint16_t e_ehsize;
5431  uint16_t e_phentsize;
5432  uint16_t e_phnum;
5433  uint16_t e_shentsize;
5434  uint16_t e_shnum;
5435  uint16_t e_shstrndx;
5436  }
5437 #if !defined(SWIG) && !defined(_MSC_VER)
5438  __attribute__((packed))
5439 #endif
5440  ;
5441 
5442 #ifdef _MSC_VER
5443 # pragma pack ()
5444 #endif
5445 
5453  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
5454  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
5455  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
5456  ctor();
5457  }
5458 
5464  uint64_t max_page_size();
5465 
5468 
5471 
5477  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
5478 
5480  virtual bool reallocate() $ROSE_OVERRIDE;
5481 
5483  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5484 
5486  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5487 
5489  static bool is_ELF(SgAsmGenericFile*);
5490 
5492  SgAsmGenericSectionPtrList get_sectab_sections();
5493 
5495  SgAsmGenericSectionPtrList get_segtab_sections();
5496 
5497  // Overrides documented in base class
5498  virtual const char *format_name() const $ROSE_OVERRIDE;
5499 
5500  private:
5501  void ctor(); // called by constructors
5502  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
5503  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
5504 #endif // SgAsmElfFileHeader_OTHERS
5505 
5506 #ifdef DOCUMENTATION
5507  };
5508 #endif
5509 
5510 
5511 
5513 
5514  /*************************************************************************************************************************
5515  * ELF Section Tables
5516  *************************************************************************************************************************/
5517 
5519 
5520  DECLARE_LEAF_CLASS(AsmElfSectionTable);
5521  IS_SERIALIZABLE(AsmElfSectionTable);
5522 
5523 #ifdef DOCUMENTATION
5524 
5530  public:
5531 #endif
5532 
5533  DECLARE_OTHERS(AsmElfSectionTable);
5534 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
5535 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5536  private:
5537  friend class boost::serialization::access;
5538 
5539  template<class S>
5540  void serialize(S &s, const unsigned /*version*/) {
5541  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5542  }
5543 #endif
5544 
5545  public:
5548  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5549  ctor();
5550  }
5551 
5557  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
5558 
5570 
5574  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5575 
5577  virtual bool reallocate() $ROSE_OVERRIDE;
5578 
5580  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5581 
5583  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5584 
5585  private:
5586  void ctor();
5587 #endif // SgAsmElfSectionTable_OTHERS
5588 
5589 #ifdef DOCUMENTATION
5590  };
5591 #endif
5592 
5593 
5595 
5596  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
5597  IS_SERIALIZABLE(AsmElfSectionTableEntry);
5598 
5599 #ifdef DOCUMENTATION
5600 
5602  public:
5603 #endif
5604 
5605 #ifdef DOCUMENTATION
5606 
5611  unsigned get_sh_name() const;
5612  void set_sh_name(unsigned);
5614 #else
5615  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
5616  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5617 #endif
5618 
5619 #ifdef DOCUMENTATION
5620 
5625  SectionType get_sh_type() const;
5626  void set_sh_type(SectionType);
5628 #else
5629  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
5630  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5631 #endif
5632 
5633 #ifdef DOCUMENTATION
5634 
5639  unsigned long get_sh_link() const;
5640  void set_sh_link(unsigned long);
5642 #else
5643  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
5644  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5645 #endif
5646 
5647 #ifdef DOCUMENTATION
5648 
5653  unsigned long get_sh_info() const;
5654  void set_sh_info(unsigned long);
5656 #else
5657  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
5658  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5659 #endif
5660 
5661 #ifdef DOCUMENTATION
5662 
5667  uint64_t get_sh_flags() const;
5668  void set_sh_flags(uint64_t);
5670 #else
5671  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
5672  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5673 #endif
5674 
5675 #ifdef DOCUMENTATION
5676 
5681  rose_addr_t get_sh_addr() const;
5682  void set_sh_addr(rose_addr_t);
5684 #else
5685  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
5686  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5687 #endif
5688 
5689 #ifdef DOCUMENTATION
5690 
5695  rose_addr_t get_sh_offset() const;
5696  void set_sh_offset(rose_addr_t);
5698 #else
5699  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
5700  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5701 #endif
5702 
5703 #ifdef DOCUMENTATION
5704 
5709  rose_addr_t get_sh_size() const;
5710  void set_sh_size(rose_addr_t);
5712 #else
5713  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
5714  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5715 #endif
5716 
5717 #ifdef DOCUMENTATION
5718 
5723  rose_addr_t get_sh_addralign() const;
5724  void set_sh_addralign(rose_addr_t);
5726 #else
5727  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
5728  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5729 #endif
5730 
5731 #ifdef DOCUMENTATION
5732 
5737  rose_addr_t get_sh_entsize() const;
5738  void set_sh_entsize(rose_addr_t);
5740 #else
5741  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
5742  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5743 #endif
5744 
5745 #ifdef DOCUMENTATION
5746 
5751  const SgUnsignedCharList& get_extra() const;
5752  void set_extra(const SgUnsignedCharLit&);
5754 #else
5755  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5756  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5757  NO_DELETE);
5758 #endif
5759 
5760  DECLARE_OTHERS(AsmElfSectionTableEntry);
5761 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5762 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5763  private:
5764  friend class boost::serialization::access;
5765 
5766  template<class S>
5767  void serialize(S &s, const unsigned /*version*/) {
5768  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5769  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5770  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5771  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5772  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5773  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5774  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5775  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5776  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5777  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5778  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5779  s & BOOST_SERIALIZATION_NVP(p_extra);
5780  }
5781 #endif
5782 
5783  public:
5786  SHT_NULL = 0,
5790  SHT_RELA = 4,
5791  SHT_HASH = 5,
5793  SHT_NOTE = 7,
5795  SHT_REL = 9,
5796  SHT_SHLIB = 10,
5797  SHT_DYNSYM = 11,
5799  SHT_LOOS = 0x60000000,
5800  SHT_GNU_verdef = 0x6ffffffd,
5801  SHT_GNU_verneed = 0x6ffffffe,
5802  SHT_GNU_versym = 0x6fffffff,
5803  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5804 
5805  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5806  SHT_HIPROC = 0x7fffffff,
5807  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5808  SHT_HIUSER = 0xffffffff
5809  };
5810 
5814  SHF_WRITE= (1 << 0),
5815  SHF_ALLOC= (1 << 1),
5816  SHF_EXECINSTR= (1 << 2),
5817  SHF_MERGE= (1 << 4),
5818  SHF_STRINGS= (1 << 5),
5819  SHF_INFO_LINK= (1 << 6),
5820  SHF_LINK_ORDER= (1 << 7),
5822  SHF_GROUP= (1 << 9),
5823  SHF_TLS= (1 << 10),
5824  SHF_MASKOS= 0x0ff00000,
5825  SHF_MASKPROC= 0xf0000000
5826  };
5827 
5834 #ifdef _MSC_VER
5835 # pragma pack (1)
5836 #endif
5838  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5839  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5840  uint32_t sh_flags; /* 0x08 Bit flags */
5841  uint32_t sh_addr; /* 0x0c Desired mapped address */
5842  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5843  uint32_t sh_size; /* 0x14 Section size in bytes */
5844  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5845  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5846  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5847  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5848  } /* 0x28 */
5849 #if !defined(SWIG) && !defined(_MSC_VER)
5850  __attribute__((packed))
5851 #endif
5852  ;
5853 
5855  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5856  uint32_t sh_type; /* 0x04 */
5857  uint64_t sh_flags; /* 0x08 */
5858  uint64_t sh_addr; /* 0x10 */
5859  uint64_t sh_offset; /* 0x18 */
5860  uint64_t sh_size; /* 0x20 */
5861  uint32_t sh_link; /* 0x28 */
5862  uint32_t sh_info; /* 0x2c */
5863  uint64_t sh_addralign; /* 0x30 */
5864  uint64_t sh_entsize; /* 0x38 */
5865  } /* 0x40 */
5866 #if !defined(SWIG) && !defined(_MSC_VER)
5867  __attribute__((packed))
5868 #endif
5869  ;
5870 #ifdef _MSC_VER
5871 # pragma pack ()
5872 #endif
5873 
5875  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5877 
5879  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5881 
5885  void *encode(ByteOrder::Endianness sex,
5887  void *encode(ByteOrder::Endianness sex,
5893 
5895  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5896 
5897  // Use Rose::stringify... function instead.
5898  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5899  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5900 
5901  private:
5902  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5903  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5904 #endif // SgAsmElfSectionTableEntry_OTHERS
5905 
5906 #ifdef DOCUMENTATION
5907  };
5908 #endif
5909 
5910 
5911 
5913 
5914  /*************************************************************************************************************************
5915  * ELF Segment Tables
5916  *************************************************************************************************************************/
5917 
5919 
5920  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5921  IS_SERIALIZABLE(AsmElfSegmentTable);
5922 
5923 #ifdef DOCUMENTATION
5924 
5931  public:
5932 #endif
5933 
5934  DECLARE_OTHERS(AsmElfSegmentTable);
5935 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5936 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5937  private:
5938  friend class boost::serialization::access;
5939 
5940  template<class S>
5941  void serialize(S &s, const unsigned /*version*/) {
5942  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5943  }
5944 #endif
5945 
5946  public:
5949  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5950  ctor();
5951  }
5952 
5957  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5958 
5973 
5977  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5978 
5980  virtual bool reallocate() $ROSE_OVERRIDE;
5981 
5983  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5984 
5986  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5987 
5988  private:
5989  void ctor();
5990 #endif // SgAsmElfSegmentTable_OTHERS
5991 
5992 #ifdef DOCUMENTATION
5993  };
5994 #endif
5995 
5997 
5998  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5999  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
6000 
6001 #ifdef DOCUMENTATION
6003  public:
6004 #endif
6005 
6006 #ifdef DOCUMENTATION
6007 
6013  const SgAsmElfSegmentTableEntryPtrList& get_entries();
6014  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
6016 #else
6017  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
6018  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6019  NO_DELETE);
6020 #endif
6021 
6022  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
6023 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
6024 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6025  private:
6026  friend class boost::serialization::access;
6027 
6028  template<class S>
6029  void serialize(S &s, const unsigned /*version*/) {
6030  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6031  }
6032 #endif
6033 #endif // SgAsmElfSegmentTableEntryList_OTHERS
6034 
6035 #ifdef DOCUMENTATION
6036  };
6037 #endif
6038 
6039 
6041 
6042  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
6043  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
6044 
6045 #ifdef DOCUMENTATION
6046 
6048  public:
6049 #endif
6050 
6051 #ifdef DOCUMENTATION
6052 
6057  size_t get_index() const;
6058  void set_index(size_t);
6060 #else
6061  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
6062  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6063 #endif
6064 
6065 #ifdef DOCUMENTATION
6066 
6069  SegmentType get_type() const;
6070  void set_type(SegmentType);
6072 #else
6073  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
6074  "= SgAsmElfSegmentTableEntry::PT_LOAD",
6075  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6076 #endif
6077 
6078 #ifdef DOCUMENTATION
6079 
6082  SegmentFlags get_flags() const;
6083  void set_flags(SegmentFlags);
6085 #else
6086  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
6087  "= SgAsmElfSegmentTableEntry::PF_NONE",
6088  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6089 #endif
6090 
6091 #ifdef DOCUMENTATION
6092 
6097  rose_addr_t get_offset() const;
6098  void set_offset(rose_addr_t);
6100 #else
6101  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
6102  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6103 #endif
6104 
6105 #ifdef DOCUMENTATION
6106 
6112  rose_addr_t get_vaddr() const;
6113  void set_vaddr(rose_addr_t);
6115 #else
6116  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
6117  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6118 #endif
6119 
6120 #ifdef DOCUMENTATION
6121 
6126  rose_addr_t get_paddr() const;
6127  void set_paddr(rose_addr_t);
6129 #else
6130  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
6131  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6132 #endif
6133 
6134 #ifdef DOCUMENTATION
6135 
6140  rose_addr_t get_filesz() const;
6141  void set_filesz(rose_addr_t);
6143 #else
6144  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
6145  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6146 #endif
6147 
6148 #ifdef DOCUMENTATION
6149 
6154  rose_addr_t get_memsz() const;
6155  void set_memsz(rose_addr_t);
6157 #else
6158  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
6159  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6160 #endif
6161 
6162 #ifdef DOCUMENTATION
6163 
6168  rose_addr_t get_align() const;
6169  void set_align(rose_addr_t);
6171 #else
6172  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
6173  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6174 #endif
6175 
6176 #ifdef DOCUMENTATION
6177 
6182  const SgUnsignedCharList& get_extra() const;
6183  void set_extra(const SgUnsignedCharList&);
6185 #else
6186  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
6187  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6188 #endif
6189 
6190  DECLARE_OTHERS(AsmElfSegmentTableEntry);
6191 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
6192 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6193  private:
6194  friend class boost::serialization::access;
6195 
6196  template<class S>
6197  void serialize(S &s, const unsigned /*version*/) {
6198  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6199  s & BOOST_SERIALIZATION_NVP(p_index);
6200  s & BOOST_SERIALIZATION_NVP(p_type);
6201  s & BOOST_SERIALIZATION_NVP(p_flags);
6202  s & BOOST_SERIALIZATION_NVP(p_offset);
6203  s & BOOST_SERIALIZATION_NVP(p_vaddr);
6204  s & BOOST_SERIALIZATION_NVP(p_paddr);
6205  s & BOOST_SERIALIZATION_NVP(p_filesz);
6206  s & BOOST_SERIALIZATION_NVP(p_memsz);
6207  s & BOOST_SERIALIZATION_NVP(p_align);
6208  s & BOOST_SERIALIZATION_NVP(p_extra);
6209  }
6210 #endif
6211 
6212  public:
6215  PT_NULL = 0,
6216  PT_LOAD = 1,
6219  PT_NOTE = 4,
6220  PT_SHLIB = 5,
6221  PT_PHDR = 6,
6222  PT_TLS = 7,
6224  // OS- and Processor-specific ranges
6225  PT_LOOS = 0x60000000,
6226  PT_HIOS = 0x6fffffff,
6227  PT_LOPROC = 0x70000000,
6228  PT_HIPROC = 0x7fffffff,
6229 
6230  // OS-specific values for GNU/Linux
6231  PT_GNU_EH_FRAME = 0x6474e550,
6232  PT_GNU_STACK = 0x6474e551,
6233  PT_GNU_RELRO = 0x6474e552,
6234  PT_PAX_FLAGS = 0x65041580,
6236  // OS-specific values for Sun
6237  PT_SUNWBSS = 0x6ffffffa,
6238  PT_SUNWSTACK = 0x6ffffffb
6239  };
6240 
6243  PF_NONE = 0,
6244  PF_RESERVED = 0x000ffff8,
6245  PF_XPERM = 0x00000001,
6246  PF_WPERM = 0x00000002,
6247  PF_RPERM = 0x00000004,
6248  PF_OS_MASK = 0x0ff00000,
6249  PF_PROC_MASK = 0xf0000000
6250  };
6251 
6252 #ifdef _MSC_VER
6253 # pragma pack (1)
6254 #endif
6255 
6263  uint32_t p_type;
6264  uint32_t p_offset;
6265  uint32_t p_vaddr;
6266  uint32_t p_paddr;
6267  uint32_t p_filesz;
6268  uint32_t p_memsz;
6269  uint32_t p_flags;
6270  uint32_t p_align;
6271  } /* 0x30 */
6272 #if !defined(SWIG) && !defined(_MSC_VER)
6273  __attribute__((packed))
6274 #endif
6275  ;
6276 
6278  uint32_t p_type; /* 0x00 */
6279  uint32_t p_flags; /* 0x04 */
6280  uint64_t p_offset; /* 0x08 */
6281  uint64_t p_vaddr; /* 0x10 */
6282  uint64_t p_paddr; /* 0x18 */
6283  uint64_t p_filesz; /* 0x20 */
6284  uint64_t p_memsz; /* 0x28 */
6285  uint64_t p_align; /* 0x30 */
6286  } /* 0x38 */
6287 #if !defined(SWIG) && !defined(_MSC_VER)
6288  __attribute__((packed))
6289 #endif
6290  ;
6291 #ifdef _MSC_VER
6292 # pragma pack ()
6293 #endif
6294 
6296  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6298 
6300  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6302 
6306  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
6307  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
6312 
6314  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
6315 
6318 
6321 
6322  private:
6323  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
6324  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
6325 #endif // SgAsmElfSegmentTableEntry_OTHERS
6326 
6327 #ifdef DOCUMENTATION
6328  };
6329 #endif
6330 
6331 
6332 
6334 
6335  /*************************************************************************************************************************
6336  * ELF Symbol Tables
6337  *************************************************************************************************************************/
6338 
6340 
6341  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
6342  IS_SERIALIZABLE(AsmElfSymbolSection);
6343 
6344 #ifdef DOCUMENTATION
6345 
6347  public:
6348 #endif
6349 
6350 #ifdef DOCUMENTATION
6351 
6354  bool get_is_dynamic() const;
6355  void set_is_dynamic(bool);
6357 #else
6358  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
6359  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6360 #endif
6361 
6362 #ifdef DOCUMENTATION
6363 
6372 #else
6373  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
6374  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6375 #endif
6376 
6377  DECLARE_OTHERS(AsmElfSymbolSection);
6378 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
6379 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6380  private:
6381  friend class boost::serialization::access;
6382 
6383  template<class S>
6384  void serialize(S &s, const unsigned /*version*/) {
6385  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6386  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
6387  s & BOOST_SERIALIZATION_NVP(p_symbols);
6388  }
6389 #endif
6390 
6391  public:
6394  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
6395  ctor(strsec);
6396  }
6397 
6399  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
6400 
6413  virtual void finish_parsing() $ROSE_OVERRIDE;
6414 
6416  size_t index_of(SgAsmElfSymbol*);
6417 
6422  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6423 
6427  virtual bool reallocate() $ROSE_OVERRIDE;
6428 
6430  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6431 
6433  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6434 
6435  private:
6436  void ctor(SgAsmElfStringSection*);
6437 #endif // SgAsmElfSymbolSection_OTHERS
6438 
6439 #ifdef DOCUMENTATION
6440  };
6441 #endif
6442 
6444 
6445  DECLARE_LEAF_CLASS(AsmElfSymbolList);
6446  IS_SERIALIZABLE(AsmElfSymbolList);
6447 
6448 #ifdef DOCUMENTATION
6450  public:
6451 #endif
6452 
6453 #ifdef DOCUMENTATION
6454 
6460  const SgAsmElfSymbolPtrList& get_symbols() const;
6461  void set_symbols(const SgAsmElfSymbolPtrList&);
6463 #else
6464  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
6465  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6466 #endif
6467 
6468  DECLARE_OTHERS(AsmElfSymbolList);
6469 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
6470 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6471  private:
6472  friend class boost::serialization::access;
6473 
6474  template<class S>
6475  void serialize(S &s, const unsigned /*version*/) {
6476  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6477  s & BOOST_SERIALIZATION_NVP(p_symbols);
6478  }
6479 #endif
6480 #endif // SgAsmElfSymbolList_OTHERS
6481 
6482 #ifdef DOCUMENTATION
6483  };
6484 #endif
6485 
6487 
6488  DECLARE_LEAF_CLASS(AsmElfSymbol);
6489  IS_SERIALIZABLE(AsmElfSymbol);
6490 
6491 #ifdef DOCUMENTATION
6492 
6497  public:
6498 #endif
6499 
6500 #ifdef DOCUMENTATION
6501 
6506  unsigned char get_st_info() const;
6507  void set_st_info(unsigned char);
6509 #else
6510  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
6511  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6512 #endif
6513 
6514 #ifdef DOCUMENTATION
6515 
6520  unsigned char get_st_res1() const;
6521  void set_st_res1(unsigned char);
6523 #else
6524  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
6525  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6526 #endif
6527 
6528 #ifdef DOCUMENTATION
6529 
6534  unsigned get_st_shndx() const;
6535  void set_st_shndx(unsigned);
6537 #else
6538  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
6539  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6540 #endif
6541 
6542 #ifdef DOCUMENTATION
6543 
6548  rose_addr_t get_st_size() const;
6549  void set_st_size(rose_addr_t);
6551 #else
6552  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
6553  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6554 #endif
6555 
6556 #ifdef DOCUMENTATION
6557 
6562  const SgUnsignedCharList& get_extra() const;
6563  void set_extra(const SgUnsignedCharList&);
6565 #else
6566  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
6567  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6568 #endif
6569 
6570  DECLARE_OTHERS(AsmElfSymbol);
6571 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
6572 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6573  private:
6574  friend class boost::serialization::access;
6575 
6576  template<class S>
6577  void serialize(S &s, const unsigned /*version*/) {
6578  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
6579  s & BOOST_SERIALIZATION_NVP(p_st_info);
6580  s & BOOST_SERIALIZATION_NVP(p_st_res1);
6581  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
6582  s & BOOST_SERIALIZATION_NVP(p_st_size);
6583  s & BOOST_SERIALIZATION_NVP(p_extra);
6584  }
6585 #endif
6586 
6587  public:
6588  enum ElfSymBinding {
6589  STB_LOCAL=0,
6590  STB_GLOBAL=1,
6591  STB_WEAK=2
6592  };
6593 
6594  enum ElfSymType {
6597  STT_FUNC = 2,
6599  STT_FILE = 4,
6601  STT_TLS = 6,
6603  };
6604 
6605 #ifdef _MSC_VER
6606 # pragma pack (1)
6607 #endif
6608 
6611  uint32_t st_name;
6612  uint32_t st_value;
6613  uint32_t st_size;
6614  unsigned char st_info;
6615  unsigned char st_res1;
6616  uint16_t st_shndx;
6617  }
6618 #if !defined(SWIG) && !defined(_MSC_VER)
6619  __attribute__((packed))
6620 #endif
6621  ;
6622 
6624  uint32_t st_name;
6625  unsigned char st_info;
6626  unsigned char st_res1;
6627  uint16_t st_shndx;
6628  uint64_t st_value;
6629  uint64_t st_size;
6630  }
6631 #if !defined(SWIG) && !defined(_MSC_VER)
6632  __attribute__((packed))
6633 #endif
6634  ;
6635 
6636 #ifdef _MSC_VER
6637 # pragma pack ()
6638 #endif
6639 
6641  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
6642 
6646  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
6647 
6651  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
6652 
6656  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
6657  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
6665  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6666  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
6670  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
6671 
6674 
6676  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
6677 
6679  static std::string to_string(SgAsmElfSymbol::ElfSymType);
6680 
6681  private:
6682  void ctor(SgAsmElfSymbolSection*);
6683  void parse_common(); // initialization common to all parse() methods
6684 #endif // SgAsmElfSymbol_OTHERS
6685 
6686 #ifdef DOCUMENTATION
6687  };
6688 #endif
6689 
6690 
6691 
6693 
6694  /*************************************************************************************************************************
6695  * ELF Symbol Version Tables
6696  *************************************************************************************************************************/
6697 
6699 
6700  DECLARE_LEAF_CLASS(AsmElfSymverSection);
6701  IS_SERIALIZABLE(AsmElfSymverSection);
6702 
6703 #ifdef DOCUMENTATION
6704 
6709  public:
6710 #endif
6711 
6712 #ifdef DOCUMENTATION
6713 
6722 #else
6723  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
6724  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6725 #endif
6726 
6727  DECLARE_OTHERS(AsmElfSymverSection);
6728 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
6729 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6730  private:
6731  friend class boost::serialization::access;
6732 
6733  template<class S>
6734  void serialize(S &s, const unsigned /*version*/) {
6735  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6736  s & BOOST_SERIALIZATION_NVP(p_entries);
6737  }
6738 #endif
6739 
6740  public:
6743  : SgAsmElfSection(fhdr) {
6744  ctor();
6745  }
6746 
6748  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
6749 
6754  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6755 
6757  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6758 
6760  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6761  private:
6762  void ctor();
6763 #endif // SgAsmElfSymverSection_OTHERS
6764 
6765 #ifdef DOCUMENTATION
6766  };
6767 #endif
6768 
6770 
6771  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6772  IS_SERIALIZABLE(AsmElfSymverEntry);
6773 
6774 #ifdef DOCUMENTATION
6775 
6777  public:
6778 #endif
6779 
6780 #ifdef DOCUMENTATION
6781 
6786  size_t get_value() const;
6787  void set_value(size_t);
6789 #else
6790  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6791  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6792 #endif
6793 
6794  DECLARE_OTHERS(AsmElfSymverEntry);
6795 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6796 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6797  private:
6798  friend class boost::serialization::access;
6799 
6800  template<class S>
6801  void serialize(S &s, const unsigned /*version*/) {
6802  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6803  s & BOOST_SERIALIZATION_NVP(p_value);
6804  }
6805 #endif
6806 
6807  public:
6810  : p_value(0) {
6811  ctor(symver);
6812  }
6813 
6815  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6816 
6817  private:
6818  void ctor(SgAsmElfSymverSection*);
6819 #endif // SgAsmElfSymverEntry_OTHERS
6820 
6821 #ifdef DOCUMENTATION
6822  };
6823 #endif
6824 
6826 
6827 
6828  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6829  IS_SERIALIZABLE(AsmElfSymverEntryList);
6830 
6831 #ifdef DOCUMENTATION
6832 
6837  public:
6838 #endif
6839 
6840 #ifdef DOCUMENTATION
6841 
6844  const SgAsmElfSymverEntryPtrList& get_entries() const;
6845  void set_entries(const SgAsmElfSymverEntryPtrList&);
6847 #else
6848  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6849  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6850  NO_DELETE);
6851 #endif
6852 
6853  DECLARE_OTHERS(AsmElfSymverEntryList);
6854 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6855 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6856  private:
6857  friend class boost::serialization::access;
6858 
6859  template<class S>
6860  void serialize(S &s, const unsigned /*version*/) {
6861  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6862  s & BOOST_SERIALIZATION_NVP(p_entries);
6863  }
6864 #endif
6865 #endif // SgAsmElfSymverEntryList_OTHERS
6866 
6867 #ifdef DOCUMENTATION
6868  };
6869 #endif
6870 
6872 
6873  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6874  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6875 
6876 #ifdef DOCUMENTATION
6877 
6883  public:
6884 #endif
6885 
6886 #ifdef DOCUMENTATION
6887 
6896 #else
6897  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6898  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6899  NO_DELETE);
6900 #endif
6901 
6902  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6903 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6904 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6905  private:
6906  friend class boost::serialization::access;
6907 
6908  template<class S>
6909  void serialize(S &s, const unsigned /*version*/) {
6910  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6911  s & BOOST_SERIALIZATION_NVP(p_entries);
6912  }
6913 #endif
6914 
6915  public:
6918  : SgAsmElfSection(fhdr) {
6919  ctor(strsec);
6920  }
6921 
6990  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6991 
6994  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6995 
6999  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7000 
7002  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7003 
7004  private:
7005  void ctor(SgAsmElfStringSection*);
7006 #endif // SgAsmElfSymverDefinedSection_OTHERS
7007 
7008 #ifdef DOCUMENTATION
7009  };
7010 #endif
7011 
7013 
7014  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
7015  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
7016 
7017 #ifdef DOCUMENTATION
7018 
7023  public:
7024 #endif
7025 
7026 #ifdef DOCUMENTATION
7027 
7030  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
7031  void set_entries(const SgAsmElfSymverDefinedPtrList&);
7033 #else
7034  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
7035  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7036  NO_DELETE);
7037 #endif
7038 
7039  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
7040 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
7041 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7042  private:
7043  friend class boost::serialization::access;
7044 
7045  template<class S>
7046  void serialize(S &s, const unsigned /*version*/) {
7047  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7048  s & BOOST_SERIALIZATION_NVP(p_entries);
7049  }
7050 #endif
7051 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
7052 
7053 #ifdef DOCUMENTATION
7054  };
7055 #endif
7056 
7058 
7059  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
7060  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
7061 
7062 #ifdef DOCUMENTATION
7063 
7065  public:
7066 #endif
7067 
7068 #ifdef DOCUMENTATION
7069 
7074  size_t get_version() const;
7075  void set_version(size_t);
7077 #else
7078  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
7079  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7080 #endif
7081 
7082 #ifdef DOCUMENTATION
7083 
7088  int get_flags() const;
7089  void set_flags(int);
7091 #else
7092  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
7093  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7094 #endif
7095 
7096 #ifdef DOCUMENTATION
7097 
7102  size_t get_index() const;
7103  void set_index(size_t);
7105 #else
7106  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
7107  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7108 #endif
7109 
7110 #ifdef DOCUMENTATION
7111 
7116  uint32_t get_hash() const;
7117  void set_hash(uint32_t);
7119 #else
7120  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
7121  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7122 #endif
7123 
7124 #ifdef DOCUMENTATION
7125 
7134 #else
7135  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
7136  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7137 #endif
7138 
7139  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
7140 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
7141 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7142  private:
7143  friend class boost::serialization::access;
7144 
7145  template<class S>
7146  void serialize(S &s, const unsigned /*version*/) {
7147  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7148  s & BOOST_SERIALIZATION_NVP(p_version);
7149  s & BOOST_SERIALIZATION_NVP(p_flags);
7150  s & BOOST_SERIALIZATION_NVP(p_index);
7151  s & BOOST_SERIALIZATION_NVP(p_hash);
7152  s & BOOST_SERIALIZATION_NVP(p_entries);
7153  }
7154 #endif
7155 
7156  public:
7157 #ifdef _MSC_VER
7158 # pragma pack (1)
7159 #endif
7160 
7162  uint16_t vd_version;
7163  uint16_t vd_flags;
7164  uint16_t vd_ndx;
7165  uint16_t vd_cnt;
7166  uint32_t vd_hash;
7167  uint32_t vd_aux;
7168  uint32_t vd_next;
7169  }
7170 #if !defined(SWIG) && !defined(_MSC_VER)
7171  __attribute__((packed))
7172 #endif
7173  ;
7174 
7175 #ifdef _MSC_VER
7176 # pragma pack ()
7177 #endif
7178 
7181  ctor(symver_defined);
7182  }
7183 
7185  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
7186 
7188  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
7189 
7191  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7192 
7193  private:
7194  void ctor(SgAsmElfSymverDefinedSection*);
7195 #endif // SgAsmElfSymverDefinedEntry_OTHERS
7196 
7197 #ifdef DOCUMENTATION
7198  };
7199 #endif
7200 
7202 
7203  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
7204  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
7205 
7206 #ifdef DOCUMENTATION
7207 
7212  pbulic:
7213 #endif
7214 
7215 #ifdef DOCUMENTATION
7216 
7219  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
7220  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
7222 #else
7223  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
7224  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7225  NO_DELETE);
7226 #endif
7227 
7228  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
7229 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
7230 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7231  private:
7232  friend class boost::serialization::access;
7233 
7234  template<class S>
7235  void serialize(S &s, const unsigned /*version*/) {
7236  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7237  s & BOOST_SERIALIZATION_NVP(p_entries);
7238  }
7239 #endif
7240 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
7241 
7242 #ifdef DOCUMENTATION
7243  };
7244 #endif
7245 
7247 
7248  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
7249  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
7250 
7251 #ifdef DOCUMENTATION
7253  public:
7254 #endif
7255 
7256 #ifdef DOCUMENTATION
7257 
7260  SgAsmGenericString* get_name() const;
7263 #else
7264  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7265  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7266 #endif
7267 
7268  DECLARE_OTHERS(AsmElfSymverDefinedAux);
7269 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
7270 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7271  private:
7272  friend class boost::serialization::access;
7273 
7274  template<class S>
7275  void serialize(S &s, const unsigned /*version*/) {
7276  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7277  s & BOOST_SERIALIZATION_NVP(p_name);
7278  }
7279 #endif
7280 
7281  public:
7282 #ifdef _MSC_VER
7283 # pragma pack (1)
7284 #endif
7285 
7288  uint32_t vda_name;
7289  uint32_t vda_next;
7290  }
7291 #if !defined(SWIG) && !defined(_MSC_VER)
7292  __attribute__((packed))
7293 #endif
7294  ;
7295 
7296 #ifdef _MSC_VER
7297 # pragma pack ()
7298 #endif
7299 
7304  SgAsmElfSymverDefinedSection *symver_def_sec)
7305  : p_name(NULL) {
7306  ctor(symver_def_entry,symver_def_sec);
7307  }
7308 
7310  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
7311 
7313  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
7314 
7320  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7321 
7322  private:
7323  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
7324 #endif // SgAsmElfSymverDefinedAux_OTHERS
7325 
7326 #ifdef DOCUMENTATION
7327  };
7328 #endif
7329 
7331 
7332  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
7333  IS_SERIALIZABLE(AsmElfSymverNeededSection);
7334 
7335 #ifdef DOCUMENTATION
7336 
7342  public:
7343 #endif
7344 
7345 #ifdef DOCUMENTATION
7346 
7355 #else
7356  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
7357  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7358 #endif
7359 
7360  DECLARE_OTHERS(AsmElfSymverNeededSection);
7361 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
7362 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7363  private:
7364  friend class boost::serialization::access;
7365 
7366  template<class S>
7367  void serialize(S &s, const unsigned /*version*/) {
7368  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7369  s & BOOST_SERIALIZATION_NVP(p_entries);
7370  }
7371 #endif
7372 
7373  public:
7378  : SgAsmElfSection(fhdr) {
7379  ctor(strsec);
7380  }
7381 
7391  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
7392 
7397  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
7398 
7402  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7403 
7405  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7406 
7407  private:
7408  void ctor(SgAsmElfStringSection*);
7409 #endif // SgAsmElfSymverNeededSection_OTHERS
7410 
7411 #ifdef DOCUMENTATION
7412  };
7413 #endif
7414 
7416 
7417  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
7418  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
7419 
7420 #ifdef DOCUMENTATION
7421 
7426  public:
7427 #endif
7428 
7429 #ifdef DOCUMENTATION
7430 
7433  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
7434  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
7436 #else
7437  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
7438  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7439  NO_DELETE);
7440 #endif
7441 
7442  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
7443 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
7444 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7445  private:
7446  friend class boost::serialization::access;
7447 
7448  template<class S>
7449  void serialize(S &s, const unsigned /*version*/) {
7450  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7451  s & BOOST_SERIALIZATION_NVP(p_entries);
7452  }
7453 #endif
7454 #endif // SgAsmElfSymverNeededEntryList_OTHERS
7455 
7456 #ifdef DOCUMENTATION
7457  };
7458 #endif
7459 
7461 
7462  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
7463  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
7464 
7465 #ifdef DOCUMENTATION
7466 
7468  public:
7469 #endif
7470 
7471 #ifdef DOCUMENTATION
7472 
7477  size_t get_version() const;
7478  void set_version(size_t);
7480 #else
7481  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
7482  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7483 #endif
7484 
7485 #ifdef DOCUMENTATION
7486 
7492 #else
7493  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
7494  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7495 #endif
7496 
7497 #ifdef DOCUMENTATION
7498 
7507 #else
7508  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
7509  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7510 #endif
7511 
7512  DECLARE_OTHERS(AsmElfSymverNeededEntry);
7513 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
7514 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7515  private:
7516  friend class boost::serialization::access;
7517 
7518  template<class S>
7519  void serialize(S &s, const unsigned /*version*/) {
7520  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7521  s & BOOST_SERIALIZATION_NVP(p_version);
7522  s & BOOST_SERIALIZATION_NVP(p_file_name);
7523  s & BOOST_SERIALIZATION_NVP(p_entries);
7524  }
7525 #endif
7526 
7527  public:
7528 #ifdef _MSC_VER
7529 # pragma pack (1)
7530 #endif
7531 
7534  uint16_t vn_version;
7535  uint16_t vn_cnt;
7536  uint32_t vn_file;
7537  uint32_t vn_aux;
7538  uint32_t vn_next;
7539  }
7540 #if !defined(SWIG) && !defined(_MSC_VER)
7541  __attribute__((packed))
7542 #endif
7543  ;
7544 
7545 #ifdef _MSC_VER
7546 # pragma pack ()
7547 #endif
7548 
7551  : p_file_name(NULL) {
7552  ctor(symver_needed);
7553  }
7554 
7556  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
7557 
7559  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
7560 
7562  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7563 
7564  private:
7565  void ctor(SgAsmElfSymverNeededSection*);
7566 #endif // SgAsmElfSymverNeededEntry_OTHERS
7567 
7568 #ifdef DOCUMENTATION
7569  };
7570 #endif
7571 
7573 
7574  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
7575  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
7576 
7577 #ifdef DOCUMENTATION
7578 
7583  public:
7584 #endif
7585 
7586 #ifdef DOCUMENTATION
7587 
7590  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
7591  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
7593 #else
7594  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
7595  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7596  NO_DELETE);
7597 #endif
7598 
7599  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
7600 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
7601 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7602  private:
7603  friend class boost::serialization::access;
7604 
7605  template<class S>
7606  void serialize(S &s, const unsigned /*version*/) {
7607  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7608  s & BOOST_SERIALIZATION_NVP(p_entries);
7609  }
7610 #endif
7611 #endif // SgAsmElfSymverNeededAuxList_OTHERS
7612 
7613 #ifdef DOCUMENTATION
7614  };
7615 #endif
7616 
7618 
7619  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
7620  IS_SERIALIZABLE(AsmElfSymverNeededAux);
7621 
7622 #ifdef DOCUMENTATION
7623 
7625  public:
7626 #endif
7627 
7628 #ifdef DOCUMENTATION
7629 
7634  uint32_t get_hash() const;
7635  void set_hash(uint32_t);
7637 #else
7638  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
7639  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7640 #endif
7641 
7642 #ifdef DOCUMENTATION
7643 
7648  int get_flags() const;
7649  void set_flags(int);
7651 #else
7652  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
7653  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7654 #endif
7655 
7656 #ifdef DOCUMENTATION
7657 
7662  size_t get_other() const;
7663  void set_other(size_t);
7665 #else
7666  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
7667  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7668 #endif
7669 
7670 #ifdef DOCUMENTATION
7671 
7674  SgAsmGenericString* get_name() const;
7677 #else
7678  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7679  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7680 #endif
7681 
7682  DECLARE_OTHERS(AsmElfSymverNeededAux);
7683 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
7684 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7685  private:
7686  friend class boost::serialization::access;
7687 
7688  template<class S>
7689  void serialize(S &s, const unsigned /*version*/) {
7690  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7691  s & BOOST_SERIALIZATION_NVP(p_hash);
7692  s & BOOST_SERIALIZATION_NVP(p_flags);
7693  s & BOOST_SERIALIZATION_NVP(p_other);
7694  s & BOOST_SERIALIZATION_NVP(p_name);
7695  }
7696 #endif
7697 
7698  public:
7699 #ifdef _MSC_VER
7700 # pragma pack (1)
7701 #endif
7702 
7705  uint32_t vna_hash;
7706  uint16_t vna_flags;
7707  uint16_t vna_other;
7708  uint32_t vna_name;
7709  uint32_t vna_next;
7710  }
7711 #if !defined(SWIG) && !defined(_MSC_VER)
7712  __attribute__((packed))
7713 #endif
7714  ;
7715 
7716 #ifdef _MSC_VER
7717 # pragma pack ()
7718 #endif
7719 
7725  : p_name(NULL) {
7726  ctor(symver_needed_entry,symver_needed_sec);
7727  }
7728 
7730  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
7731 
7733  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
7734 
7740  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7741 
7742  private:
7744 #endif // SgAsmElfSymverNeededAux_OTHERS
7745 
7746 #ifdef DOCUMENTATION
7747  };
7748 #endif
7749 
7750 
7751 
7752 
7754 
7755  /*************************************************************************************************************************
7756  * ELF Relocation Tables
7757  *************************************************************************************************************************/
7758 
7760 
7761  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7762  IS_SERIALIZABLE(AsmElfRelocSection);
7763 
7764 #ifdef DOCUMENTATION
7765 
7767  public:
7768 #endif
7769 
7770 #ifdef DOCUMENTATION
7771 
7774  bool get_uses_addend() const;
7775  void set_uses_addend(bool);
7777 #else
7778  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7779  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7780 #endif
7781 
7782 #ifdef DOCUMENTATION
7783 
7789 #else
7790  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7791  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7792 #endif
7793 
7794 #ifdef DOCUMENTATION
7795 
7803 #else
7804  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7805  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7806 #endif
7807 
7808  DECLARE_OTHERS(AsmElfRelocSection);
7809 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7810 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7811  private:
7812  friend class boost::serialization::access;
7813 
7814  template<class S>
7815  void serialize(S &s, const unsigned /*version*/) {
7816  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7817  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7818  s & BOOST_SERIALIZATION_NVP(p_target_section);
7819  s & BOOST_SERIALIZATION_NVP(p_entries);
7820  }
7821 #endif
7822 
7823  public:
7825  : SgAsmElfSection(fhdr) {
7826  ctor(symsec,targetsec);
7827  }
7828 
7831  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7832 
7834  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7835 
7837  virtual bool reallocate() $ROSE_OVERRIDE;
7838 
7840  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7841 
7843  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7844 
7845  private:
7847 #endif // SgAsmElfRelocSection_OTHERS
7848 
7849 #ifdef DOCUMENTATION
7850  };
7851 #endif
7852 
7854 
7855  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7856  IS_SERIALIZABLE(AsmElfRelocEntryList);
7857 
7858 #ifdef DOCUMENTATION
7859 
7864  public:
7865 #endif
7866 
7867 #ifdef DOCUMENTATION
7868 
7871  const SgAsmElfRelocEntryPtrList& get_entries() const;
7872  void set_entries(const SgAsmElfRelocEntryPtrList&);
7874 #else
7875  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7876  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7877  NO_DELETE);
7878 #endif
7879 
7880  DECLARE_OTHERS(AsmElfRelocEntryList);
7881 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7882 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7883  private:
7884  friend class boost::serialization::access;
7885 
7886  template<class S>
7887  void serialize(S &s, const unsigned /*version*/) {
7888  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7889  s & BOOST_SERIALIZATION_NVP(p_entries);
7890  }
7891 #endif
7892 #endif // SgAsmElfRelocEntryList_OTHERS
7893 
7894 #ifdef DOCUMENTATION
7895  };
7896 #endif
7897 
7899 
7900  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7901  IS_SERIALIZABLE(AsmElfRelocEntry);
7902 
7903 #ifdef DOCUMENTATION
7904 
7906  public:
7907 #endif
7908 
7909 #ifdef DOCUMENTATION
7910 
7915  rose_addr_t get_r_offset() const;
7916  void set_r_offset(rose_addr_t);
7918 #else
7919  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7920  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7921 #endif
7922 
7923 #ifdef DOCUMENTATION
7924 
7929  rose_addr_t get_r_addend() const;
7930  void set_r_addend(rose_addr_t);
7932 #else
7933  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7934  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7935 #endif
7936 
7937 #ifdef DOCUMENTATION
7938 
7943  unsigned long get_sym() const;
7944  void set_sym(unsigned long);
7946 #else
7947  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7948  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7949 #endif
7950 
7951 #ifdef DOCUMENTATION
7952 
7957  RelocType get_type() const;
7958  void set_type(RelocType);
7960 #else
7961  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7962  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7963 #endif
7964 
7965 #ifdef DOCUMENTATION
7966 
7969  const SgUnsignedCharList& get_extra() const;
7970  void set_extra(const SgUnsignedCharList&);
7972 #else
7973  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7974  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7975 #endif
7976 
7977  DECLARE_OTHERS(AsmElfRelocEntry);
7978 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7979 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7980  private:
7981  friend class boost::serialization::access;
7982 
7983  template<class S>
7984  void serialize(S &s, const unsigned /*version*/) {
7985  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7986  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7987  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7988  s & BOOST_SERIALIZATION_NVP(p_sym);
7989  s & BOOST_SERIALIZATION_NVP(p_type);
7990  s & BOOST_SERIALIZATION_NVP(p_extra);
7991  }
7992 #endif
7993 
7994  public:
7997  // Intel 80386 specific definitions.
8009  R_386_32PLT =11,
8016  R_386_16 =20,
8017  R_386_PC16 =21,
8018  R_386_8 =22,
8019  R_386_PC8 =23,
8035  // First Entry for X86-64
8050  R_X86_64_8 =114,
8060  };
8061 
8062 #ifdef _MSC_VER
8063 # pragma pack (1)
8064 #endif
8065 
8067  uint32_t r_offset;
8068  uint32_t r_info;
8069  uint32_t r_addend;
8070  }
8071 #if !defined(SWIG) && !defined(_MSC_VER)
8072  __attribute__((packed))
8073 #endif
8074  ;
8075 
8077  uint64_t r_offset;
8078  uint64_t r_info;
8079  uint64_t r_addend;
8080  }
8081 #if !defined(SWIG) && !defined(_MSC_VER)
8082  __attribute__((packed))
8083 #endif
8084  ;
8085 
8087  uint32_t r_offset;
8088  uint32_t r_info;
8089  }
8090 #if !defined(SWIG) && !defined(_MSC_VER)
8091  __attribute__((packed))
8092 #endif
8093  ;
8094 
8096  uint64_t r_offset;
8097  uint64_t r_info;
8098  }
8099 #if !defined(SWIG) && !defined(_MSC_VER)
8100  __attribute__((packed))
8101 #endif
8102  ;
8103 
8104 #ifdef _MSC_VER
8105 # pragma pack ()
8106 #endif
8107 
8110  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
8111  ctor(section);
8112  }
8113 
8117  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
8118  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
8119  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
8120  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
8126  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
8127  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
8128  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
8129  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
8135  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
8136  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
8137  dump(f, prefix, idx, NULL);
8138  }
8142  std::string reloc_name() const;
8143 
8144  private:
8145  void ctor(SgAsmElfRelocSection*);
8146 #endif // SgAsmElfRelocEntry_OTHERS
8147 
8148 #ifdef DOCUMENTATION
8149  };
8150 #endif
8151 
8152 
8153 
8155 
8156  /*************************************************************************************************************************
8157  * ELF Dynamic Linking
8158  *************************************************************************************************************************/
8159 
8161 
8162  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
8163  IS_SERIALIZABLE(AsmElfDynamicSection);
8164 
8165 #ifdef DOCUMENTATION
8166 
8168  public:
8169 #endif
8170 
8171 #ifdef DOCUMENTATION
8172 
8181 #else
8182  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
8183  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8184 #endif
8185 
8186  DECLARE_OTHERS(AsmElfDynamicSection);
8187 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
8188 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8189  private:
8190  friend class boost::serialization::access;
8191 
8192  template<class S>
8193  void serialize(S &s, const unsigned /*version*/) {
8194  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8195  s & BOOST_SERIALIZATION_NVP(p_entries);
8196  }
8197 #endif
8198 
8199  public:
8202  : SgAsmElfSection(fhdr) {
8203  ctor(strsec);
8204  }
8205 
8207  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
8208 
8210  virtual void finish_parsing() $ROSE_OVERRIDE;
8211 
8214  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
8215 
8217  virtual bool reallocate() $ROSE_OVERRIDE;
8218 
8220  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8221 
8223  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8224 
8225  private:
8226  void ctor(SgAsmElfStringSection*);
8227 #endif // SgAsmElfDynamicSection_OTHERS
8228 
8229 #ifdef DOCUMENTATION
8230  };
8231 #endif
8232 
8234 
8235  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
8236  IS_SERIALIZABLE(AsmElfDynamicEntryList);
8237 
8238 #ifdef DOCUMENTATION
8239 
8244  public:
8245 #endif
8246 
8247 #ifdef DOCUMENTATION