ROSE  0.9.11.115
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  }
784 #endif
785 
786  private:
787  struct SemanticFailure {
788  size_t n;
789  SemanticFailure(): n(0) {}
790  };
791  SemanticFailure semanticFailure_;
792 
793  public:
798  static const int64_t INVALID_STACK_DELTA;
799 
805  virtual std::string description() const { return ""; }
806 
807  // FIXME[Robb P Matzke 2017-02-13]: unused?
808  void appendSources( SgAsmInstruction* instruction );
809 
811  size_t nOperands() const;
812 
816  SgAsmExpression* operand(size_t) const;
817 
824  virtual bool terminatesBasicBlock();
825 
839  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
840  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
852  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
853  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
859  bool isFirstInBlock();
860 
864  bool isLastInBlock();
865 
870  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
871 
1006  virtual bool hasEffect();
1007 
1016  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
1017  bool relax_stack_semantics=false);
1018 
1028  virtual std::vector<std::pair<size_t,size_t> >
1029  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
1030  bool relax_stack_semantics=false);
1031 
1038  virtual std::set<rose_addr_t> getSuccessors(bool* complete); /*subclasses must redefine*/
1039 
1048  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1049  bool *complete,
1050  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1052 
1058  virtual size_t get_size() const;
1059 
1065  virtual bool isUnknown() const;
1066 
1100  virtual unsigned get_anyKind() const;
1101 
1105  virtual std::string toString() const;
1106 
1111  virtual std::set<rose_addr_t> explicitConstants() const;
1112 
1122  size_t semanticFailure() const;
1123  void semanticFailure(size_t);
1124  void incrementSemanticFailure();
1127 #endif // SgAsmInstruction_OTHERS
1128 
1129 #ifdef DOCUMENTATION
1130  };
1131 #endif
1132 
1133 
1134 
1136 
1137  /**************************************************************************************************************************
1138  * Instruction Expressions
1139  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1140  **************************************************************************************************************************/
1141 
1143 
1144  DECLARE_LEAF_CLASS(AsmOperandList);
1145  IS_SERIALIZABLE(AsmOperandList);
1146 
1147 #ifdef DOCUMENTATION
1148 
1149  class SgAsmOperandList: public SgAsmNode {
1150  public:
1151 #endif
1152 
1153 #ifdef DOCUMENTATION
1154 
1160  const SgAsmExpressionPtrList& get_operands() const;
1161  void set_oerands(const SgAsmExpressionPtrList&);
1163 #else
1164  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1165  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1166 #endif
1167 
1168  DECLARE_OTHERS(AsmOperandList);
1169 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1170 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1171  private:
1172  friend class boost::serialization::access;
1173 
1174  template<class S>
1175  void serialize(S &s, const unsigned /*version*/) {
1176  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1177  s & BOOST_SERIALIZATION_NVP(p_operands);
1178  }
1179 #endif
1180 
1181  public:
1183  void append_operand(SgAsmExpression* operand);
1184 #endif // SgAsmOperandList_OTHERS
1185 
1186 #ifdef DOCUMENTATION
1187  };
1188 #endif
1189 
1190  // FIXME[Robb P Matzke 2016-10-31]
1191  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1192 
1194 
1195  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1196  IS_SERIALIZABLE(AsmBinaryAdd);
1197 
1198 #ifdef DOCUMENTATION
1199 
1201  public:
1202 #endif
1203 
1204  DECLARE_OTHERS(AsmBinaryAdd);
1205 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1206 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1207  private:
1208  friend class boost::serialization::access;
1209 
1210  template<class S>
1211  void serialize(S &s, const unsigned /*version*/) {
1212  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1213  }
1214 #endif
1215 #endif // SgAsmBinaryAdd_OTHERS
1216 
1217 #ifdef DOCUMENTATION
1218  };
1219 #endif
1220 
1222 
1223  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1224  IS_SERIALIZABLE(AsmBinarySubtract);
1225 
1226 #ifdef DOCUMENTATION
1227 
1229  public:
1230 #endif
1231 
1232  DECLARE_OTHERS(AsmBinarySubtract);
1233 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1234 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1235  private:
1236  friend class boost::serialization::access;
1237 
1238  template<class S>
1239  void serialize(S &s, const unsigned /*version*/) {
1240  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1241  }
1242 #endif
1243 #endif // SgAsmBinarySubtract_OTHERS
1244 
1245 #ifdef DOCUMENTATION
1246  };
1247 #endif
1248 
1250 
1251  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1252  IS_SERIALIZABLE(AsmBinaryMultiply);
1253 
1254 #ifdef DOCUMENTATION
1255 
1257  public:
1258 #endif
1259 
1260  DECLARE_OTHERS(AsmBinaryMultiply);
1261 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1262 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1263  private:
1264  friend class boost::serialization::access;
1265 
1266  template<class S>
1267  void serialize(S &s, const unsigned /*version*/) {
1268  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1269  }
1270 #endif
1271 #endif // SgAsmBinaryMultiply_OTHERS
1272 
1273 #ifdef DOCUMENTATION
1274  };
1275 #endif
1276 
1278 
1279  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1280  IS_SERIALIZABLE(AsmBinaryDivide);
1281 
1282 #ifdef DOCUMENTATION
1283 
1285  public:
1286 #endif
1287 
1288  DECLARE_OTHERS(AsmBinaryDivide);
1289 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1290 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1291  private:
1292  friend class boost::serialization::access;
1293 
1294  template<class S>
1295  void serialize(S &s, const unsigned /*version*/) {
1296  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1297  }
1298 #endif
1299 #endif // SgAsmBinaryDivide_OTHERS
1300 
1301 #ifdef DOCUMENTATION
1302  };
1303 #endif
1304 
1306 
1307  DECLARE_LEAF_CLASS(AsmBinaryMod);
1308  IS_SERIALIZABLE(AsmBinaryMod);
1309 
1310 #ifdef DOCUMENTATION
1311 
1313  public:
1314 #endif
1315 
1316  DECLARE_OTHERS(AsmBinaryMod);
1317 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1318 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1319  private:
1320  friend class boost::serialization::access;
1321 
1322  template<class S>
1323  void serialize(S &s, const unsigned /*version*/) {
1324  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1325  }
1326 #endif
1327 #endif // SgAsmBinaryMod_OTHERS
1328 
1329 #ifdef DOCUMENTATION
1330  };
1331 #endif
1332 
1334 
1335  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1336  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1337 
1338 #ifdef DOCUMENTATION
1339 
1341  public:
1342 #endif
1343 
1344  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1345 #if defined(SgAsmBinaryAddPreupdate_OTHERS) || defined(DOCUMENTATION)
1346 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1347  private:
1348  friend class boost::serialization::access;
1349 
1350  template<class S>
1351  void serialize(S &s, const unsigned /*version*/) {
1352  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1353  }
1354 #endif
1355 #endif // SgAsmBinaryAddPreupdate_OTHERS
1356 
1357 #ifdef DOCUMENTATION
1358  };
1359 #endif
1360 
1362 
1363  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1364  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1365 
1366 #ifdef DOCUMENTATION
1367 
1369  public:
1370 #endif
1371 
1372  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1373 #if defined(SgAsmBinarySubtractPreupdate_OTHERS) || defined(DOCUMENTATION)
1374 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1375  private:
1376  friend class boost::serialization::access;
1377 
1378  template<class S>
1379  void serialize(S &s, const unsigned /*version*/) {
1380  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1381  }
1382 #endif
1383 #endif // SgAsmBinarySubtractPreupdate_OTHERS
1384 
1385 #ifdef DOCUMENTATION
1386  };
1387 #endif
1388 
1390 
1391  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1392  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1393 
1394 #ifdef DOCUMENTATION
1395 
1397  public:
1398 #endif
1399 
1400  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1401 #if defined(SgAsmBinaryAddPostupdate_OTHERS) || defined(DOCUMENTATION)
1402 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1403  private:
1404  friend class boost::serialization::access;
1405 
1406  template<class S>
1407  void serialize(S &s, const unsigned /*version*/) {
1408  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1409  }
1410 #endif
1411 #endif // SgAsmBinaryAddPostupdate_OTHERS
1412 
1413 #ifdef DOCUMENTATION
1414  };
1415 #endif
1416 
1418 
1419  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1420  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1421 
1422 #ifdef DOCUMENTATION
1423 
1425  public:
1426 #endif
1427 
1428  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1429 #if defined(SgAsmBinarySubtractPostupdate_OTHERS) || defined(DOCUMENTATION)
1430 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1431  private:
1432  friend class boost::serialization::access;
1433 
1434  template<class S>
1435  void serialize(S &s, const unsigned /*version*/) {
1436  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1437  }
1438 #endif
1439 #endif // SgAsmBinarySubtractPostupdate_OTHERS
1440 
1441 #ifdef DOCUMENTATION
1442  };
1443 #endif
1444 
1446 
1447  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1448  IS_SERIALIZABLE(AsmBinaryLsl);
1449 
1450 #ifdef DOCUMENTATION
1451 
1453  public:
1454 #endif
1455 
1456  DECLARE_OTHERS(AsmBinaryLsl);
1457 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1458 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1459  private:
1460  friend class boost::serialization::access;
1461 
1462  template<class S>
1463  void serialize(S &s, const unsigned /*version*/) {
1464  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1465  }
1466 #endif
1467 #endif // SgAsmBinaryLsl_OTHERS
1468 
1469 #ifdef DOCUMENTATION
1470  };
1471 #endif
1472 
1474 
1475  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1476  IS_SERIALIZABLE(AsmBinaryLsr);
1477 
1478 #ifdef DOCUMENTATION
1479 
1481  public:
1482 #endif
1483 
1484  DECLARE_OTHERS(AsmBinaryLsr);
1485 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1486 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1487  private:
1488  friend class boost::serialization::access;
1489 
1490  template<class S>
1491  void serialize(S &s, const unsigned /*version*/) {
1492  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1493  }
1494 #endif
1495 #endif // SgAsmBinaryLsr_OTHERS
1496 
1497 #ifdef DOCUMENTATION
1498  };
1499 #endif
1500 
1502 
1503  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1504  IS_SERIALIZABLE(AsmBinaryAsr);
1505 
1506 #ifdef DOCUMENTATION
1507 
1509  public:
1510 #endif
1511 
1512  DECLARE_OTHERS(AsmBinaryAsr);
1513 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1514 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1515  private:
1516  friend class boost::serialization::access;
1517 
1518  template<class S>
1519  void serialize(S &s, const unsigned /*version*/) {
1520  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1521  }
1522 #endif
1523 #endif // SgAsmBinaryAsr_OTHERS
1524 
1525 #ifdef DOCUMENTATION
1526  };
1527 #endif
1528 
1530 
1531  DECLARE_LEAF_CLASS(AsmBinaryRor);
1532  IS_SERIALIZABLE(AsmBinaryRor);
1533 
1534 #ifdef DOCUMENTATION
1535 
1537  public:
1538 #endif
1539 
1540  DECLARE_OTHERS(AsmBinaryRor);
1541 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1542 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1543  private:
1544  friend class boost::serialization::access;
1545 
1546  template<class S>
1547  void serialize(S &s, const unsigned /*version*/) {
1548  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1549  }
1550 #endif
1551 #endif // SgAsmBinaryRor_OTHERS
1552 
1553 #ifdef DOCUMENTATION
1554  };
1555 #endif
1556 
1558 
1559  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1560  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1561  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1562  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1563  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1564  AsmBinaryRor,
1565  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1566  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1567  IS_SERIALIZABLE(AsmBinaryExpression);
1568 
1569 #ifdef DOCUMENTATION
1570 
1572  public:
1573 #endif
1574 
1575 #ifdef DOCUMENTATION
1576 
1579  SgAsmExpression* get_lhs() const;
1580  void set_lhs(SgAsmExpression*);
1582 #else
1583  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1584  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1585 #endif
1586 
1587 #ifdef DOCUMENTATION
1588 
1591  SgAsmExpression* get_rhs() const;
1592  void set_rhs(SgAsmExpression*);
1594 #else
1595  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1596  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1597 #endif
1598 
1599  DECLARE_OTHERS(AsmBinaryExpression);
1600 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1601 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1602  private:
1603  friend class boost::serialization::access;
1604 
1605  template<class S>
1606  void serialize(S &s, const unsigned /*version*/) {
1607  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1608  s & BOOST_SERIALIZATION_NVP(p_lhs);
1609  s & BOOST_SERIALIZATION_NVP(p_rhs);
1610  }
1611 #endif
1612 #endif // SgAsmBinaryExpression_OTHERS
1613 
1614 #ifdef DOCUMENTATION
1615  };
1616 #endif
1617 
1619 
1620  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1621  IS_SERIALIZABLE(AsmUnaryPlus);
1622 
1623 #ifdef DOCUMENTATION
1624 
1626  public:
1627 #endif
1628 
1629  DECLARE_OTHERS(AsmUnaryPlus);
1630 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1631 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1632  private:
1633  friend class boost::serialization::access;
1634 
1635  template<class S>
1636  void serialize(S &s, const unsigned /*version*/) {
1637  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1638  }
1639 #endif
1640 #endif // SgAsmUnaryPlus_OTHERS
1641 
1642 #ifdef DOCUMENTATION
1643  };
1644 #endif
1645 
1647 
1648  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1649  IS_SERIALIZABLE(AsmUnaryMinus);
1650 
1651 #ifdef DOCUMENTATION
1652 
1654  public:
1655 #endif
1656 
1657  DECLARE_OTHERS(AsmUnaryMinus);
1658 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1659 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1660  private:
1661  friend class boost::serialization::access;
1662 
1663  template<class S>
1664  void serialize(S &s, const unsigned /*version*/) {
1665  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1666  }
1667 #endif
1668 #endif // SgAsmUnaryMinus_OTHERS
1669 
1670 #ifdef DOCUMENTATION
1671  };
1672 #endif
1673 
1675 
1676  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1677  IS_SERIALIZABLE(AsmUnaryRrx);
1678 
1679 #ifdef DOCUMENTATION
1680  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1682  public:
1683 #endif
1684 
1685  DECLARE_OTHERS(AsmUnaryRrx);
1686 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1687 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1688  private:
1689  friend class boost::serialization::access;
1690 
1691  template<class S>
1692  void serialize(S &s, const unsigned /*version*/) {
1693  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1694  }
1695 #endif
1696 #endif // SgAsmUnaryRrx_OTHERS
1697 
1698 #ifdef DOCUMENTATION
1699  };
1700 #endif
1701 
1703 
1704  DECLARE_LEAF_CLASS(AsmUnaryArmSpecialRegisterList);
1705  IS_SERIALIZABLE(AsmUnaryArmSpecialRegisterList);
1706 
1707 #ifdef DOCUMENTATION
1708  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1710  public:
1711 #endif
1712 
1713  DECLARE_OTHERS(AsmUnaryArmSpecialRegisterList);
1714 #if defined(SgAsmUnaryArmSpecialRegisterList_OTHERS) || defined(DOCUMENTATION)
1715 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1716  private:
1717  friend class boost::serialization::access;
1718 
1719  template<class S>
1720  void serialize(S &s, const unsigned /*version*/) {
1721  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1722  }
1723 #endif
1724 #endif // SgAsmUnaryArmSpecialRegisterList_OTHERS
1725 
1726 #ifdef DOCUMENTATION
1727  };
1728 #endif
1729 
1731 
1732  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
1733  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryArmSpecialRegisterList,
1734  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
1735  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1736  IS_SERIALIZABLE(AsmUnaryExpression);
1737 
1738 #ifdef DOCUMENTATION
1739 
1741  public:
1742 #endif
1743 
1744 #ifdef DOCUMENTATION
1745 
1748  SgAsmExpression* get_operand() const;
1751 #else
1752  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
1753  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1754 #endif
1755 
1756  DECLARE_OTHERS(AsmUnaryExpression);
1757 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
1758 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1759  private:
1760  friend class boost::serialization::access;
1761 
1762  template<class S>
1763  void serialize(S &s, const unsigned /*version*/) {
1764  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1765  s & BOOST_SERIALIZATION_NVP(p_operand);
1766  }
1767 #endif
1768 #endif // SgAsmUnaryExpression_OTHERS
1769 
1770 #ifdef DOCUMENTATION
1771  };
1772 #endif
1773 
1775 
1776  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
1777  IS_SERIALIZABLE(AsmDirectRegisterExpression);
1778 
1779 #ifdef DOCUMENTATION
1780 
1782  public:
1783 #endif
1784 
1785 #ifdef DOCUMENTATION
1786 
1789  unsigned get_psr_mask() const;
1790  void set_psr_mask(unsigned);
1792 #else
1793  AsmDirectRegisterExpression.setDataPrototype("unsigned", "psr_mask", "=0", // for ARM
1794  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1795  NO_DELETE);
1796 #endif
1797 
1798  DECLARE_OTHERS(AsmDirectRegisterExpression);
1799 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1800 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1801  private:
1802  friend class boost::serialization::access;
1803 
1804  template<class S>
1805  void serialize(S &s, const unsigned /*version*/) {
1806  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1807  s & BOOST_SERIALIZATION_NVP(p_psr_mask);
1808  }
1809 #endif
1810 
1811  private:
1812  // Default c'tor needed for serialization
1814  : p_psr_mask(0) {}
1815 #endif // SgAsmDirectRegisterExpression_OTHERS
1816 
1817 #ifdef DOCUMENTATION
1818  };
1819 #endif
1820 
1822 
1823  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
1824  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
1825 
1826 #ifdef DOCUMENTATION
1827 
1844  public:
1845 #endif
1846 
1847 #ifdef DOCUMENTATION
1848 
1856 #else
1857  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "stride", "",
1858  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1859 #endif
1860 
1861 #ifdef DOCUMENTATION
1862 
1870 #else
1871  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "offset", "",
1872  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1873 #endif
1874 
1875 #ifdef DOCUMENTATION
1876 
1881  size_t get_index() const;
1882  void set_index(size_t);
1884 #else
1885  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
1886  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1887 #endif
1888 
1889 #ifdef DOCUMENTATION
1890 
1895  size_t get_modulus() const;
1896  void set_modulus(size_t);
1898 #else
1899  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
1900  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1901 #endif
1902 
1903  DECLARE_OTHERS(AsmIndirectRegisterExpression);
1904 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1905 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1906  private:
1907  friend class boost::serialization::access;
1908 
1909  template<class S>
1910  void serialize(S &s, const unsigned /*version*/) {
1911  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1912  s & BOOST_SERIALIZATION_NVP(p_stride);
1913  s & BOOST_SERIALIZATION_NVP(p_offset);
1914  s & BOOST_SERIALIZATION_NVP(p_index);
1915  s & BOOST_SERIALIZATION_NVP(p_modulus);
1916  }
1917 #endif
1918 
1919  private:
1920  // Default c'tor needed for serialization
1922  : p_index(0), p_modulus(0) {}
1923 #endif // SgAsmIndirectRegisterExpression_OTHERS
1924 
1925 #ifdef DOCUMENTATION
1926  };
1927 #endif
1928 
1930 
1931  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
1932  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
1933  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
1934  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
1935 
1936 #ifdef DOCUMENTATION
1937 
1939  public:
1940 #endif
1941 
1942 #ifdef DOCUMENTATION
1943 
1949 #else
1950  AsmRegisterReferenceExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "descriptor", "",
1951  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1952 #endif
1953 
1954 #ifdef DOCUMENTATION
1955 
1960  int get_adjustment() const;
1961  void set_adjustment(int);
1963 #else
1964  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
1965  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1966  NO_DELETE);
1967 #endif
1968 
1969  DECLARE_OTHERS(AsmRegisterReferenceExpression);
1970 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
1971 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1972  private:
1973  friend class boost::serialization::access;
1974 
1975  template<class S>
1976  void serialize(S &s, const unsigned /*version*/) {
1977  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1978  s & BOOST_SERIALIZATION_NVP(p_descriptor);
1979  s & BOOST_SERIALIZATION_NVP(p_adjustment);
1980  }
1981 #endif
1982 
1983  protected:
1984  // Default c'tor needed for serialization
1986  : p_adjustment(0) {}
1987 #endif // SgAsmRegisterReferenceExpression_OTHERS
1988 
1989 #ifdef DOCUMENTATION
1990  };
1991 #endif
1992 
1994 
1995  DECLARE_LEAF_CLASS(AsmRegisterNames);
1996  IS_SERIALIZABLE(AsmRegisterNames);
1997 
1998 #ifdef DOCUMENTATION
1999 
2001  public:
2002 #endif
2003 
2004 #ifdef DOCUMENTATION
2005 
2011  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
2012  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
2014 #else
2015  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
2016  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2017 #endif
2018 
2019 #ifdef DOCUMENTATION
2020 
2026  unsigned get_mask() const;
2027  void set_mask(unsigned);
2029 #else
2030  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
2031  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2032 #endif
2033 
2034  DECLARE_OTHERS(AsmRegisterNames);
2035 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
2036 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2037  private:
2038  friend class boost::serialization::access;
2039 
2040  template<class S>
2041  void serialize(S &s, const unsigned /*version*/) {
2042  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2043  s & BOOST_SERIALIZATION_NVP(p_registers);
2044  s & BOOST_SERIALIZATION_NVP(p_mask);
2045  }
2046 #endif
2047 #endif // SgAsmRegisterNames_OTHERS
2048 
2049 #ifdef DOCUMENTATION
2050  };
2051 #endif
2052 
2054 
2055  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2056  IS_SERIALIZABLE(AsmIntegerValueExpression);
2057 
2058 #ifdef DOCUMENTATION
2059 
2075  public:
2076 #endif
2077 
2078 #ifdef DOCUMENTATION
2079 
2089  SgNode* get_baseNode() const;
2090  void set_baseNode(SgNode*);
2092 #else
2093  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2094  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2095 #endif
2096 
2097  DECLARE_OTHERS(AsmIntegerValueExpression);
2098 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2099 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2100  private:
2101  friend class boost::serialization::access;
2102 
2103  template<class S>
2104  void serialize(S &s, const unsigned /*version*/) {
2105  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2106  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2107  }
2108 #endif
2109 
2110  public:
2115  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2116 
2123 
2125  static uint64_t virtualAddress(SgNode*);
2126 
2146  std::string get_label(bool quiet=false) const;
2147 
2149  size_t get_significantBits() const;
2150 
2156  void makeRelativeTo(SgNode *baseNode);
2157 
2162  uint64_t get_baseAddress() const;
2163 
2169  uint64_t get_absoluteValue(size_t nbits=0) const;
2170 
2174  void set_absoluteValue(uint64_t);
2175 
2177  int64_t get_signedValue() const;
2178 
2182  int64_t get_relativeValue() const;
2183 
2188  void set_relativeValue(int64_t v, size_t nbits=64);
2189 
2190  uint64_t get_value() const { return get_absoluteValue(); }
2191 
2192 #endif // SgAsmIntegerValueExpression_OTHERS
2193 
2194 #ifdef DOCUMENTATION
2195  };
2196 #endif
2197 
2199 
2200  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2201  IS_SERIALIZABLE(AsmFloatValueExpression);
2202 
2203 #ifdef DOCUMENTATION
2204 
2209  public:
2210 #endif
2211 
2212  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2213 
2214  DECLARE_OTHERS(AsmFloatValueExpression);
2215 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2216  private:
2217  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2218  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2219  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2220  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2221  // understand "mutable".
2222  mutable double p_nativeValue;
2223  mutable bool p_nativeValueIsValid;
2224 
2225 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2226  private:
2227  friend class boost::serialization::access;
2228 
2229  template<class S>
2230  void serialize(S &s, const unsigned /*version*/) {
2231  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2232  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2233  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2234  }
2235 #endif
2236 
2237  public:
2242  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2243 
2249  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2250 
2257 
2259  void set_nativeValue(double);
2260 
2262  double get_nativeValue() const;
2263 
2268  void updateBitVector();
2269 
2274  void updateNativeValue() const;
2275 #endif // SgAsmFloatValueExpression_OTHERS
2276 
2277 #ifdef DOCUMENTATION
2278  };
2279 #endif
2280 
2282 
2283  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2284  AsmIntegerValueExpression | AsmFloatValueExpression,
2285  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2286  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2287  IS_SERIALIZABLE(AsmConstantExpression);
2288 
2289  DECLARE_HEADERS(AsmConstantExpression);
2290 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2291  #include <Sawyer/BitVector.h>
2292 #endif // SgAsmConstantExpression_HEADERS
2293 
2294 #ifdef DOCUMENTATION
2295 
2300  public:
2301 #endif
2302 
2303 #ifndef DOCUMENTATION
2304  // Documented below. Implemented below due to ROSETTA limitations.
2305  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2306  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2307 #endif
2308 
2309  DECLARE_OTHERS(AsmConstantExpression);
2310 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2311 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2312  private:
2313  friend class boost::serialization::access;
2314 
2315  template<class S>
2316  void serialize(S &s, const unsigned /*version*/) {
2317  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2318  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2319  }
2320 #endif
2321 
2322  public:
2328  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2329  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2330  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2332 #endif // SgAsmConstantExpression_OTHERS
2333 
2334 #ifdef DOCUMENTATION
2335  };
2336 #endif
2337 
2339 
2340  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2341  AsmConstantExpression,
2342  "AsmValueExpression", "AsmValueExpressionTag", false);
2343  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2344  IS_SERIALIZABLE(AsmValueExpression);
2345 
2346 #ifdef DOCUMENTATION
2347 
2355  public:
2356 #endif
2357 
2358 #ifdef DOCUMENTATION
2359 
2369 #else
2370  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
2371  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2372 #endif
2373 
2374 #ifdef DOCUMENTATION
2375 
2383  unsigned short get_bit_offset() const;
2384  void set_bit_offset(unsigned short);
2386 #else
2387  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
2388  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2389 #endif
2390 
2391 #ifdef DOCUMENTATION
2392 
2398  unsigned short get_bit_size() const;
2399  void set_bit_size(unsigned short);
2401 #else
2402  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
2403  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2404 #endif
2405 
2406 #ifdef DOCUMENTATION
2407 
2413  SgSymbol* get_symbol() const;
2414  void set_symbol(SgSymbol*);
2416 #else
2417  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
2418  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2419 #endif
2420 
2421  DECLARE_OTHERS(AsmValueExpression);
2422 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
2423 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2424  private:
2425  friend class boost::serialization::access;
2426 
2427  template<class S>
2428  void serialize(S &s, const unsigned /*version*/) {
2429  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2430  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
2431  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
2432  s & BOOST_SERIALIZATION_NVP(p_bit_size);
2433 #if 1
2434  ASSERT_require2(p_symbol == NULL, "not implemented yet");
2435 #else
2436  s & BOOST_SERIALIZATION_NVP(p_symbol);
2437 #endif
2438  }
2439 #endif
2440 #endif // SgAsmValueExpression_OTHERS
2441 
2442 #ifdef DOCUMENTATION
2443  };
2444 #endif
2445 
2447 
2448  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
2449  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
2450 
2451 #ifdef DOCUMENTATION
2452 
2454  public:
2455 #endif
2456 
2457 #ifdef DOCUMENTATION
2458 
2465  SgAsmExpression* get_address() const;
2468 #else
2469  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
2470  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2471 #endif
2472 
2473 #ifdef DOCUMENTATION
2474 
2481  SgAsmExpression* get_segment() const;
2484 #else
2485  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
2486  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2487 #endif
2488 
2489  DECLARE_OTHERS(AsmMemoryReferenceExpression);
2490 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2491 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2492  private:
2493  friend class boost::serialization::access;
2494 
2495  template<class S>
2496  void serialize(S &s, const unsigned /*version*/) {
2497  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2498  s & BOOST_SERIALIZATION_NVP(p_address);
2499  s & BOOST_SERIALIZATION_NVP(p_segment);
2500  }
2501 #endif
2502 #endif // SgAsmMemoryReferenceExpression_OTHERS
2503 
2504 #ifdef DOCUMENTATION
2505  };
2506 #endif
2507 
2509 
2510  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
2511  IS_SERIALIZABLE(AsmControlFlagsExpression);
2512 
2513 #ifdef DOCUMENTATION
2514  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2516  public:
2517 #endif
2518 
2519 #ifndef DOCUMENTATION
2520  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
2521  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2522 #endif
2523 
2524  DECLARE_OTHERS(AsmControlFlagsExpression);
2525 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
2526 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2527  private:
2528  friend class boost::serialization::access;
2529 
2530  template<class S>
2531  void serialize(S &s, const unsigned /*version*/) {
2532  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2533  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
2534  }
2535 #endif
2536 #endif // SgAsmControlFlagsExpression_OTHERS
2537 
2538 #ifdef DOCUMENTATION
2539  };
2540 #endif
2541 
2543 
2544  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
2545  IS_SERIALIZABLE(AsmCommonSubExpression);
2546 
2547 #ifdef DOCUMENTATION
2548  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2550  public:
2551 #endif
2552 
2553 #ifndef DOCUMENTATION
2554  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
2555  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2556 #endif
2557 
2558  DECLARE_OTHERS(AsmCommonSubExpression);
2559 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
2560 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2561  private:
2562  friend class boost::serialization::access;
2563 
2564  template<class S>
2565  void serialize(S &s, const unsigned /*version*/) {
2566  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2567  s & BOOST_SERIALIZATION_NVP(p_subexpression);
2568  }
2569 #endif
2570 #endif // SgAsmCommonSubExpression_OTHERS
2571 
2572 #ifdef DOCUMENTATION
2573  };
2574 #endif
2575 
2577 
2578  DECLARE_LEAF_CLASS(AsmRiscOperation);
2579  IS_SERIALIZABLE(AsmRiscOperation);
2580 
2581 #ifdef DOCUMENTATION
2582 
2591  public:
2592 #endif
2593 
2594 #ifdef DOCUMENTATION
2595 
2604 #else
2605  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
2606  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
2607 #endif
2608 
2609 #ifdef DOCUMENTATION
2610 
2616  SgAsmExprListExp* get_operands() const;
2619 #else
2620  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
2621  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2622 #endif
2623 
2624  DECLARE_OTHERS(AsmRiscOperation);
2625 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
2626  public:
2633  OP_NONE,
2634  OP_bottom,
2635  OP_undefined,
2636  OP_unspecified,
2637  OP_filterCallTarget,
2638  OP_filterReturnTarget,
2639  OP_filterIndirectJumpTarget,
2640  OP_hlt,
2641  OP_cpuid,
2642  OP_rdtsc,
2643  OP_and_,
2644  OP_or_,
2645  OP_xor_,
2646  OP_invert,
2647  OP_extract,
2648  OP_concat,
2649  OP_leastSignificantSetBit,
2650  OP_mostSignificantSetBit,
2651  OP_rotateLeft,
2652  OP_rotateRight,
2653  OP_shiftLeft,
2654  OP_shiftRight,
2655  OP_shiftRightArithmetic,
2656  OP_equalToZero,
2657  OP_ite,
2658  OP_isEqual,
2659  OP_isNotEqual,
2660  OP_isUnsignedLessThan,
2661  OP_isUnsignedLessThanOrEqual,
2662  OP_isUnsignedGreaterThan,
2663  OP_isUnsignedGreaterThanOrEqual,
2664  OP_isSignedLessThan,
2665  OP_isSignedLessThanOrEqual,
2666  OP_isSignedGreaterThan,
2667  OP_isSignedGreaterThanOrEqual,
2668  OP_unsignedExtend,
2669  OP_signExtend,
2672  OP_subtract,
2673  OP_negate,
2674  OP_signedDivide,
2675  OP_signedModulo,
2676  OP_signedMultiply,
2677  OP_unsignedDivide,
2678  OP_unsignedModulo,
2679  OP_unsignedMultiply,
2680  OP_interrupt,
2681  OP_readRegister,
2682  OP_peekRegister,
2683  OP_writeRegister,
2685  OP_peekMemory,
2687  OP_N_OPERATORS // MUST BE LAST!
2688  };
2689 
2690 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2691  private:
2692  friend class boost::serialization::access;
2693 
2694  template<class S>
2695  void serialize(S &s, const unsigned /*version*/) {
2696  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2697  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
2698  s & BOOST_SERIALIZATION_NVP(p_operands);
2699  }
2700 #endif
2701 #endif // SgAsmRiscOperation_OTHERS
2702 
2703 #ifdef DOCUMENTATION
2704  };
2705 #endif
2706 
2708 
2709  DECLARE_LEAF_CLASS(AsmExprListExp);
2710  IS_SERIALIZABLE(AsmExprListExp);
2711 
2712 #ifdef DOCUMENTATION
2713 
2715  public:
2716 #endif
2717 
2718 #ifdef DOCUMENTATION
2719 
2725  const SgAsmExpressionPtrList& get_expressions() const;
2726  void set_expressions(const SgAsmExpressionPtrList&);
2728 #else
2729  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
2730  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2731 #endif
2732 
2733  DECLARE_OTHERS(AsmExprListExp);
2734 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
2735 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2736  private:
2737  friend class boost::serialization::access;
2738 
2739  template<class S>
2740  void serialize(S &s, const unsigned /*version*/) {
2741  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2742  s & BOOST_SERIALIZATION_NVP(p_expressions);
2743  }
2744 #endif
2745 #endif // SgAsmExprListExp_OTHERS
2746 
2747 #ifdef DOCUMENTATION
2748  };
2749 #endif
2750 
2752 
2753  NEW_NONTERMINAL_MACRO(AsmExpression,
2754  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
2755  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
2756  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
2757  AsmRiscOperation,
2758  "AsmExpression", "AsmExpressionTag", false);
2759  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
2760  IS_SERIALIZABLE(AsmExpression);
2761 
2762 #ifdef DOCUMENTATION
2763 
2764  class SgAsmExpression: public SgAsmNode {
2765  public:
2766 #endif
2767 
2768 #ifdef DOCUMENTATION
2769 
2774  SgAsmType* get_type() const;
2775  void set_type(SgAsmType*);
2777 #else
2778  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
2779  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2780 #endif
2781 
2782 #ifdef DOCUMENTATION
2783 
2788  const std::string& get_comment() const;
2789  void set_comment(const std::string&);
2791 #else
2792  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
2793  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2794 #endif
2795 
2796  DECLARE_OTHERS(AsmExpression);
2797 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
2798 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2799  private:
2800  friend class boost::serialization::access;
2801 
2802  template<class S>
2803  void serialize(S &s, const unsigned /*version*/) {
2804  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
2805  s & BOOST_SERIALIZATION_NVP(p_type);
2806  s & BOOST_SERIALIZATION_NVP(p_comment);
2807  }
2808 #endif
2809 
2810  public:
2814  size_t get_nBits() const;
2815 
2821 
2827 
2828 #endif // SgAsmExpression_OTHERS
2829 
2830 #ifdef DOCUMENTATION
2831  };
2832 #endif
2833 
2834 
2835 
2836 
2838 
2839  /***************************************************************************************************************************
2840  * Data Types (new interface 2014-07)
2841  *
2842  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
2843  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
2844  * 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
2845  * don't allow types to be modified after they're created.
2846  ***************************************************************************************************************************/
2847 
2849 
2850  DECLARE_LEAF_CLASS(AsmIntegerType);
2851  IS_SERIALIZABLE(AsmIntegerType);
2852 
2853 #ifdef DOCUMENTATION
2854 
2856  public:
2857 #endif
2858 
2859 #ifndef DOCUMENTATION
2860  // Documented below due to ROSETTA limitations
2861  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
2862  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2863 #endif
2864 
2865  DECLARE_OTHERS(AsmIntegerType);
2866 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
2867 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2868  private:
2869  friend class boost::serialization::access;
2870 
2871  template<class S>
2872  void serialize(S &s, const unsigned /*version*/) {
2873  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2874  s & BOOST_SERIALIZATION_NVP(p_isSigned);
2875  }
2876 #endif
2877 
2878  public:
2882  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
2883 
2887  bool get_isSigned() const;
2888 
2889  // Overrides documented in base class
2890  virtual void check() const $ROSE_OVERRIDE;
2891  virtual std::string toString() const $ROSE_OVERRIDE;
2892 #endif // SgAsmIntegerType_OTHERS
2893 
2894 #ifdef DOCUMENTATION
2895  };
2896 #endif
2897 
2899 
2900  DECLARE_LEAF_CLASS(AsmFloatType);
2901  IS_SERIALIZABLE(AsmFloatType);
2902 
2903  DECLARE_HEADERS(AsmFloatType);
2904 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
2905  #include <Sawyer/BitVector.h>
2906 #endif // SgAsmFloatType_HEADERS
2907 
2908 #ifdef DOCUMENTATION
2909 
2911  public:
2912 #endif
2913 
2914 #ifndef DOCUMENTATION
2915  // Documented below because of ROSETTA limitations (they're read-only)
2916  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
2917  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2918  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
2919  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2920  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
2921  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2922  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
2923  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2924  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
2925  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2926  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
2927  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2928  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
2929  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2930 #endif
2931 
2932  DECLARE_OTHERS(AsmFloatType);
2933 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
2934 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2935  private:
2936  friend class boost::serialization::access;
2937 
2938  template<class S>
2939  void serialize(S &s, const unsigned /*version*/) {
2940  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2941  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
2942  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
2943  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
2944  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
2945  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
2946  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
2947  s & BOOST_SERIALIZATION_NVP(p_flags);
2948  }
2949 #endif
2950 
2951  public:
2952  enum {
2953  GRADUAL_UNDERFLOW = 0x00000001,
2954  NORMALIZED_SIGNIFICAND = 0x00000002
2955  };
2956 
2958 
2960  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
2961  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
2962  uint64_t exponentBias, unsigned flags);
2963 
2965  BitRange significandBits() const;
2966 
2968  BitRange exponentBits() const;
2969 
2971  size_t signBit() const;
2972 
2974  uint64_t exponentBias() const;
2975 
2977  unsigned flags() const;
2978 
2980  bool gradualUnderflow() const;
2981 
2983  bool normalizedSignificand() const;
2984 
2985  // Overrides documented in base class
2986  virtual void check() const $ROSE_OVERRIDE;
2987  virtual std::string toString() const $ROSE_OVERRIDE;
2988 #endif // SgAsmFloatType_OTHERS
2989 
2990 #ifdef DOCUMENTATION
2991  };
2992 #endif
2993 
2995 
2996  NEW_NONTERMINAL_MACRO(AsmScalarType,
2997  AsmIntegerType | AsmFloatType,
2998  "AsmScalarType", "AsmScalarTypeTag", false);
2999  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
3000  IS_SERIALIZABLE(AsmScalarType);
3001 
3002 #ifdef DOCUMENTATION
3003 
3004  class SgAsmScalarType: public SgAsmType {
3005  public:
3006 #endif
3007 
3008 #ifndef DOCUMENTATION
3009  // Documented below due to ROSETTA limitations (read-only)
3010  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3011  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3012  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3013  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3014  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
3015  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3016  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
3017  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3018 #endif
3019 
3020  DECLARE_OTHERS(AsmScalarType);
3021 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
3022 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3023  private:
3024  friend class boost::serialization::access;
3025 
3026  template<class S>
3027  void serialize(S &s, const unsigned /*version*/) {
3028  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3029  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
3030  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
3031  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
3032  s & BOOST_SERIALIZATION_NVP(p_nBits);
3033  }
3034 #endif
3035 
3036  protected:
3041  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
3042 
3043  public:
3045  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3046 
3048  ByteOrder::Endianness get_minorOrder() const;
3049 
3051  ByteOrder::Endianness get_majorOrder() const;
3052 
3054  size_t get_majorNBytes() const;
3055 
3056  // Overrides documented in base class
3057  virtual void check() const $ROSE_OVERRIDE;
3058  virtual std::string toString() const $ROSE_OVERRIDE;
3059 #endif // SgAsmScalarType_OTHERS
3060 
3061 #ifdef DOCUMENTATION
3062  };
3063 #endif
3064 
3066 
3067  DECLARE_LEAF_CLASS(AsmVectorType);
3068  IS_SERIALIZABLE(AsmVectorType);
3069 
3070 #ifdef DOCUMENTATION
3071 
3072  class SgAsmVectorType: public SgAsmType {
3073  public:
3074 #endif
3075 
3076 #ifndef DOCUMENTATION
3077  // Documented below due to ROSETTA limitations (read-only)
3078  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3079  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3080  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3081  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3082 #endif
3083 
3084  DECLARE_OTHERS(AsmVectorType);
3085 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3086 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3087  private:
3088  friend class boost::serialization::access;
3089 
3090  template<class S>
3091  void serialize(S &s, const unsigned /*version*/) {
3092  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3093  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3094  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3095  }
3096 #endif
3097 
3098  public:
3100  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3101 
3103  size_t get_nElmts() const;
3104 
3106  SgAsmType* get_elmtType() const;
3107 
3108  // Overrides documented in base class
3109  virtual void check() const $ROSE_OVERRIDE;
3110  virtual std::string toString() const $ROSE_OVERRIDE;
3111  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3112 #endif // SgAsmVectorType_OTHERS
3113 
3114 #ifdef DOCUMENTATION
3115  };
3116 #endif
3117 
3119 
3120  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3121  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3122  IS_SERIALIZABLE(AsmType);
3123 
3124 #ifdef DOCUMENTATION
3125 
3126  class SgAsmType: public SgAsmNode {
3127  public:
3128 #endif
3129 
3130  DECLARE_OTHERS(AsmType);
3131 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3132  private:
3134 
3135 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3136  private:
3137  friend class boost::serialization::access;
3138 
3139  template<class S>
3140  void serialize(S &s, const unsigned /*version*/) {
3141  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3142  }
3143 #endif
3144 
3145  public:
3153  virtual void check() const;
3154 
3160  virtual std::string toString() const {
3161  abort(); // ROSETTA limitation: intended pure virtual
3162  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3163  }
3164 
3166  virtual size_t get_nBits() const {
3167  abort(); // ROSETTA limitation: intended pure virtual
3168  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3169  }
3170 
3172  virtual size_t get_nBytes() const;
3173 
3179  template<class Type> // Type is a subclass of SgAsmType
3180  static Type* registerOrDelete(Type *toInsert) {
3181  ASSERT_not_null(toInsert);
3182  std::string key = toInsert->toString();
3183  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3184  ASSERT_not_null(retval);
3185  if (retval!=toInsert)
3186  delete toInsert;
3187  return retval;
3188  }
3189 #endif // SgAsmType_OTHERS
3190 
3191 #ifdef DOCUMENTATION
3192  };
3193 #endif
3194 
3195 
3196 
3198 
3199  /**************************************************************************************************************************
3200  * Collections of Instructions
3201  **************************************************************************************************************************/
3202 
3204 
3205  DECLARE_LEAF_CLASS(AsmFunction);
3206  IS_SERIALIZABLE(AsmFunction);
3207 
3208 #ifdef DOCUMENTATION
3209 
3225  public:
3226 #endif
3227 
3228 #ifdef DOCUMENTATION
3229 
3234  const std::string& get_name() const;
3235  void set_name(const std::string&);
3237 #else
3238  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3239  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3240 #endif
3241 
3242 #ifdef DOCUMENTATION
3243 
3249  unsigned get_reason() const;
3250  void set_reason(unsigned);
3252 #else
3253  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3254  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3255 #endif
3256 
3257 #ifdef DOCUMENTATION
3258 
3265  const std::string& get_reasonComment() const;
3266  void set_reasonComment(const std::string&);
3268 #else
3269  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
3270  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3271 #endif
3272 
3273 #ifdef DOCUMENTATION
3274 
3282 #else
3283  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3284  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3285 #endif
3286 
3287 #ifdef DOCUMENTATION
3288 
3291  MayReturn get_may_return() const;
3292  void set_may_return(MayReturn);
3294 #else
3295  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3296  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3297 #endif
3298 
3299 #ifdef DOCUMENTATION
3300 
3305  const std::string& get_name_md5() const;
3306  void set_name_md5(const std::string&);
3308 #else
3309  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3310  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3311 #endif
3312 
3313 #ifdef DOCUMENTATION
3314 
3319  const SgAsmStatementPtrList& get_statementList() const;
3320  void set_statementList(const SgAsmStatementPtrList&);
3322 #else
3323  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3324  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3325 #endif
3326 
3327 #ifdef DOCUMENTATION
3328  // FIXME[Robb P Matzke 2017-02-13]: unused?
3329 #else
3330  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3331  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3332 #endif
3333 
3334 #ifdef DOCUMENTATION
3335 
3341  rose_addr_t get_entry_va() const;
3342  void set_entry_va(rose_addr_t);
3344 #else
3345  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3346  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3347 #endif
3348 
3349 #ifdef DOCUMENTATION
3350 
3359 #else
3360  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3361  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3362 #endif
3363 
3364 #ifdef DOCUMENTATION
3365  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3366 #else
3367  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3368  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3369 #endif
3370 
3371 #ifdef DOCUMENTATION
3372 
3381  int64_t get_stackDelta() const;
3382  void set_stackDelta(int64_t);
3384 #else
3385  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3386  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3387 #endif
3388 
3389 #ifdef DOCUMENTATION
3390 
3398  const std::string& get_callingConvention() const;
3399  void set_callingConvention(const std::string&);
3401 #else
3402  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3403  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3404 #endif
3405 
3406  DECLARE_OTHERS(AsmFunction);
3407 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3408 
3409 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3410  private:
3411  friend class boost::serialization::access;
3412 
3413  template<class S>
3414  void serialize(S &s, const unsigned /*version*/) {
3415  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3416  s & BOOST_SERIALIZATION_NVP(p_name);
3417  s & BOOST_SERIALIZATION_NVP(p_reason);
3418  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
3419  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3420  s & BOOST_SERIALIZATION_NVP(p_may_return);
3421  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3422  s & BOOST_SERIALIZATION_NVP(p_statementList);
3423  s & BOOST_SERIALIZATION_NVP(p_dest);
3424  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3425  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3426  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3427  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3428  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3429  }
3430 #endif
3431 
3432  public:
3435 
3439  void remove_statement(SgAsmStatement* statement);
3440 
3445  SgAsmBlock* get_entry_block() const;
3446 
3448  enum MayReturn {
3453  };
3454 
3459  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3460  // Also fix SgAsmFunction::reason_key()
3461  FUNC_NONE = 0x00000000,
3462  FUNC_THUNK_TARGET= 0x00004000,
3464  = 0x00008000,
3465  FUNC_ENTRY_POINT = 0x00010000,
3466  FUNC_CALL_TARGET = 0x00020000,
3469  FUNC_CALL_INSN = 0x00040000,
3475  FUNC_EH_FRAME = 0x00080000,
3476  FUNC_SYMBOL = 0x00100000,
3477  FUNC_PATTERN = 0x00200000,
3482  FUNC_GRAPH = 0x00400000,
3486  FUNC_USERDEF = 0x00800000,
3487  FUNC_PADDING = 0x01000000,
3492  FUNC_DISCONT = 0x02000000,
3495  FUNC_INSNHEAD = 0x04000000,
3496  FUNC_IMPORT = 0x08000000,
3499  FUNC_LEFTOVERS = 0x10000000,
3503  FUNC_INTRABLOCK = 0x20000000,
3511  FUNC_THUNK = 0x40000000,
3520  FUNC_EXPORT = 0x80000000,
3522  FUNC_DEFAULT = 0xefff80ff,
3524  /*========= Miscellaneous Reasons ===========================================================================
3525  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3526  * availalble for users to use as they see fit. */
3527  FUNC_MISCMASK = 0x000000ff,
3542  };
3543 
3547  static std::string reason_key(const std::string &prefix="");
3548 
3550  std::string reason_str(bool pad) const;
3551 
3555  static std::string reason_str(bool pad, unsigned reason);
3556 
3559  public:
3560  virtual ~NodeSelector() {}
3561  virtual bool operator()(SgNode*) = 0;
3562  };
3563 
3603  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
3604  NodeSelector *selector=NULL);
3605 
3611  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
3612 
3615  e_unknown = 0,
3616  e_standard = 1,
3617  e_library = 2,
3618  e_imported = 3,
3619  e_thunk = 4,
3620  e_last
3621  };
3622 #endif // SgAsmFunction_OTHERS
3623 
3624 
3625 #ifdef DOCUMENTATION
3626  };
3627 #endif
3628 
3629 
3631 
3632  DECLARE_LEAF_CLASS(AsmBlock);
3633  IS_SERIALIZABLE(AsmBlock);
3634 
3635 #ifdef DOCUMENTATION
3636 
3656  class SgAsmBlock: public SgAsmStatement {
3657  public:
3658 #endif
3659 
3660 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3661  // [tps 05Apr07] needed for the control_flow_graph
3662  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
3663  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3664 #endif
3665 
3666 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3667  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
3668  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3669 #endif
3670 
3671 #ifdef DOCUMENTATION
3672 
3677  rose_addr_t get_id() const;
3678  void set_id(rose_addr_t);
3680 #else
3681  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
3682  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3683 #endif
3684 
3685 #ifdef DOCUMENTATION
3686 
3691  unsigned get_reason() const;
3692  void set_reason(unsigned);
3694 #else
3695  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
3696  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3697 #endif
3698 
3699 #ifdef DOCUMENTATION
3700  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3701  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3702  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3703  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3710  const SgAsmStatementPtrList& get_statementList() const;
3711  void set_statementList(const SgAsmStatementPtrList&);
3713 #else
3714  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3715  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3716 #endif
3717 
3718 #ifdef DOCUMENTATION
3719  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3720  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3721  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3722  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3730  const SgAsmIntegerValuePtrList& get_successors() const;
3731  void set_successors(const SgAsmIntegerValuePtrList&);
3733 #else
3734  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
3735  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3736 #endif
3737 
3738 #ifdef DOCUMENTATION
3739 
3749  bool get_successors_complete() const;
3750  void set_successors_complete(bool);
3752 #else
3753  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
3754  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3755 #endif
3756 
3757 #ifdef DOCUMENTATION
3758 
3770 #else
3771  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
3772  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3773 #endif
3774 
3775 #ifdef DOCUMENTATION
3776 
3784  size_t get_cached_vertex() const;
3785  void set_cached_vertex(size_t);
3787 #else
3788  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
3789  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3790 #endif
3791 
3792 #ifdef DOCUMENTATION
3793 
3799  double get_code_likelihood() const;
3800  void set_code_likelihood(double);
3802 #else
3803  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
3804  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3805 #endif
3806 
3807 #ifdef DOCUMENTATION
3808 
3816  int64_t get_stackDeltaOut() const;
3817  void set_stackDeltaOut(int64_t);
3819 #else
3820  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
3821  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3822 #endif
3823 
3824  DECLARE_OTHERS(AsmBlock);
3825 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
3826 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3827  private:
3828  friend class boost::serialization::access;
3829 
3830  template<class S>
3831  void serialize(S &s, const unsigned /*version*/) {
3832  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3833  s & BOOST_SERIALIZATION_NVP(p_reason);
3834  s & BOOST_SERIALIZATION_NVP(p_statementList);
3835  s & BOOST_SERIALIZATION_NVP(p_successors);
3836  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
3837  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
3838  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3839  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
3840  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
3841  }
3842 #endif
3843 
3844  public:
3846  enum Reason {
3847  // Please update SgAsmBlock::reason_str() if you change this enum!
3848  BLK_NONE = 0x00000000,
3849  BLK_ENTRY_POINT = 0x00010000,
3850  BLK_PADDING = 0x00020000,
3851  BLK_FRAGMENT = 0x00080000,
3853  BLK_CFGHEAD = 0x00100000,
3854  BLK_USERDEF = 0x00200000,
3855  BLK_LEFTOVERS = 0x00400000,
3857  BLK_JUMPTABLE = 0x00800000,
3858  BLK_GRAPH1 = 0x01000000,
3859  BLK_GRAPH2 = 0x02000000,
3860  BLK_GRAPH3 = 0x04000000,
3862  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
3863 
3864  // ========= Miscellaneous Reasons ===========================================================================
3865  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3866  // availalble for users to use as they see fit.
3867  BLK_MISCMASK = 0x000000ff,
3869  BLK_FINDDATA = 0x00000001,
3871  BLK_POSTFUNC = 0x00000002
3873  };
3874 
3879 
3884 
3885  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
3890  void remove_children();
3891 
3896  rose_addr_t get_fallthrough_va();
3897 
3902 
3908  bool has_instructions() const;
3909 
3915  bool is_basic_block() const { return has_instructions(); }
3916 
3926  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
3927 
3931  static std::string reason_key(const std::string &prefix="");
3932 
3936  std::string reason_str(bool pad) const;
3937 
3943  static std::string reason_str(bool pad, unsigned reason);
3944 #endif // SgAsmBlock_OTHERS
3945 
3946 #ifdef DOCUMENTATION
3947  };
3948 #endif
3949 
3950 
3952 
3953  DECLARE_LEAF_CLASS(AsmStaticData);
3954  IS_SERIALIZABLE(AsmStaticData);
3955 
3956 #ifdef DOCUMENTATION
3957 
3965  public:
3966 #endif
3967 
3968 #ifdef DOCUMENTATION
3969 
3975  const SgUnsignedCharList& get_raw_bytes() const;
3976  void set_raw_bytes(const SgUnsignedCharList&);
3978 #else
3979  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
3980  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3981 #endif
3982 
3983  DECLARE_OTHERS(AsmStaticData);
3984 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
3985 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3986  private:
3987  friend class boost::serialization::access;
3988 
3989  template<class S>
3990  void serialize(S &s, const unsigned /*version*/) {
3991  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3992  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
3993  }
3994 #endif
3995 
3996  public:
4000  size_t get_size() const { return p_raw_bytes.size(); }
4001 #endif // SgAsmStaticData_OTHERS
4002 
4003 #ifdef DOCUMENTATION
4004  };
4005 #endif
4006 
4007 
4009 
4010  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
4011  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
4012 
4013 #ifdef DOCUMENTATION
4014 
4025  public:
4026 #endif
4027 
4028  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4029 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4030 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4031  private:
4032  friend class boost::serialization::access;
4033 
4034  template<class S>
4035  void serialize(S & s, const unsigned /*version*/) {
4036  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4037  }
4038 #endif
4039  protected:
4040  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4041 
4042  public:
4045  p_declarationList.push_back(declaration);
4046  }
4047 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4048 
4049 #ifdef DOCUMENTATION
4050  };
4051 #endif
4052 
4053 
4055 
4056  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4057  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4058 
4059 #ifdef DOCUMENTATION
4060  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4062  public:
4063 #endif
4064 
4065 #ifdef DOCUMENTATION
4066 
4069  const std::string& get_name() const;
4070  void set_name(const std::string&);
4072 #else
4073  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4074  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4075  NO_DELETE);
4076 #endif
4077 
4078 #ifdef DOCUMENTATION
4079  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4083  uint64_t get_offset() const;
4084  void set_ofset(uint64_t);
4086 #else
4087  // Not clear if we want to store the offset explicitly
4088  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4089  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4090  NO_DELETE);
4091 #endif
4092 
4093  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4094 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4095 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4096  private:
4097  friend class boost::serialization::access;
4098 
4099  template<class S>
4100  void serialize(S &s, const unsigned /*version*/) {
4101  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4102  }
4103 #endif
4104 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4105 
4106 #ifdef DOCUMENTATION
4107  };
4108 #endif
4109 
4110 
4112 
4113  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4114  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4115  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4116  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4117  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4118 
4119 #ifdef DOCUMENTATION
4120 
4127  public:
4128 #endif
4129 
4130  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4131 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4132 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4133  private:
4134  friend class boost::serialization::access;
4135 
4136  template<class S>
4137  void serialize(S &s, const unsigned /*version*/) {
4138  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4139  };
4140 #endif
4141 #endif // SgAsmSynthesizedDeclaration_OTHERS
4142 
4143 #ifdef DOCUMENTATION
4144  };
4145 #endif
4146 
4147 
4149 
4150  NEW_NONTERMINAL_MACRO(AsmStatement,
4151  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4152  "AsmStatement", "AsmStatementTag", false);
4153  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4154  IS_SERIALIZABLE(AsmStatement);
4155 
4156 #ifdef DOCUMENTATION
4157 
4161  class SgAsmStatement: public SgAsmNode {
4162  public:
4163 #endif
4164 
4165 #ifdef DOCUMENTATION
4166 
4171  rose_addr_t get_address() const;
4172  void set_address(rose_addr_t);
4174 #else
4175  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4176  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4177 #endif
4178 
4179 
4180 #ifdef DOCUMENTATION
4181 
4184  const std::string& get_comment() const;
4185  void set_comment(const std::string&);
4187 #else
4188  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4189  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4190 #endif
4191 
4192  DECLARE_OTHERS(AsmStatement);
4193 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4194 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4195  private:
4196  friend class boost::serialization::access;
4197 
4198  template<class S>
4199  void serialize(S &s, const unsigned /*version*/) {
4200  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4201  s & BOOST_SERIALIZATION_NVP(p_address);
4202  s & BOOST_SERIALIZATION_NVP(p_comment);
4203  }
4204 #endif
4205 #endif // SgAsmStatement_OTHERS
4206 
4207 #ifdef DOCUMENTATION
4208  };
4209 #endif
4210 
4211 
4212 
4213 
4215 
4216  /*************************************************************************************************************************
4217  * Binary Interpretations
4218  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4219  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4220  * an AST that represents a single, coherent sub-part of the file.
4221  *************************************************************************************************************************/
4222 
4224 
4225  DECLARE_LEAF_CLASS(AsmInterpretationList);
4226  IS_SERIALIZABLE(AsmInterpretationList);
4227 
4228 #ifdef DOCUMENTATION
4229 
4231  public:
4232 #endif
4233 
4234 #ifdef DOCUMENTATION
4235 
4244 #else
4245  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4246  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4247  NO_DELETE);
4248 #endif
4249 
4250  DECLARE_OTHERS(AsmInterpretationList);
4251 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4252 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4253  private:
4254  friend class boost::serialization::access;
4255 
4256  template<class S>
4257  void serialize(S &s, const unsigned /*version*/) {
4258  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4259  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4260  }
4261 #endif
4262 #endif // SgAsmInterpretationList_OTHERS
4263 
4264 #ifdef DOCUMENTATION
4265  };
4266 #endif
4267 
4269 
4270  DECLARE_LEAF_CLASS(AsmInterpretation);
4271  IS_SERIALIZABLE(AsmInterpretation);
4272 
4273  DECLARE_HEADERS(AsmInterpretation);
4274 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4275  #include <MemoryMap.h>
4276  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
4277 #endif // SgAsmInterpretation_HEADERS
4278 
4279 #ifdef DOCUMENTATION
4280 
4287  public:
4288 #endif
4289 
4290 #ifdef DOCUMENTATION
4291  // documentation and definition are below
4292 #else
4293  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4294 #endif
4295 
4296 #ifdef DOCUMENTATION
4297 
4308 #else
4309  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4310  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4311 #endif
4312 
4313 #ifdef DOCUMENTATION
4314 
4319  SgAsmBlock* get_global_block() const;
4322 #else
4323  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4324  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4325 #endif
4326 
4327  DECLARE_OTHERS(AsmInterpretation);
4328 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4329  private:
4331  const Rose::BinaryAnalysis::RegisterDictionary *p_registers;
4332  bool coverageComputed; // true iff percentageCoverage has been computed
4333  mutable InstructionMap instruction_map; // cached instruction map
4334 
4336  // disassembly into instructions.
4337  double percentageCoverage;
4338 
4339 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4340  private:
4341  friend class boost::serialization::access;
4342 
4343  template<class S>
4344  void serialize(S &s, const unsigned /*version*/) {
4345  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4346  s & BOOST_SERIALIZATION_NVP(p_headers);
4347  s & BOOST_SERIALIZATION_NVP(p_global_block);
4348  s & BOOST_SERIALIZATION_NVP(p_map);
4349  s & BOOST_SERIALIZATION_NVP(p_registers);
4350  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4351  s & BOOST_SERIALIZATION_NVP(instruction_map);
4352  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4353  }
4354 #endif
4355 
4356  public:
4359  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4360  ctor();
4361  }
4362 
4367  SgAsmGenericFilePtrList get_files() const;
4368 
4395  InstructionMap& get_instruction_map(bool recompute=false);
4396  void set_instruction_map(const InstructionMap&);
4403  void insert_instructions(InstructionMap&/*in,out*/);
4404 
4409  void erase_instructions(InstructionMap&/*in,out*/);
4410 
4416  void set_coverageComputed(bool x) { coverageComputed = x; }
4417  void set_percentageCoverage(double x) { percentageCoverage = x; }
4420  private:
4421  void ctor(); // finalize construction
4422 #endif // SgAsmInterpretation_OTHERS
4423 
4424 #ifdef DOCUMENTATION
4425  };
4426 #endif
4427 
4428 
4429 
4431 
4432  /*************************************************************************************************************************
4433  * ELF File Header
4434  *************************************************************************************************************************/
4435 
4437 
4438  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4439  IS_SERIALIZABLE(AsmElfFileHeader);
4440 
4441 #ifdef DOCUMENTATION
4442 
4451  public:
4452 #endif
4453 
4454 #ifdef DOCUMENTATION
4455 
4460  unsigned char get_e_ident_file_class() const;
4461  void set_e_ident_file_class(unsigned char);
4463 #else
4464  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4465  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4466 #endif
4467 
4468 #ifdef DOCUMENTATION
4469 
4474  unsigned char get_e_ident_data_encoding() const;
4475  void set_e_ident_data_encoding(unsigned char);
4477 #else
4478  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4479  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4480 #endif
4481 
4482 #ifdef DOCUMENTATION
4483 
4488  unsigned char get_e_ident_file_version() const;
4489  void set_e_ident_file_version(unsigned char*);
4491 #else
4492  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4493  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4494 #endif
4495 
4496 #ifdef DOCUMENTATION
4497 
4502  const SgUnsignedCharList& get_e_ident_padding() const;
4503  void set_e_ident_padding(const SgUnsignedCharList&);
4505 #else
4506  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4507  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4508 #endif
4509 
4510 #ifdef DOCUMENTATION
4511 
4516  unsigned long get_e_type() const;
4517  void set_e_type(unsigned long);
4519 #else
4520  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4521  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4522 #endif
4523 
4524 #ifdef DOCUMENTATION
4525 
4530  unsigned long get_e_machine() const;
4531  void set_e_machine(unsigned long);
4533 #else
4534  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4535  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4536 #endif
4537 
4538 #ifdef DOCUMENTATION
4539 
4544  unsigned long get_e_flags() const;
4545  void set_e_flags(unsigned long);
4547 #else
4548  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4549  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4550 #endif
4551 
4552 #ifdef DOCUMENTATION
4553 
4558  unsigned long get_e_ehsize() const;
4559  void set_e_ehsize(unsigned long);
4561 #else
4562  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4563  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4564 #endif
4565 
4566 #ifdef DOCUMENTATION
4567 
4572  unsigned long get_phextrasz() const;
4573  void set_phextrasz(unsigned long);
4575 #else
4576  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4577  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4578 #endif
4579 
4580 #ifdef DOCUMENTATION
4581 
4586  unsigned long get_e_phnum() const;
4587  void set_e_phnum(unsigned long);
4589 #else
4590  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
4591  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4592 #endif
4593 
4594 #ifdef DOCUMENTATION
4595 
4600  unsigned long get_shextrasz() const;
4601  void set_shextrasz(unsigned long);
4603 #else
4604  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
4605  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4606 #endif
4607 
4608 #ifdef DOCUMENTATION
4609 
4614  unsigned long get_e_shnum() const;
4615  void set_e_shnum(unsigned long);
4617 #else
4618  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
4619  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4620 #endif
4621 
4622 #ifdef DOCUMENTATION
4623 
4628  unsigned long get_e_shstrndx() const;
4629  void set_e_shstrndx(unsigned long);
4631 #else
4632  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
4633  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4634 #endif
4635 
4636 #ifdef DOCUMENTATION
4637 
4647 #else
4648  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
4649  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4650 #endif
4651 
4652 #ifdef DOCUMENTATION
4653 
4662 #else
4663  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
4664  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4665 #endif
4666 
4667  DECLARE_OTHERS(AsmElfFileHeader);
4668 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
4669 
4670 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4671  private:
4672  friend class boost::serialization::access;
4673 
4674  template<class S>
4675  void serialize(S &s, const unsigned /*version*/) {
4676  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
4677  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
4678  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
4679  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
4680  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
4681  s & BOOST_SERIALIZATION_NVP(p_e_type);
4682  s & BOOST_SERIALIZATION_NVP(p_e_machine);
4683  s & BOOST_SERIALIZATION_NVP(p_e_flags);
4684  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
4685  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
4686  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
4687  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
4688  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
4689  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
4690  s & BOOST_SERIALIZATION_NVP(p_section_table);
4691  s & BOOST_SERIALIZATION_NVP(p_segment_table);
4692  }
4693 #endif
4694 
4695  public:
4697  enum ObjectType {
4698  ET_NONE = 0
4699  ,ET_REL = 1
4700  ,ET_EXEC = 2
4701  ,ET_DYN = 3
4702  ,ET_CORE = 4
4704  ,ET_LOOS = 0xfe00
4705  ,ET_HIOS = 0xfeff
4706  ,ET_LOPROC = 0xff00
4707  ,ET_HIPROC = 0xffff
4708  };
4709 
4710  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
4711  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
4712  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
4713  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
4714  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
4715 #ifdef _MSC_VER
4716 # pragma pack (1)
4717 #endif
4718 
4725  unsigned char e_ident_magic[4];
4726  unsigned char e_ident_file_class;
4727  unsigned char e_ident_data_encoding;
4728  unsigned char e_ident_file_version;
4729  unsigned char e_ident_padding[9];
4730  uint16_t e_type;
4731  uint16_t e_machine;
4732  uint32_t e_version;
4733  uint32_t e_entry;
4734  uint32_t e_phoff;
4735  uint32_t e_shoff;
4736  uint32_t e_flags;
4737  uint16_t e_ehsize;
4738  uint16_t e_phentsize;
4739  uint16_t e_phnum;
4740  uint16_t e_shentsize;
4741  uint16_t e_shnum;
4742  uint16_t e_shstrndx;
4743  }
4744 #if !defined(SWIG) && !defined(_MSC_VER)
4745  __attribute__((packed))
4746 #endif
4747  ;
4748 
4750  unsigned char e_ident_magic[4];
4751  unsigned char e_ident_file_class;
4752  unsigned char e_ident_data_encoding;
4753  unsigned char e_ident_file_version;
4754  unsigned char e_ident_padding[9];
4755  uint16_t e_type;
4756  uint16_t e_machine;
4757  uint32_t e_version;
4758  uint64_t e_entry;
4759  uint64_t e_phoff;
4760  uint64_t e_shoff;
4761  uint32_t e_flags;
4762  uint16_t e_ehsize;
4763  uint16_t e_phentsize;
4764  uint16_t e_phnum;
4765  uint16_t e_shentsize;
4766  uint16_t e_shnum;
4767  uint16_t e_shstrndx;
4768  }
4769 #if !defined(SWIG) && !defined(_MSC_VER)
4770  __attribute__((packed))
4771 #endif
4772  ;
4773 
4774 #ifdef _MSC_VER
4775 # pragma pack ()
4776 #endif
4777 
4785  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
4786  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
4787  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
4788  ctor();
4789  }
4790 
4796  uint64_t max_page_size();
4797 
4800 
4803 
4809  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
4810 
4812  virtual bool reallocate() $ROSE_OVERRIDE;
4813 
4815  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4816 
4818  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4819 
4821  static bool is_ELF(SgAsmGenericFile*);
4822 
4824  SgAsmGenericSectionPtrList get_sectab_sections();
4825 
4827  SgAsmGenericSectionPtrList get_segtab_sections();
4828 
4829  // Overrides documented in base class
4830  virtual const char *format_name() const $ROSE_OVERRIDE;
4831 
4832  private:
4833  void ctor(); // called by constructors
4834  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
4835  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
4836 #endif // SgAsmElfFileHeader_OTHERS
4837 
4838 #ifdef DOCUMENTATION
4839  };
4840 #endif
4841 
4842 
4843 
4845 
4846  /*************************************************************************************************************************
4847  * ELF Section Tables
4848  *************************************************************************************************************************/
4849 
4851 
4852  DECLARE_LEAF_CLASS(AsmElfSectionTable);
4853  IS_SERIALIZABLE(AsmElfSectionTable);
4854 
4855 #ifdef DOCUMENTATION
4856 
4862  public:
4863 #endif
4864 
4865  DECLARE_OTHERS(AsmElfSectionTable);
4866 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
4867 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4868  private:
4869  friend class boost::serialization::access;
4870 
4871  template<class S>
4872  void serialize(S &s, const unsigned /*version*/) {
4873  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
4874  }
4875 #endif
4876 
4877  public:
4880  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
4881  ctor();
4882  }
4883 
4889  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
4890 
4902 
4906  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
4907 
4909  virtual bool reallocate() $ROSE_OVERRIDE;
4910 
4912  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4913 
4915  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4916 
4917  private:
4918  void ctor();
4919 #endif // SgAsmElfSectionTable_OTHERS
4920 
4921 #ifdef DOCUMENTATION
4922  };
4923 #endif
4924 
4925 
4927 
4928  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
4929  IS_SERIALIZABLE(AsmElfSectionTableEntry);
4930 
4931 #ifdef DOCUMENTATION
4932 
4934  public:
4935 #endif
4936 
4937 #ifdef DOCUMENTATION
4938 
4943  unsigned get_sh_name() const;
4944  void set_sh_name(unsigned);
4946 #else
4947  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
4948  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4949 #endif
4950 
4951 #ifdef DOCUMENTATION
4952 
4957  SectionType get_sh_type() const;
4958  void set_sh_type(SectionType);
4960 #else
4961  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
4962  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4963 #endif
4964 
4965 #ifdef DOCUMENTATION
4966 
4971  unsigned long get_sh_link() const;
4972  void set_sh_link(unsigned long);
4974 #else
4975  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
4976  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4977 #endif
4978 
4979 #ifdef DOCUMENTATION
4980 
4985  unsigned long get_sh_info() const;
4986  void set_sh_info(unsigned long);
4988 #else
4989  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
4990  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4991 #endif
4992 
4993 #ifdef DOCUMENTATION
4994 
4999  uint64_t get_sh_flags() const;
5000  void set_sh_flags(uint64_t);
5002 #else
5003  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
5004  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5005 #endif
5006 
5007 #ifdef DOCUMENTATION
5008 
5013  rose_addr_t get_sh_addr() const;
5014  void set_sh_addr(rose_addr_t);
5016 #else
5017  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
5018  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5019 #endif
5020 
5021 #ifdef DOCUMENTATION
5022 
5027  rose_addr_t get_sh_offset() const;
5028  void set_sh_offset(rose_addr_t);
5030 #else
5031  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
5032  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5033 #endif
5034 
5035 #ifdef DOCUMENTATION
5036 
5041  rose_addr_t get_sh_size() const;
5042  void set_sh_size(rose_addr_t);
5044 #else
5045  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
5046  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5047 #endif
5048 
5049 #ifdef DOCUMENTATION
5050 
5055  rose_addr_t get_sh_addralign() const;
5056  void set_sh_addralign(rose_addr_t);
5058 #else
5059  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
5060  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5061 #endif
5062 
5063 #ifdef DOCUMENTATION
5064 
5069  rose_addr_t get_sh_entsize() const;
5070  void set_sh_entsize(rose_addr_t);
5072 #else
5073  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
5074  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5075 #endif
5076 
5077 #ifdef DOCUMENTATION
5078 
5083  const SgUnsignedCharList& get_extra() const;
5084  void set_extra(const SgUnsignedCharLit&);
5086 #else
5087  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5088  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5089  NO_DELETE);
5090 #endif
5091 
5092  DECLARE_OTHERS(AsmElfSectionTableEntry);
5093 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5094 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5095  private:
5096  friend class boost::serialization::access;
5097 
5098  template<class S>
5099  void serialize(S &s, const unsigned /*version*/) {
5100  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5101  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5102  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5103  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5104  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5105  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5106  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5107  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5108  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5109  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5110  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5111  s & BOOST_SERIALIZATION_NVP(p_extra);
5112  }
5113 #endif
5114 
5115  public:
5118  SHT_NULL = 0,
5122  SHT_RELA = 4,
5123  SHT_HASH = 5,
5125  SHT_NOTE = 7,
5127  SHT_REL = 9,
5128  SHT_SHLIB = 10,
5129  SHT_DYNSYM = 11,
5131  SHT_LOOS = 0x60000000,
5132  SHT_GNU_verdef = 0x6ffffffd,
5133  SHT_GNU_verneed = 0x6ffffffe,
5134  SHT_GNU_versym = 0x6fffffff,
5135  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5136 
5137  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5138  SHT_HIPROC = 0x7fffffff,
5139  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5140  SHT_HIUSER = 0xffffffff
5141  };
5142 
5146  SHF_WRITE= (1 << 0),
5147  SHF_ALLOC= (1 << 1),
5148  SHF_EXECINSTR= (1 << 2),
5149  SHF_MERGE= (1 << 4),
5150  SHF_STRINGS= (1 << 5),
5151  SHF_INFO_LINK= (1 << 6),
5152  SHF_LINK_ORDER= (1 << 7),
5154  SHF_GROUP= (1 << 9),
5155  SHF_TLS= (1 << 10),
5156  SHF_MASKOS= 0x0ff00000,
5157  SHF_MASKPROC= 0xf0000000
5158  };
5159 
5166 #ifdef _MSC_VER
5167 # pragma pack (1)
5168 #endif
5170  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5171  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5172  uint32_t sh_flags; /* 0x08 Bit flags */
5173  uint32_t sh_addr; /* 0x0c Desired mapped address */
5174  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5175  uint32_t sh_size; /* 0x14 Section size in bytes */
5176  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5177  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5178  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5179  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5180  } /* 0x28 */
5181 #if !defined(SWIG) && !defined(_MSC_VER)
5182  __attribute__((packed))
5183 #endif
5184  ;
5185 
5187  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5188  uint32_t sh_type; /* 0x04 */
5189  uint64_t sh_flags; /* 0x08 */
5190  uint64_t sh_addr; /* 0x10 */
5191  uint64_t sh_offset; /* 0x18 */
5192  uint64_t sh_size; /* 0x20 */
5193  uint32_t sh_link; /* 0x28 */
5194  uint32_t sh_info; /* 0x2c */
5195  uint64_t sh_addralign; /* 0x30 */
5196  uint64_t sh_entsize; /* 0x38 */
5197  } /* 0x40 */
5198 #if !defined(SWIG) && !defined(_MSC_VER)
5199  __attribute__((packed))
5200 #endif
5201  ;
5202 #ifdef _MSC_VER
5203 # pragma pack ()
5204 #endif
5205 
5207  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5209 
5211  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5213 
5217  void *encode(ByteOrder::Endianness sex,
5219  void *encode(ByteOrder::Endianness sex,
5225 
5227  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5228 
5229  // Use Rose::stringify... function instead.
5230  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5231  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5232 
5233  private:
5234  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5235  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5236 #endif // SgAsmElfSectionTableEntry_OTHERS
5237 
5238 #ifdef DOCUMENTATION
5239  };
5240 #endif
5241 
5242 
5243 
5245 
5246  /*************************************************************************************************************************
5247  * ELF Segment Tables
5248  *************************************************************************************************************************/
5249 
5251 
5252  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5253  IS_SERIALIZABLE(AsmElfSegmentTable);
5254 
5255 #ifdef DOCUMENTATION
5256 
5263  public:
5264 #endif
5265 
5266  DECLARE_OTHERS(AsmElfSegmentTable);
5267 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5268 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5269  private:
5270  friend class boost::serialization::access;
5271 
5272  template<class S>
5273  void serialize(S &s, const unsigned /*version*/) {
5274  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5275  }
5276 #endif
5277 
5278  public:
5281  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5282  ctor();
5283  }
5284 
5289  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5290 
5305 
5309  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5310 
5312  virtual bool reallocate() $ROSE_OVERRIDE;
5313 
5315  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5316 
5318  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5319 
5320  private:
5321  void ctor();
5322 #endif // SgAsmElfSegmentTable_OTHERS
5323 
5324 #ifdef DOCUMENTATION
5325  };
5326 #endif
5327 
5329 
5330  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5331  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5332 
5333 #ifdef DOCUMENTATION
5335  public:
5336 #endif
5337 
5338 #ifdef DOCUMENTATION
5339 
5345  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5346  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5348 #else
5349  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5350  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5351  NO_DELETE);
5352 #endif
5353 
5354  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5355 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5356 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5357  private:
5358  friend class boost::serialization::access;
5359 
5360  template<class S>
5361  void serialize(S &s, const unsigned /*version*/) {
5362  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5363  }
5364 #endif
5365 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5366 
5367 #ifdef DOCUMENTATION
5368  };
5369 #endif
5370 
5371 
5373 
5374  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5375  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5376 
5377 #ifdef DOCUMENTATION
5378 
5380  public:
5381 #endif
5382 
5383 #ifdef DOCUMENTATION
5384 
5389  size_t get_index() const;
5390  void set_index(size_t);
5392 #else
5393  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5394  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5395 #endif
5396 
5397 #ifdef DOCUMENTATION
5398 
5401  SegmentType get_type() const;
5402  void set_type(SegmentType);
5404 #else
5405  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5406  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5407  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5408 #endif
5409 
5410 #ifdef DOCUMENTATION
5411 
5414  SegmentFlags get_flags() const;
5415  void set_flags(SegmentFlags);
5417 #else
5418  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5419  "= SgAsmElfSegmentTableEntry::PF_NONE",
5420  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5421 #endif
5422 
5423 #ifdef DOCUMENTATION
5424 
5429  rose_addr_t get_offset() const;
5430  void set_offset(rose_addr_t);
5432 #else
5433  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5434  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5435 #endif
5436 
5437 #ifdef DOCUMENTATION
5438 
5444  rose_addr_t get_vaddr() const;
5445  void set_vaddr(rose_addr_t);
5447 #else
5448  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5449  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5450 #endif
5451 
5452 #ifdef DOCUMENTATION
5453 
5458  rose_addr_t get_paddr() const;
5459  void set_paddr(rose_addr_t);
5461 #else
5462  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5463  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5464 #endif
5465 
5466 #ifdef DOCUMENTATION
5467 
5472  rose_addr_t get_filesz() const;
5473  void set_filesz(rose_addr_t);
5475 #else
5476  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5477  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5478 #endif
5479 
5480 #ifdef DOCUMENTATION
5481 
5486  rose_addr_t get_memsz() const;
5487  void set_memsz(rose_addr_t);
5489 #else
5490  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5491  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5492 #endif
5493 
5494 #ifdef DOCUMENTATION
5495 
5500  rose_addr_t get_align() const;
5501  void set_align(rose_addr_t);
5503 #else
5504  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5505  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5506 #endif
5507 
5508 #ifdef DOCUMENTATION
5509 
5514  const SgUnsignedCharList& get_extra() const;
5515  void set_extra(const SgUnsignedCharList&);
5517 #else
5518  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5519  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5520 #endif
5521 
5522  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5523 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
5524 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5525  private:
5526  friend class boost::serialization::access;
5527 
5528  template<class S>
5529  void serialize(S &s, const unsigned /*version*/) {
5530  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5531  s & BOOST_SERIALIZATION_NVP(p_index);
5532  s & BOOST_SERIALIZATION_NVP(p_type);
5533  s & BOOST_SERIALIZATION_NVP(p_flags);
5534  s & BOOST_SERIALIZATION_NVP(p_offset);
5535  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5536  s & BOOST_SERIALIZATION_NVP(p_paddr);
5537  s & BOOST_SERIALIZATION_NVP(p_filesz);
5538  s & BOOST_SERIALIZATION_NVP(p_memsz);
5539  s & BOOST_SERIALIZATION_NVP(p_align);
5540  s & BOOST_SERIALIZATION_NVP(p_extra);
5541  }
5542 #endif
5543 
5544  public:
5547  PT_NULL = 0,
5548  PT_LOAD = 1,
5551  PT_NOTE = 4,
5552  PT_SHLIB = 5,
5553  PT_PHDR = 6,
5554  PT_TLS = 7,
5556  // OS- and Processor-specific ranges
5557  PT_LOOS = 0x60000000,
5558  PT_HIOS = 0x6fffffff,
5559  PT_LOPROC = 0x70000000,
5560  PT_HIPROC = 0x7fffffff,
5561 
5562  // OS-specific values for GNU/Linux
5563  PT_GNU_EH_FRAME = 0x6474e550,
5564  PT_GNU_STACK = 0x6474e551,
5565  PT_GNU_RELRO = 0x6474e552,
5566  PT_PAX_FLAGS = 0x65041580,
5568  // OS-specific values for Sun
5569  PT_SUNWBSS = 0x6ffffffa,
5570  PT_SUNWSTACK = 0x6ffffffb
5571  };
5572 
5575  PF_NONE = 0,
5576  PF_RESERVED = 0x000ffff8,
5577  PF_XPERM = 0x00000001,
5578  PF_WPERM = 0x00000002,
5579  PF_RPERM = 0x00000004,
5580  PF_OS_MASK = 0x0ff00000,
5581  PF_PROC_MASK = 0xf0000000
5582  };
5583 
5584 #ifdef _MSC_VER
5585 # pragma pack (1)
5586 #endif
5587 
5595  uint32_t p_type;
5596  uint32_t p_offset;
5597  uint32_t p_vaddr;
5598  uint32_t p_paddr;
5599  uint32_t p_filesz;
5600  uint32_t p_memsz;
5601  uint32_t p_flags;
5602  uint32_t p_align;
5603  } /* 0x30 */
5604 #if !defined(SWIG) && !defined(_MSC_VER)
5605  __attribute__((packed))
5606 #endif
5607  ;
5608 
5610  uint32_t p_type; /* 0x00 */
5611  uint32_t p_flags; /* 0x04 */
5612  uint64_t p_offset; /* 0x08 */
5613  uint64_t p_vaddr; /* 0x10 */
5614  uint64_t p_paddr; /* 0x18 */
5615  uint64_t p_filesz; /* 0x20 */
5616  uint64_t p_memsz; /* 0x28 */
5617  uint64_t p_align; /* 0x30 */
5618  } /* 0x38 */
5619 #if !defined(SWIG) && !defined(_MSC_VER)
5620  __attribute__((packed))
5621 #endif
5622  ;
5623 #ifdef _MSC_VER
5624 # pragma pack ()
5625 #endif
5626 
5628  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5630 
5632  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5634 
5638  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
5639  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
5644 
5646  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5647 
5650 
5653 
5654  private:
5655  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
5656  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
5657 #endif // SgAsmElfSegmentTableEntry_OTHERS
5658 
5659 #ifdef DOCUMENTATION
5660  };
5661 #endif
5662 
5663 
5664 
5666 
5667  /*************************************************************************************************************************
5668  * ELF Symbol Tables
5669  *************************************************************************************************************************/
5670 
5672 
5673  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
5674  IS_SERIALIZABLE(AsmElfSymbolSection);
5675 
5676 #ifdef DOCUMENTATION
5677 
5679  public:
5680 #endif
5681 
5682 #ifdef DOCUMENTATION
5683 
5686  bool get_is_dynamic() const;
5687  void set_is_dynamic(bool);
5689 #else
5690  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
5691  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5692 #endif
5693 
5694 #ifdef DOCUMENTATION
5695 
5704 #else
5705  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
5706  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5707 #endif
5708 
5709  DECLARE_OTHERS(AsmElfSymbolSection);
5710 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
5711 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5712  private:
5713  friend class boost::serialization::access;
5714 
5715  template<class S>
5716  void serialize(S &s, const unsigned /*version*/) {
5717  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5718  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
5719  s & BOOST_SERIALIZATION_NVP(p_symbols);
5720  }
5721 #endif
5722 
5723  public:
5726  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
5727  ctor(strsec);
5728  }
5729 
5731  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
5732 
5745  virtual void finish_parsing() $ROSE_OVERRIDE;
5746 
5748  size_t index_of(SgAsmElfSymbol*);
5749 
5754  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5755 
5759  virtual bool reallocate() $ROSE_OVERRIDE;
5760 
5762  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5763 
5765  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5766 
5767  private:
5768  void ctor(SgAsmElfStringSection*);
5769 #endif // SgAsmElfSymbolSection_OTHERS
5770 
5771 #ifdef DOCUMENTATION
5772  };
5773 #endif
5774 
5776 
5777  DECLARE_LEAF_CLASS(AsmElfSymbolList);
5778  IS_SERIALIZABLE(AsmElfSymbolList);
5779 
5780 #ifdef DOCUMENTATION
5782  public:
5783 #endif
5784 
5785 #ifdef DOCUMENTATION
5786 
5792  const SgAsmElfSymbolPtrList& get_symbols() const;
5793  void set_symbols(const SgAsmElfSymbolPtrList&);
5795 #else
5796  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
5797  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5798 #endif
5799 
5800  DECLARE_OTHERS(AsmElfSymbolList);
5801 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
5802 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5803  private:
5804  friend class boost::serialization::access;
5805 
5806  template<class S>
5807  void serialize(S &s, const unsigned /*version*/) {
5808  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5809  s & BOOST_SERIALIZATION_NVP(p_symbols);
5810  }
5811 #endif
5812 #endif // SgAsmElfSymbolList_OTHERS
5813 
5814 #ifdef DOCUMENTATION
5815  };
5816 #endif
5817 
5819 
5820  DECLARE_LEAF_CLASS(AsmElfSymbol);
5821  IS_SERIALIZABLE(AsmElfSymbol);
5822 
5823 #ifdef DOCUMENTATION
5824 
5829  public:
5830 #endif
5831 
5832 #ifdef DOCUMENTATION
5833 
5838  unsigned char get_st_info() const;
5839  void set_st_info(unsigned char);
5841 #else
5842  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
5843  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5844 #endif
5845 
5846 #ifdef DOCUMENTATION
5847 
5852  unsigned char get_st_res1() const;
5853  void set_st_res1(unsigned char);
5855 #else
5856  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
5857  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5858 #endif
5859 
5860 #ifdef DOCUMENTATION
5861 
5866  unsigned get_st_shndx() const;
5867  void set_st_shndx(unsigned);
5869 #else
5870  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
5871  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5872 #endif
5873 
5874 #ifdef DOCUMENTATION
5875 
5880  rose_addr_t get_st_size() const;
5881  void set_st_size(rose_addr_t);
5883 #else
5884  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
5885  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5886 #endif
5887 
5888 #ifdef DOCUMENTATION
5889 
5894  const SgUnsignedCharList& get_extra() const;
5895  void set_extra(const SgUnsignedCharList&);
5897 #else
5898  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
5899  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5900 #endif
5901 
5902  DECLARE_OTHERS(AsmElfSymbol);
5903 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
5904 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5905  private:
5906  friend class boost::serialization::access;
5907 
5908  template<class S>
5909  void serialize(S &s, const unsigned /*version*/) {
5910  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
5911  s & BOOST_SERIALIZATION_NVP(p_st_info);
5912  s & BOOST_SERIALIZATION_NVP(p_st_res1);
5913  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
5914  s & BOOST_SERIALIZATION_NVP(p_st_size);
5915  s & BOOST_SERIALIZATION_NVP(p_extra);
5916  }
5917 #endif
5918 
5919  public:
5920  enum ElfSymBinding {
5921  STB_LOCAL=0,
5922  STB_GLOBAL=1,
5923  STB_WEAK=2
5924  };
5925 
5926  enum ElfSymType {
5929  STT_FUNC = 2,
5931  STT_FILE = 4,
5933  STT_TLS = 6,
5935  };
5936 
5937 #ifdef _MSC_VER
5938 # pragma pack (1)
5939 #endif
5940 
5943  uint32_t st_name;
5944  uint32_t st_value;
5945  uint32_t st_size;
5946  unsigned char st_info;
5947  unsigned char st_res1;
5948  uint16_t st_shndx;
5949  }
5950 #if !defined(SWIG) && !defined(_MSC_VER)
5951  __attribute__((packed))
5952 #endif
5953  ;
5954 
5956  uint32_t st_name;
5957  unsigned char st_info;
5958  unsigned char st_res1;
5959  uint16_t st_shndx;
5960  uint64_t st_value;
5961  uint64_t st_size;
5962  }
5963 #if !defined(SWIG) && !defined(_MSC_VER)
5964  __attribute__((packed))
5965 #endif
5966  ;
5967 
5968 #ifdef _MSC_VER
5969 # pragma pack ()
5970 #endif
5971 
5973  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
5974 
5978  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
5979 
5983  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
5984 
5988  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
5989  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
5997  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5998  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
6002  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
6003 
6006 
6008  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
6009 
6011  static std::string to_string(SgAsmElfSymbol::ElfSymType);
6012 
6013  private:
6014  void ctor(SgAsmElfSymbolSection*);
6015  void parse_common(); // initialization common to all parse() methods
6016 #endif // SgAsmElfSymbol_OTHERS
6017 
6018 #ifdef DOCUMENTATION
6019  };
6020 #endif
6021 
6022 
6023 
6025 
6026  /*************************************************************************************************************************
6027  * ELF Symbol Version Tables
6028  *************************************************************************************************************************/
6029 
6031 
6032  DECLARE_LEAF_CLASS(AsmElfSymverSection);
6033  IS_SERIALIZABLE(AsmElfSymverSection);
6034 
6035 #ifdef DOCUMENTATION
6036 
6041  public:
6042 #endif
6043 
6044 #ifdef DOCUMENTATION
6045 
6054 #else
6055  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
6056  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6057 #endif
6058 
6059  DECLARE_OTHERS(AsmElfSymverSection);
6060 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
6061 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6062  private:
6063  friend class boost::serialization::access;
6064 
6065  template<class S>
6066  void serialize(S &s, const unsigned /*version*/) {
6067  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6068  s & BOOST_SERIALIZATION_NVP(p_entries);
6069  }
6070 #endif
6071 
6072  public:
6075  : SgAsmElfSection(fhdr) {
6076  ctor();
6077  }
6078 
6080  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
6081 
6086  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6087 
6089  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6090 
6092  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6093  private:
6094  void ctor();
6095 #endif // SgAsmElfSymverSection_OTHERS
6096 
6097 #ifdef DOCUMENTATION
6098  };
6099 #endif
6100 
6102 
6103  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6104  IS_SERIALIZABLE(AsmElfSymverEntry);
6105 
6106 #ifdef DOCUMENTATION
6107 
6109  public:
6110 #endif
6111 
6112 #ifdef DOCUMENTATION
6113 
6118  size_t get_value() const;
6119  void set_value(size_t);
6121 #else
6122  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6123  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6124 #endif
6125 
6126  DECLARE_OTHERS(AsmElfSymverEntry);
6127 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6128 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6129  private:
6130  friend class boost::serialization::access;
6131 
6132  template<class S>
6133  void serialize(S &s, const unsigned /*version*/) {
6134  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6135  s & BOOST_SERIALIZATION_NVP(p_value);
6136  }
6137 #endif
6138 
6139  public:
6142  : p_value(0) {
6143  ctor(symver);
6144  }
6145 
6147  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6148 
6149  private:
6150  void ctor(SgAsmElfSymverSection*);
6151 #endif // SgAsmElfSymverEntry_OTHERS
6152 
6153 #ifdef DOCUMENTATION
6154  };
6155 #endif
6156 
6158 
6159 
6160  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6161  IS_SERIALIZABLE(AsmElfSymverEntryList);
6162 
6163 #ifdef DOCUMENTATION
6164 
6169  public:
6170 #endif
6171 
6172 #ifdef DOCUMENTATION
6173 
6176  const SgAsmElfSymverEntryPtrList& get_entries() const;
6177  void set_entries(const SgAsmElfSymverEntryPtrList&);
6179 #else
6180  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6181  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6182  NO_DELETE);
6183 #endif
6184 
6185  DECLARE_OTHERS(AsmElfSymverEntryList);
6186 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6187 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6188  private:
6189  friend class boost::serialization::access;
6190 
6191  template<class S>
6192  void serialize(S &s, const unsigned /*version*/) {
6193  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6194  s & BOOST_SERIALIZATION_NVP(p_entries);
6195  }
6196 #endif
6197 #endif // SgAsmElfSymverEntryList_OTHERS
6198 
6199 #ifdef DOCUMENTATION
6200  };
6201 #endif
6202 
6204 
6205  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6206  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6207 
6208 #ifdef DOCUMENTATION
6209 
6215  public:
6216 #endif
6217 
6218 #ifdef DOCUMENTATION
6219 
6228 #else
6229  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6230  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6231  NO_DELETE);
6232 #endif
6233 
6234  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6235 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6236 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6237  private:
6238  friend class boost::serialization::access;
6239 
6240  template<class S>
6241  void serialize(S &s, const unsigned /*version*/) {
6242  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6243  s & BOOST_SERIALIZATION_NVP(p_entries);
6244  }
6245 #endif
6246 
6247  public:
6250  : SgAsmElfSection(fhdr) {
6251  ctor(strsec);
6252  }
6253 
6322  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6323 
6326  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6327 
6331  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6332 
6334  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6335 
6336  private:
6337  void ctor(SgAsmElfStringSection*);
6338 #endif // SgAsmElfSymverDefinedSection_OTHERS
6339 
6340 #ifdef DOCUMENTATION
6341  };
6342 #endif
6343 
6345 
6346  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6347  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6348 
6349 #ifdef DOCUMENTATION
6350 
6355  public:
6356 #endif
6357 
6358 #ifdef DOCUMENTATION
6359 
6362  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6363  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6365 #else
6366  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6367  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6368  NO_DELETE);
6369 #endif
6370 
6371  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6372 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6373 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6374  private:
6375  friend class boost::serialization::access;
6376 
6377  template<class S>
6378  void serialize(S &s, const unsigned /*version*/) {
6379  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6380  s & BOOST_SERIALIZATION_NVP(p_entries);
6381  }
6382 #endif
6383 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6384 
6385 #ifdef DOCUMENTATION
6386  };
6387 #endif
6388 
6390 
6391  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6392  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6393 
6394 #ifdef DOCUMENTATION
6395 
6397  public:
6398 #endif
6399 
6400 #ifdef DOCUMENTATION
6401 
6406  size_t get_version() const;
6407  void set_version(size_t);
6409 #else
6410  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6411  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6412 #endif
6413 
6414 #ifdef DOCUMENTATION
6415 
6420  int get_flags() const;
6421  void set_flags(int);
6423 #else
6424  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6425  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6426 #endif
6427 
6428 #ifdef DOCUMENTATION
6429 
6434  size_t get_index() const;
6435  void set_index(size_t);
6437 #else
6438  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6439  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6440 #endif
6441 
6442 #ifdef DOCUMENTATION
6443 
6448  uint32_t get_hash() const;
6449  void set_hash(uint32_t);
6451 #else
6452  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6453  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6454 #endif
6455 
6456 #ifdef DOCUMENTATION
6457 
6466 #else
6467  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6468  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6469 #endif
6470 
6471  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6472 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6473 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6474  private:
6475  friend class boost::serialization::access;
6476 
6477  template<class S>
6478  void serialize(S &s, const unsigned /*version*/) {
6479  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6480  s & BOOST_SERIALIZATION_NVP(p_version);
6481  s & BOOST_SERIALIZATION_NVP(p_flags);
6482  s & BOOST_SERIALIZATION_NVP(p_index);
6483  s & BOOST_SERIALIZATION_NVP(p_hash);
6484  s & BOOST_SERIALIZATION_NVP(p_entries);
6485  }
6486 #endif
6487 
6488  public:
6489 #ifdef _MSC_VER
6490 # pragma pack (1)
6491 #endif
6492 
6494  uint16_t vd_version;
6495  uint16_t vd_flags;
6496  uint16_t vd_ndx;
6497  uint16_t vd_cnt;
6498  uint32_t vd_hash;
6499  uint32_t vd_aux;
6500  uint32_t vd_next;
6501  }
6502 #if !defined(SWIG) && !defined(_MSC_VER)
6503  __attribute__((packed))
6504 #endif
6505  ;
6506 
6507 #ifdef _MSC_VER
6508 # pragma pack ()
6509 #endif
6510 
6513  ctor(symver_defined);
6514  }
6515 
6517  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6518 
6520  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6521 
6523  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6524 
6525  private:
6526  void ctor(SgAsmElfSymverDefinedSection*);
6527 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6528 
6529 #ifdef DOCUMENTATION
6530  };
6531 #endif
6532 
6534 
6535  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6536  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6537 
6538 #ifdef DOCUMENTATION
6539 
6544  pbulic:
6545 #endif
6546 
6547 #ifdef DOCUMENTATION
6548 
6551  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6552  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6554 #else
6555  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6556  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6557  NO_DELETE);
6558 #endif
6559 
6560  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6561 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6562 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6563  private:
6564  friend class boost::serialization::access;
6565 
6566  template<class S>
6567  void serialize(S &s, const unsigned /*version*/) {
6568  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6569  s & BOOST_SERIALIZATION_NVP(p_entries);
6570  }
6571 #endif
6572 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6573 
6574 #ifdef DOCUMENTATION
6575  };
6576 #endif
6577 
6579 
6580  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
6581  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
6582 
6583 #ifdef DOCUMENTATION
6585  public:
6586 #endif
6587 
6588 #ifdef DOCUMENTATION
6589 
6592  SgAsmGenericString* get_name() const;
6595 #else
6596  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6597  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6598 #endif
6599 
6600  DECLARE_OTHERS(AsmElfSymverDefinedAux);
6601 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
6602 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6603  private:
6604  friend class boost::serialization::access;
6605 
6606  template<class S>
6607  void serialize(S &s, const unsigned /*version*/) {
6608  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6609  s & BOOST_SERIALIZATION_NVP(p_name);
6610  }
6611 #endif
6612 
6613  public:
6614 #ifdef _MSC_VER
6615 # pragma pack (1)
6616 #endif
6617 
6620  uint32_t vda_name;
6621  uint32_t vda_next;
6622  }
6623 #if !defined(SWIG) && !defined(_MSC_VER)
6624  __attribute__((packed))
6625 #endif
6626  ;
6627 
6628 #ifdef _MSC_VER
6629 # pragma pack ()
6630 #endif
6631 
6636  SgAsmElfSymverDefinedSection *symver_def_sec)
6637  : p_name(NULL) {
6638  ctor(symver_def_entry,symver_def_sec);
6639  }
6640 
6642  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
6643 
6645  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
6646 
6652  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6653 
6654  private:
6655  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
6656 #endif // SgAsmElfSymverDefinedAux_OTHERS
6657 
6658 #ifdef DOCUMENTATION
6659  };
6660 #endif
6661 
6663 
6664  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
6665  IS_SERIALIZABLE(AsmElfSymverNeededSection);
6666 
6667 #ifdef DOCUMENTATION
6668 
6674  public:
6675 #endif
6676 
6677 #ifdef DOCUMENTATION
6678 
6687 #else
6688  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
6689  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6690 #endif
6691 
6692  DECLARE_OTHERS(AsmElfSymverNeededSection);
6693 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
6694 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6695  private:
6696  friend class boost::serialization::access;
6697 
6698  template<class S>
6699  void serialize(S &s, const unsigned /*version*/) {
6700  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6701  s & BOOST_SERIALIZATION_NVP(p_entries);
6702  }
6703 #endif
6704 
6705  public:
6710  : SgAsmElfSection(fhdr) {
6711  ctor(strsec);
6712  }
6713 
6723  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
6724 
6729  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6730 
6734  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6735 
6737  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6738 
6739  private:
6740  void ctor(SgAsmElfStringSection*);
6741 #endif // SgAsmElfSymverNeededSection_OTHERS
6742 
6743 #ifdef DOCUMENTATION
6744  };
6745 #endif
6746 
6748 
6749  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
6750  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
6751 
6752 #ifdef DOCUMENTATION
6753 
6758  public:
6759 #endif
6760 
6761 #ifdef DOCUMENTATION
6762 
6765  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
6766  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
6768 #else
6769  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
6770  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6771  NO_DELETE);
6772 #endif
6773 
6774  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
6775 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
6776 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6777  private:
6778  friend class boost::serialization::access;
6779 
6780  template<class S>
6781  void serialize(S &s, const unsigned /*version*/) {
6782  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6783  s & BOOST_SERIALIZATION_NVP(p_entries);
6784  }
6785 #endif
6786 #endif // SgAsmElfSymverNeededEntryList_OTHERS
6787 
6788 #ifdef DOCUMENTATION
6789  };
6790 #endif
6791 
6793 
6794  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
6795  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
6796 
6797 #ifdef DOCUMENTATION
6798 
6800  public:
6801 #endif
6802 
6803 #ifdef DOCUMENTATION
6804 
6809  size_t get_version() const;
6810  void set_version(size_t);
6812 #else
6813  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
6814  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6815 #endif
6816 
6817 #ifdef DOCUMENTATION
6818 
6824 #else
6825  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
6826  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6827 #endif
6828 
6829 #ifdef DOCUMENTATION
6830 
6839 #else
6840  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
6841  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6842 #endif
6843 
6844  DECLARE_OTHERS(AsmElfSymverNeededEntry);
6845 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
6846 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6847  private:
6848  friend class boost::serialization::access;
6849 
6850  template<class S>
6851  void serialize(S &s, const unsigned /*version*/) {
6852  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6853  s & BOOST_SERIALIZATION_NVP(p_version);
6854  s & BOOST_SERIALIZATION_NVP(p_file_name);
6855  s & BOOST_SERIALIZATION_NVP(p_entries);
6856  }
6857 #endif
6858 
6859  public:
6860 #ifdef _MSC_VER
6861 # pragma pack (1)
6862 #endif
6863 
6866  uint16_t vn_version;
6867  uint16_t vn_cnt;
6868  uint32_t vn_file;
6869  uint32_t vn_aux;
6870  uint32_t vn_next;
6871  }
6872 #if !defined(SWIG) && !defined(_MSC_VER)
6873  __attribute__((packed))
6874 #endif
6875  ;
6876 
6877 #ifdef _MSC_VER
6878 # pragma pack ()
6879 #endif
6880 
6883  : p_file_name(NULL) {
6884  ctor(symver_needed);
6885  }
6886 
6888  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
6889 
6891  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
6892 
6894  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6895 
6896  private:
6897  void ctor(SgAsmElfSymverNeededSection*);
6898 #endif // SgAsmElfSymverNeededEntry_OTHERS
6899 
6900 #ifdef DOCUMENTATION
6901  };
6902 #endif
6903 
6905 
6906  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
6907  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
6908 
6909 #ifdef DOCUMENTATION
6910 
6915  public:
6916 #endif
6917 
6918 #ifdef DOCUMENTATION
6919 
6922  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
6923  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
6925 #else
6926  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
6927  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6928  NO_DELETE);
6929 #endif
6930 
6931  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
6932 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
6933 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6934  private:
6935  friend class boost::serialization::access;
6936 
6937  template<class S>
6938  void serialize(S &s, const unsigned /*version*/) {
6939  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6940  s & BOOST_SERIALIZATION_NVP(p_entries);
6941  }
6942 #endif
6943 #endif // SgAsmElfSymverNeededAuxList_OTHERS
6944 
6945 #ifdef DOCUMENTATION
6946  };
6947 #endif
6948 
6950 
6951  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
6952  IS_SERIALIZABLE(AsmElfSymverNeededAux);
6953 
6954 #ifdef DOCUMENTATION
6955 
6957  public:
6958 #endif
6959 
6960 #ifdef DOCUMENTATION
6961 
6966  uint32_t get_hash() const;
6967  void set_hash(uint32_t);
6969 #else
6970  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
6971  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6972 #endif
6973 
6974 #ifdef DOCUMENTATION
6975 
6980  int get_flags() const;
6981  void set_flags(int);
6983 #else
6984  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
6985  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6986 #endif
6987 
6988 #ifdef DOCUMENTATION
6989 
6994  size_t get_other() const;
6995  void set_other(size_t);
6997 #else
6998  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
6999  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7000 #endif
7001 
7002 #ifdef DOCUMENTATION
7003 
7006  SgAsmGenericString* get_name() const;
7009 #else
7010  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7011  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7012 #endif
7013 
7014  DECLARE_OTHERS(AsmElfSymverNeededAux);
7015 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
7016 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7017  private:
7018  friend class boost::serialization::access;
7019 
7020  template<class S>
7021  void serialize(S &s, const unsigned /*version*/) {
7022  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7023  s & BOOST_SERIALIZATION_NVP(p_hash);
7024  s & BOOST_SERIALIZATION_NVP(p_flags);
7025  s & BOOST_SERIALIZATION_NVP(p_other);
7026  s & BOOST_SERIALIZATION_NVP(p_name);
7027  }
7028 #endif
7029 
7030  public:
7031 #ifdef _MSC_VER
7032 # pragma pack (1)
7033 #endif
7034 
7037  uint32_t vna_hash;
7038  uint16_t vna_flags;
7039  uint16_t vna_other;
7040  uint32_t vna_name;
7041  uint32_t vna_next;
7042  }
7043 #if !defined(SWIG) && !defined(_MSC_VER)
7044  __attribute__((packed))
7045 #endif
7046  ;
7047 
7048 #ifdef _MSC_VER
7049 # pragma pack ()
7050 #endif
7051 
7057  : p_name(NULL) {
7058  ctor(symver_needed_entry,symver_needed_sec);
7059  }
7060 
7062  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
7063 
7065  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
7066 
7072  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7073 
7074  private:
7076 #endif // SgAsmElfSymverNeededAux_OTHERS
7077 
7078 #ifdef DOCUMENTATION
7079  };
7080 #endif
7081 
7082 
7083 
7084 
7086 
7087  /*************************************************************************************************************************
7088  * ELF Relocation Tables
7089  *************************************************************************************************************************/
7090 
7092 
7093  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7094  IS_SERIALIZABLE(AsmElfRelocSection);
7095 
7096 #ifdef DOCUMENTATION
7097 
7099  public:
7100 #endif
7101 
7102 #ifdef DOCUMENTATION
7103 
7106  bool get_uses_addend() const;
7107  void set_uses_addend(bool);
7109 #else
7110  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7111  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7112 #endif
7113 
7114 #ifdef DOCUMENTATION
7115 
7121 #else
7122  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7123  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7124 #endif
7125 
7126 #ifdef DOCUMENTATION
7127 
7135 #else
7136  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7137  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7138 #endif
7139 
7140  DECLARE_OTHERS(AsmElfRelocSection);
7141 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7142 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7143  private:
7144  friend class boost::serialization::access;
7145 
7146  template<class S>
7147  void serialize(S &s, const unsigned /*version*/) {
7148  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7149  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7150  s & BOOST_SERIALIZATION_NVP(p_target_section);
7151  s & BOOST_SERIALIZATION_NVP(p_entries);
7152  }
7153 #endif
7154 
7155  public:
7157  : SgAsmElfSection(fhdr) {
7158  ctor(symsec,targetsec);
7159  }
7160 
7163  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7164 
7166  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7167 
7169  virtual bool reallocate() $ROSE_OVERRIDE;
7170 
7172  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7173 
7175  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7176 
7177  private:
7179 #endif // SgAsmElfRelocSection_OTHERS
7180 
7181 #ifdef DOCUMENTATION
7182  };
7183 #endif
7184 
7186 
7187  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7188  IS_SERIALIZABLE(AsmElfRelocEntryList);
7189 
7190 #ifdef DOCUMENTATION
7191 
7196  public:
7197 #endif
7198 
7199 #ifdef DOCUMENTATION
7200 
7203  const SgAsmElfRelocEntryPtrList& get_entries() const;
7204  void set_entries(const SgAsmElfRelocEntryPtrList&);
7206 #else
7207  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7208  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7209  NO_DELETE);
7210 #endif
7211 
7212  DECLARE_OTHERS(AsmElfRelocEntryList);
7213 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7214 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7215  private:
7216  friend class boost::serialization::access;
7217 
7218  template<class S>
7219  void serialize(S &s, const unsigned /*version*/) {
7220  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7221  s & BOOST_SERIALIZATION_NVP(p_entries);
7222  }
7223 #endif
7224 #endif // SgAsmElfRelocEntryList_OTHERS
7225 
7226 #ifdef DOCUMENTATION
7227  };
7228 #endif
7229 
7231 
7232  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7233  IS_SERIALIZABLE(AsmElfRelocEntry);
7234 
7235 #ifdef DOCUMENTATION
7236 
7238  public:
7239 #endif
7240 
7241 #ifdef DOCUMENTATION
7242 
7247  rose_addr_t get_r_offset() const;
7248  void set_r_offset(rose_addr_t);
7250 #else
7251  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7252  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7253 #endif
7254 
7255 #ifdef DOCUMENTATION
7256 
7261  rose_addr_t get_r_addend() const;
7262  void set_r_addend(rose_addr_t);
7264 #else
7265  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7266  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7267 #endif
7268 
7269 #ifdef DOCUMENTATION
7270 
7275  unsigned long get_sym() const;
7276  void set_sym(unsigned long);
7278 #else
7279  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7280  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7281 #endif
7282 
7283 #ifdef DOCUMENTATION
7284 
7289  RelocType get_type() const;
7290  void set_type(RelocType);
7292 #else
7293  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7294  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7295 #endif
7296 
7297 #ifdef DOCUMENTATION
7298 
7301  const SgUnsignedCharList& get_extra() const;
7302  void set_extra(const SgUnsignedCharList&);
7304 #else
7305  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7306  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7307 #endif
7308 
7309  DECLARE_OTHERS(AsmElfRelocEntry);
7310 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7311 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7312  private:
7313  friend class boost::serialization::access;
7314 
7315  template<class S>
7316  void serialize(S &s, const unsigned /*version*/) {
7317  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7318  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7319  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7320  s & BOOST_SERIALIZATION_NVP(p_sym);
7321  s & BOOST_SERIALIZATION_NVP(p_type);
7322  s & BOOST_SERIALIZATION_NVP(p_extra);
7323  }
7324 #endif
7325 
7326  public:
7329  // Intel 80386 specific definitions.
7341  R_386_32PLT =11,
7348  R_386_16 =20,
7349  R_386_PC16 =21,
7350  R_386_8 =22,
7351  R_386_PC8 =23,
7367  // First Entry for X86-64
7382  R_X86_64_8 =114,
7392  };
7393 
7394 #ifdef _MSC_VER
7395 # pragma pack (1)
7396 #endif
7397 
7399  uint32_t r_offset;
7400  uint32_t r_info;
7401  uint32_t r_addend;
7402  }
7403 #if !defined(SWIG) && !defined(_MSC_VER)
7404  __attribute__((packed))
7405 #endif
7406  ;
7407 
7409  uint64_t r_offset;
7410  uint64_t r_info;
7411  uint64_t r_addend;
7412  }
7413 #if !defined(SWIG) && !defined(_MSC_VER)
7414  __attribute__((packed))
7415 #endif
7416  ;
7417 
7419  uint32_t r_offset;
7420  uint32_t r_info;
7421  }
7422 #if !defined(SWIG) && !defined(_MSC_VER)
7423  __attribute__((packed))
7424 #endif
7425  ;
7426 
7428  uint64_t r_offset;
7429  uint64_t r_info;
7430  }
7431 #if !defined(SWIG) && !defined(_MSC_VER)
7432  __attribute__((packed))
7433 #endif
7434  ;
7435 
7436 #ifdef _MSC_VER
7437 # pragma pack ()
7438 #endif
7439 
7442  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7443  ctor(section);
7444  }
7445 
7449  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7450  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7451  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7452  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7458  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7459  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7460  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7461  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7467  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7468  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7469  dump(f, prefix, idx, NULL);
7470  }
7474  std::string reloc_name() const;
7475 
7476  private:
7477  void ctor(SgAsmElfRelocSection*);
7478 #endif // SgAsmElfRelocEntry_OTHERS
7479 
7480 #ifdef DOCUMENTATION
7481  };
7482 #endif
7483 
7484 
7485 
7487 
7488  /*************************************************************************************************************************
7489  * ELF Dynamic Linking
7490  *************************************************************************************************************************/
7491 
7493 
7494  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7495  IS_SERIALIZABLE(AsmElfDynamicSection);
7496 
7497 #ifdef DOCUMENTATION
7498 
7500  public:
7501 #endif
7502 
7503 #ifdef DOCUMENTATION
7504 
7513 #else
7514  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7515  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7516 #endif
7517 
7518  DECLARE_OTHERS(AsmElfDynamicSection);
7519 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7520 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7521  private:
7522  friend class boost::serialization::access;
7523 
7524  template<class S>
7525  void serialize(S &s, const unsigned /*version*/) {
7526  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7527  s & BOOST_SERIALIZATION_NVP(p_entries);
7528  }
7529 #endif
7530 
7531  public:
7534  : SgAsmElfSection(fhdr) {
7535  ctor(strsec);
7536  }
7537 
7539  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7540 
7542  virtual void finish_parsing() $ROSE_OVERRIDE;
7543 
7546  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7547 
7549  virtual bool reallocate() $ROSE_OVERRIDE;
7550 
7552  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7553 
7555  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7556 
7557  private:
7558  void ctor(SgAsmElfStringSection*);
7559 #endif // SgAsmElfDynamicSection_OTHERS
7560 
7561 #ifdef DOCUMENTATION
7562  };
7563 #endif
7564 
7566 
7567  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7568  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7569 
7570 #ifdef DOCUMENTATION
7571 
7576  public:
7577 #endif
7578 
7579 #ifdef DOCUMENTATION
7580 
7583  const SgAsmElfDynamicEntryPtrList& get_entries() const;
7584  void set_entries(const SgAsmElfDynamicEntryPtrList&);
7586 #else
7587  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
7588  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
7589  NO_DELETE);
7590 #endif
7591 
7592  DECLARE_OTHERS(AsmElfDynamicEntryList);
7593 #if defined(SgAsmElfDynamicEntryList_OTHERS) || defined(DOCUMENTATION)
7594 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7595  private:
7596  friend class boost::serialization::access;
7597 
7598  template<class S>
7599  void serialize(S &s, const unsigned /*version*/) {
7600  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7601  s & BOOST_SERIALIZATION_NVP(p_entries);
7602  }
7603 #endif
7604 #endif // SgAsmElfDynamicEntryList_OTHERS
7605 
7606 #ifdef DOCUMENTATION
7607  };
7608 #endif
7609 
7611 
7612  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
7613  IS_SERIALIZABLE(AsmElfDynamicEntry);
7614 
7615 #ifdef DOCUMENTATION
7616 
7618  public:
7619 #endif
7620 
7621 #ifdef DOCUMENTATION
7622 
7627  EntryType get_d_tag() const;
7628  void set_d_tag(EntryType);
7630 #else
7631  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
7632  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7633 #endif
7634 
7635 #ifdef DOCUMENTATION
7636 
7641  rose_rva_t get_d_val() const;
7642  void set_d_val(rose_rva_t);
7644 #else
7645  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
7646  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7647 #endif
7648 
7649 #ifdef DOCUMENTATION
7650  // declared and documented below
7651 #else
7652  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
7653  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7654 #endif
7655 
7656 #ifdef DOCUMENTATION
7657 
7660  const SgUnsignedCharList& get_extra() const;
7661  void set_extra(const SgUnsignedCharList&);
7663 #else
7664  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7665  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7666 #endif
7667 
7668  DECLARE_OTHERS(AsmElfDynamicEntry);
7669 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
7670 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7671  private:
7672  friend class boost::serialization::access;
7673 
7674  template<class S>
7675  void serialize(S &s, const unsigned /*version*/) {
7676  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7677  s & BOOST_SERIALIZATION_NVP(p_d_tag);
7678  s & BOOST_SERIALIZATION_NVP(p_d_val);
7679  s & BOOST_SERIALIZATION_NVP(p_name);
7680  s & BOOST_SERIALIZATION_NVP(p_extra);
7681  }
7682 #endif
7683 
7684  public:
7685  enum EntryType { /* Type Executable SharedObj Purpose */
7686  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
7687  DT_NEEDED = 1, /* value optional optional Name of needed library */
7688  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
7689  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
7690  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
7691  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
7692  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
7693  DT_RELA = 7, /* pointer mandatory optional Relocation table */
7694  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
7695  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
7696  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
7697  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
7698  DT_INIT = 12, /* pointer optional optional Initialization function */
7699  DT_FINI = 13, /* pointer optional optional Termination function */
7700  DT_SONAME = 14, /* value ignored optional Name of shared object */
7701  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
7702  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
7703  DT_REL = 17, /* pointer mandatory optional Relocation table */
7704  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
7705  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
7706  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
7707  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
7708  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
7709  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
7710  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
7711  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
7712  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
7713  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
7714  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
7715  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
7716  DT_FLAGS = 30, /* value optional ? Bit flags */
7717  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
7718  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
7719  DT_NUM = 34, /* ? ? ? "number used"? */
7720 
7721  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
7722  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
7723  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
7724  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
7725  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
7726  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
7727  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
7728  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
7729  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
7730  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
7731  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
7732 
7733  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
7734  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
7735  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
7736  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
7737  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
7738  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
7739  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
7740  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
7741  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
7742  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
7743  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
7744 
7745  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
7746  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
7747  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
7748  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
7749  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
7750  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
7751  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
7752  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
7753 
7754  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
7755  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
7756  };
7757 
7758 #ifdef _MSC_VER
7759 # pragma pack (1)
7760 #endif
7761 
7764  uint32_t d_tag;
7765  uint32_t d_val;
7766  }
7767 #if !defined(SWIG) && !defined(_MSC_VER)
7768  __attribute__((packed))
7769 #endif
7770  ;
7771 
7773  uint64_t d_tag;
7774  uint64_t d_val;
7775  }
7776 #if !defined(SWIG) && !defined(_MSC_VER)
7777  __attribute__((packed))
7778 #endif
7779  ;
7780 
7781 #ifdef _MSC_VER
7782 # pragma pack ()
7783 #endif
7784 
7787  : p_d_tag(DT_NULL), p_name(NULL) {
7788  ctor(dynsec);
7789  }
7790 
7794  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);
7795  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*);
7801  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*) const;
7802  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*) const;
7806  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
7807 
7809  static std::string to_string(SgAsmElfDynamicEntry::EntryType);
7810 
7814  SgAsmGenericString* get_name() const { return p_name; }
7818  private:
7819  void ctor(SgAsmElfDynamicSection*);
7820 #endif // SgAsmElfDynamicEntry_OTHERS
7821 
7822 #ifdef DOCUMENTATION
7823  };
7824 #endif
7825 
7826 
7827 
7828 
7830 
7831  /*************************************************************************************************************************
7832  * ELF String Tables
7833  *************************************************************************************************************************/
7834 
7836 
7837  DECLARE_LEAF_CLASS(AsmElfStringSection);
7838  IS_SERIALIZABLE(AsmElfStringSection);
7839  AsmElfStringSection.setAutomaticGenerationOfDestructor(false);
7840 
7841 #ifdef DOCUMENTATION
7842 
7846  public:
7847 #endif
7848 
7849 #ifdef DOCUMENTATION
7850 
7855  SgAsmElfStrtab* get_strtab() const;
7856  void set_strtab(SgAsmElfStrtab*);
7858 #else
7859  AsmElfStringSection.setDataPrototype("SgAsmElfStrtab*", "strtab", "= NULL",
7860  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7861 #endif
7862 
7863  DECLARE_OTHERS(AsmElfStringSection);
7864 #if defined(SgAsmElfStringSection_OTHERS) || defined(DOCUMENTATION)
7865 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7866  private:
7867  friend class boost::serialization::access;
7868 
7869  template<class S>
7870  void serialize(S &s, const unsigned /*version*/) {
7871  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7872  s & BOOST_SERIALIZATION_NVP(p_strtab);
7873  }
7874 #endif
7875 
7876  public:
7879  : SgAsmElfSection(fhdr), p_strtab(NULL) {
7880  ctor();
7881  }
7882 
7884  virtual SgAsmElfStringSection *parse() $ROSE_OVERRIDE;
7885 
7887  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7888 
7893  virtual void set_size(rose_addr_t newsize) $ROSE_OVERRIDE;
7894 
7901  virtual bool reallocate() $ROSE_OVERRIDE;
7902 
7904  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7905 
7906  private:
7907  void ctor();
7908  void ctor(SgAsmElfSectionTable*);
7909 #endif // SgAsmElfStringSection_OTHERS
7910 
7911 #ifdef DOCUMENTATION
7912  };
7913 #endif
7914 
7916 
7917  DECLARE_LEAF_CLASS(AsmElfStrtab);
7918  IS_SERIALIZABLE(AsmElfStrtab);
7919  AsmElfStrtab.setAutomaticGenerationOfDestructor(false);
7920 
7921 #ifdef DOCUMENTATION
7922 
7923  class SgAsmElfStrtab: public SgAsmGenericStrtab {
7924  public:
7925 #endif
7926 
7927  DECLARE_OTHERS(AsmElfStrtab);
7928 #if defined(SgAsmElfStrtab_OTHERS) || defined(DOCUMENTATION)
7929 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7930  private:
7931  friend class boost::serialization::access;
7932 
7933  template<class S>
7934  void serialize(S &s, const unsigned /*version*/) {
7935  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericStrtab);
7936  }
7937 #endif
7938 
7939  public:
7943  explicit SgAsmElfStrtab(class SgAsmElfSection *containing_section)
7944  : SgAsmGenericStrtab(containing_section) {
7945  ctor();
7946  }
7947 
7954  virtual ~SgAsmElfStrtab();
7955 
7959  virtual SgAsmElfStrtab *parse() $ROSE_OVERRIDE;
7960 
7964  virtual void unparse(std::ostream&) const;
7965 
7971  virtual SgAsmStringStorage *create_storage(rose_addr_t offset, bool shared) $ROSE_OVERRIDE;
7972 
7976  virtual rose_addr_t get_storage_size(const SgAsmStringStorage*) $ROSE_OVERRIDE;
7977 
7987  virtual void allocate_overlap(SgAsmStringStorage*) $ROSE_OVERRIDE;
7988 
7990  virtual void rebind(SgAsmStringStorage*, rose_addr_t) $ROSE_OVERRIDE;
7991 
7992  private:
7993  void ctor();
7994 #endif // SgAsmElfStrtab_OTHERS
7995 
7996 #ifdef DOCUMENTATION
7997  };
7998 #endif
7999 
8000 
8001 
8002 
8004 
8005  /*************************************************************************************************************************
8006  * ELF Notes
8007  *************************************************************************************************************************/
8008 
8010 
8011  DECLARE_LEAF_CLASS(AsmElfNoteSection);
8012  IS_SERIALIZABLE(AsmElfNoteSection);
8013 
8014 #ifdef DOCUMENTATION
8016  public:
8017 #endif
8018 
8019 #ifdef DOCUMENTATION
8020 
8029 #else
8030  AsmElfNoteSection.setDataPrototype("SgAsmElfNoteEntryList*", "entries", "= NULL",
8031  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8032 #endif
8033 
8034  DECLARE_OTHERS(AsmElfNoteSection);
8035 #if defined(SgAsmElfNoteSection_OTHERS) || defined(DOCUMENTATION)
8036 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8037  private:
8038  friend class boost::serialization::access;
8039 
8040  template<class S>
8041  void serialize(S &s, const unsigned /*version*/) {
8042  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8043  s & BOOST_SERIALIZATION_NVP(p_entries);
8044  }
8045 #endif
8046 
8047  public:
8050  : SgAsmElfSection(fhdr) {
8051  ctor();
8052  }
8053  virtual SgAsmElfNoteSection *parse() $ROSE_OVERRIDE;
8054 
8056  virtual bool reallocate() $ROSE_OVERRIDE;
8057 
8059  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8060 
8062  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8063 
8064  private:
8065  void ctor();
8066 #endif // SgAsmElfNoteSection_OTHERS
8067 
8068 #ifdef DOCUMENTATION
8069  };
8070 #endif
8071 
8073 
8074  DECLARE_LEAF_CLASS(AsmElfNoteEntryList);
8075  IS_SERIALIZABLE(AsmElfNoteEntryList);
8076 
8077 #ifdef DOCUMENTATION
8078 
8083  public:
8084 #endif
8085 
8086 #ifdef DOCUMENTATION
8087 
8090  const SgAsmElfNoteEntryPtrList& get_entries() const;
8091  void set_entries(const SgAsmElfNoteEntryPtrList&);
8093 #else
8094  AsmElfNoteEntryList.setDataPrototype("SgAsmElfNoteEntryPtrList", "entries", "",
8095  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8096 #endif
8097 
8098  DECLARE_OTHERS(AsmElfNoteEntryList);
8099 #if defined(SgAsmElfNoteEntryList_OTHERS) || defined(DOCUMENTATION)
8100 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8101  private:
8102  friend class boost::serialization::access;
8103 
8104  template<class S>
8105  void serialize(S &s, const unsigned /*version*/) {
8106  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8107  s & BOOST_SERIALIZATION_NVP(p_entries);
8108  }
8109 #endif
8110 #endif // SgAsmElfNoteEntryList_OTHERS
8111 
8112 #ifdef DOCUMENTATION
8113  };
8114 #endif
8115 
8117 
8118  DECLARE_LEAF_CLASS(AsmElfNoteEntry);
8119  IS_SERIALIZABLE(AsmElfNoteEntry);
8120 
8121 #ifdef DOCUMENTATION
8122 
8124  public:
8125 #endif
8126 
8127 #ifdef DOCUMENTATION
8128 
8133  unsigned get_type() const;
8134  void set_type(unsigned);
8136 #else
8137  AsmElfNoteEntry.setDataPrototype("unsigned", "type", "= 0",
8138  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8139 #endif
8140 
8141 #ifdef DOCUMENTATION
8142  // documented below
8143 #else
8144  AsmElfNoteEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
8145  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8146 #endif
8147 
8148 #ifdef DOCUMENTATION
8149 
8154  const SgUnsignedCharList& get_payload() const;
8155  void set_payload(const SgUnsignedCharList&);
8157 #else
8158  AsmElfNoteEntry.setDataPrototype("SgUnsignedCharList", "payload", "",
8159  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8160 #endif
8161 
8162  DECLARE_OTHERS(AsmElfNoteEntry);
8163 #if defined(SgAsmElfNoteEntry_OTHERS) || defined(DOCUMENTATION)
8164 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8165  private:
8166  friend class boost::serialization::access;
8167 
8168  template<class S>
8169  void serialize(S &s, const unsigned /*version*/) {
8170  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8171  s & BOOST_SERIALIZATION_NVP(p_type);
8172  s & BOOST_SERIALIZATION_NVP(p_name);
8173  s & BOOST_SERIALIZATION_NVP(p_payload);
8174  }
8175 #endif
8176 
8177  public:
8180  : p_type(0), p_name(NULL) {
8181  ctor(section);
8182  }
8183 
8190  SgAsmGenericString *get_name() const;
8191  void set_name(SgAsmGenericString *name);
8197  rose_addr_t parse(rose_addr_t starting_offset);
8198 
8202  rose_addr_t unparse(std::ostream &f, rose_addr_t starting_offset);
8203 
8205  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
8206 
8210  void set_payload(const void*, size_t nbytes);
8211 
8213  rose_addr_t