ROSE  0.9.12.19
binaryInstruction.C
1 /******************************************************************************************************************************
2  * NOTE: For any given IR class, please keep all its parts as close together as possible. Its bad enough that we're
3  * defining classes in a non-C-like language -- and it's painful when a definition is scattered all over this file. We
4  * already have four places to look to get the definition of an IR class:
5  * (1) here, in this source file, built with ROSETTA functions
6  * (2) additional declarations between HEADER_* markers in ../Grammar/BinaryInstruction.code (which we can't
7  * even parse as a C++ file, making IDEs useless there).
8  * (3) function definitions between SOURCE_* markers in ../Grammar/BinaryInstruction.code, which for some
9  * reason are not next to the corresponding HEADER_ markers. Please migrate these definitions to *.C files
10  * whenever you have an opportunity, so that IDEs can see the definitions.
11  * (4) Doxygen documentation in ../../../docs/testDoxygen directory since doxygen can't parse the IR classes
12  * from this source file. Documented entities are marked with a "DOXYGEN" comment here to make it more
13  * obvious when documentation is present.
14  *
15  * NOTE: First part of the file is for classes describing instructions. Middle part is for classes describing binary
16  * containers (organized by container type: ELF, DOS, PE, ...) Last part is the base classes. Unlike C++, the classes
17  * defined in this file need to be defined from the most specific (derived classes) to the most general (base class).
18  *
19  * NOTE: Please use three blank lines between IR node definitions to help make this file more readable. Unless those IR
20  * nodes are so closely related to one another that it's better to keep them close.
21  *
22  * UPDATE: Instead of splitting class declarations into four separate places, we can now use the macros defined below to put
23  * everything into one place in this file. My goal is to eventually remove the
24  * src/ROSETTA/Grammar/BinaryInstruction.code file and the related docs/testDoxygen/xxx.docs files and to add
25  * documentation here for all property accessors.
26  *
27  * ROSETTA FAILURE MODES:
28  *
29  * + If you get thousands of compile errors in Cxx_Grammar.h that seem to have absolutely nothing to do with the node
30  * you just added, then double check that the new node type is listed as the descendant of some other node type in a
31  * NEW_NONTERMINAL_MACRO macro expansion.
32  *
33  * + If CxxGrammarMetaProgram uses gigabytes and gigabytes of memory and never terminates then check that all the new
34  * IR node types have a correctly spelled entry in the astNodeList file.
35  *-----------------------------------------------------------------------------------------------------------------------------*/
36 
37 #include "ROSETTA_macros.h"
38 #include "grammar.h"
39 #include "AstNodeClass.h"
40 
41 // The following macros try to make it possile to keep all aspects of a Sage node's declaration in this one file. The old way
42 // of doing things required the class declarations to be split into four places:
43 // (1) The #include files necessary to declare the class were at the top of a src/ROSETTA/Grammar/*.code file
44 // (2) The class declaration and properties were built in src/ROSETTA/src/*.C
45 // (3) The documentation for the class and its properties were in docs/testDoxygen/*.docs files
46 // (4) Additional non-ROSETTA members were in src/ROSETTA/Grammar/*.code files
47 // Implementations were originally also in the src/ROSETTA/Grammar/*.code files but have since been moved to *.C files. The
48 // problem with *.code files is no IDE understands them.
49 //
50 // The following macros take a CLASS_WITHOUT_Sg parameter, which is the name of the Sage node class but without the leading
51 // "Sg". I'm not sure why ROSETTA was written this way. For instance, use "AsmInstruction" instead of "SgAsmInstruction". Most
52 // other things will use the full class name.
53 //
54 // The macros are:
55 // DOCUMENTATION is never defined when compiling, but will be defined when generating documentation and can be used to help
56 // IDE's figure out the indentation and as commentary. We don't use "#if 0" because some IDEs figure out that the code is
57 // never possible and don't indent it properly. For instance, most of the classes are defined like this:
58 // #ifdef DOCUMENTATION
59 // class SgAsmArmInstruction: public SgAsmInstruction {
60 // #endif
61 //
62 // ...
63 //
64 // #ifdef DOCUMENTATION
65 // };
66 // #endif
67 //
68 //
69 // DECLARE_LEAF_CLASS is the simpler way to declare a Sage class that has no subclasses. This must be the first macro
70 // invoked when starting a new class declaration. Example, to declare the SgMyClass node, say:
71 // DECLARE_LEAF_CLASS(MyClass);
72 // #ifdef DOCUMENTATION
73 // class SgMyClass: public ...base-classes... {
74 // #endif
75 //
76 //
77 // DECLARE_HEADERS is used to indicate what header files need to be included. Note that due to limitations of ROSETTA
78 // (specifically, not having any portable regular expression library due to prohibition against using boost), the #ifdef and
79 // #endif lines must be *exactly* as written here -- they are sensitive to white space.
80 // DECLARE_HEADERS(MyClass);
81 // #if defined(SgMyClass_HEADERS) || defined(DOCUMENTATION)
82 // #include <someHeader>
83 // #endif // SgMyClass_HEADERS
84 //
85 //
86 // DECLARE_OTHERS is for declaring other class members that don't need to be processed by ROSETTA. Due to limitations of
87 // ROSETTA (specifically, not having any portable regular expression library due to prohibition against using boost), the
88 // #ifdef and #endif lines must be *exactly* as written here -- they are sensitive to white space.
89 // DECLARE_OTHERS(MyClass);
90 // #if defined(SgMyClass_OTHERS) || defined(DOCUMENTATION)
91 // // other declarations here
92 // #endif // SgMyClass_OTHERS
93 
94 //#undef DOCUMENTATION -- commented out so IDEs can't figure it out
95 #ifdef DOCUMENTATION
96 DOCUMENTATION_should_never_be_defined;
97 #endif
98 
99 #ifdef DOCUMENTATION
100 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) /*void*/
101 #else
102 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) \
103  NEW_TERMINAL_MACRO(CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg "Tag"); \
104  CLASS_WITHOUT_Sg.setCppCondition("!defined(DOCUMENTATION)")
105 #endif
106 
107 #ifdef DOCUMENTATION
108 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) /*void*/
109 #else
110 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) \
111  CLASS_WITHOUT_Sg.setPredeclarationString("Sg" #CLASS_WITHOUT_Sg "_HEADERS", \
112  ROSE_AUTOMAKE_ABSOLUTE_PATH_TOP_SRCDIR + "/src/ROSETTA/src/binaryInstruction.C")
113 #endif
114 
115 #ifdef DOCUMENTATION
116 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) /*void*/
117 #else
118 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) \
119  CLASS_WITHOUT_Sg.setFunctionPrototype("Sg" #CLASS_WITHOUT_Sg "_OTHERS", \
120  ROSE_AUTOMAKE_ABSOLUTE_PATH_TOP_SRCDIR + "/src/ROSETTA/src/binaryInstruction.C")
121 #endif
122 
123 #ifdef DOCUMENTATION
124 #define IS_SERIALIZABLE() /*void*/
125 #else
126 #define IS_SERIALIZABLE(CLASS_WITHOUT_Sg) \
127  CLASS_WITHOUT_Sg.isBoostSerializable(true)
128 #endif
129 
130 // Since ROSETTA builds classes from the leaves up to the base, and C++ builds classes from the base down to the leaves, we
131 // need to make sure that doxygen sees the base classes before the derived classes. So just list all the non-leaf classes here.
132 #ifdef DOCUMENTATION
135 class SgAsmDwarfConstruct;
137 class SgAsmElfSection;
139 class SgAsmExpression;
140 class SgAsmGenericHeader;
141 class SgAsmGenericSection;
142 class SgAsmGenericString;
143 class SgAsmGenericStrtab;
144 class SgAsmGenericSymbol;
145 class SgAsmInstruction;
146 class SgAsmNode;
147 class SgAsmPESection;
149 class SgAsmScalarType;
150 class SgAsmStatement;
151 class AsmSynthesizedFieldDeclaration;
152 class SgAsmType;
155 class SgNode;
156 #endif
157 
158 #ifndef DOCUMENTATION
159 void Grammar::setUpBinaryInstructions() {
160 #endif
161 
163 
164  /**************************************************************************************************************************
165  * Instructions.
166  * Base class (SgAsmInstruction) and various subclasses, one per architecture.
167  **************************************************************************************************************************/
168 
170 
171  DECLARE_LEAF_CLASS(AsmArmInstruction);
172  IS_SERIALIZABLE(AsmArmInstruction);
173 
174  DECLARE_HEADERS(AsmArmInstruction);
175 #if defined(SgAsmArmInstruction_HEADERS) || defined(DOCUMENTATION)
176  #include <InstructionEnumsArm.h>
177 #endif // SgAsmArmInstruction_HEADERS
178 
179 #ifdef DOCUMENTATION
180 
182  public:
183 #endif
184 
185 #ifdef DOCUMENTATION
186 
195 #else
196  AsmArmInstruction.setDataPrototype("Rose::BinaryAnalysis::ArmInstructionKind", "kind",
197  "= Rose::BinaryAnalysis::arm_unknown_instruction",
198  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
199 #endif
200 
201 #ifdef DOCUMENTATION
202 
208 #else
209  AsmArmInstruction.setDataPrototype("Rose::BinaryAnalysis::ArmInstructionCondition", "condition",
210  "= Rose::BinaryAnalysis::arm_cond_unknown",
211  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
212 #endif
213 
214 #ifdef DOCUMENTATION
215 
221 #else
222  AsmArmInstruction.setDataPrototype("int", "positionOfConditionInMnemonic", "= -1",
223  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
224 #endif
225 
226  DECLARE_OTHERS(AsmArmInstruction);
227 #if defined(SgAsmArmInstruction_OTHERS) || defined(DOCUMENTATION)
228 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
229  private:
230  friend class boost::serialization::access;
231 
232  template<class S>
233  void serialize(S &s, const unsigned /*version*/) {
234  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
235  s & BOOST_SERIALIZATION_NVP(p_kind);
236  s & BOOST_SERIALIZATION_NVP(p_condition);
237  s & BOOST_SERIALIZATION_NVP(p_positionOfConditionInMnemonic);
238  }
239 #endif
240 
241  public:
242  // Overrides are documented in the base class
243  virtual std::string description() const $ROSE_OVERRIDE;
244  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
245  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
246  virtual bool isUnknown() const $ROSE_OVERRIDE;
247  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
248 #endif // SgAsmArmInstruction_OTHERS
249 #ifdef DOCUMENTATION
250  };
251 #endif
252 
253 
255 
256  DECLARE_LEAF_CLASS(AsmX86Instruction);
257  IS_SERIALIZABLE(AsmX86Instruction);
258  DECLARE_HEADERS(AsmX86Instruction);
259 #if defined(SgAsmX86Instruction_HEADERS) || defined(DOCUMENTATION)
260  #include <InstructionEnumsX86.h>
261  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
262 #endif // SgAsmX86Instruction_HEADERS
263 
264 #ifdef DOCUMENTATION
265 
267  public:
268 #endif
269 
270 #ifdef DOCUMENTATION
271 
280 #else
281  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionKind", "kind",
282  "= Rose::BinaryAnalysis::x86_unknown_instruction",
283  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
284 #endif
285 
286 #ifdef DOCUMENTATION
287 
293 #else
294  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "baseSize",
295  "= Rose::BinaryAnalysis::x86_insnsize_none",
296  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
297 #endif
298 
299 #ifdef DOCUMENTATION
300 
306 #else
307  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "operandSize",
308  "= Rose::BinaryAnalysis::x86_insnsize_none",
309  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
310 #endif
311 
312 #ifdef DOCUMENTATION
313 
319 #else
320  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "addressSize",
321  "= Rose::BinaryAnalysis::x86_insnsize_none",
322  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
323 #endif
324 
325 #ifdef DOCUMENTATION
326 
331  bool get_lockPrefix() const;
332  void set_lockPrefix(bool);
334 #else
335  AsmX86Instruction.setDataPrototype("bool", "lockPrefix", "= false",
336  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
337 #endif
338 
339 #ifdef DOCUMENTATION
340 
346 #else
347  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86RepeatPrefix", "repeatPrefix",
348  "= Rose::BinaryAnalysis::x86_repeat_none",
349  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
350 #endif
351 
352 #ifdef DOCUMENTATION
353 
359 #else
360  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86BranchPrediction", "branchPrediction",
361  "= Rose::BinaryAnalysis::x86_branch_prediction_none",
362  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
363 #endif
364 
365 #ifdef DOCUMENTATION
366 
375 #else
376  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86SegmentRegister", "segmentOverride",
377  "= Rose::BinaryAnalysis::x86_segreg_none",
378  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
379 #endif
380 
381 
382  DECLARE_OTHERS(AsmX86Instruction);
383 #if defined(SgAsmX86Instruction_OTHERS) || defined(DOCUMENTATION)
384 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
385  private:
386  friend class boost::serialization::access;
387 
388  template<class S>
389  void serialize(S &s, const unsigned /*version*/) {
390  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
391  s & BOOST_SERIALIZATION_NVP(p_kind);
392  s & BOOST_SERIALIZATION_NVP(p_baseSize);
393  s & BOOST_SERIALIZATION_NVP(p_operandSize);
394  s & BOOST_SERIALIZATION_NVP(p_addressSize);
395  s & BOOST_SERIALIZATION_NVP(p_lockPrefix);
396  s & BOOST_SERIALIZATION_NVP(p_repeatPrefix);
397  s & BOOST_SERIALIZATION_NVP(p_branchPrediction);
398  s & BOOST_SERIALIZATION_NVP(p_segmentOverride);
399  }
400 #endif
401 
402  public:
407 
412 
418 
424 
425  // Overrides are documented in the base class
426  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
427  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
428  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
429  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
430  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
431  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
432  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
433  virtual bool getBranchTarget(rose_addr_t *target/*out*/) $ROSE_OVERRIDE;
434  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
435  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*>&,
436  bool* complete,
437  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
438  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
439  virtual bool isUnknown() const $ROSE_OVERRIDE;
440  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
441 #endif // SgAsmX86Instruction_OTHERS
442 #ifdef DOCUMENTATION
443  };
444 #endif
445 
447 
448  DECLARE_LEAF_CLASS(AsmPowerpcInstruction);
449  IS_SERIALIZABLE(AsmPowerpcInstruction);
450  DECLARE_HEADERS(AsmPowerpcInstruction);
451 #if defined(SgAsmPowerpcInstruction_HEADERS) || defined(DOCUMENTATION)
452  #include <InstructionEnumsPowerpc.h>
453 #endif // SgAsmPowerpcInstruction_HEADERS
454 
455 #ifdef DOCUMENTATION
456 
458  public:
459 #endif
460 
461 
462 #ifdef DOCUMENTATION
463 
472 #else
473  AsmPowerpcInstruction.setDataPrototype("Rose::BinaryAnalysis::PowerpcInstructionKind", "kind",
474  "= Rose::BinaryAnalysis::powerpc_unknown_instruction",
475  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
476  COPY_DATA);
477 #endif
478 
479  DECLARE_OTHERS(AsmPowerpcInstruction);
480 #if defined(SgAsmPowerpcInstruction_OTHERS) || defined(DOCUMENTATION)
481 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
482  private:
483  friend class boost::serialization::access;
484 
485  template<class S>
486  void serialize(S &s, const unsigned /*version*/) {
487  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
488  s & BOOST_SERIALIZATION_NVP(p_kind);
489  }
490 #endif
491 
492  public:
498  std::string conditionalBranchDescription() const;
499 
505 
506  // Overrides are documented in the base class
507  virtual std::string description() const $ROSE_OVERRIDE;
508  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
509  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
510  virtual bool isUnknown() const $ROSE_OVERRIDE;
511  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
512  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
513  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
514  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
515  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
516  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
517  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
518 #endif // SgAsmPowerpcInstruction_OTHERS
519 #ifdef DOCUMENTATION
520  };
521 #endif
522 
523 
525 
526  DECLARE_LEAF_CLASS(AsmMipsInstruction);
527  IS_SERIALIZABLE(AsmMipsInstruction);
528  DECLARE_HEADERS(AsmMipsInstruction);
529 #if defined(SgAsmMipsInstruction_HEADERS) || defined(DOCUMENTATION)
530  #include <InstructionEnumsMips.h>
531 #endif // SgAsmMipsInstruction_HEADERS
532 
533 #ifdef DOCUMENTATION
534 
536  public:
537 #endif
538 
539 #ifdef DOCUMENTATION
540 
549 #else
550  AsmMipsInstruction.setDataPrototype("Rose::BinaryAnalysis::MipsInstructionKind", "kind",
551  "= Rose::BinaryAnalysis::mips_unknown_instruction",
552  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
553  COPY_DATA);
554 #endif
555 
556  DECLARE_OTHERS(AsmMipsInstruction);
557 #if defined(SgAsmMipsInstruction_OTHERS) || defined(DOCUMENTATION)
558 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
559  private:
560  friend class boost::serialization::access;
561 
562  template<class S>
563  void serialize(S &s, const unsigned /*version*/) {
564  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
565  s & BOOST_SERIALIZATION_NVP(p_kind);
566  }
567 #endif
568 
569  public:
570  // Overrides are documented in the base class
571  virtual std::string description() const $ROSE_OVERRIDE;
572  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
573  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
574  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
575  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
576  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
577  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
578  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
579  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
580  virtual bool isUnknown() const $ROSE_OVERRIDE;
581  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
582  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
583 #endif // SgAsmMipsInstruction_OTHERS
584 #ifdef DOCUMENTATION
585  };
586 #endif
587 
589 
590  DECLARE_LEAF_CLASS(AsmM68kInstruction);
591  IS_SERIALIZABLE(AsmM68kInstruction);
592  DECLARE_HEADERS(AsmM68kInstruction);
593 #if defined(SgAsmM68kInstruction_HEADERS) || defined(DOCUMENTATION)
594  #include "InstructionEnumsM68k.h"
595 #endif // SgAsmM68kInstruction_HEADERS
596 
597 #ifdef DOCUMENTATION
599  public:
600 #endif
601 
602 #ifdef DOCUMENTATION
603 
612 #else
613  AsmM68kInstruction.setDataPrototype("Rose::BinaryAnalysis::M68kInstructionKind", "kind",
614  " = Rose::BinaryAnalysis::m68k_unknown_instruction",
615  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
616  COPY_DATA);
617 #endif
618 
619  DECLARE_OTHERS(AsmM68kInstruction);
620 #if defined(SgAsmM68kInstruction_OTHERS) || defined(DOCUMENTATION)
621 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
622  private:
623  friend class boost::serialization::access;
624 
625  template<class S>
626  void serialize(S &s, const unsigned /*version*/) {
627  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
628  s & BOOST_SERIALIZATION_NVP(p_kind);
629  }
630 #endif
631 
632  public:
633  // Overrides are documented in the base class
634  virtual std::string description() const $ROSE_OVERRIDE;
635  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
636  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
637  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
638  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
639  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
640  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
641  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
642  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
643  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
644  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*>&,
645  bool* complete,
646  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
647  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
648  virtual bool isUnknown() const $ROSE_OVERRIDE;
649  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
650 #endif // SgAsmM68kInstruction_OTHERS
651 #ifdef DOCUMENTATION
652  };
653 #endif
654 
656 
657  NEW_NONTERMINAL_MACRO(AsmInstruction,
658  AsmX86Instruction | AsmArmInstruction | AsmPowerpcInstruction | AsmMipsInstruction |
659  AsmM68kInstruction,
660  "AsmInstruction", "AsmInstructionTag", true);
661  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
662  IS_SERIALIZABLE(AsmInstruction);
663 
664  DECLARE_HEADERS(AsmInstruction);
665 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
666  #include <MemoryMap.h>
667 #endif // SgAsmInstruction_HEADERS
668 
669 #ifdef DOCUMENTATION
670 
692  public:
693 #endif
694 
695 #ifdef DOCUMENTATION
696 
704  const std::string& get_mnemonic() const;
705  void set_mnemonic(const std::string&);
707 #else
708  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
709  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
710 #endif
711 
712 #ifdef DOCUMENTATION
713 
718  const SgUnsignedList& get_raw_bytes() const;
719  void set_raw_bytes(const SgUnsignedList&);
721 #else
722  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
723  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
724 #endif
725 
726 #ifdef DOCUMENTATION
727 
736 #else
737  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
738  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
739 #endif
740 
741 #ifdef DOCUMENTATION
742  // FIXME[Robb P Matzke 2017-02-13]: unused?
743 #else
744  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
745  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
746 #endif
747 
748 #ifdef DOCUMENTATION
749 
755  int64_t get_stackDeltaIn() const;
756  void set_stackDeltaIn(int64_t);
758 #else
759  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
760  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
761 #endif
762 
763 #ifdef DOCUMENTATION
764  // FIXME[Robb P Matzke 2017-02-13]: unused?
765 #else
766  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
767  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
768 #endif
769 
770  DECLARE_OTHERS(AsmInstruction);
771 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
772 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
773  private:
774  friend class boost::serialization::access;
775 
776  template<class S>
777  void serialize(S &s, const unsigned version) {
778  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
779  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
780  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
781  s & BOOST_SERIALIZATION_NVP(p_operandList);
782  s & BOOST_SERIALIZATION_NVP(p_sources);
783  if (version >= 1)
784  s & BOOST_SERIALIZATION_NVP(semanticFailure_);
785  }
786 #endif
787 
788  private:
789  struct SemanticFailure {
790  size_t n;
791  SemanticFailure(): n(0) {}
792 
793 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
794  private:
795  friend class boost::serialization::access;
796  template<class S>
797  void serialize(S &s, const unsigned /*version*/) {
798  s & BOOST_SERIALIZATION_NVP(n);
799  }
800 #endif
801  };
802  SemanticFailure semanticFailure_;
803 
804  public:
809  static const int64_t INVALID_STACK_DELTA;
810 
816  virtual std::string description() const { return ""; }
817 
818  // FIXME[Robb P Matzke 2017-02-13]: unused?
819  void appendSources( SgAsmInstruction* instruction );
820 
822  size_t nOperands() const;
823 
827  SgAsmExpression* operand(size_t) const;
828 
835  virtual bool terminatesBasicBlock();
836 
850  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
851  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
863  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
864  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
870  bool isFirstInBlock();
871 
875  bool isLastInBlock();
876 
881  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
882 
1017  virtual bool hasEffect();
1018 
1027  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
1028  bool relax_stack_semantics=false);
1029 
1039  virtual std::vector<std::pair<size_t,size_t> >
1040  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
1041  bool relax_stack_semantics=false);
1042 
1049  virtual std::set<rose_addr_t> getSuccessors(bool* complete); /*subclasses must redefine*/
1050 
1059  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1060  bool *complete,
1061  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1063 
1069  virtual size_t get_size() const;
1070 
1076  virtual bool isUnknown() const;
1077 
1111  virtual unsigned get_anyKind() const;
1112 
1116  virtual std::string toString() const;
1117 
1122  virtual std::set<rose_addr_t> explicitConstants() const;
1123 
1133  size_t semanticFailure() const;
1134  void semanticFailure(size_t);
1135  void incrementSemanticFailure();
1138 #endif // SgAsmInstruction_OTHERS
1139 
1140 #ifdef DOCUMENTATION
1141  };
1142 #endif
1143 
1144 
1145 
1147 
1148  /**************************************************************************************************************************
1149  * Instruction Expressions
1150  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1151  **************************************************************************************************************************/
1152 
1154 
1155  DECLARE_LEAF_CLASS(AsmOperandList);
1156  IS_SERIALIZABLE(AsmOperandList);
1157 
1158 #ifdef DOCUMENTATION
1159 
1160  class SgAsmOperandList: public SgAsmNode {
1161  public:
1162 #endif
1163 
1164 #ifdef DOCUMENTATION
1165 
1171  const SgAsmExpressionPtrList& get_operands() const;
1172  void set_oerands(const SgAsmExpressionPtrList&);
1174 #else
1175  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1176  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1177 #endif
1178 
1179  DECLARE_OTHERS(AsmOperandList);
1180 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1181 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1182  private:
1183  friend class boost::serialization::access;
1184 
1185  template<class S>
1186  void serialize(S &s, const unsigned /*version*/) {
1187  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1188  s & BOOST_SERIALIZATION_NVP(p_operands);
1189  }
1190 #endif
1191 
1192  public:
1194  void append_operand(SgAsmExpression* operand);
1195 #endif // SgAsmOperandList_OTHERS
1196 
1197 #ifdef DOCUMENTATION
1198  };
1199 #endif
1200 
1201  // FIXME[Robb P Matzke 2016-10-31]
1202  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1203 
1205 
1206  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1207  IS_SERIALIZABLE(AsmBinaryAdd);
1208 
1209 #ifdef DOCUMENTATION
1210 
1212  public:
1213 #endif
1214 
1215  DECLARE_OTHERS(AsmBinaryAdd);
1216 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1217 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1218  private:
1219  friend class boost::serialization::access;
1220 
1221  template<class S>
1222  void serialize(S &s, const unsigned /*version*/) {
1223  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1224  }
1225 #endif
1226 #endif // SgAsmBinaryAdd_OTHERS
1227 
1228 #ifdef DOCUMENTATION
1229  };
1230 #endif
1231 
1233 
1234  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1235  IS_SERIALIZABLE(AsmBinarySubtract);
1236 
1237 #ifdef DOCUMENTATION
1238 
1240  public:
1241 #endif
1242 
1243  DECLARE_OTHERS(AsmBinarySubtract);
1244 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1245 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1246  private:
1247  friend class boost::serialization::access;
1248 
1249  template<class S>
1250  void serialize(S &s, const unsigned /*version*/) {
1251  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1252  }
1253 #endif
1254 #endif // SgAsmBinarySubtract_OTHERS
1255 
1256 #ifdef DOCUMENTATION
1257  };
1258 #endif
1259 
1261 
1262  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1263  IS_SERIALIZABLE(AsmBinaryMultiply);
1264 
1265 #ifdef DOCUMENTATION
1266 
1268  public:
1269 #endif
1270 
1271  DECLARE_OTHERS(AsmBinaryMultiply);
1272 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1273 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1274  private:
1275  friend class boost::serialization::access;
1276 
1277  template<class S>
1278  void serialize(S &s, const unsigned /*version*/) {
1279  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1280  }
1281 #endif
1282 #endif // SgAsmBinaryMultiply_OTHERS
1283 
1284 #ifdef DOCUMENTATION
1285  };
1286 #endif
1287 
1289 
1290  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1291  IS_SERIALIZABLE(AsmBinaryDivide);
1292 
1293 #ifdef DOCUMENTATION
1294 
1296  public:
1297 #endif
1298 
1299  DECLARE_OTHERS(AsmBinaryDivide);
1300 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1301 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1302  private:
1303  friend class boost::serialization::access;
1304 
1305  template<class S>
1306  void serialize(S &s, const unsigned /*version*/) {
1307  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1308  }
1309 #endif
1310 #endif // SgAsmBinaryDivide_OTHERS
1311 
1312 #ifdef DOCUMENTATION
1313  };
1314 #endif
1315 
1317 
1318  DECLARE_LEAF_CLASS(AsmBinaryMod);
1319  IS_SERIALIZABLE(AsmBinaryMod);
1320 
1321 #ifdef DOCUMENTATION
1322 
1324  public:
1325 #endif
1326 
1327  DECLARE_OTHERS(AsmBinaryMod);
1328 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1329 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1330  private:
1331  friend class boost::serialization::access;
1332 
1333  template<class S>
1334  void serialize(S &s, const unsigned /*version*/) {
1335  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1336  }
1337 #endif
1338 #endif // SgAsmBinaryMod_OTHERS
1339 
1340 #ifdef DOCUMENTATION
1341  };
1342 #endif
1343 
1345 
1346  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1347  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1348 
1349 #ifdef DOCUMENTATION
1350 
1352  public:
1353 #endif
1354 
1355  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1356 #if defined(SgAsmBinaryAddPreupdate_OTHERS) || defined(DOCUMENTATION)
1357 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1358  private:
1359  friend class boost::serialization::access;
1360 
1361  template<class S>
1362  void serialize(S &s, const unsigned /*version*/) {
1363  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1364  }
1365 #endif
1366 #endif // SgAsmBinaryAddPreupdate_OTHERS
1367 
1368 #ifdef DOCUMENTATION
1369  };
1370 #endif
1371 
1373 
1374  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1375  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1376 
1377 #ifdef DOCUMENTATION
1378 
1380  public:
1381 #endif
1382 
1383  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1384 #if defined(SgAsmBinarySubtractPreupdate_OTHERS) || defined(DOCUMENTATION)
1385 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1386  private:
1387  friend class boost::serialization::access;
1388 
1389  template<class S>
1390  void serialize(S &s, const unsigned /*version*/) {
1391  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1392  }
1393 #endif
1394 #endif // SgAsmBinarySubtractPreupdate_OTHERS
1395 
1396 #ifdef DOCUMENTATION
1397  };
1398 #endif
1399 
1401 
1402  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1403  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1404 
1405 #ifdef DOCUMENTATION
1406 
1408  public:
1409 #endif
1410 
1411  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1412 #if defined(SgAsmBinaryAddPostupdate_OTHERS) || defined(DOCUMENTATION)
1413 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1414  private:
1415  friend class boost::serialization::access;
1416 
1417  template<class S>
1418  void serialize(S &s, const unsigned /*version*/) {
1419  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1420  }
1421 #endif
1422 #endif // SgAsmBinaryAddPostupdate_OTHERS
1423 
1424 #ifdef DOCUMENTATION
1425  };
1426 #endif
1427 
1429 
1430  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1431  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1432 
1433 #ifdef DOCUMENTATION
1434 
1436  public:
1437 #endif
1438 
1439  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1440 #if defined(SgAsmBinarySubtractPostupdate_OTHERS) || defined(DOCUMENTATION)
1441 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1442  private:
1443  friend class boost::serialization::access;
1444 
1445  template<class S>
1446  void serialize(S &s, const unsigned /*version*/) {
1447  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1448  }
1449 #endif
1450 #endif // SgAsmBinarySubtractPostupdate_OTHERS
1451 
1452 #ifdef DOCUMENTATION
1453  };
1454 #endif
1455 
1457 
1458  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1459  IS_SERIALIZABLE(AsmBinaryLsl);
1460 
1461 #ifdef DOCUMENTATION
1462 
1464  public:
1465 #endif
1466 
1467  DECLARE_OTHERS(AsmBinaryLsl);
1468 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1469 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1470  private:
1471  friend class boost::serialization::access;
1472 
1473  template<class S>
1474  void serialize(S &s, const unsigned /*version*/) {
1475  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1476  }
1477 #endif
1478 #endif // SgAsmBinaryLsl_OTHERS
1479 
1480 #ifdef DOCUMENTATION
1481  };
1482 #endif
1483 
1485 
1486  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1487  IS_SERIALIZABLE(AsmBinaryLsr);
1488 
1489 #ifdef DOCUMENTATION
1490 
1492  public:
1493 #endif
1494 
1495  DECLARE_OTHERS(AsmBinaryLsr);
1496 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1497 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1498  private:
1499  friend class boost::serialization::access;
1500 
1501  template<class S>
1502  void serialize(S &s, const unsigned /*version*/) {
1503  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1504  }
1505 #endif
1506 #endif // SgAsmBinaryLsr_OTHERS
1507 
1508 #ifdef DOCUMENTATION
1509  };
1510 #endif
1511 
1513 
1514  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1515  IS_SERIALIZABLE(AsmBinaryAsr);
1516 
1517 #ifdef DOCUMENTATION
1518 
1520  public:
1521 #endif
1522 
1523  DECLARE_OTHERS(AsmBinaryAsr);
1524 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1525 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1526  private:
1527  friend class boost::serialization::access;
1528 
1529  template<class S>
1530  void serialize(S &s, const unsigned /*version*/) {
1531  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1532  }
1533 #endif
1534 #endif // SgAsmBinaryAsr_OTHERS
1535 
1536 #ifdef DOCUMENTATION
1537  };
1538 #endif
1539 
1541 
1542  DECLARE_LEAF_CLASS(AsmBinaryRor);
1543  IS_SERIALIZABLE(AsmBinaryRor);
1544 
1545 #ifdef DOCUMENTATION
1546 
1548  public:
1549 #endif
1550 
1551  DECLARE_OTHERS(AsmBinaryRor);
1552 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1553 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1554  private:
1555  friend class boost::serialization::access;
1556 
1557  template<class S>
1558  void serialize(S &s, const unsigned /*version*/) {
1559  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1560  }
1561 #endif
1562 #endif // SgAsmBinaryRor_OTHERS
1563 
1564 #ifdef DOCUMENTATION
1565  };
1566 #endif
1567 
1569 
1570  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1571  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1572  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1573  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1574  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1575  AsmBinaryRor,
1576  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1577  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1578  IS_SERIALIZABLE(AsmBinaryExpression);
1579 
1580 #ifdef DOCUMENTATION
1581 
1583  public:
1584 #endif
1585 
1586 #ifdef DOCUMENTATION
1587 
1590  SgAsmExpression* get_lhs() const;
1591  void set_lhs(SgAsmExpression*);
1593 #else
1594  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1595  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1596 #endif
1597 
1598 #ifdef DOCUMENTATION
1599 
1602  SgAsmExpression* get_rhs() const;
1603  void set_rhs(SgAsmExpression*);
1605 #else
1606  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1607  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1608 #endif
1609 
1610  DECLARE_OTHERS(AsmBinaryExpression);
1611 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1612 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1613  private:
1614  friend class boost::serialization::access;
1615 
1616  template<class S>
1617  void serialize(S &s, const unsigned /*version*/) {
1618  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1619  s & BOOST_SERIALIZATION_NVP(p_lhs);
1620  s & BOOST_SERIALIZATION_NVP(p_rhs);
1621  }
1622 #endif
1623 #endif // SgAsmBinaryExpression_OTHERS
1624 
1625 #ifdef DOCUMENTATION
1626  };
1627 #endif
1628 
1630 
1631  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1632  IS_SERIALIZABLE(AsmUnaryPlus);
1633 
1634 #ifdef DOCUMENTATION
1635 
1637  public:
1638 #endif
1639 
1640  DECLARE_OTHERS(AsmUnaryPlus);
1641 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1642 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1643  private:
1644  friend class boost::serialization::access;
1645 
1646  template<class S>
1647  void serialize(S &s, const unsigned /*version*/) {
1648  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1649  }
1650 #endif
1651 #endif // SgAsmUnaryPlus_OTHERS
1652 
1653 #ifdef DOCUMENTATION
1654  };
1655 #endif
1656 
1658 
1659  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1660  IS_SERIALIZABLE(AsmUnaryMinus);
1661 
1662 #ifdef DOCUMENTATION
1663 
1665  public:
1666 #endif
1667 
1668  DECLARE_OTHERS(AsmUnaryMinus);
1669 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1670 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1671  private:
1672  friend class boost::serialization::access;
1673 
1674  template<class S>
1675  void serialize(S &s, const unsigned /*version*/) {
1676  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1677  }
1678 #endif
1679 #endif // SgAsmUnaryMinus_OTHERS
1680 
1681 #ifdef DOCUMENTATION
1682  };
1683 #endif
1684 
1686 
1687  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1688  IS_SERIALIZABLE(AsmUnaryRrx);
1689 
1690 #ifdef DOCUMENTATION
1691  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1693  public:
1694 #endif
1695 
1696  DECLARE_OTHERS(AsmUnaryRrx);
1697 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1698 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1699  private:
1700  friend class boost::serialization::access;
1701 
1702  template<class S>
1703  void serialize(S &s, const unsigned /*version*/) {
1704  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1705  }
1706 #endif
1707 #endif // SgAsmUnaryRrx_OTHERS
1708 
1709 #ifdef DOCUMENTATION
1710  };
1711 #endif
1712 
1714 
1715  DECLARE_LEAF_CLASS(AsmUnaryArmSpecialRegisterList);
1716  IS_SERIALIZABLE(AsmUnaryArmSpecialRegisterList);
1717 
1718 #ifdef DOCUMENTATION
1719  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1721  public:
1722 #endif
1723 
1724  DECLARE_OTHERS(AsmUnaryArmSpecialRegisterList);
1725 #if defined(SgAsmUnaryArmSpecialRegisterList_OTHERS) || defined(DOCUMENTATION)
1726 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1727  private:
1728  friend class boost::serialization::access;
1729 
1730  template<class S>
1731  void serialize(S &s, const unsigned /*version*/) {
1732  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1733  }
1734 #endif
1735 #endif // SgAsmUnaryArmSpecialRegisterList_OTHERS
1736 
1737 #ifdef DOCUMENTATION
1738  };
1739 #endif
1740 
1742 
1743  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
1744  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryArmSpecialRegisterList,
1745  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
1746  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1747  IS_SERIALIZABLE(AsmUnaryExpression);
1748 
1749 #ifdef DOCUMENTATION
1750 
1752  public:
1753 #endif
1754 
1755 #ifdef DOCUMENTATION
1756 
1759  SgAsmExpression* get_operand() const;
1762 #else
1763  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
1764  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1765 #endif
1766 
1767  DECLARE_OTHERS(AsmUnaryExpression);
1768 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
1769 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1770  private:
1771  friend class boost::serialization::access;
1772 
1773  template<class S>
1774  void serialize(S &s, const unsigned /*version*/) {
1775  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1776  s & BOOST_SERIALIZATION_NVP(p_operand);
1777  }
1778 #endif
1779 #endif // SgAsmUnaryExpression_OTHERS
1780 
1781 #ifdef DOCUMENTATION
1782  };
1783 #endif
1784 
1786 
1787  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
1788  IS_SERIALIZABLE(AsmDirectRegisterExpression);
1789 
1790 #ifdef DOCUMENTATION
1791 
1793  public:
1794 #endif
1795 
1796 #ifdef DOCUMENTATION
1797 
1800  unsigned get_psr_mask() const;
1801  void set_psr_mask(unsigned);
1803 #else
1804  AsmDirectRegisterExpression.setDataPrototype("unsigned", "psr_mask", "=0", // for ARM
1805  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1806  NO_DELETE);
1807 #endif
1808 
1809  DECLARE_OTHERS(AsmDirectRegisterExpression);
1810 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1811 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1812  private:
1813  friend class boost::serialization::access;
1814 
1815  template<class S>
1816  void serialize(S &s, const unsigned /*version*/) {
1817  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1818  s & BOOST_SERIALIZATION_NVP(p_psr_mask);
1819  }
1820 #endif
1821 
1822  private:
1823  // Default c'tor needed for serialization
1825  : p_psr_mask(0) {}
1826 #endif // SgAsmDirectRegisterExpression_OTHERS
1827 
1828 #ifdef DOCUMENTATION
1829  };
1830 #endif
1831 
1833 
1834  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
1835  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
1836 
1837 #ifdef DOCUMENTATION
1838 
1855  public:
1856 #endif
1857 
1858 #ifdef DOCUMENTATION
1859 
1867 #else
1868  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "stride", "",
1869  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1870 #endif
1871 
1872 #ifdef DOCUMENTATION
1873 
1881 #else
1882  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "offset", "",
1883  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1884 #endif
1885 
1886 #ifdef DOCUMENTATION
1887 
1892  size_t get_index() const;
1893  void set_index(size_t);
1895 #else
1896  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
1897  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1898 #endif
1899 
1900 #ifdef DOCUMENTATION
1901 
1906  size_t get_modulus() const;
1907  void set_modulus(size_t);
1909 #else
1910  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
1911  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1912 #endif
1913 
1914  DECLARE_OTHERS(AsmIndirectRegisterExpression);
1915 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1916 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1917  private:
1918  friend class boost::serialization::access;
1919 
1920  template<class S>
1921  void serialize(S &s, const unsigned /*version*/) {
1922  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1923  s & BOOST_SERIALIZATION_NVP(p_stride);
1924  s & BOOST_SERIALIZATION_NVP(p_offset);
1925  s & BOOST_SERIALIZATION_NVP(p_index);
1926  s & BOOST_SERIALIZATION_NVP(p_modulus);
1927  }
1928 #endif
1929 
1930  private:
1931  // Default c'tor needed for serialization
1933  : p_index(0), p_modulus(0) {}
1934 #endif // SgAsmIndirectRegisterExpression_OTHERS
1935 
1936 #ifdef DOCUMENTATION
1937  };
1938 #endif
1939 
1941 
1942  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
1943  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
1944  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
1945  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
1946 
1947 #ifdef DOCUMENTATION
1948 
1950  public:
1951 #endif
1952 
1953 #ifdef DOCUMENTATION
1954 
1960 #else
1961  AsmRegisterReferenceExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "descriptor", "",
1962  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1963 #endif
1964 
1965 #ifdef DOCUMENTATION
1966 
1971  int get_adjustment() const;
1972  void set_adjustment(int);
1974 #else
1975  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
1976  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1977  NO_DELETE);
1978 #endif
1979 
1980  DECLARE_OTHERS(AsmRegisterReferenceExpression);
1981 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
1982 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1983  private:
1984  friend class boost::serialization::access;
1985 
1986  template<class S>
1987  void serialize(S &s, const unsigned /*version*/) {
1988  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1989  s & BOOST_SERIALIZATION_NVP(p_descriptor);
1990  s & BOOST_SERIALIZATION_NVP(p_adjustment);
1991  }
1992 #endif
1993 
1994  protected:
1995  // Default c'tor needed for serialization
1997  : p_adjustment(0) {}
1998 #endif // SgAsmRegisterReferenceExpression_OTHERS
1999 
2000 #ifdef DOCUMENTATION
2001  };
2002 #endif
2003 
2005 
2006  DECLARE_LEAF_CLASS(AsmRegisterNames);
2007  IS_SERIALIZABLE(AsmRegisterNames);
2008 
2009 #ifdef DOCUMENTATION
2010 
2012  public:
2013 #endif
2014 
2015 #ifdef DOCUMENTATION
2016 
2022  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
2023  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
2025 #else
2026  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
2027  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2028 #endif
2029 
2030 #ifdef DOCUMENTATION
2031 
2037  unsigned get_mask() const;
2038  void set_mask(unsigned);
2040 #else
2041  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
2042  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2043 #endif
2044 
2045  DECLARE_OTHERS(AsmRegisterNames);
2046 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
2047 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2048  private:
2049  friend class boost::serialization::access;
2050 
2051  template<class S>
2052  void serialize(S &s, const unsigned /*version*/) {
2053  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2054  s & BOOST_SERIALIZATION_NVP(p_registers);
2055  s & BOOST_SERIALIZATION_NVP(p_mask);
2056  }
2057 #endif
2058 #endif // SgAsmRegisterNames_OTHERS
2059 
2060 #ifdef DOCUMENTATION
2061  };
2062 #endif
2063 
2065 
2066  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2067  IS_SERIALIZABLE(AsmIntegerValueExpression);
2068 
2069 #ifdef DOCUMENTATION
2070 
2086  public:
2087 #endif
2088 
2089 #ifdef DOCUMENTATION
2090 
2100  SgNode* get_baseNode() const;
2101  void set_baseNode(SgNode*);
2103 #else
2104  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2105  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2106 #endif
2107 
2108  DECLARE_OTHERS(AsmIntegerValueExpression);
2109 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2110 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2111  private:
2112  friend class boost::serialization::access;
2113 
2114  template<class S>
2115  void serialize(S &s, const unsigned /*version*/) {
2116  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2117  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2118  }
2119 #endif
2120 
2121  public:
2126  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2127 
2134 
2136  static uint64_t virtualAddress(SgNode*);
2137 
2157  std::string get_label(bool quiet=false) const;
2158 
2160  size_t get_significantBits() const;
2161 
2167  void makeRelativeTo(SgNode *baseNode);
2168 
2173  uint64_t get_baseAddress() const;
2174 
2180  uint64_t get_absoluteValue(size_t nbits=0) const;
2181 
2185  void set_absoluteValue(uint64_t);
2186 
2188  int64_t get_signedValue() const;
2189 
2193  int64_t get_relativeValue() const;
2194 
2199  void set_relativeValue(int64_t v, size_t nbits=64);
2200 
2201  uint64_t get_value() const { return get_absoluteValue(); }
2202 
2203 #endif // SgAsmIntegerValueExpression_OTHERS
2204 
2205 #ifdef DOCUMENTATION
2206  };
2207 #endif
2208 
2210 
2211  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2212  IS_SERIALIZABLE(AsmFloatValueExpression);
2213 
2214 #ifdef DOCUMENTATION
2215 
2220  public:
2221 #endif
2222 
2223  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2224 
2225  DECLARE_OTHERS(AsmFloatValueExpression);
2226 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2227  private:
2228  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2229  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2230  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2231  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2232  // understand "mutable".
2233  mutable double p_nativeValue;
2234  mutable bool p_nativeValueIsValid;
2235 
2236 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2237  private:
2238  friend class boost::serialization::access;
2239 
2240  template<class S>
2241  void serialize(S &s, const unsigned /*version*/) {
2242  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2243  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2244  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2245  }
2246 #endif
2247 
2248  public:
2253  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2254 
2260  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2261 
2268 
2270  void set_nativeValue(double);
2271 
2273  double get_nativeValue() const;
2274 
2279  void updateBitVector();
2280 
2285  void updateNativeValue() const;
2286 #endif // SgAsmFloatValueExpression_OTHERS
2287 
2288 #ifdef DOCUMENTATION
2289  };
2290 #endif
2291 
2293 
2294  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2295  AsmIntegerValueExpression | AsmFloatValueExpression,
2296  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2297  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2298  IS_SERIALIZABLE(AsmConstantExpression);
2299 
2300  DECLARE_HEADERS(AsmConstantExpression);
2301 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2302  #include <Sawyer/BitVector.h>
2303 #endif // SgAsmConstantExpression_HEADERS
2304 
2305 #ifdef DOCUMENTATION
2306 
2311  public:
2312 #endif
2313 
2314 #ifndef DOCUMENTATION
2315  // Documented below. Implemented below due to ROSETTA limitations.
2316  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2317  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2318 #endif
2319 
2320  DECLARE_OTHERS(AsmConstantExpression);
2321 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2322 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2323  private:
2324  friend class boost::serialization::access;
2325 
2326  template<class S>
2327  void serialize(S &s, const unsigned /*version*/) {
2328  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2329  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2330  }
2331 #endif
2332 
2333  public:
2339  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2340  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2341  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2343 #endif // SgAsmConstantExpression_OTHERS
2344 
2345 #ifdef DOCUMENTATION
2346  };
2347 #endif
2348 
2350 
2351  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2352  AsmConstantExpression,
2353  "AsmValueExpression", "AsmValueExpressionTag", false);
2354  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2355  IS_SERIALIZABLE(AsmValueExpression);
2356 
2357 #ifdef DOCUMENTATION
2358 
2366  public:
2367 #endif
2368 
2369 #ifdef DOCUMENTATION
2370 
2380 #else
2381  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
2382  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2383 #endif
2384 
2385 #ifdef DOCUMENTATION
2386 
2394  unsigned short get_bit_offset() const;
2395  void set_bit_offset(unsigned short);
2397 #else
2398  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
2399  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2400 #endif
2401 
2402 #ifdef DOCUMENTATION
2403 
2409  unsigned short get_bit_size() const;
2410  void set_bit_size(unsigned short);
2412 #else
2413  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
2414  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2415 #endif
2416 
2417 #ifdef DOCUMENTATION
2418 
2424  SgSymbol* get_symbol() const;
2425  void set_symbol(SgSymbol*);
2427 #else
2428  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
2429  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2430 #endif
2431 
2432  DECLARE_OTHERS(AsmValueExpression);
2433 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
2434 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2435  private:
2436  friend class boost::serialization::access;
2437 
2438  template<class S>
2439  void serialize(S &s, const unsigned /*version*/) {
2440  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2441  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
2442  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
2443  s & BOOST_SERIALIZATION_NVP(p_bit_size);
2444 #if 1
2445  ASSERT_require2(p_symbol == NULL, "not implemented yet");
2446 #else
2447  s & BOOST_SERIALIZATION_NVP(p_symbol);
2448 #endif
2449  }
2450 #endif
2451 #endif // SgAsmValueExpression_OTHERS
2452 
2453 #ifdef DOCUMENTATION
2454  };
2455 #endif
2456 
2458 
2459  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
2460  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
2461 
2462 #ifdef DOCUMENTATION
2463 
2465  public:
2466 #endif
2467 
2468 #ifdef DOCUMENTATION
2469 
2476  SgAsmExpression* get_address() const;
2479 #else
2480  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
2481  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2482 #endif
2483 
2484 #ifdef DOCUMENTATION
2485 
2492  SgAsmExpression* get_segment() const;
2495 #else
2496  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
2497  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2498 #endif
2499 
2500  DECLARE_OTHERS(AsmMemoryReferenceExpression);
2501 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2502 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2503  private:
2504  friend class boost::serialization::access;
2505 
2506  template<class S>
2507  void serialize(S &s, const unsigned /*version*/) {
2508  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2509  s & BOOST_SERIALIZATION_NVP(p_address);
2510  s & BOOST_SERIALIZATION_NVP(p_segment);
2511  }
2512 #endif
2513 #endif // SgAsmMemoryReferenceExpression_OTHERS
2514 
2515 #ifdef DOCUMENTATION
2516  };
2517 #endif
2518 
2520 
2521  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
2522  IS_SERIALIZABLE(AsmControlFlagsExpression);
2523 
2524 #ifdef DOCUMENTATION
2525  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2527  public:
2528 #endif
2529 
2530 #ifndef DOCUMENTATION
2531  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
2532  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2533 #endif
2534 
2535  DECLARE_OTHERS(AsmControlFlagsExpression);
2536 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
2537 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2538  private:
2539  friend class boost::serialization::access;
2540 
2541  template<class S>
2542  void serialize(S &s, const unsigned /*version*/) {
2543  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2544  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
2545  }
2546 #endif
2547 #endif // SgAsmControlFlagsExpression_OTHERS
2548 
2549 #ifdef DOCUMENTATION
2550  };
2551 #endif
2552 
2554 
2555  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
2556  IS_SERIALIZABLE(AsmCommonSubExpression);
2557 
2558 #ifdef DOCUMENTATION
2559  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2561  public:
2562 #endif
2563 
2564 #ifndef DOCUMENTATION
2565  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
2566  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2567 #endif
2568 
2569  DECLARE_OTHERS(AsmCommonSubExpression);
2570 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
2571 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2572  private:
2573  friend class boost::serialization::access;
2574 
2575  template<class S>
2576  void serialize(S &s, const unsigned /*version*/) {
2577  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2578  s & BOOST_SERIALIZATION_NVP(p_subexpression);
2579  }
2580 #endif
2581 #endif // SgAsmCommonSubExpression_OTHERS
2582 
2583 #ifdef DOCUMENTATION
2584  };
2585 #endif
2586 
2588 
2589  DECLARE_LEAF_CLASS(AsmRiscOperation);
2590  IS_SERIALIZABLE(AsmRiscOperation);
2591 
2592 #ifdef DOCUMENTATION
2593 
2602  public:
2603 #endif
2604 
2605 #ifdef DOCUMENTATION
2606 
2615 #else
2616  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
2617  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
2618 #endif
2619 
2620 #ifdef DOCUMENTATION
2621 
2627  SgAsmExprListExp* get_operands() const;
2630 #else
2631  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
2632  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2633 #endif
2634 
2635  DECLARE_OTHERS(AsmRiscOperation);
2636 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
2637  public:
2644  OP_NONE,
2645  OP_bottom,
2646  OP_undefined,
2647  OP_unspecified,
2648  OP_filterCallTarget,
2649  OP_filterReturnTarget,
2650  OP_filterIndirectJumpTarget,
2651  OP_hlt,
2652  OP_cpuid,
2653  OP_rdtsc,
2654  OP_and_,
2655  OP_or_,
2656  OP_xor_,
2657  OP_invert,
2658  OP_extract,
2659  OP_concat,
2660  OP_leastSignificantSetBit,
2661  OP_mostSignificantSetBit,
2662  OP_rotateLeft,
2663  OP_rotateRight,
2664  OP_shiftLeft,
2665  OP_shiftRight,
2666  OP_shiftRightArithmetic,
2667  OP_equalToZero,
2668  OP_ite,
2669  OP_isEqual,
2670  OP_isNotEqual,
2671  OP_isUnsignedLessThan,
2672  OP_isUnsignedLessThanOrEqual,
2673  OP_isUnsignedGreaterThan,
2674  OP_isUnsignedGreaterThanOrEqual,
2675  OP_isSignedLessThan,
2676  OP_isSignedLessThanOrEqual,
2677  OP_isSignedGreaterThan,
2678  OP_isSignedGreaterThanOrEqual,
2679  OP_unsignedExtend,
2680  OP_signExtend,
2683  OP_subtract,
2684  OP_negate,
2685  OP_signedDivide,
2686  OP_signedModulo,
2687  OP_signedMultiply,
2688  OP_unsignedDivide,
2689  OP_unsignedModulo,
2690  OP_unsignedMultiply,
2691  OP_interrupt,
2692  OP_readRegister,
2693  OP_peekRegister,
2694  OP_writeRegister,
2696  OP_peekMemory,
2698  OP_N_OPERATORS // MUST BE LAST!
2699  };
2700 
2701 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2702  private:
2703  friend class boost::serialization::access;
2704 
2705  template<class S>
2706  void serialize(S &s, const unsigned /*version*/) {
2707  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2708  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
2709  s & BOOST_SERIALIZATION_NVP(p_operands);
2710  }
2711 #endif
2712 #endif // SgAsmRiscOperation_OTHERS
2713 
2714 #ifdef DOCUMENTATION
2715  };
2716 #endif
2717 
2719 
2720  DECLARE_LEAF_CLASS(AsmExprListExp);
2721  IS_SERIALIZABLE(AsmExprListExp);
2722 
2723 #ifdef DOCUMENTATION
2724 
2726  public:
2727 #endif
2728 
2729 #ifdef DOCUMENTATION
2730 
2736  const SgAsmExpressionPtrList& get_expressions() const;
2737  void set_expressions(const SgAsmExpressionPtrList&);
2739 #else
2740  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
2741  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2742 #endif
2743 
2744  DECLARE_OTHERS(AsmExprListExp);
2745 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
2746 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2747  private:
2748  friend class boost::serialization::access;
2749 
2750  template<class S>
2751  void serialize(S &s, const unsigned /*version*/) {
2752  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2753  s & BOOST_SERIALIZATION_NVP(p_expressions);
2754  }
2755 #endif
2756 #endif // SgAsmExprListExp_OTHERS
2757 
2758 #ifdef DOCUMENTATION
2759  };
2760 #endif
2761 
2763 
2764  NEW_NONTERMINAL_MACRO(AsmExpression,
2765  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
2766  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
2767  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
2768  AsmRiscOperation,
2769  "AsmExpression", "AsmExpressionTag", false);
2770  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
2771  IS_SERIALIZABLE(AsmExpression);
2772 
2773 #ifdef DOCUMENTATION
2774 
2775  class SgAsmExpression: public SgAsmNode {
2776  public:
2777 #endif
2778 
2779 #ifdef DOCUMENTATION
2780 
2785  SgAsmType* get_type() const;
2786  void set_type(SgAsmType*);
2788 #else
2789  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
2790  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2791 #endif
2792 
2793 #ifdef DOCUMENTATION
2794 
2799  const std::string& get_comment() const;
2800  void set_comment(const std::string&);
2802 #else
2803  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
2804  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2805 #endif
2806 
2807  DECLARE_OTHERS(AsmExpression);
2808 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
2809 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2810  private:
2811  friend class boost::serialization::access;
2812 
2813  template<class S>
2814  void serialize(S &s, const unsigned /*version*/) {
2815  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
2816  s & BOOST_SERIALIZATION_NVP(p_type);
2817  s & BOOST_SERIALIZATION_NVP(p_comment);
2818  }
2819 #endif
2820 
2821  public:
2825  size_t get_nBits() const;
2826 
2832 
2838 
2839 #endif // SgAsmExpression_OTHERS
2840 
2841 #ifdef DOCUMENTATION
2842  };
2843 #endif
2844 
2845 
2846 
2847 
2849 
2850  /***************************************************************************************************************************
2851  * Data Types (new interface 2014-07)
2852  *
2853  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
2854  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
2855  * 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
2856  * don't allow types to be modified after they're created.
2857  ***************************************************************************************************************************/
2858 
2860 
2861  DECLARE_LEAF_CLASS(AsmIntegerType);
2862  IS_SERIALIZABLE(AsmIntegerType);
2863 
2864 #ifdef DOCUMENTATION
2865 
2867  public:
2868 #endif
2869 
2870 #ifndef DOCUMENTATION
2871  // Documented below due to ROSETTA limitations
2872  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
2873  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2874 #endif
2875 
2876  DECLARE_OTHERS(AsmIntegerType);
2877 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
2878 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2879  private:
2880  friend class boost::serialization::access;
2881 
2882  template<class S>
2883  void serialize(S &s, const unsigned /*version*/) {
2884  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2885  s & BOOST_SERIALIZATION_NVP(p_isSigned);
2886  }
2887 #endif
2888 
2889  public:
2893  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
2894 
2898  bool get_isSigned() const;
2899 
2900  // Overrides documented in base class
2901  virtual void check() const $ROSE_OVERRIDE;
2902  virtual std::string toString() const $ROSE_OVERRIDE;
2903 #endif // SgAsmIntegerType_OTHERS
2904 
2905 #ifdef DOCUMENTATION
2906  };
2907 #endif
2908 
2910 
2911  DECLARE_LEAF_CLASS(AsmFloatType);
2912  IS_SERIALIZABLE(AsmFloatType);
2913 
2914  DECLARE_HEADERS(AsmFloatType);
2915 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
2916  #include <Sawyer/BitVector.h>
2917 #endif // SgAsmFloatType_HEADERS
2918 
2919 #ifdef DOCUMENTATION
2920 
2922  public:
2923 #endif
2924 
2925 #ifndef DOCUMENTATION
2926  // Documented below because of ROSETTA limitations (they're read-only)
2927  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
2928  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2929  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
2930  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2931  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
2932  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2933  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
2934  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2935  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
2936  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2937  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
2938  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2939  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
2940  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2941 #endif
2942 
2943  DECLARE_OTHERS(AsmFloatType);
2944 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
2945 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2946  private:
2947  friend class boost::serialization::access;
2948 
2949  template<class S>
2950  void serialize(S &s, const unsigned /*version*/) {
2951  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2952  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
2953  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
2954  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
2955  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
2956  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
2957  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
2958  s & BOOST_SERIALIZATION_NVP(p_flags);
2959  }
2960 #endif
2961 
2962  public:
2963  enum {
2964  GRADUAL_UNDERFLOW = 0x00000001,
2965  NORMALIZED_SIGNIFICAND = 0x00000002
2966  };
2967 
2969 
2971  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
2972  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
2973  uint64_t exponentBias, unsigned flags);
2974 
2976  BitRange significandBits() const;
2977 
2979  BitRange exponentBits() const;
2980 
2982  size_t signBit() const;
2983 
2985  uint64_t exponentBias() const;
2986 
2988  unsigned flags() const;
2989 
2991  bool gradualUnderflow() const;
2992 
2994  bool normalizedSignificand() const;
2995 
2996  // Overrides documented in base class
2997  virtual void check() const $ROSE_OVERRIDE;
2998  virtual std::string toString() const $ROSE_OVERRIDE;
2999 #endif // SgAsmFloatType_OTHERS
3000 
3001 #ifdef DOCUMENTATION
3002  };
3003 #endif
3004 
3006 
3007  NEW_NONTERMINAL_MACRO(AsmScalarType,
3008  AsmIntegerType | AsmFloatType,
3009  "AsmScalarType", "AsmScalarTypeTag", false);
3010  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
3011  IS_SERIALIZABLE(AsmScalarType);
3012 
3013 #ifdef DOCUMENTATION
3014 
3015  class SgAsmScalarType: public SgAsmType {
3016  public:
3017 #endif
3018 
3019 #ifndef DOCUMENTATION
3020  // Documented below due to ROSETTA limitations (read-only)
3021  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3022  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3023  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3024  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3025  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
3026  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3027  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
3028  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3029 #endif
3030 
3031  DECLARE_OTHERS(AsmScalarType);
3032 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
3033 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3034  private:
3035  friend class boost::serialization::access;
3036 
3037  template<class S>
3038  void serialize(S &s, const unsigned /*version*/) {
3039  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3040  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
3041  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
3042  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
3043  s & BOOST_SERIALIZATION_NVP(p_nBits);
3044  }
3045 #endif
3046 
3047  protected:
3052  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
3053 
3054  public:
3056  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3057 
3059  ByteOrder::Endianness get_minorOrder() const;
3060 
3062  ByteOrder::Endianness get_majorOrder() const;
3063 
3065  size_t get_majorNBytes() const;
3066 
3067  // Overrides documented in base class
3068  virtual void check() const $ROSE_OVERRIDE;
3069  virtual std::string toString() const $ROSE_OVERRIDE;
3070 #endif // SgAsmScalarType_OTHERS
3071 
3072 #ifdef DOCUMENTATION
3073  };
3074 #endif
3075 
3077 
3078  DECLARE_LEAF_CLASS(AsmVectorType);
3079  IS_SERIALIZABLE(AsmVectorType);
3080 
3081 #ifdef DOCUMENTATION
3082 
3083  class SgAsmVectorType: public SgAsmType {
3084  public:
3085 #endif
3086 
3087 #ifndef DOCUMENTATION
3088  // Documented below due to ROSETTA limitations (read-only)
3089  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3090  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3091  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3092  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3093 #endif
3094 
3095  DECLARE_OTHERS(AsmVectorType);
3096 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3097 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3098  private:
3099  friend class boost::serialization::access;
3100 
3101  template<class S>
3102  void serialize(S &s, const unsigned /*version*/) {
3103  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3104  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3105  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3106  }
3107 #endif
3108 
3109  public:
3111  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3112 
3114  size_t get_nElmts() const;
3115 
3117  SgAsmType* get_elmtType() const;
3118 
3119  // Overrides documented in base class
3120  virtual void check() const $ROSE_OVERRIDE;
3121  virtual std::string toString() const $ROSE_OVERRIDE;
3122  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3123 #endif // SgAsmVectorType_OTHERS
3124 
3125 #ifdef DOCUMENTATION
3126  };
3127 #endif
3128 
3130 
3131  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3132  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3133  IS_SERIALIZABLE(AsmType);
3134 
3135 #ifdef DOCUMENTATION
3136 
3137  class SgAsmType: public SgAsmNode {
3138  public:
3139 #endif
3140 
3141  DECLARE_OTHERS(AsmType);
3142 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3143  private:
3145 
3146 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3147  private:
3148  friend class boost::serialization::access;
3149 
3150  template<class S>
3151  void serialize(S &s, const unsigned /*version*/) {
3152  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3153  }
3154 #endif
3155 
3156  public:
3164  virtual void check() const;
3165 
3171  virtual std::string toString() const {
3172  abort(); // ROSETTA limitation: intended pure virtual
3173  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3174  }
3175 
3177  virtual size_t get_nBits() const {
3178  abort(); // ROSETTA limitation: intended pure virtual
3179  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3180  }
3181 
3183  virtual size_t get_nBytes() const;
3184 
3190  template<class Type> // Type is a subclass of SgAsmType
3191  static Type* registerOrDelete(Type *toInsert) {
3192  ASSERT_not_null(toInsert);
3193  std::string key = toInsert->toString();
3194  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3195  ASSERT_not_null(retval);
3196  if (retval!=toInsert)
3197  delete toInsert;
3198  return retval;
3199  }
3200 #endif // SgAsmType_OTHERS
3201 
3202 #ifdef DOCUMENTATION
3203  };
3204 #endif
3205 
3206 
3207 
3209 
3210  /**************************************************************************************************************************
3211  * Collections of Instructions
3212  **************************************************************************************************************************/
3213 
3215 
3216  DECLARE_LEAF_CLASS(AsmFunction);
3217  IS_SERIALIZABLE(AsmFunction);
3218 
3219 #ifdef DOCUMENTATION
3220 
3236  public:
3237 #endif
3238 
3239 #ifdef DOCUMENTATION
3240 
3245  const std::string& get_name() const;
3246  void set_name(const std::string&);
3248 #else
3249  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3250  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3251 #endif
3252 
3253 #ifdef DOCUMENTATION
3254 
3260  unsigned get_reason() const;
3261  void set_reason(unsigned);
3263 #else
3264  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3265  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3266 #endif
3267 
3268 #ifdef DOCUMENTATION
3269 
3276  const std::string& get_reasonComment() const;
3277  void set_reasonComment(const std::string&);
3279 #else
3280  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
3281  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3282 #endif
3283 
3284 #ifdef DOCUMENTATION
3285 
3293 #else
3294  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3295  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3296 #endif
3297 
3298 #ifdef DOCUMENTATION
3299 
3302  MayReturn get_may_return() const;
3303  void set_may_return(MayReturn);
3305 #else
3306  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3307  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3308 #endif
3309 
3310 #ifdef DOCUMENTATION
3311 
3316  const std::string& get_name_md5() const;
3317  void set_name_md5(const std::string&);
3319 #else
3320  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3321  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3322 #endif
3323 
3324 #ifdef DOCUMENTATION
3325 
3330  const SgAsmStatementPtrList& get_statementList() const;
3331  void set_statementList(const SgAsmStatementPtrList&);
3333 #else
3334  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3335  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3336 #endif
3337 
3338 #ifdef DOCUMENTATION
3339  // FIXME[Robb P Matzke 2017-02-13]: unused?
3340 #else
3341  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3342  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3343 #endif
3344 
3345 #ifdef DOCUMENTATION
3346 
3352  rose_addr_t get_entry_va() const;
3353  void set_entry_va(rose_addr_t);
3355 #else
3356  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3357  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3358 #endif
3359 
3360 #ifdef DOCUMENTATION
3361 
3370 #else
3371  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3372  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3373 #endif
3374 
3375 #ifdef DOCUMENTATION
3376  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3377 #else
3378  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3379  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3380 #endif
3381 
3382 #ifdef DOCUMENTATION
3383 
3392  int64_t get_stackDelta() const;
3393  void set_stackDelta(int64_t);
3395 #else
3396  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3397  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3398 #endif
3399 
3400 #ifdef DOCUMENTATION
3401 
3409  const std::string& get_callingConvention() const;
3410  void set_callingConvention(const std::string&);
3412 #else
3413  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3414  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3415 #endif
3416 
3417  DECLARE_OTHERS(AsmFunction);
3418 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3419 
3420 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3421  private:
3422  friend class boost::serialization::access;
3423 
3424  template<class S>
3425  void serialize(S &s, const unsigned /*version*/) {
3426  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3427  s & BOOST_SERIALIZATION_NVP(p_name);
3428  s & BOOST_SERIALIZATION_NVP(p_reason);
3429  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
3430  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3431  s & BOOST_SERIALIZATION_NVP(p_may_return);
3432  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3433  s & BOOST_SERIALIZATION_NVP(p_statementList);
3434  s & BOOST_SERIALIZATION_NVP(p_dest);
3435  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3436  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3437  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3438  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3439  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3440  }
3441 #endif
3442 
3443  public:
3446 
3450  void remove_statement(SgAsmStatement* statement);
3451 
3456  SgAsmBlock* get_entry_block() const;
3457 
3459  enum MayReturn {
3464  };
3465 
3470  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3471  // Also fix SgAsmFunction::reason_key()
3472  FUNC_NONE = 0x00000000,
3473  FUNC_THUNK_TARGET= 0x00004000,
3475  = 0x00008000,
3476  FUNC_ENTRY_POINT = 0x00010000,
3477  FUNC_CALL_TARGET = 0x00020000,
3480  FUNC_CALL_INSN = 0x00040000,
3486  FUNC_EH_FRAME = 0x00080000,
3487  FUNC_SYMBOL = 0x00100000,
3488  FUNC_PATTERN = 0x00200000,
3493  FUNC_GRAPH = 0x00400000,
3497  FUNC_USERDEF = 0x00800000,
3498  FUNC_PADDING = 0x01000000,
3503  FUNC_DISCONT = 0x02000000,
3506  FUNC_INSNHEAD = 0x04000000,
3507  FUNC_IMPORT = 0x08000000,
3510  FUNC_LEFTOVERS = 0x10000000,
3514  FUNC_INTRABLOCK = 0x20000000,
3522  FUNC_THUNK = 0x40000000,
3531  FUNC_EXPORT = 0x80000000,
3533  FUNC_DEFAULT = 0xefff80ff,
3535  /*========= Miscellaneous Reasons ===========================================================================
3536  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3537  * availalble for users to use as they see fit. */
3538  FUNC_MISCMASK = 0x000000ff,
3553  };
3554 
3558  static std::string reason_key(const std::string &prefix="");
3559 
3561  std::string reason_str(bool pad) const;
3562 
3566  static std::string reason_str(bool pad, unsigned reason);
3567 
3570  public:
3571  virtual ~NodeSelector() {}
3572  virtual bool operator()(SgNode*) = 0;
3573  };
3574 
3614  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
3615  NodeSelector *selector=NULL);
3616 
3622  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
3623 
3626  e_unknown = 0,
3627  e_standard = 1,
3628  e_library = 2,
3629  e_imported = 3,
3630  e_thunk = 4,
3631  e_last
3632  };
3633 #endif // SgAsmFunction_OTHERS
3634 
3635 
3636 #ifdef DOCUMENTATION
3637  };
3638 #endif
3639 
3640 
3642 
3643  DECLARE_LEAF_CLASS(AsmBlock);
3644  IS_SERIALIZABLE(AsmBlock);
3645 
3646 #ifdef DOCUMENTATION
3647 
3667  class SgAsmBlock: public SgAsmStatement {
3668  public:
3669 #endif
3670 
3671 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3672  // [tps 05Apr07] needed for the control_flow_graph
3673  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
3674  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3675 #endif
3676 
3677 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3678  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
3679  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3680 #endif
3681 
3682 #ifdef DOCUMENTATION
3683 
3688  rose_addr_t get_id() const;
3689  void set_id(rose_addr_t);
3691 #else
3692  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
3693  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3694 #endif
3695 
3696 #ifdef DOCUMENTATION
3697 
3702  unsigned get_reason() const;
3703  void set_reason(unsigned);
3705 #else
3706  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
3707  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3708 #endif
3709 
3710 #ifdef DOCUMENTATION
3711  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3712  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3713  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3714  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3721  const SgAsmStatementPtrList& get_statementList() const;
3722  void set_statementList(const SgAsmStatementPtrList&);
3724 #else
3725  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3726  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3727 #endif
3728 
3729 #ifdef DOCUMENTATION
3730  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3731  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3732  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3733  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3741  const SgAsmIntegerValuePtrList& get_successors() const;
3742  void set_successors(const SgAsmIntegerValuePtrList&);
3744 #else
3745  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
3746  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3747 #endif
3748 
3749 #ifdef DOCUMENTATION
3750 
3760  bool get_successors_complete() const;
3761  void set_successors_complete(bool);
3763 #else
3764  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
3765  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3766 #endif
3767 
3768 #ifdef DOCUMENTATION
3769 
3781 #else
3782  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
3783  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3784 #endif
3785 
3786 #ifdef DOCUMENTATION
3787 
3795  size_t get_cached_vertex() const;
3796  void set_cached_vertex(size_t);
3798 #else
3799  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
3800  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3801 #endif
3802 
3803 #ifdef DOCUMENTATION
3804 
3810  double get_code_likelihood() const;
3811  void set_code_likelihood(double);
3813 #else
3814  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
3815  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3816 #endif
3817 
3818 #ifdef DOCUMENTATION
3819 
3827  int64_t get_stackDeltaOut() const;
3828  void set_stackDeltaOut(int64_t);
3830 #else
3831  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
3832  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3833 #endif
3834 
3835  DECLARE_OTHERS(AsmBlock);
3836 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
3837 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3838  private:
3839  friend class boost::serialization::access;
3840 
3841  template<class S>
3842  void serialize(S &s, const unsigned /*version*/) {
3843  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3844  s & BOOST_SERIALIZATION_NVP(p_reason);
3845  s & BOOST_SERIALIZATION_NVP(p_statementList);
3846  s & BOOST_SERIALIZATION_NVP(p_successors);
3847  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
3848  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
3849  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3850  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
3851  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
3852  }
3853 #endif
3854 
3855  public:
3857  enum Reason {
3858  // Please update SgAsmBlock::reason_str() if you change this enum!
3859  BLK_NONE = 0x00000000,
3860  BLK_ENTRY_POINT = 0x00010000,
3861  BLK_PADDING = 0x00020000,
3862  BLK_FRAGMENT = 0x00080000,
3864  BLK_CFGHEAD = 0x00100000,
3865  BLK_USERDEF = 0x00200000,
3866  BLK_LEFTOVERS = 0x00400000,
3868  BLK_JUMPTABLE = 0x00800000,
3869  BLK_GRAPH1 = 0x01000000,
3870  BLK_GRAPH2 = 0x02000000,
3871  BLK_GRAPH3 = 0x04000000,
3873  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
3874 
3875  // ========= Miscellaneous Reasons ===========================================================================
3876  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3877  // availalble for users to use as they see fit.
3878  BLK_MISCMASK = 0x000000ff,
3880  BLK_FINDDATA = 0x00000001,
3882  BLK_POSTFUNC = 0x00000002
3884  };
3885 
3890 
3895 
3896  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
3901  void remove_children();
3902 
3907  rose_addr_t get_fallthrough_va();
3908 
3913 
3919  bool has_instructions() const;
3920 
3926  bool is_basic_block() const { return has_instructions(); }
3927 
3937  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
3938 
3942  static std::string reason_key(const std::string &prefix="");
3943 
3947  std::string reason_str(bool pad) const;
3948 
3954  static std::string reason_str(bool pad, unsigned reason);
3955 #endif // SgAsmBlock_OTHERS
3956 
3957 #ifdef DOCUMENTATION
3958  };
3959 #endif
3960 
3961 
3963 
3964  DECLARE_LEAF_CLASS(AsmStaticData);
3965  IS_SERIALIZABLE(AsmStaticData);
3966 
3967 #ifdef DOCUMENTATION
3968 
3976  public:
3977 #endif
3978 
3979 #ifdef DOCUMENTATION
3980 
3986  const SgUnsignedCharList& get_raw_bytes() const;
3987  void set_raw_bytes(const SgUnsignedCharList&);
3989 #else
3990  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
3991  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3992 #endif
3993 
3994  DECLARE_OTHERS(AsmStaticData);
3995 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
3996 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3997  private:
3998  friend class boost::serialization::access;
3999 
4000  template<class S>
4001  void serialize(S &s, const unsigned /*version*/) {
4002  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4003  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
4004  }
4005 #endif
4006 
4007  public:
4011  size_t get_size() const { return p_raw_bytes.size(); }
4012 #endif // SgAsmStaticData_OTHERS
4013 
4014 #ifdef DOCUMENTATION
4015  };
4016 #endif
4017 
4018 
4020 
4021  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
4022  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
4023 
4024 #ifdef DOCUMENTATION
4025 
4036  public:
4037 #endif
4038 
4039  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4040 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4041 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4042  private:
4043  friend class boost::serialization::access;
4044 
4045  template<class S>
4046  void serialize(S & s, const unsigned /*version*/) {
4047  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4048  }
4049 #endif
4050  protected:
4051  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4052 
4053  public:
4056  p_declarationList.push_back(declaration);
4057  }
4058 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4059 
4060 #ifdef DOCUMENTATION
4061  };
4062 #endif
4063 
4064 
4066 
4067  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4068  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4069 
4070 #ifdef DOCUMENTATION
4071  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4073  public:
4074 #endif
4075 
4076 #ifdef DOCUMENTATION
4077 
4080  const std::string& get_name() const;
4081  void set_name(const std::string&);
4083 #else
4084  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4085  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4086  NO_DELETE);
4087 #endif
4088 
4089 #ifdef DOCUMENTATION
4090  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4094  uint64_t get_offset() const;
4095  void set_ofset(uint64_t);
4097 #else
4098  // Not clear if we want to store the offset explicitly
4099  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4100  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4101  NO_DELETE);
4102 #endif
4103 
4104  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4105 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4106 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4107  private:
4108  friend class boost::serialization::access;
4109 
4110  template<class S>
4111  void serialize(S &s, const unsigned /*version*/) {
4112  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4113  }
4114 #endif
4115 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4116 
4117 #ifdef DOCUMENTATION
4118  };
4119 #endif
4120 
4121 
4123 
4124  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4125  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4126  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4127  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4128  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4129 
4130 #ifdef DOCUMENTATION
4131 
4138  public:
4139 #endif
4140 
4141  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4142 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4143 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4144  private:
4145  friend class boost::serialization::access;
4146 
4147  template<class S>
4148  void serialize(S &s, const unsigned /*version*/) {
4149  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4150  };
4151 #endif
4152 #endif // SgAsmSynthesizedDeclaration_OTHERS
4153 
4154 #ifdef DOCUMENTATION
4155  };
4156 #endif
4157 
4158 
4160 
4161  NEW_NONTERMINAL_MACRO(AsmStatement,
4162  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4163  "AsmStatement", "AsmStatementTag", false);
4164  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4165  IS_SERIALIZABLE(AsmStatement);
4166 
4167 #ifdef DOCUMENTATION
4168 
4172  class SgAsmStatement: public SgAsmNode {
4173  public:
4174 #endif
4175 
4176 #ifdef DOCUMENTATION
4177 
4182  rose_addr_t get_address() const;
4183  void set_address(rose_addr_t);
4185 #else
4186  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4187  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4188 #endif
4189 
4190 
4191 #ifdef DOCUMENTATION
4192 
4195  const std::string& get_comment() const;
4196  void set_comment(const std::string&);
4198 #else
4199  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4200  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4201 #endif
4202 
4203  DECLARE_OTHERS(AsmStatement);
4204 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4205 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4206  private:
4207  friend class boost::serialization::access;
4208 
4209  template<class S>
4210  void serialize(S &s, const unsigned /*version*/) {
4211  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4212  s & BOOST_SERIALIZATION_NVP(p_address);
4213  s & BOOST_SERIALIZATION_NVP(p_comment);
4214  }
4215 #endif
4216 #endif // SgAsmStatement_OTHERS
4217 
4218 #ifdef DOCUMENTATION
4219  };
4220 #endif
4221 
4222 
4223 
4224 
4226 
4227  /*************************************************************************************************************************
4228  * Binary Interpretations
4229  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4230  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4231  * an AST that represents a single, coherent sub-part of the file.
4232  *************************************************************************************************************************/
4233 
4235 
4236  DECLARE_LEAF_CLASS(AsmInterpretationList);
4237  IS_SERIALIZABLE(AsmInterpretationList);
4238 
4239 #ifdef DOCUMENTATION
4240 
4242  public:
4243 #endif
4244 
4245 #ifdef DOCUMENTATION
4246 
4255 #else
4256  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4257  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4258  NO_DELETE);
4259 #endif
4260 
4261  DECLARE_OTHERS(AsmInterpretationList);
4262 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4263 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4264  private:
4265  friend class boost::serialization::access;
4266 
4267  template<class S>
4268  void serialize(S &s, const unsigned /*version*/) {
4269  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4270  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4271  }
4272 #endif
4273 #endif // SgAsmInterpretationList_OTHERS
4274 
4275 #ifdef DOCUMENTATION
4276  };
4277 #endif
4278 
4280 
4281  DECLARE_LEAF_CLASS(AsmInterpretation);
4282  IS_SERIALIZABLE(AsmInterpretation);
4283 
4284  DECLARE_HEADERS(AsmInterpretation);
4285 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4286  #include <MemoryMap.h>
4287  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
4288 #endif // SgAsmInterpretation_HEADERS
4289 
4290 #ifdef DOCUMENTATION
4291 
4298  public:
4299 #endif
4300 
4301 #ifdef DOCUMENTATION
4302  // documentation and definition are below
4303 #else
4304  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4305 #endif
4306 
4307 #ifdef DOCUMENTATION
4308 
4319 #else
4320  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4321  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4322 #endif
4323 
4324 #ifdef DOCUMENTATION
4325 
4330  SgAsmBlock* get_global_block() const;
4333 #else
4334  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4335  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4336 #endif
4337 
4338  DECLARE_OTHERS(AsmInterpretation);
4339 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4340  private:
4342  const Rose::BinaryAnalysis::RegisterDictionary *p_registers;
4343  bool coverageComputed; // true iff percentageCoverage has been computed
4344  mutable InstructionMap instruction_map; // cached instruction map
4345 
4347  // disassembly into instructions.
4348  double percentageCoverage;
4349 
4350 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4351  private:
4352  friend class boost::serialization::access;
4353 
4354  template<class S>
4355  void serialize(S &s, const unsigned /*version*/) {
4356  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4357  s & BOOST_SERIALIZATION_NVP(p_headers);
4358  s & BOOST_SERIALIZATION_NVP(p_global_block);
4359  s & BOOST_SERIALIZATION_NVP(p_map);
4360  s & BOOST_SERIALIZATION_NVP(p_registers);
4361  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4362  s & BOOST_SERIALIZATION_NVP(instruction_map);
4363  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4364  }
4365 #endif
4366 
4367  public:
4370  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4371  ctor();
4372  }
4373 
4378  SgAsmGenericFilePtrList get_files() const;
4379 
4406  InstructionMap& get_instruction_map(bool recompute=false);
4407  void set_instruction_map(const InstructionMap&);
4414  void insert_instructions(InstructionMap&/*in,out*/);
4415 
4420  void erase_instructions(InstructionMap&/*in,out*/);
4421 
4427  void set_coverageComputed(bool x) { coverageComputed = x; }
4428  void set_percentageCoverage(double x) { percentageCoverage = x; }
4431  private:
4432  void ctor(); // finalize construction
4433 #endif // SgAsmInterpretation_OTHERS
4434 
4435 #ifdef DOCUMENTATION
4436  };
4437 #endif
4438 
4439 
4440 
4442 
4443  /*************************************************************************************************************************
4444  * ELF File Header
4445  *************************************************************************************************************************/
4446 
4448 
4449  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4450  IS_SERIALIZABLE(AsmElfFileHeader);
4451 
4452 #ifdef DOCUMENTATION
4453 
4462  public:
4463 #endif
4464 
4465 #ifdef DOCUMENTATION
4466 
4471  unsigned char get_e_ident_file_class() const;
4472  void set_e_ident_file_class(unsigned char);
4474 #else
4475  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4476  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4477 #endif
4478 
4479 #ifdef DOCUMENTATION
4480 
4485  unsigned char get_e_ident_data_encoding() const;
4486  void set_e_ident_data_encoding(unsigned char);
4488 #else
4489  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4490  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4491 #endif
4492 
4493 #ifdef DOCUMENTATION
4494 
4499  unsigned char get_e_ident_file_version() const;
4500  void set_e_ident_file_version(unsigned char*);
4502 #else
4503  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4504  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4505 #endif
4506 
4507 #ifdef DOCUMENTATION
4508 
4513  const SgUnsignedCharList& get_e_ident_padding() const;
4514  void set_e_ident_padding(const SgUnsignedCharList&);
4516 #else
4517  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4518  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4519 #endif
4520 
4521 #ifdef DOCUMENTATION
4522 
4527  unsigned long get_e_type() const;
4528  void set_e_type(unsigned long);
4530 #else
4531  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4532  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4533 #endif
4534 
4535 #ifdef DOCUMENTATION
4536 
4541  unsigned long get_e_machine() const;
4542  void set_e_machine(unsigned long);
4544 #else
4545  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4546  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4547 #endif
4548 
4549 #ifdef DOCUMENTATION
4550 
4555  unsigned long get_e_flags() const;
4556  void set_e_flags(unsigned long);
4558 #else
4559  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4560  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4561 #endif
4562 
4563 #ifdef DOCUMENTATION
4564 
4569  unsigned long get_e_ehsize() const;
4570  void set_e_ehsize(unsigned long);
4572 #else
4573  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4574  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4575 #endif
4576 
4577 #ifdef DOCUMENTATION
4578 
4583  unsigned long get_phextrasz() const;
4584  void set_phextrasz(unsigned long);
4586 #else
4587  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4588  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4589 #endif
4590 
4591 #ifdef DOCUMENTATION
4592 
4597  unsigned long get_e_phnum() const;
4598  void set_e_phnum(unsigned long);
4600 #else
4601  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
4602  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4603 #endif
4604 
4605 #ifdef DOCUMENTATION
4606 
4611  unsigned long get_shextrasz() const;
4612  void set_shextrasz(unsigned long);
4614 #else
4615  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
4616  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4617 #endif
4618 
4619 #ifdef DOCUMENTATION
4620 
4625  unsigned long get_e_shnum() const;
4626  void set_e_shnum(unsigned long);
4628 #else
4629  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
4630  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4631 #endif
4632 
4633 #ifdef DOCUMENTATION
4634 
4639  unsigned long get_e_shstrndx() const;
4640  void set_e_shstrndx(unsigned long);
4642 #else
4643  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
4644  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4645 #endif
4646 
4647 #ifdef DOCUMENTATION
4648 
4658 #else
4659  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
4660  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4661 #endif
4662 
4663 #ifdef DOCUMENTATION
4664 
4673 #else
4674  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
4675  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4676 #endif
4677 
4678  DECLARE_OTHERS(AsmElfFileHeader);
4679 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
4680 
4681 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4682  private:
4683  friend class boost::serialization::access;
4684 
4685  template<class S>
4686  void serialize(S &s, const unsigned /*version*/) {
4687  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
4688  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
4689  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
4690  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
4691  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
4692  s & BOOST_SERIALIZATION_NVP(p_e_type);
4693  s & BOOST_SERIALIZATION_NVP(p_e_machine);
4694  s & BOOST_SERIALIZATION_NVP(p_e_flags);
4695  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
4696  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
4697  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
4698  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
4699  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
4700  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
4701  s & BOOST_SERIALIZATION_NVP(p_section_table);
4702  s & BOOST_SERIALIZATION_NVP(p_segment_table);
4703  }
4704 #endif
4705 
4706  public:
4708  enum ObjectType {
4709  ET_NONE = 0
4710  ,ET_REL = 1
4711  ,ET_EXEC = 2
4712  ,ET_DYN = 3
4713  ,ET_CORE = 4
4715  ,ET_LOOS = 0xfe00
4716  ,ET_HIOS = 0xfeff
4717  ,ET_LOPROC = 0xff00
4718  ,ET_HIPROC = 0xffff
4719  };
4720 
4721  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
4722  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
4723  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
4724  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
4725  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
4726 #ifdef _MSC_VER
4727 # pragma pack (1)
4728 #endif
4729 
4736  unsigned char e_ident_magic[4];
4737  unsigned char e_ident_file_class;
4738  unsigned char e_ident_data_encoding;
4739  unsigned char e_ident_file_version;
4740  unsigned char e_ident_padding[9];
4741  uint16_t e_type;
4742  uint16_t e_machine;
4743  uint32_t e_version;
4744  uint32_t e_entry;
4745  uint32_t e_phoff;
4746  uint32_t e_shoff;
4747  uint32_t e_flags;
4748  uint16_t e_ehsize;
4749  uint16_t e_phentsize;
4750  uint16_t e_phnum;
4751  uint16_t e_shentsize;
4752  uint16_t e_shnum;
4753  uint16_t e_shstrndx;
4754  }
4755 #if !defined(SWIG) && !defined(_MSC_VER)
4756  __attribute__((packed))
4757 #endif
4758  ;
4759 
4761  unsigned char e_ident_magic[4];
4762  unsigned char e_ident_file_class;
4763  unsigned char e_ident_data_encoding;
4764  unsigned char e_ident_file_version;
4765  unsigned char e_ident_padding[9];
4766  uint16_t e_type;
4767  uint16_t e_machine;
4768  uint32_t e_version;
4769  uint64_t e_entry;
4770  uint64_t e_phoff;
4771  uint64_t e_shoff;
4772  uint32_t e_flags;
4773  uint16_t e_ehsize;
4774  uint16_t e_phentsize;
4775  uint16_t e_phnum;
4776  uint16_t e_shentsize;
4777  uint16_t e_shnum;
4778  uint16_t e_shstrndx;
4779  }
4780 #if !defined(SWIG) && !defined(_MSC_VER)
4781  __attribute__((packed))
4782 #endif
4783  ;
4784 
4785 #ifdef _MSC_VER
4786 # pragma pack ()
4787 #endif
4788 
4796  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
4797  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
4798  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
4799  ctor();
4800  }
4801 
4807  uint64_t max_page_size();
4808 
4811 
4814 
4820  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
4821 
4823  virtual bool reallocate() $ROSE_OVERRIDE;
4824 
4826  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4827 
4829  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4830 
4832  static bool is_ELF(SgAsmGenericFile*);
4833 
4835  SgAsmGenericSectionPtrList get_sectab_sections();
4836 
4838  SgAsmGenericSectionPtrList get_segtab_sections();
4839 
4840  // Overrides documented in base class
4841  virtual const char *format_name() const $ROSE_OVERRIDE;
4842 
4843  private:
4844  void ctor(); // called by constructors
4845  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
4846  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
4847 #endif // SgAsmElfFileHeader_OTHERS
4848 
4849 #ifdef DOCUMENTATION
4850  };
4851 #endif
4852 
4853 
4854 
4856 
4857  /*************************************************************************************************************************
4858  * ELF Section Tables
4859  *************************************************************************************************************************/
4860 
4862 
4863  DECLARE_LEAF_CLASS(AsmElfSectionTable);
4864  IS_SERIALIZABLE(AsmElfSectionTable);
4865 
4866 #ifdef DOCUMENTATION
4867 
4873  public:
4874 #endif
4875 
4876  DECLARE_OTHERS(AsmElfSectionTable);
4877 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
4878 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4879  private:
4880  friend class boost::serialization::access;
4881 
4882  template<class S>
4883  void serialize(S &s, const unsigned /*version*/) {
4884  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
4885  }
4886 #endif
4887 
4888  public:
4891  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
4892  ctor();
4893  }
4894 
4900  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
4901 
4913 
4917  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
4918 
4920  virtual bool reallocate() $ROSE_OVERRIDE;
4921 
4923  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4924 
4926  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4927 
4928  private:
4929  void ctor();
4930 #endif // SgAsmElfSectionTable_OTHERS
4931 
4932 #ifdef DOCUMENTATION
4933  };
4934 #endif
4935 
4936 
4938 
4939  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
4940  IS_SERIALIZABLE(AsmElfSectionTableEntry);
4941 
4942 #ifdef DOCUMENTATION
4943 
4945  public:
4946 #endif
4947 
4948 #ifdef DOCUMENTATION
4949 
4954  unsigned get_sh_name() const;
4955  void set_sh_name(unsigned);
4957 #else
4958  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
4959  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4960 #endif
4961 
4962 #ifdef DOCUMENTATION
4963 
4968  SectionType get_sh_type() const;
4969  void set_sh_type(SectionType);
4971 #else
4972  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
4973  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4974 #endif
4975 
4976 #ifdef DOCUMENTATION
4977 
4982  unsigned long get_sh_link() const;
4983  void set_sh_link(unsigned long);
4985 #else
4986  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
4987  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4988 #endif
4989 
4990 #ifdef DOCUMENTATION
4991 
4996  unsigned long get_sh_info() const;
4997  void set_sh_info(unsigned long);
4999 #else
5000  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
5001  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5002 #endif
5003 
5004 #ifdef DOCUMENTATION
5005 
5010  uint64_t get_sh_flags() const;
5011  void set_sh_flags(uint64_t);
5013 #else
5014  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
5015  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5016 #endif
5017 
5018 #ifdef DOCUMENTATION
5019 
5024  rose_addr_t get_sh_addr() const;
5025  void set_sh_addr(rose_addr_t);
5027 #else
5028  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
5029  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5030 #endif
5031 
5032 #ifdef DOCUMENTATION
5033 
5038  rose_addr_t get_sh_offset() const;
5039  void set_sh_offset(rose_addr_t);
5041 #else
5042  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
5043  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5044 #endif
5045 
5046 #ifdef DOCUMENTATION
5047 
5052  rose_addr_t get_sh_size() const;
5053  void set_sh_size(rose_addr_t);
5055 #else
5056  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
5057  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5058 #endif
5059 
5060 #ifdef DOCUMENTATION
5061 
5066  rose_addr_t get_sh_addralign() const;
5067  void set_sh_addralign(rose_addr_t);
5069 #else
5070  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
5071  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5072 #endif
5073 
5074 #ifdef DOCUMENTATION
5075 
5080  rose_addr_t get_sh_entsize() const;
5081  void set_sh_entsize(rose_addr_t);
5083 #else
5084  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
5085  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5086 #endif
5087 
5088 #ifdef DOCUMENTATION
5089 
5094  const SgUnsignedCharList& get_extra() const;
5095  void set_extra(const SgUnsignedCharLit&);
5097 #else
5098  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5099  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5100  NO_DELETE);
5101 #endif
5102 
5103  DECLARE_OTHERS(AsmElfSectionTableEntry);
5104 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5105 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5106  private:
5107  friend class boost::serialization::access;
5108 
5109  template<class S>
5110  void serialize(S &s, const unsigned /*version*/) {
5111  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5112  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5113  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5114  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5115  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5116  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5117  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5118  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5119  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5120  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5121  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5122  s & BOOST_SERIALIZATION_NVP(p_extra);
5123  }
5124 #endif
5125 
5126  public:
5129  SHT_NULL = 0,
5133  SHT_RELA = 4,
5134  SHT_HASH = 5,
5136  SHT_NOTE = 7,
5138  SHT_REL = 9,
5139  SHT_SHLIB = 10,
5140  SHT_DYNSYM = 11,
5142  SHT_LOOS = 0x60000000,
5143  SHT_GNU_verdef = 0x6ffffffd,
5144  SHT_GNU_verneed = 0x6ffffffe,
5145  SHT_GNU_versym = 0x6fffffff,
5146  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5147 
5148  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5149  SHT_HIPROC = 0x7fffffff,
5150  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5151  SHT_HIUSER = 0xffffffff
5152  };
5153 
5157  SHF_WRITE= (1 << 0),
5158  SHF_ALLOC= (1 << 1),
5159  SHF_EXECINSTR= (1 << 2),
5160  SHF_MERGE= (1 << 4),
5161  SHF_STRINGS= (1 << 5),
5162  SHF_INFO_LINK= (1 << 6),
5163  SHF_LINK_ORDER= (1 << 7),
5165  SHF_GROUP= (1 << 9),
5166  SHF_TLS= (1 << 10),
5167  SHF_MASKOS= 0x0ff00000,
5168  SHF_MASKPROC= 0xf0000000
5169  };
5170 
5177 #ifdef _MSC_VER
5178 # pragma pack (1)
5179 #endif
5181  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5182  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5183  uint32_t sh_flags; /* 0x08 Bit flags */
5184  uint32_t sh_addr; /* 0x0c Desired mapped address */
5185  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5186  uint32_t sh_size; /* 0x14 Section size in bytes */
5187  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5188  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5189  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5190  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5191  } /* 0x28 */
5192 #if !defined(SWIG) && !defined(_MSC_VER)
5193  __attribute__((packed))
5194 #endif
5195  ;
5196 
5198  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5199  uint32_t sh_type; /* 0x04 */
5200  uint64_t sh_flags; /* 0x08 */
5201  uint64_t sh_addr; /* 0x10 */
5202  uint64_t sh_offset; /* 0x18 */
5203  uint64_t sh_size; /* 0x20 */
5204  uint32_t sh_link; /* 0x28 */
5205  uint32_t sh_info; /* 0x2c */
5206  uint64_t sh_addralign; /* 0x30 */
5207  uint64_t sh_entsize; /* 0x38 */
5208  } /* 0x40 */
5209 #if !defined(SWIG) && !defined(_MSC_VER)
5210  __attribute__((packed))
5211 #endif
5212  ;
5213 #ifdef _MSC_VER
5214 # pragma pack ()
5215 #endif
5216 
5218  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5220 
5222  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5224 
5228  void *encode(ByteOrder::Endianness sex,
5230  void *encode(ByteOrder::Endianness sex,
5236 
5238  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5239 
5240  // Use Rose::stringify... function instead.
5241  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5242  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5243 
5244  private:
5245  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5246  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5247 #endif // SgAsmElfSectionTableEntry_OTHERS
5248 
5249 #ifdef DOCUMENTATION
5250  };
5251 #endif
5252 
5253 
5254 
5256 
5257  /*************************************************************************************************************************
5258  * ELF Segment Tables
5259  *************************************************************************************************************************/
5260 
5262 
5263  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5264  IS_SERIALIZABLE(AsmElfSegmentTable);
5265 
5266 #ifdef DOCUMENTATION
5267 
5274  public:
5275 #endif
5276 
5277  DECLARE_OTHERS(AsmElfSegmentTable);
5278 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5279 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5280  private:
5281  friend class boost::serialization::access;
5282 
5283  template<class S>
5284  void serialize(S &s, const unsigned /*version*/) {
5285  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5286  }
5287 #endif
5288 
5289  public:
5292  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5293  ctor();
5294  }
5295 
5300  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5301 
5316 
5320  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5321 
5323  virtual bool reallocate() $ROSE_OVERRIDE;
5324 
5326  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5327 
5329  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5330 
5331  private:
5332  void ctor();
5333 #endif // SgAsmElfSegmentTable_OTHERS
5334 
5335 #ifdef DOCUMENTATION
5336  };
5337 #endif
5338 
5340 
5341  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5342  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5343 
5344 #ifdef DOCUMENTATION
5346  public:
5347 #endif
5348 
5349 #ifdef DOCUMENTATION
5350 
5356  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5357  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5359 #else
5360  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5361  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5362  NO_DELETE);
5363 #endif
5364 
5365  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5366 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5367 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5368  private:
5369  friend class boost::serialization::access;
5370 
5371  template<class S>
5372  void serialize(S &s, const unsigned /*version*/) {
5373  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5374  }
5375 #endif
5376 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5377 
5378 #ifdef DOCUMENTATION
5379  };
5380 #endif
5381 
5382 
5384 
5385  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5386  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5387 
5388 #ifdef DOCUMENTATION
5389 
5391  public:
5392 #endif
5393 
5394 #ifdef DOCUMENTATION
5395 
5400  size_t get_index() const;
5401  void set_index(size_t);
5403 #else
5404  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5405  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5406 #endif
5407 
5408 #ifdef DOCUMENTATION
5409 
5412  SegmentType get_type() const;
5413  void set_type(SegmentType);
5415 #else
5416  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5417  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5418  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5419 #endif
5420 
5421 #ifdef DOCUMENTATION
5422 
5425  SegmentFlags get_flags() const;
5426  void set_flags(SegmentFlags);
5428 #else
5429  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5430  "= SgAsmElfSegmentTableEntry::PF_NONE",
5431  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5432 #endif
5433 
5434 #ifdef DOCUMENTATION
5435 
5440  rose_addr_t get_offset() const;
5441  void set_offset(rose_addr_t);
5443 #else
5444  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5445  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5446 #endif
5447 
5448 #ifdef DOCUMENTATION
5449 
5455  rose_addr_t get_vaddr() const;
5456  void set_vaddr(rose_addr_t);
5458 #else
5459  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5460  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5461 #endif
5462 
5463 #ifdef DOCUMENTATION
5464 
5469  rose_addr_t get_paddr() const;
5470  void set_paddr(rose_addr_t);
5472 #else
5473  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5474  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5475 #endif
5476 
5477 #ifdef DOCUMENTATION
5478 
5483  rose_addr_t get_filesz() const;
5484  void set_filesz(rose_addr_t);
5486 #else
5487  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5488  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5489 #endif
5490 
5491 #ifdef DOCUMENTATION
5492 
5497  rose_addr_t get_memsz() const;
5498  void set_memsz(rose_addr_t);
5500 #else
5501  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5502  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5503 #endif
5504 
5505 #ifdef DOCUMENTATION
5506 
5511  rose_addr_t get_align() const;
5512  void set_align(rose_addr_t);
5514 #else
5515  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5516  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5517 #endif
5518 
5519 #ifdef DOCUMENTATION
5520 
5525  const SgUnsignedCharList& get_extra() const;
5526  void set_extra(const SgUnsignedCharList&);
5528 #else
5529  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5530  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5531 #endif
5532 
5533  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5534 #if defined(SgAsmElfSegmentTableEntry_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(SgAsmExecutableFileFormat);
5542  s & BOOST_SERIALIZATION_NVP(p_index);
5543  s & BOOST_SERIALIZATION_NVP(p_type);
5544  s & BOOST_SERIALIZATION_NVP(p_flags);
5545  s & BOOST_SERIALIZATION_NVP(p_offset);
5546  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5547  s & BOOST_SERIALIZATION_NVP(p_paddr);
5548  s & BOOST_SERIALIZATION_NVP(p_filesz);
5549  s & BOOST_SERIALIZATION_NVP(p_memsz);
5550  s & BOOST_SERIALIZATION_NVP(p_align);
5551  s & BOOST_SERIALIZATION_NVP(p_extra);
5552  }
5553 #endif
5554 
5555  public:
5558  PT_NULL = 0,
5559  PT_LOAD = 1,
5562  PT_NOTE = 4,
5563  PT_SHLIB = 5,
5564  PT_PHDR = 6,
5565  PT_TLS = 7,
5567  // OS- and Processor-specific ranges
5568  PT_LOOS = 0x60000000,
5569  PT_HIOS = 0x6fffffff,
5570  PT_LOPROC = 0x70000000,
5571  PT_HIPROC = 0x7fffffff,
5572 
5573  // OS-specific values for GNU/Linux
5574  PT_GNU_EH_FRAME = 0x6474e550,
5575  PT_GNU_STACK = 0x6474e551,
5576  PT_GNU_RELRO = 0x6474e552,
5577  PT_PAX_FLAGS = 0x65041580,
5579  // OS-specific values for Sun
5580  PT_SUNWBSS = 0x6ffffffa,
5581  PT_SUNWSTACK = 0x6ffffffb
5582  };
5583 
5586  PF_NONE = 0,
5587  PF_RESERVED = 0x000ffff8,
5588  PF_XPERM = 0x00000001,
5589  PF_WPERM = 0x00000002,
5590  PF_RPERM = 0x00000004,
5591  PF_OS_MASK = 0x0ff00000,
5592  PF_PROC_MASK = 0xf0000000
5593  };
5594 
5595 #ifdef _MSC_VER
5596 # pragma pack (1)
5597 #endif
5598 
5606  uint32_t p_type;
5607  uint32_t p_offset;
5608  uint32_t p_vaddr;
5609  uint32_t p_paddr;
5610  uint32_t p_filesz;
5611  uint32_t p_memsz;
5612  uint32_t p_flags;
5613  uint32_t p_align;
5614  } /* 0x30 */
5615 #if !defined(SWIG) && !defined(_MSC_VER)
5616  __attribute__((packed))
5617 #endif
5618  ;
5619 
5621  uint32_t p_type; /* 0x00 */
5622  uint32_t p_flags; /* 0x04 */
5623  uint64_t p_offset; /* 0x08 */
5624  uint64_t p_vaddr; /* 0x10 */
5625  uint64_t p_paddr; /* 0x18 */
5626  uint64_t p_filesz; /* 0x20 */
5627  uint64_t p_memsz; /* 0x28 */
5628  uint64_t p_align; /* 0x30 */
5629  } /* 0x38 */
5630 #if !defined(SWIG) && !defined(_MSC_VER)
5631  __attribute__((packed))
5632 #endif
5633  ;
5634 #ifdef _MSC_VER
5635 # pragma pack ()
5636 #endif
5637 
5639  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5641 
5643  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5645 
5649  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
5650  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
5655 
5657  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5658 
5661 
5664 
5665  private:
5666  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
5667  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
5668 #endif // SgAsmElfSegmentTableEntry_OTHERS
5669 
5670 #ifdef DOCUMENTATION
5671  };
5672 #endif
5673 
5674 
5675 
5677 
5678  /*************************************************************************************************************************
5679  * ELF Symbol Tables
5680  *************************************************************************************************************************/
5681 
5683 
5684  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
5685  IS_SERIALIZABLE(AsmElfSymbolSection);
5686 
5687 #ifdef DOCUMENTATION
5688 
5690  public:
5691 #endif
5692 
5693 #ifdef DOCUMENTATION
5694 
5697  bool get_is_dynamic() const;
5698  void set_is_dynamic(bool);
5700 #else
5701  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
5702  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5703 #endif
5704 
5705 #ifdef DOCUMENTATION
5706 
5715 #else
5716  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
5717  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5718 #endif
5719 
5720  DECLARE_OTHERS(AsmElfSymbolSection);
5721 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
5722 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5723  private:
5724  friend class boost::serialization::access;
5725 
5726  template<class S>
5727  void serialize(S &s, const unsigned /*version*/) {
5728  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5729  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
5730  s & BOOST_SERIALIZATION_NVP(p_symbols);
5731  }
5732 #endif
5733 
5734  public:
5737  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
5738  ctor(strsec);
5739  }
5740 
5742  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
5743 
5756  virtual void finish_parsing() $ROSE_OVERRIDE;
5757 
5759  size_t index_of(SgAsmElfSymbol*);
5760 
5765  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5766 
5770  virtual bool reallocate() $ROSE_OVERRIDE;
5771 
5773  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5774 
5776  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5777 
5778  private:
5779  void ctor(SgAsmElfStringSection*);
5780 #endif // SgAsmElfSymbolSection_OTHERS
5781 
5782 #ifdef DOCUMENTATION
5783  };
5784 #endif
5785 
5787 
5788  DECLARE_LEAF_CLASS(AsmElfSymbolList);
5789  IS_SERIALIZABLE(AsmElfSymbolList);
5790 
5791 #ifdef DOCUMENTATION
5793  public:
5794 #endif
5795 
5796 #ifdef DOCUMENTATION
5797 
5803  const SgAsmElfSymbolPtrList& get_symbols() const;
5804  void set_symbols(const SgAsmElfSymbolPtrList&);
5806 #else
5807  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
5808  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5809 #endif
5810 
5811  DECLARE_OTHERS(AsmElfSymbolList);
5812 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
5813 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5814  private:
5815  friend class boost::serialization::access;
5816 
5817  template<class S>
5818  void serialize(S &s, const unsigned /*version*/) {
5819  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5820  s & BOOST_SERIALIZATION_NVP(p_symbols);
5821  }
5822 #endif
5823 #endif // SgAsmElfSymbolList_OTHERS
5824 
5825 #ifdef DOCUMENTATION
5826  };
5827 #endif
5828 
5830 
5831  DECLARE_LEAF_CLASS(AsmElfSymbol);
5832  IS_SERIALIZABLE(AsmElfSymbol);
5833 
5834 #ifdef DOCUMENTATION
5835 
5840  public:
5841 #endif
5842 
5843 #ifdef DOCUMENTATION
5844 
5849  unsigned char get_st_info() const;
5850  void set_st_info(unsigned char);
5852 #else
5853  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
5854  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5855 #endif
5856 
5857 #ifdef DOCUMENTATION
5858 
5863  unsigned char get_st_res1() const;
5864  void set_st_res1(unsigned char);
5866 #else
5867  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
5868  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5869 #endif
5870 
5871 #ifdef DOCUMENTATION
5872 
5877  unsigned get_st_shndx() const;
5878  void set_st_shndx(unsigned);
5880 #else
5881  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
5882  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5883 #endif
5884 
5885 #ifdef DOCUMENTATION
5886 
5891  rose_addr_t get_st_size() const;
5892  void set_st_size(rose_addr_t);
5894 #else
5895  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
5896  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5897 #endif
5898 
5899 #ifdef DOCUMENTATION
5900 
5905  const SgUnsignedCharList& get_extra() const;
5906  void set_extra(const SgUnsignedCharList&);
5908 #else
5909  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
5910  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5911 #endif
5912 
5913  DECLARE_OTHERS(AsmElfSymbol);
5914 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
5915 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5916  private:
5917  friend class boost::serialization::access;
5918 
5919  template<class S>
5920  void serialize(S &s, const unsigned /*version*/) {
5921  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
5922  s & BOOST_SERIALIZATION_NVP(p_st_info);
5923  s & BOOST_SERIALIZATION_NVP(p_st_res1);
5924  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
5925  s & BOOST_SERIALIZATION_NVP(p_st_size);
5926  s & BOOST_SERIALIZATION_NVP(p_extra);
5927  }
5928 #endif
5929 
5930  public:
5931  enum ElfSymBinding {
5932  STB_LOCAL=0,
5933  STB_GLOBAL=1,
5934  STB_WEAK=2
5935  };
5936 
5937  enum ElfSymType {
5940  STT_FUNC = 2,
5942  STT_FILE = 4,
5944  STT_TLS = 6,
5946  };
5947 
5948 #ifdef _MSC_VER
5949 # pragma pack (1)
5950 #endif
5951 
5954  uint32_t st_name;
5955  uint32_t st_value;
5956  uint32_t st_size;
5957  unsigned char st_info;
5958  unsigned char st_res1;
5959  uint16_t st_shndx;
5960  }
5961 #if !defined(SWIG) && !defined(_MSC_VER)
5962  __attribute__((packed))
5963 #endif
5964  ;
5965 
5967  uint32_t st_name;
5968  unsigned char st_info;
5969  unsigned char st_res1;
5970  uint16_t st_shndx;
5971  uint64_t st_value;
5972  uint64_t st_size;
5973  }
5974 #if !defined(SWIG) && !defined(_MSC_VER)
5975  __attribute__((packed))
5976 #endif
5977  ;
5978 
5979 #ifdef _MSC_VER
5980 # pragma pack ()
5981 #endif
5982 
5984  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
5985 
5989  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
5990 
5994  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
5995 
5999  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
6000  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
6008  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6009  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
6013  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
6014 
6017 
6019  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
6020 
6022  static std::string to_string(SgAsmElfSymbol::ElfSymType);
6023 
6024  private:
6025  void ctor(SgAsmElfSymbolSection*);
6026  void parse_common(); // initialization common to all parse() methods
6027 #endif // SgAsmElfSymbol_OTHERS
6028 
6029 #ifdef DOCUMENTATION
6030  };
6031 #endif
6032 
6033 
6034 
6036 
6037  /*************************************************************************************************************************
6038  * ELF Symbol Version Tables
6039  *************************************************************************************************************************/
6040 
6042 
6043  DECLARE_LEAF_CLASS(AsmElfSymverSection);
6044  IS_SERIALIZABLE(AsmElfSymverSection);
6045 
6046 #ifdef DOCUMENTATION
6047 
6052  public:
6053 #endif
6054 
6055 #ifdef DOCUMENTATION
6056 
6065 #else
6066  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
6067  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6068 #endif
6069 
6070  DECLARE_OTHERS(AsmElfSymverSection);
6071 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
6072 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6073  private:
6074  friend class boost::serialization::access;
6075 
6076  template<class S>
6077  void serialize(S &s, const unsigned /*version*/) {
6078  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6079  s & BOOST_SERIALIZATION_NVP(p_entries);
6080  }
6081 #endif
6082 
6083  public:
6086  : SgAsmElfSection(fhdr) {
6087  ctor();
6088  }
6089 
6091  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
6092 
6097  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6098 
6100  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6101 
6103  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6104  private:
6105  void ctor();
6106 #endif // SgAsmElfSymverSection_OTHERS
6107 
6108 #ifdef DOCUMENTATION
6109  };
6110 #endif
6111 
6113 
6114  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6115  IS_SERIALIZABLE(AsmElfSymverEntry);
6116 
6117 #ifdef DOCUMENTATION
6118 
6120  public:
6121 #endif
6122 
6123 #ifdef DOCUMENTATION
6124 
6129  size_t get_value() const;
6130  void set_value(size_t);
6132 #else
6133  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6134  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6135 #endif
6136 
6137  DECLARE_OTHERS(AsmElfSymverEntry);
6138 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6139 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6140  private:
6141  friend class boost::serialization::access;
6142 
6143  template<class S>
6144  void serialize(S &s, const unsigned /*version*/) {
6145  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6146  s & BOOST_SERIALIZATION_NVP(p_value);
6147  }
6148 #endif
6149 
6150  public:
6153  : p_value(0) {
6154  ctor(symver);
6155  }
6156 
6158  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6159 
6160  private:
6161  void ctor(SgAsmElfSymverSection*);
6162 #endif // SgAsmElfSymverEntry_OTHERS
6163 
6164 #ifdef DOCUMENTATION
6165  };
6166 #endif
6167 
6169 
6170 
6171  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6172  IS_SERIALIZABLE(AsmElfSymverEntryList);
6173 
6174 #ifdef DOCUMENTATION
6175 
6180  public:
6181 #endif
6182 
6183 #ifdef DOCUMENTATION
6184 
6187  const SgAsmElfSymverEntryPtrList& get_entries() const;
6188  void set_entries(const SgAsmElfSymverEntryPtrList&);
6190 #else
6191  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6192  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6193  NO_DELETE);
6194 #endif
6195 
6196  DECLARE_OTHERS(AsmElfSymverEntryList);
6197 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6198 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6199  private:
6200  friend class boost::serialization::access;
6201 
6202  template<class S>
6203  void serialize(S &s, const unsigned /*version*/) {
6204  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6205  s & BOOST_SERIALIZATION_NVP(p_entries);
6206  }
6207 #endif
6208 #endif // SgAsmElfSymverEntryList_OTHERS
6209 
6210 #ifdef DOCUMENTATION
6211  };
6212 #endif
6213 
6215 
6216  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6217  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6218 
6219 #ifdef DOCUMENTATION
6220 
6226  public:
6227 #endif
6228 
6229 #ifdef DOCUMENTATION
6230 
6239 #else
6240  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6241  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6242  NO_DELETE);
6243 #endif
6244 
6245  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6246 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6247 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6248  private:
6249  friend class boost::serialization::access;
6250 
6251  template<class S>
6252  void serialize(S &s, const unsigned /*version*/) {
6253  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6254  s & BOOST_SERIALIZATION_NVP(p_entries);
6255  }
6256 #endif
6257 
6258  public:
6261  : SgAsmElfSection(fhdr) {
6262  ctor(strsec);
6263  }
6264 
6333  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6334 
6337  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6338 
6342  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6343 
6345  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6346 
6347  private:
6348  void ctor(SgAsmElfStringSection*);
6349 #endif // SgAsmElfSymverDefinedSection_OTHERS
6350 
6351 #ifdef DOCUMENTATION
6352  };
6353 #endif
6354 
6356 
6357  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6358  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6359 
6360 #ifdef DOCUMENTATION
6361 
6366  public:
6367 #endif
6368 
6369 #ifdef DOCUMENTATION
6370 
6373  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6374  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6376 #else
6377  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6378  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6379  NO_DELETE);
6380 #endif
6381 
6382  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6383 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6384 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6385  private:
6386  friend class boost::serialization::access;
6387 
6388  template<class S>
6389  void serialize(S &s, const unsigned /*version*/) {
6390  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6391  s & BOOST_SERIALIZATION_NVP(p_entries);
6392  }
6393 #endif
6394 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6395 
6396 #ifdef DOCUMENTATION
6397  };
6398 #endif
6399 
6401 
6402  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6403  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6404 
6405 #ifdef DOCUMENTATION
6406 
6408  public:
6409 #endif
6410 
6411 #ifdef DOCUMENTATION
6412 
6417  size_t get_version() const;
6418  void set_version(size_t);
6420 #else
6421  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6422  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6423 #endif
6424 
6425 #ifdef DOCUMENTATION
6426 
6431  int get_flags() const;
6432  void set_flags(int);
6434 #else
6435  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6436  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6437 #endif
6438 
6439 #ifdef DOCUMENTATION
6440 
6445  size_t get_index() const;
6446  void set_index(size_t);
6448 #else
6449  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6450  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6451 #endif
6452 
6453 #ifdef DOCUMENTATION
6454 
6459  uint32_t get_hash() const;
6460  void set_hash(uint32_t);
6462 #else
6463  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6464  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6465 #endif
6466 
6467 #ifdef DOCUMENTATION
6468 
6477 #else
6478  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6479  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6480 #endif
6481 
6482  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6483 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6484 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6485  private:
6486  friend class boost::serialization::access;
6487 
6488  template<class S>
6489  void serialize(S &s, const unsigned /*version*/) {
6490  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6491  s & BOOST_SERIALIZATION_NVP(p_version);
6492  s & BOOST_SERIALIZATION_NVP(p_flags);
6493  s & BOOST_SERIALIZATION_NVP(p_index);
6494  s & BOOST_SERIALIZATION_NVP(p_hash);
6495  s & BOOST_SERIALIZATION_NVP(p_entries);
6496  }
6497 #endif
6498 
6499  public:
6500 #ifdef _MSC_VER
6501 # pragma pack (1)
6502 #endif
6503 
6505  uint16_t vd_version;
6506  uint16_t vd_flags;
6507  uint16_t vd_ndx;
6508  uint16_t vd_cnt;
6509  uint32_t vd_hash;
6510  uint32_t vd_aux;
6511  uint32_t vd_next;
6512  }
6513 #if !defined(SWIG) && !defined(_MSC_VER)
6514  __attribute__((packed))
6515 #endif
6516  ;
6517 
6518 #ifdef _MSC_VER
6519 # pragma pack ()
6520 #endif
6521 
6524  ctor(symver_defined);
6525  }
6526 
6528  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6529 
6531  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6532 
6534  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6535 
6536  private:
6537  void ctor(SgAsmElfSymverDefinedSection*);
6538 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6539 
6540 #ifdef DOCUMENTATION
6541  };
6542 #endif
6543 
6545 
6546  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6547  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6548 
6549 #ifdef DOCUMENTATION
6550 
6555  pbulic:
6556 #endif
6557 
6558 #ifdef DOCUMENTATION
6559 
6562  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6563  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6565 #else
6566  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6567  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6568  NO_DELETE);
6569 #endif
6570 
6571  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6572 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6573 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6574  private:
6575  friend class boost::serialization::access;
6576 
6577  template<class S>
6578  void serialize(S &s, const unsigned /*version*/) {
6579  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6580  s & BOOST_SERIALIZATION_NVP(p_entries);
6581  }
6582 #endif
6583 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6584 
6585 #ifdef DOCUMENTATION
6586  };
6587 #endif
6588 
6590 
6591  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
6592  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
6593 
6594 #ifdef DOCUMENTATION
6596  public:
6597 #endif
6598 
6599 #ifdef DOCUMENTATION
6600 
6603  SgAsmGenericString* get_name() const;
6606 #else
6607  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6608  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6609 #endif
6610 
6611  DECLARE_OTHERS(AsmElfSymverDefinedAux);
6612 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
6613 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6614  private:
6615  friend class boost::serialization::access;
6616 
6617  template<class S>
6618  void serialize(S &s, const unsigned /*version*/) {
6619  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6620  s & BOOST_SERIALIZATION_NVP(p_name);
6621  }
6622 #endif
6623 
6624  public:
6625 #ifdef _MSC_VER
6626 # pragma pack (1)
6627 #endif
6628 
6631  uint32_t vda_name;
6632  uint32_t vda_next;
6633  }
6634 #if !defined(SWIG) && !defined(_MSC_VER)
6635  __attribute__((packed))
6636 #endif
6637  ;
6638 
6639 #ifdef _MSC_VER
6640 # pragma pack ()
6641 #endif
6642 
6647  SgAsmElfSymverDefinedSection *symver_def_sec)
6648  : p_name(NULL) {
6649  ctor(symver_def_entry,symver_def_sec);
6650  }
6651 
6653  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
6654 
6656  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
6657 
6663  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6664 
6665  private:
6666  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
6667 #endif // SgAsmElfSymverDefinedAux_OTHERS
6668 
6669 #ifdef DOCUMENTATION
6670  };
6671 #endif
6672 
6674 
6675  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
6676  IS_SERIALIZABLE(AsmElfSymverNeededSection);
6677 
6678 #ifdef DOCUMENTATION
6679 
6685  public:
6686 #endif
6687 
6688 #ifdef DOCUMENTATION
6689 
6698 #else
6699  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
6700  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6701 #endif
6702 
6703  DECLARE_OTHERS(AsmElfSymverNeededSection);
6704 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
6705 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6706  private:
6707  friend class boost::serialization::access;
6708 
6709  template<class S>
6710  void serialize(S &s, const unsigned /*version*/) {
6711  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6712  s & BOOST_SERIALIZATION_NVP(p_entries);
6713  }
6714 #endif
6715 
6716  public:
6721  : SgAsmElfSection(fhdr) {
6722  ctor(strsec);
6723  }
6724 
6734  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
6735 
6740  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6741 
6745  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6746 
6748  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6749 
6750  private:
6751  void ctor(SgAsmElfStringSection*);
6752 #endif // SgAsmElfSymverNeededSection_OTHERS
6753 
6754 #ifdef DOCUMENTATION
6755  };
6756 #endif
6757 
6759 
6760  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
6761  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
6762 
6763 #ifdef DOCUMENTATION
6764 
6769  public:
6770 #endif
6771 
6772 #ifdef DOCUMENTATION
6773 
6776  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
6777  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
6779 #else
6780  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
6781  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6782  NO_DELETE);
6783 #endif
6784 
6785  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
6786 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
6787 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6788  private:
6789  friend class boost::serialization::access;
6790 
6791  template<class S>
6792  void serialize(S &s, const unsigned /*version*/) {
6793  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6794  s & BOOST_SERIALIZATION_NVP(p_entries);
6795  }
6796 #endif
6797 #endif // SgAsmElfSymverNeededEntryList_OTHERS
6798 
6799 #ifdef DOCUMENTATION
6800  };
6801 #endif
6802 
6804 
6805  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
6806  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
6807 
6808 #ifdef DOCUMENTATION
6809 
6811  public:
6812 #endif
6813 
6814 #ifdef DOCUMENTATION
6815 
6820  size_t get_version() const;
6821  void set_version(size_t);
6823 #else
6824  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
6825  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6826 #endif
6827 
6828 #ifdef DOCUMENTATION
6829 
6835 #else
6836  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
6837  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6838 #endif
6839 
6840 #ifdef DOCUMENTATION
6841 
6850 #else
6851  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
6852  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6853 #endif
6854 
6855  DECLARE_OTHERS(AsmElfSymverNeededEntry);
6856 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
6857 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6858  private:
6859  friend class boost::serialization::access;
6860 
6861  template<class S>
6862  void serialize(S &s, const unsigned /*version*/) {
6863  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6864  s & BOOST_SERIALIZATION_NVP(p_version);
6865  s & BOOST_SERIALIZATION_NVP(p_file_name);
6866  s & BOOST_SERIALIZATION_NVP(p_entries);
6867  }
6868 #endif
6869 
6870  public:
6871 #ifdef _MSC_VER
6872 # pragma pack (1)
6873 #endif
6874 
6877  uint16_t vn_version;
6878  uint16_t vn_cnt;
6879  uint32_t vn_file;
6880  uint32_t vn_aux;
6881  uint32_t vn_next;
6882  }
6883 #if !defined(SWIG) && !defined(_MSC_VER)
6884  __attribute__((packed))
6885 #endif
6886  ;
6887 
6888 #ifdef _MSC_VER
6889 # pragma pack ()
6890 #endif
6891 
6894  : p_file_name(NULL) {
6895  ctor(symver_needed);
6896  }
6897 
6899  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
6900 
6902  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
6903 
6905  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6906 
6907  private:
6908  void ctor(SgAsmElfSymverNeededSection*);
6909 #endif // SgAsmElfSymverNeededEntry_OTHERS
6910 
6911 #ifdef DOCUMENTATION
6912  };
6913 #endif
6914 
6916 
6917  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
6918  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
6919 
6920 #ifdef DOCUMENTATION
6921 
6926  public:
6927 #endif
6928 
6929 #ifdef DOCUMENTATION
6930 
6933  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
6934  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
6936 #else
6937  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
6938  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6939  NO_DELETE);
6940 #endif
6941 
6942  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
6943 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
6944 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6945  private:
6946  friend class boost::serialization::access;
6947 
6948  template<class S>
6949  void serialize(S &s, const unsigned /*version*/) {
6950  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6951  s & BOOST_SERIALIZATION_NVP(p_entries);
6952  }
6953 #endif
6954 #endif // SgAsmElfSymverNeededAuxList_OTHERS
6955 
6956 #ifdef DOCUMENTATION
6957  };
6958 #endif
6959 
6961 
6962  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
6963  IS_SERIALIZABLE(AsmElfSymverNeededAux);
6964 
6965 #ifdef DOCUMENTATION
6966 
6968  public:
6969 #endif
6970 
6971 #ifdef DOCUMENTATION
6972 
6977  uint32_t get_hash() const;
6978  void set_hash(uint32_t);
6980 #else
6981  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
6982  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6983 #endif
6984 
6985 #ifdef DOCUMENTATION
6986 
6991  int get_flags() const;
6992  void set_flags(int);
6994 #else
6995  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
6996  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6997 #endif
6998 
6999 #ifdef DOCUMENTATION
7000 
7005  size_t get_other() const;
7006  void set_other(size_t);
7008 #else
7009  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
7010  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7011 #endif
7012 
7013 #ifdef DOCUMENTATION
7014 
7017  SgAsmGenericString* get_name() const;
7020 #else
7021  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7022  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7023 #endif
7024 
7025  DECLARE_OTHERS(AsmElfSymverNeededAux);
7026 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
7027 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7028  private:
7029  friend class boost::serialization::access;
7030 
7031  template<class S>
7032  void serialize(S &s, const unsigned /*version*/) {
7033  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7034  s & BOOST_SERIALIZATION_NVP(p_hash);
7035  s & BOOST_SERIALIZATION_NVP(p_flags);
7036  s & BOOST_SERIALIZATION_NVP(p_other);
7037  s & BOOST_SERIALIZATION_NVP(p_name);
7038  }
7039 #endif
7040 
7041  public:
7042 #ifdef _MSC_VER
7043 # pragma pack (1)
7044 #endif
7045 
7048  uint32_t vna_hash;
7049  uint16_t vna_flags;
7050  uint16_t vna_other;
7051  uint32_t vna_name;
7052  uint32_t vna_next;
7053  }
7054 #if !defined(SWIG) && !defined(_MSC_VER)
7055  __attribute__((packed))
7056 #endif
7057  ;
7058 
7059 #ifdef _MSC_VER
7060 # pragma pack ()
7061 #endif
7062 
7068  : p_name(NULL) {
7069  ctor(symver_needed_entry,symver_needed_sec);
7070  }
7071 
7073  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
7074 
7076  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
7077 
7083  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7084 
7085  private:
7087 #endif // SgAsmElfSymverNeededAux_OTHERS
7088 
7089 #ifdef DOCUMENTATION
7090  };
7091 #endif
7092 
7093 
7094 
7095 
7097 
7098  /*************************************************************************************************************************
7099  * ELF Relocation Tables
7100  *************************************************************************************************************************/
7101 
7103 
7104  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7105  IS_SERIALIZABLE(AsmElfRelocSection);
7106 
7107 #ifdef DOCUMENTATION
7108 
7110  public:
7111 #endif
7112 
7113 #ifdef DOCUMENTATION
7114 
7117  bool get_uses_addend() const;
7118  void set_uses_addend(bool);
7120 #else
7121  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7122  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7123 #endif
7124 
7125 #ifdef DOCUMENTATION
7126 
7132 #else
7133  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7134  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7135 #endif
7136 
7137 #ifdef DOCUMENTATION
7138 
7146 #else
7147  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7148  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7149 #endif
7150 
7151  DECLARE_OTHERS(AsmElfRelocSection);
7152 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7153 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7154  private:
7155  friend class boost::serialization::access;
7156 
7157  template<class S>
7158  void serialize(S &s, const unsigned /*version*/) {
7159  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7160  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7161  s & BOOST_SERIALIZATION_NVP(p_target_section);
7162  s & BOOST_SERIALIZATION_NVP(p_entries);
7163  }
7164 #endif
7165 
7166  public:
7168  : SgAsmElfSection(fhdr) {
7169  ctor(symsec,targetsec);
7170  }
7171 
7174  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7175 
7177  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7178 
7180  virtual bool reallocate() $ROSE_OVERRIDE;
7181 
7183  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7184 
7186  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7187 
7188  private:
7190 #endif // SgAsmElfRelocSection_OTHERS
7191 
7192 #ifdef DOCUMENTATION
7193  };
7194 #endif
7195 
7197 
7198  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7199  IS_SERIALIZABLE(AsmElfRelocEntryList);
7200 
7201 #ifdef DOCUMENTATION
7202 
7207  public:
7208 #endif
7209 
7210 #ifdef DOCUMENTATION
7211 
7214  const SgAsmElfRelocEntryPtrList& get_entries() const;
7215  void set_entries(const SgAsmElfRelocEntryPtrList&);
7217 #else
7218  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7219  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7220  NO_DELETE);
7221 #endif
7222 
7223  DECLARE_OTHERS(AsmElfRelocEntryList);
7224 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7225 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7226  private:
7227  friend class boost::serialization::access;
7228 
7229  template<class S>
7230  void serialize(S &s, const unsigned /*version*/) {
7231  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7232  s & BOOST_SERIALIZATION_NVP(p_entries);
7233  }
7234 #endif
7235 #endif // SgAsmElfRelocEntryList_OTHERS
7236 
7237 #ifdef DOCUMENTATION
7238  };
7239 #endif
7240 
7242 
7243  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7244  IS_SERIALIZABLE(AsmElfRelocEntry);
7245 
7246 #ifdef DOCUMENTATION
7247 
7249  public:
7250 #endif
7251 
7252 #ifdef DOCUMENTATION
7253 
7258  rose_addr_t get_r_offset() const;
7259  void set_r_offset(rose_addr_t);
7261 #else
7262  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7263  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7264 #endif
7265 
7266 #ifdef DOCUMENTATION
7267 
7272  rose_addr_t get_r_addend() const;
7273  void set_r_addend(rose_addr_t);
7275 #else
7276  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7277  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7278 #endif
7279 
7280 #ifdef DOCUMENTATION
7281 
7286  unsigned long get_sym() const;
7287  void set_sym(unsigned long);
7289 #else
7290  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7291  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7292 #endif
7293 
7294 #ifdef DOCUMENTATION
7295 
7300  RelocType get_type() const;
7301  void set_type(RelocType);
7303 #else
7304  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7305  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7306 #endif
7307 
7308 #ifdef DOCUMENTATION
7309 
7312  const SgUnsignedCharList& get_extra() const;
7313  void set_extra(const SgUnsignedCharList&);
7315 #else
7316  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7317  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7318 #endif
7319 
7320  DECLARE_OTHERS(AsmElfRelocEntry);
7321 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7322 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7323  private:
7324  friend class boost::serialization::access;
7325 
7326  template<class S>
7327  void serialize(S &s, const unsigned /*version*/) {
7328  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7329  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7330  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7331  s & BOOST_SERIALIZATION_NVP(p_sym);
7332  s & BOOST_SERIALIZATION_NVP(p_type);
7333  s & BOOST_SERIALIZATION_NVP(p_extra);
7334  }
7335 #endif
7336 
7337  public:
7340  // Intel 80386 specific definitions.
7352  R_386_32PLT =11,
7359  R_386_16 =20,
7360  R_386_PC16 =21,
7361  R_386_8 =22,
7362  R_386_PC8 =23,
7378  // First Entry for X86-64
7393  R_X86_64_8 =114,
7403  };
7404 
7405 #ifdef _MSC_VER
7406 # pragma pack (1)
7407 #endif
7408 
7410  uint32_t r_offset;
7411  uint32_t r_info;
7412  uint32_t r_addend;
7413  }
7414 #if !defined(SWIG) && !defined(_MSC_VER)
7415  __attribute__((packed))
7416 #endif
7417  ;
7418 
7420  uint64_t r_offset;
7421  uint64_t r_info;
7422  uint64_t r_addend;
7423  }
7424 #if !defined(SWIG) && !defined(_MSC_VER)
7425  __attribute__((packed))
7426 #endif
7427  ;
7428 
7430  uint32_t r_offset;
7431  uint32_t r_info;
7432  }
7433 #if !defined(SWIG) && !defined(_MSC_VER)
7434  __attribute__((packed))
7435 #endif
7436  ;
7437 
7439  uint64_t r_offset;
7440  uint64_t r_info;
7441  }
7442 #if !defined(SWIG) && !defined(_MSC_VER)
7443  __attribute__((packed))
7444 #endif
7445  ;
7446 
7447 #ifdef _MSC_VER
7448 # pragma pack ()
7449 #endif
7450 
7453  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7454  ctor(section);
7455  }
7456 
7460  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7461  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7462  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7463  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7469  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7470  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7471  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7472  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7478  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7479  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7480  dump(f, prefix, idx, NULL);
7481  }
7485  std::string reloc_name() const;
7486 
7487  private:
7488  void ctor(SgAsmElfRelocSection*);
7489 #endif // SgAsmElfRelocEntry_OTHERS
7490 
7491 #ifdef DOCUMENTATION
7492  };
7493 #endif
7494 
7495 
7496 
7498 
7499  /*************************************************************************************************************************
7500  * ELF Dynamic Linking
7501  *************************************************************************************************************************/
7502 
7504 
7505  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7506  IS_SERIALIZABLE(AsmElfDynamicSection);
7507 
7508 #ifdef DOCUMENTATION
7509 
7511  public:
7512 #endif
7513 
7514 #ifdef DOCUMENTATION
7515 
7524 #else
7525  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7526  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7527 #endif
7528 
7529  DECLARE_OTHERS(AsmElfDynamicSection);
7530 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7531 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7532  private:
7533  friend class boost::serialization::access;
7534 
7535  template<class S>
7536  void serialize(S &s, const unsigned /*version*/) {
7537  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7538  s & BOOST_SERIALIZATION_NVP(p_entries);
7539  }
7540 #endif
7541 
7542  public:
7545  : SgAsmElfSection(fhdr) {
7546  ctor(strsec);
7547  }
7548 
7550  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7551 
7553  virtual void finish_parsing() $ROSE_OVERRIDE;
7554 
7557  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7558 
7560  virtual bool reallocate() $ROSE_OVERRIDE;
7561 
7563  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7564 
7566  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7567 
7568  private:
7569  void ctor(SgAsmElfStringSection*);
7570 #endif // SgAsmElfDynamicSection_OTHERS
7571 
7572 #ifdef DOCUMENTATION
7573  };
7574 #endif
7575 
7577 
7578  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7579  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7580 
7581 #ifdef DOCUMENTATION
7582 
7587  public:
7588 #endif
7589 
7590 #ifdef DOCUMENTATION
7591 
7594  const SgAsmElfDynamicEntryPtrList& get_entries() const;
7595  void set_entries(const SgAsmElfDynamicEntryPtrList&);
7597 #else
7598  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
7599  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
7600  NO_DELETE);
7601 #endif
7602 
7603  DECLARE_OTHERS(AsmElfDynamicEntryList);
7604 #if defined(SgAsmElfDynamicEntryList_OTHERS) || defined(DOCUMENTATION)
7605 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7606  private:
7607  friend class boost::serialization::access;
7608 
7609  template<class S>
7610  void serialize(S &s, const unsigned /*version*/) {
7611  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7612  s & BOOST_SERIALIZATION_NVP(p_entries);
7613  }
7614 #endif
7615 #endif // SgAsmElfDynamicEntryList_OTHERS
7616 
7617 #ifdef DOCUMENTATION
7618  };
7619 #endif
7620 
7622 
7623  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
7624  IS_SERIALIZABLE(AsmElfDynamicEntry);
7625 
7626 #ifdef DOCUMENTATION
7627 
7629  public:
7630 #endif
7631 
7632 #ifdef DOCUMENTATION
7633 
7638  EntryType get_d_tag() const;
7639  void set_d_tag(EntryType);
7641 #else
7642  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
7643  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7644 #endif
7645 
7646 #ifdef DOCUMENTATION
7647 
7652  rose_rva_t get_d_val() const;
7653  void set_d_val(rose_rva_t);
7655 #else
7656  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
7657  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7658 #endif
7659 
7660 #ifdef DOCUMENTATION
7661  // declared and documented below
7662 #else
7663  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
7664  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7665 #endif
7666 
7667 #ifdef DOCUMENTATION
7668 
7671  const SgUnsignedCharList& get_extra() const;
7672  void set_extra(const SgUnsignedCharList&);
7674 #else
7675  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7676  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7677 #endif
7678 
7679  DECLARE_OTHERS(AsmElfDynamicEntry);
7680 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
7681 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7682  private:
7683  friend class boost::serialization::access;
7684 
7685  template<class S>
7686  void serialize(S &s, const unsigned /*version*/) {
7687  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7688  s & BOOST_SERIALIZATION_NVP(p_d_tag);
7689  s & BOOST_SERIALIZATION_NVP(p_d_val);
7690  s & BOOST_SERIALIZATION_NVP(p_name);
7691  s & BOOST_SERIALIZATION_NVP(p_extra);
7692  }
7693 #endif
7694 
7695  public:
7696  enum EntryType { /* Type Executable SharedObj Purpose */
7697  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
7698  DT_NEEDED = 1, /* value optional optional Name of needed library */
7699  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
7700  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
7701  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
7702  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
7703  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
7704  DT_RELA = 7, /* pointer mandatory optional Relocation table */
7705  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
7706  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
7707  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
7708  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
7709  DT_INIT = 12, /* pointer optional optional Initialization function */
7710  DT_FINI = 13, /* pointer optional optional Termination function */
7711  DT_SONAME = 14, /* value ignored optional Name of shared object */
7712  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
7713  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
7714  DT_REL = 17, /* pointer mandatory optional Relocation table */
7715  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
7716  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
7717  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
7718  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
7719  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
7720  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
7721  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
7722  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
7723  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
7724  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
7725  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
7726  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
7727  DT_FLAGS = 30, /* value optional ? Bit flags */
7728  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
7729  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
7730  DT_NUM = 34, /* ? ? ? "number used"? */
7731 
7732  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
7733  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
7734  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
7735  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
7736  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
7737  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
7738  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
7739  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
7740  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
7741  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
7742  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
7743 
7744  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
7745  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
7746  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
7747  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
7748  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
7749  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
7750  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
7751  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
7752  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
7753  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
7754  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
7755 
7756  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
7757  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
7758  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
7759  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
7760  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
7761  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
7762  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
7763  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
7764 
7765  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
7766  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
7767  };
7768 
7769 #ifdef _MSC_VER
7770 # pragma pack (1)
7771 #endif
7772 
7775  uint32_t d_tag;
7776  uint32_t d_val;
7777  }
7778 #if !defined(SWIG) && !defined(_MSC_VER)
7779  __attribute__((packed))
7780 #endif
7781  ;
7782 
7784  uint64_t d_tag;
7785  uint64_t d_val;
7786  }
7787 #if !defined(SWIG) && !defined(_MSC_VER)
7788  __attribute__((packed))
7789 #endif
7790  ;
7791 
7792 #ifdef _MSC_VER
7793 # pragma pack ()
7794 #endif
7795 
7798  : p_d_tag(DT_NULL), p_name(NULL) {
7799  ctor(dynsec);
7800  }
7801 
7805  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);
7806  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*);
7812  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*) const;
7813  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*) const;
7817  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
7818 
7820  static std::string to_string(SgAsmElfDynamicEntry::EntryType);
7821 
7825  SgAsmGenericString* get_name() const { return p_name; }
7829  private:
7830  void ctor(SgAsmElfDynamicSection*);
7831 #endif // SgAsmElfDynamicEntry_OTHERS
7832 
7833 #ifdef DOCUMENTATION
7834  };
7835 #endif
7836 
7837 
7838 
7839 
7841 
7842  /*************************************************************************************************************************
7843  * ELF String Tables
7844  *************************************************************************************************************************/
7845 
7847 
7848  DECLARE_LEAF_CLASS(AsmElfStringSection);
7849  IS_SERIALIZABLE(AsmElfStringSection);
7850  AsmElfStringSection.setAutomaticGenerationOfDestructor(false);
7851 
7852 #ifdef DOCUMENTATION
7853 
7857  public:
7858 #endif
7859 
7860 #ifdef DOCUMENTATION
7861 
7866  SgAsmElfStrtab* get_strtab() const;
7867  void set_strtab(SgAsmElfStrtab*);
7869 #else
7870  AsmElfStringSection.setDataPrototype("SgAsmElfStrtab*", "strtab", "= NULL",
7871  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7872 #endif
7873 
7874  DECLARE_OTHERS(AsmElfStringSection);
7875 #if defined(SgAsmElfStringSection_OTHERS) || defined(DOCUMENTATION)
7876 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7877  private:
7878  friend class boost::serialization::access;
7879 
7880  template<class S>
7881  void serialize(S &s, const unsigned /*version*/) {
7882  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7883  s & BOOST_SERIALIZATION_NVP(p_strtab);
7884  }
7885 #endif
7886 
7887  public:
7890  : SgAsmElfSection(fhdr), p_strtab(NULL) {
7891  ctor();
7892  }
7893 
7895  virtual SgAsmElfStringSection *parse() $ROSE_OVERRIDE;
7896 
7898  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7899 
7904  virtual void set_size(rose_addr_t newsize) $ROSE_OVERRIDE;
7905 
7912  virtual bool reallocate() $ROSE_OVERRIDE;
7913 
7915  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7916 
7917  private:
7918  void ctor();
7919  void ctor(SgAsmElfSectionTable*);
7920 #endif // SgAsmElfStringSection_OTHERS
7921 
7922 #ifdef DOCUMENTATION
7923  };
7924 #endif
7925 
7927 
7928  DECLARE_LEAF_CLASS(AsmElfStrtab);
7929  IS_SERIALIZABLE(AsmElfStrtab);
7930  AsmElfStrtab.setAutomaticGenerationOfDestructor(false);
7931 
7932 #ifdef DOCUMENTATION
7933 
7934  class SgAsmElfStrtab: public SgAsmGenericStrtab {
7935  public:
7936 #endif
7937 
7938  DECLARE_OTHERS(AsmElfStrtab);
7939 #if defined(SgAsmElfStrtab_OTHERS) || defined(DOCUMENTATION)
7940 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7941  private:
7942  friend class boost::serialization::access;
7943 
7944  template<class S>
7945  void serialize(S &s, const unsigned /*version*/) {
7946  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericStrtab);
7947  }
7948 #endif
7949 
7950  public:
7954  explicit SgAsmElfStrtab(class SgAsmElfSection *containing_section)
7955  : SgAsmGenericStrtab(containing_section) {
7956  ctor();
7957  }
7958 
7965  virtual ~SgAsmElfStrtab();
7966 
7970  virtual SgAsmElfStrtab *parse() $ROSE_OVERRIDE;
7971 
7975  virtual void unparse(std::ostream&) const;
7976 
7982  virtual SgAsmStringStorage *create_storage(rose_addr_t offset, bool shared) $ROSE_OVERRIDE;
7983 
7987  virtual rose_addr_t get_storage_size(const SgAsmStringStorage*) $ROSE_OVERRIDE;
7988 
7998  virtual void allocate_overlap(SgAsmStringStorage*) $ROSE_OVERRIDE;
7999 
8001  virtual void rebind(SgAsmStringStorage*, rose_addr_t) $ROSE_OVERRIDE;
8002 
8003  private:
8004  void ctor();
8005 #endif // SgAsmElfStrtab_OTHERS
8006 
8007 #ifdef DOCUMENTATION
8008  };
8009 #endif
8010 
8011 
8012 
8013 
8015 
8016  /*************************************************************************************************************************
8017  * ELF Notes
8018  *************************************************************************************************************************/
8019 
8021 
8022  DECLARE_LEAF_CLASS(AsmElfNoteSection);
8023  IS_SERIALIZABLE(AsmElfNoteSection);
8024 
8025 #ifdef DOCUMENTATION
8027  public:
8028 #endif
8029 
8030 #ifdef DOCUMENTATION
8031 
8040 #else
8041  AsmElfNoteSection.setDataPrototype("SgAsmElfNoteEntryList*", "entries", "= NULL",
8042  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8043 #endif
8044 
8045  DECLARE_OTHERS(AsmElfNoteSection);
8046 #if defined(SgAsmElfNoteSection_OTHERS) || defined(DOCUMENTATION)
8047 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8048  private:
8049  friend class boost::serialization::access;
8050 
8051  template<class S>
8052  void serialize(S &s, const unsigned /*version*/) {
8053  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8054  s & BOOST_SERIALIZATION_NVP(p_entries);
8055  }
8056 #endif
8057 
8058  public:
8061  : SgAsmElfSection(fhdr) {
8062  ctor();
8063  }
8064  virtual SgAsmElfNoteSection *parse() $ROSE_OVERRIDE;
8065 
8067  virtual bool reallocate() $ROSE_OVERRIDE;
8068 
8070  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8071 
8073  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8074 
8075  private:
8076  void ctor();
8077 #endif // SgAsmElfNoteSection_OTHERS
8078 
8079 #ifdef DOCUMENTATION
8080  };
8081 #endif
8082 
8084 
8085  DECLARE_LEAF_CLASS(AsmElfNoteEntryList);
8086  IS_SERIALIZABLE(AsmElfNoteEntryList);
8087 
8088 #ifdef DOCUMENTATION
8089 
8094  public:
8095 #endif
8096 
8097 #ifdef DOCUMENTATION
8098 
8101  const SgAsmElfNoteEntryPtrList& get_entries() const;
8102  void set_entries(const SgAsmElfNoteEntryPtrList&);
8104 #else
8105  AsmElfNoteEntryList.setDataPrototype("SgAsmElfNoteEntryPtrList", "entries", "",
8106  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8107 #endif
8108 
8109  DECLARE_OTHERS(AsmElfNoteEntryList);
8110 #if defined(SgAsmElfNoteEntryList_OTHERS) || defined(DOCUMENTATION)
8111 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8112  private:
8113  friend class boost::serialization::access;
8114 
8115  template<class S>
8116  void serialize(S &s, const unsigned /*version*/) {
8117  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8118  s & BOOST_SERIALIZATION_NVP(p_entries);
8119  }
8120 #endif
8121 #endif // SgAsmElfNoteEntryList_OTHERS
8122 
8123 #ifdef DOCUMENTATION
8124  };
8125 #endif
8126 
8128 
8129  DECLARE_LEAF_CLASS(AsmElfNoteEntry);
8130  IS_SERIALIZABLE(AsmElfNoteEntry);
8131 
8132 #ifdef DOCUMENTATION
8133 
8135  public:
8136 #endif
8137 
8138 #ifdef DOCUMENTATION
8139 
8144  unsigned get_type() const;
8145  void set_type(unsigned);
8147 #else
8148  AsmElfNoteEntry.setDataPrototype("unsigned", "type", "= 0",
8149  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8150 #endif
8151 
8152 #ifdef DOCUMENTATION
8153  // documented below
8154 #else
8155  AsmElfNoteEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
8156  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8157 #endif
8158 
8159 #ifdef DOCUMENTATION
8160 
8165  const SgUnsignedCharList& get_payload() const;
8166  void set_payload(const SgUnsignedCharList&);
8168 #else
8169  AsmElfNoteEntry.setDataPrototype("SgUnsignedCharList", "payload", "",
8170  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8171 #endif
8172 
8173  DECLARE_OTHERS(AsmElfNoteEntry);
8174 #if defined(SgAsmElfNoteEntry_OTHERS) || defined(DOCUMENTATION)
8175 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8176  private:
8177  friend class boost::serialization::access;
8178 
8179  template<class S>
8180  void serialize(S &s, const unsigned /*version*/) {
8181  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8182  s & BOOST_SERIALIZATION_NVP(p_type);
8183  s & BOOST_SERIALIZATION_NVP(p_name);
8184  s & BOOST_SERIALIZATION_NVP(p_payload);
8185  }
8186 #endif
8187 
8188  public:
8191  : p_type(0), p_name(NULL) {
8192  ctor(section);
8193  }
8194 
8201  SgAsmGenericString *get_name() const;
8202  void set_name(SgAsmGenericString *name);