ROSE  0.9.11.8
binaryInstruction.C
1 /******************************************************************************************************************************
2  * NOTE: For any given IR class, please keep all its parts as close together as possible. Its bad enough that we're
3  * defining classes in a non-C-like language -- and it's painful when a definition is scattered all over this file. We
4  * already have four places to look to get the definition of an IR class:
5  * (1) here, in this source file, built with ROSETTA functions
6  * (2) additional declarations between HEADER_* markers in ../Grammar/BinaryInstruction.code (which we can't
7  * even parse as a C++ file, making IDEs useless there).
8  * (3) function definitions between SOURCE_* markers in ../Grammar/BinaryInstruction.code, which for some
9  * reason are not next to the corresponding HEADER_ markers. Please migrate these definitions to *.C files
10  * whenever you have an opportunity, so that IDEs can see the definitions.
11  * (4) Doxygen documentation in ../../../docs/testDoxygen directory since doxygen can't parse the IR classes
12  * from this source file. Documented entities are marked with a "DOXYGEN" comment here to make it more
13  * obvious when documentation is present.
14  *
15  * NOTE: First part of the file is for classes describing instructions. Middle part is for classes describing binary
16  * containers (organized by container type: ELF, DOS, PE, ...) Last part is the base classes. Unlike C++, the classes
17  * defined in this file need to be defined from the most specific (derived classes) to the most general (base class).
18  *
19  * NOTE: Please use three blank lines between IR node definitions to help make this file more readable. Unless those IR
20  * nodes are so closely related to one another that it's better to keep them close.
21  *
22  * UPDATE: Instead of splitting class declarations into four separate places, we can now use the macros defined below to put
23  * everything into one place in this file. My goal is to eventually remove the
24  * src/ROSETTA/Grammar/BinaryInstruction.code file and the related docs/testDoxygen/xxx.docs files and to add
25  * documentation here for all property accessors.
26  *
27  * ROSETTA FAILURE MODES:
28  *
29  * + If you get thousands of compile errors in Cxx_Grammar.h that seem to have absolutely nothing to do with the node
30  * you just added, then double check that the new node type is listed as the descendant of some other node type in a
31  * NEW_NONTERMINAL_MACRO macro expansion.
32  *
33  * + If CxxGrammarMetaProgram uses gigabytes and gigabytes of memory and never terminates then check that all the new
34  * IR node types have a correctly spelled entry in the astNodeList file.
35  *-----------------------------------------------------------------------------------------------------------------------------*/
36 
37 #include "ROSETTA_macros.h"
38 #include "grammar.h"
39 #include "AstNodeClass.h"
40 
41 // The following macros try to make it possile to keep all aspects of a Sage node's declaration in this one file. The old way
42 // of doing things required the class declarations to be split into four places:
43 // (1) The #include files necessary to declare the class were at the top of a src/ROSETTA/Grammar/*.code file
44 // (2) The class declaration and properties were built in src/ROSETTA/src/*.C
45 // (3) The documentation for the class and its properties were in docs/testDoxygen/*.docs files
46 // (4) Additional non-ROSETTA members were in src/ROSETTA/Grammar/*.code files
47 // Implementations were originally also in the src/ROSETTA/Grammar/*.code files but have since been moved to *.C files. The
48 // problem with *.code files is no IDE understands them.
49 //
50 // The following macros take a CLASS_WITHOUT_Sg parameter, which is the name of the Sage node class but without the leading
51 // "Sg". I'm not sure why ROSETTA was written this way. For instance, use "AsmInstruction" instead of "SgAsmInstruction". Most
52 // other things will use the full class name.
53 //
54 // The macros are:
55 // DOCUMENTATION is never defined when compiling, but will be defined when generating documentation and can be used to help
56 // IDE's figure out the indentation and as commentary. We don't use "#if 0" because some IDEs figure out that the code is
57 // never possible and don't indent it properly. For instance, most of the classes are defined like this:
58 // #ifdef DOCUMENTATION
59 // class SgAsmArmInstruction: public SgAsmInstruction {
60 // #endif
61 //
62 // ...
63 //
64 // #ifdef DOCUMENTATION
65 // };
66 // #endif
67 //
68 //
69 // DECLARE_LEAF_CLASS is the simpler way to declare a Sage class that has no subclasses. This must be the first macro
70 // invoked when starting a new class declaration. Example, to declare the SgMyClass node, say:
71 // DECLARE_LEAF_CLASS(MyClass);
72 // #ifdef DOCUMENTATION
73 // class SgMyClass: public ...base-classes... {
74 // #endif
75 //
76 //
77 // DECLARE_HEADERS is used to indicate what header files need to be included. Note that due to limitations of ROSETTA
78 // (specifically, not having any portable regular expression library due to prohibition against using boost), the #ifdef and
79 // #endif lines must be *exactly* as written here -- they are sensitive to white space.
80 // DECLARE_HEADERS(MyClass);
81 // #if defined(SgMyClass_HEADERS) || defined(DOCUMENTATION)
82 // #include <someHeader>
83 // #endif // SgMyClass_HEADERS
84 //
85 //
86 // DECLARE_OTHERS is for declaring other class members that don't need to be processed by ROSETTA. Due to limitations of
87 // ROSETTA (specifically, not having any portable regular expression library due to prohibition against using boost), the
88 // #ifdef and #endif lines must be *exactly* as written here -- they are sensitive to white space.
89 // DECLARE_OTHERS(MyClass);
90 // #if defined(SgMyClass_OTHERS) || defined(DOCUMENTATION)
91 // // other declarations here
92 // #endif // SgMyClass_OTHERS
93 
94 //#undef DOCUMENTATION -- commented out so IDEs can't figure it out
95 #ifdef DOCUMENTATION
96 DOCUMENTATION_should_never_be_defined;
97 #endif
98 
99 #ifdef DOCUMENTATION
100 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) /*void*/
101 #else
102 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) \
103  NEW_TERMINAL_MACRO(CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg "Tag"); \
104  CLASS_WITHOUT_Sg.setCppCondition("!defined(DOCUMENTATION)")
105 #endif
106 
107 #ifdef DOCUMENTATION
108 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) /*void*/
109 #else
110 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) \
111  CLASS_WITHOUT_Sg.setPredeclarationString("Sg" #CLASS_WITHOUT_Sg "_HEADERS", __FILE__)
112 #endif
113 
114 #ifdef DOCUMENTATION
115 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) /*void*/
116 #else
117 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) \
118  CLASS_WITHOUT_Sg.setFunctionPrototype("Sg" #CLASS_WITHOUT_Sg "_OTHERS", __FILE__)
119 #endif
120 
121 #ifdef DOCUMENTATION
122 #define IS_SERIALIZABLE() /*void*/
123 #else
124 #define IS_SERIALIZABLE(CLASS_WITHOUT_Sg) \
125  CLASS_WITHOUT_Sg.isBoostSerializable(true)
126 #endif
127 
128 // Since ROSETTA builds classes from the leaves up to the base, and C++ builds classes from the base down to the leaves, we
129 // need to make sure that doxygen sees the base classes before the derived classes. So just list all the non-leaf classes here.
130 #ifdef DOCUMENTATION
133 class SgAsmDwarfConstruct;
135 class SgAsmElfSection;
137 class SgAsmExpression;
138 class SgAsmGenericHeader;
139 class SgAsmGenericSection;
140 class SgAsmGenericString;
141 class SgAsmGenericStrtab;
142 class SgAsmGenericSymbol;
143 class SgAsmInstruction;
144 class SgAsmNode;
145 class SgAsmPESection;
147 class SgAsmScalarType;
148 class SgAsmStatement;
149 class AsmSynthesizedFieldDeclaration;
150 class SgAsmType;
153 class SgNode;
154 #endif
155 
156 #ifndef DOCUMENTATION
157 void Grammar::setUpBinaryInstructions() {
158 #endif
159 
161 
162  /**************************************************************************************************************************
163  * Instructions.
164  * Base class (SgAsmInstruction) and various subclasses, one per architecture.
165  **************************************************************************************************************************/
166 
168 
169  DECLARE_LEAF_CLASS(AsmArmInstruction);
170  IS_SERIALIZABLE(AsmArmInstruction);
171 
172  DECLARE_HEADERS(AsmArmInstruction);
173 #if defined(SgAsmArmInstruction_HEADERS) || defined(DOCUMENTATION)
174  #include <InstructionEnumsArm.h>
175 #endif // SgAsmArmInstruction_HEADERS
176 
177 #ifdef DOCUMENTATION
178 
180  public:
181 #endif
182 
183 #ifdef DOCUMENTATION
184 
193 #else
194  AsmArmInstruction.setDataPrototype("Rose::BinaryAnalysis::ArmInstructionKind", "kind",
195  "= Rose::BinaryAnalysis::arm_unknown_instruction",
196  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
197 #endif
198 
199 #ifdef DOCUMENTATION
200 
206 #else
207  AsmArmInstruction.setDataPrototype("Rose::BinaryAnalysis::ArmInstructionCondition", "condition",
208  "= Rose::BinaryAnalysis::arm_cond_unknown",
209  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
210 #endif
211 
212 #ifdef DOCUMENTATION
213 
219 #else
220  AsmArmInstruction.setDataPrototype("int", "positionOfConditionInMnemonic", "= -1",
221  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
222 #endif
223 
224  DECLARE_OTHERS(AsmArmInstruction);
225 #if defined(SgAsmArmInstruction_OTHERS) || defined(DOCUMENTATION)
226 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
227  private:
228  friend class boost::serialization::access;
229 
230  template<class S>
231  void serialize(S &s, const unsigned /*version*/) {
232  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
233  s & BOOST_SERIALIZATION_NVP(p_kind);
234  s & BOOST_SERIALIZATION_NVP(p_condition);
235  s & BOOST_SERIALIZATION_NVP(p_positionOfConditionInMnemonic);
236  }
237 #endif
238 
239  public:
240  // Overrides are documented in the base class
241  virtual std::string description() const $ROSE_OVERRIDE;
242  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
243  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
244  virtual bool isUnknown() const $ROSE_OVERRIDE;
245  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
246 #endif // SgAsmArmInstruction_OTHERS
247 #ifdef DOCUMENTATION
248  };
249 #endif
250 
251 
253 
254  DECLARE_LEAF_CLASS(AsmX86Instruction);
255  IS_SERIALIZABLE(AsmX86Instruction);
256  DECLARE_HEADERS(AsmX86Instruction);
257 #if defined(SgAsmX86Instruction_HEADERS) || defined(DOCUMENTATION)
258  #include <InstructionEnumsX86.h>
259  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
260 #endif // SgAsmX86Instruction_HEADERS
261 
262 #ifdef DOCUMENTATION
263 
265  public:
266 #endif
267 
268 #ifdef DOCUMENTATION
269 
278 #else
279  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionKind", "kind",
280  "= Rose::BinaryAnalysis::x86_unknown_instruction",
281  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
282 #endif
283 
284 #ifdef DOCUMENTATION
285 
291 #else
292  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "baseSize",
293  "= Rose::BinaryAnalysis::x86_insnsize_none",
294  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
295 #endif
296 
297 #ifdef DOCUMENTATION
298 
304 #else
305  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "operandSize",
306  "= Rose::BinaryAnalysis::x86_insnsize_none",
307  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
308 #endif
309 
310 #ifdef DOCUMENTATION
311 
317 #else
318  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "addressSize",
319  "= Rose::BinaryAnalysis::x86_insnsize_none",
320  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
321 #endif
322 
323 #ifdef DOCUMENTATION
324 
329  bool get_lockPrefix() const;
330  void set_lockPrefix(bool);
332 #else
333  AsmX86Instruction.setDataPrototype("bool", "lockPrefix", "= false",
334  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
335 #endif
336 
337 #ifdef DOCUMENTATION
338 
344 #else
345  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86RepeatPrefix", "repeatPrefix",
346  "= Rose::BinaryAnalysis::x86_repeat_none",
347  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
348 #endif
349 
350 #ifdef DOCUMENTATION
351 
357 #else
358  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86BranchPrediction", "branchPrediction",
359  "= Rose::BinaryAnalysis::x86_branch_prediction_none",
360  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
361 #endif
362 
363 #ifdef DOCUMENTATION
364 
373 #else
374  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86SegmentRegister", "segmentOverride",
375  "= Rose::BinaryAnalysis::x86_segreg_none",
376  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
377 #endif
378 
379 
380  DECLARE_OTHERS(AsmX86Instruction);
381 #if defined(SgAsmX86Instruction_OTHERS) || defined(DOCUMENTATION)
382 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
383  private:
384  friend class boost::serialization::access;
385 
386  template<class S>
387  void serialize(S &s, const unsigned /*version*/) {
388  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
389  s & BOOST_SERIALIZATION_NVP(p_kind);
390  s & BOOST_SERIALIZATION_NVP(p_baseSize);
391  s & BOOST_SERIALIZATION_NVP(p_operandSize);
392  s & BOOST_SERIALIZATION_NVP(p_addressSize);
393  s & BOOST_SERIALIZATION_NVP(p_lockPrefix);
394  s & BOOST_SERIALIZATION_NVP(p_repeatPrefix);
395  s & BOOST_SERIALIZATION_NVP(p_branchPrediction);
396  s & BOOST_SERIALIZATION_NVP(p_segmentOverride);
397  }
398 #endif
399 
400  public:
405 
410 
416 
422 
423  // Overrides are documented in the base class
424  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
425  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
426  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
427  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
428  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
429  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
430  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
431  virtual bool getBranchTarget(rose_addr_t *target/*out*/) $ROSE_OVERRIDE;
432  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
433  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*>&,
434  bool* complete,
435  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
436  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
437  virtual bool isUnknown() const $ROSE_OVERRIDE;
438  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
439 #endif // SgAsmX86Instruction_OTHERS
440 #ifdef DOCUMENTATION
441  };
442 #endif
443 
445 
446  DECLARE_LEAF_CLASS(AsmPowerpcInstruction);
447  IS_SERIALIZABLE(AsmPowerpcInstruction);
448  DECLARE_HEADERS(AsmPowerpcInstruction);
449 #if defined(SgAsmPowerpcInstruction_HEADERS) || defined(DOCUMENTATION)
450  #include <InstructionEnumsPowerpc.h>
451 #endif // SgAsmPowerpcInstruction_HEADERS
452 
453 #ifdef DOCUMENTATION
454 
456  public:
457 #endif
458 
459 
460 #ifdef DOCUMENTATION
461 
470 #else
471  AsmPowerpcInstruction.setDataPrototype("Rose::BinaryAnalysis::PowerpcInstructionKind", "kind",
472  "= Rose::BinaryAnalysis::powerpc_unknown_instruction",
473  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
474  COPY_DATA);
475 #endif
476 
477  DECLARE_OTHERS(AsmPowerpcInstruction);
478 #if defined(SgAsmPowerpcInstruction_OTHERS) || defined(DOCUMENTATION)
479 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
480  private:
481  friend class boost::serialization::access;
482 
483  template<class S>
484  void serialize(S &s, const unsigned /*version*/) {
485  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
486  s & BOOST_SERIALIZATION_NVP(p_kind);
487  }
488 #endif
489 
490  public:
491  // Overrides are documented in the base class
492  virtual std::string description() const $ROSE_OVERRIDE;
493  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
494  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
495  virtual bool isUnknown() const $ROSE_OVERRIDE;
496  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
497  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
498  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
499  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
500  rose_addr_t *target, rose_addr_t *retva) $ROSE_OVERRIDE;
501  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
502  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) $ROSE_OVERRIDE;
503 #endif // SgAsmPowerpcInstruction_OTHERS
504 #ifdef DOCUMENTATION
505  };
506 #endif
507 
508 
510 
511  DECLARE_LEAF_CLASS(AsmMipsInstruction);
512  IS_SERIALIZABLE(AsmMipsInstruction);
513  DECLARE_HEADERS(AsmMipsInstruction);
514 #if defined(SgAsmMipsInstruction_HEADERS) || defined(DOCUMENTATION)
515  #include <InstructionEnumsMips.h>
516 #endif // SgAsmMipsInstruction_HEADERS
517 
518 #ifdef DOCUMENTATION
519 
521  public:
522 #endif
523 
524 #ifdef DOCUMENTATION
525 
534 #else
535  AsmMipsInstruction.setDataPrototype("Rose::BinaryAnalysis::MipsInstructionKind", "kind",
536  "= Rose::BinaryAnalysis::mips_unknown_instruction",
537  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
538  COPY_DATA);
539 #endif
540 
541  DECLARE_OTHERS(AsmMipsInstruction);
542 #if defined(SgAsmMipsInstruction_OTHERS) || defined(DOCUMENTATION)
543 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
544  private:
545  friend class boost::serialization::access;
546 
547  template<class S>
548  void serialize(S &s, const unsigned /*version*/) {
549  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
550  s & BOOST_SERIALIZATION_NVP(p_kind);
551  }
552 #endif
553 
554  public:
555  // Overrides are documented in the base class
556  virtual std::string description() const $ROSE_OVERRIDE;
557  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
558  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
559  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
560  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
561  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
562  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
563  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
564  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
565  virtual bool isUnknown() const $ROSE_OVERRIDE;
566  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
567  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
568 #endif // SgAsmMipsInstruction_OTHERS
569 #ifdef DOCUMENTATION
570  };
571 #endif
572 
574 
575  DECLARE_LEAF_CLASS(AsmM68kInstruction);
576  IS_SERIALIZABLE(AsmM68kInstruction);
577  DECLARE_HEADERS(AsmM68kInstruction);
578 #if defined(SgAsmM68kInstruction_HEADERS) || defined(DOCUMENTATION)
579  #include "InstructionEnumsM68k.h"
580 #endif // SgAsmM68kInstruction_HEADERS
581 
582 #ifdef DOCUMENTATION
584  public:
585 #endif
586 
587 #ifdef DOCUMENTATION
588 
597 #else
598  AsmM68kInstruction.setDataPrototype("Rose::BinaryAnalysis::M68kInstructionKind", "kind",
599  " = Rose::BinaryAnalysis::m68k_unknown_instruction",
600  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
601  COPY_DATA);
602 #endif
603 
604  DECLARE_OTHERS(AsmM68kInstruction);
605 #if defined(SgAsmM68kInstruction_OTHERS) || defined(DOCUMENTATION)
606 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
607  private:
608  friend class boost::serialization::access;
609 
610  template<class S>
611  void serialize(S &s, const unsigned /*version*/) {
612  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
613  s & BOOST_SERIALIZATION_NVP(p_kind);
614  }
615 #endif
616 
617  public:
618  // Overrides are documented in the base class
619  virtual std::string description() const $ROSE_OVERRIDE;
620  virtual bool terminatesBasicBlock() $ROSE_OVERRIDE;
621  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
622  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) $ROSE_OVERRIDE;
623  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
624  rose_addr_t *target, rose_addr_t *ret) $ROSE_OVERRIDE;
625  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
626  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) $ROSE_OVERRIDE;
627  virtual bool getBranchTarget(rose_addr_t *target) $ROSE_OVERRIDE;
628  virtual std::set<rose_addr_t> getSuccessors(bool* complete) $ROSE_OVERRIDE;
629  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*>&,
630  bool* complete,
631  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
632  Rose::BinaryAnalysis::MemoryMap::Ptr()) $ROSE_OVERRIDE;
633  virtual bool isUnknown() const $ROSE_OVERRIDE;
634  virtual unsigned get_anyKind() const $ROSE_OVERRIDE;
635 #endif // SgAsmM68kInstruction_OTHERS
636 #ifdef DOCUMENTATION
637  };
638 #endif
639 
641 
642  NEW_NONTERMINAL_MACRO(AsmInstruction,
643  AsmX86Instruction | AsmArmInstruction | AsmPowerpcInstruction | AsmMipsInstruction |
644  AsmM68kInstruction,
645  "AsmInstruction", "AsmInstructionTag", true);
646  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
647  IS_SERIALIZABLE(AsmInstruction);
648 
649  DECLARE_HEADERS(AsmInstruction);
650 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
651  #include <MemoryMap.h>
652 #endif // SgAsmInstruction_HEADERS
653 
654 #ifdef DOCUMENTATION
655 
677  public:
678 #endif
679 
680 #ifdef DOCUMENTATION
681 
689  const std::string& get_mnemonic() const;
690  void set_mnemonic(const std::string&);
692 #else
693  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
694  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
695 #endif
696 
697 #ifdef DOCUMENTATION
698 
703  const SgUnsignedList& get_raw_bytes() const;
704  void set_raw_bytes(const SgUnsignedList&);
706 #else
707  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
708  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
709 #endif
710 
711 #ifdef DOCUMENTATION
712 
721 #else
722  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
723  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
724 #endif
725 
726 #ifdef DOCUMENTATION
727  // FIXME[Robb P Matzke 2017-02-13]: unused?
728 #else
729  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
730  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
731 #endif
732 
733 #ifdef DOCUMENTATION
734 
740  int64_t get_stackDeltaIn() const;
741  void set_stackDeltaIn(int64_t);
743 #else
744  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
745  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
746 #endif
747 
748 #ifdef DOCUMENTATION
749  // FIXME[Robb P Matzke 2017-02-13]: unused?
750 #else
751  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
752  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
753 #endif
754 
755  DECLARE_OTHERS(AsmInstruction);
756 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
757 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
758  private:
759  friend class boost::serialization::access;
760 
761  template<class S>
762  void serialize(S &s, const unsigned /*version*/) {
763  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
764  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
765  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
766  s & BOOST_SERIALIZATION_NVP(p_operandList);
767  s & BOOST_SERIALIZATION_NVP(p_sources);
768  }
769 #endif
770 
771  private:
772  struct SemanticFailure {
773  size_t n;
774  SemanticFailure(): n(0) {}
775  };
776  SemanticFailure semanticFailure_;
777 
778  public:
783  static const int64_t INVALID_STACK_DELTA;
784 
790  virtual std::string description() const { return ""; }
791 
792  // FIXME[Robb P Matzke 2017-02-13]: unused?
793  void appendSources( SgAsmInstruction* instruction );
794 
796  size_t nOperands() const;
797 
801  SgAsmExpression* operand(size_t) const;
802 
809  virtual bool terminatesBasicBlock();
810 
824  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
825  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
837  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
838  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
844  bool isFirstInBlock();
845 
849  bool isLastInBlock();
850 
855  virtual bool getBranchTarget(rose_addr_t *target/*out*/);
856 
991  virtual bool hasEffect();
992 
1001  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
1002  bool relax_stack_semantics=false);
1003 
1013  virtual std::vector<std::pair<size_t,size_t> >
1014  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
1015  bool relax_stack_semantics=false);
1016 
1023  virtual std::set<rose_addr_t> getSuccessors(bool* complete); /*subclasses must redefine*/
1024 
1033  virtual std::set<rose_addr_t> getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1034  bool *complete,
1035  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1037 
1043  virtual size_t get_size() const;
1044 
1050  virtual bool isUnknown() const;
1051 
1085  virtual unsigned get_anyKind() const;
1086 
1090  virtual std::string toString() const;
1091 
1096  virtual std::set<rose_addr_t> explicitConstants() const;
1097 
1107  size_t semanticFailure() const;
1108  void semanticFailure(size_t);
1109  void incrementSemanticFailure();
1112 #endif // SgAsmInstruction_OTHERS
1113 
1114 #ifdef DOCUMENTATION
1115  };
1116 #endif
1117 
1118 
1119 
1121 
1122  /**************************************************************************************************************************
1123  * Instruction Expressions
1124  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1125  **************************************************************************************************************************/
1126 
1128 
1129  DECLARE_LEAF_CLASS(AsmOperandList);
1130  IS_SERIALIZABLE(AsmOperandList);
1131 
1132 #ifdef DOCUMENTATION
1133 
1134  class SgAsmOperandList: public SgAsmNode {
1135  public:
1136 #endif
1137 
1138 #ifdef DOCUMENTATION
1139 
1145  const SgAsmExpressionPtrList& get_operands() const;
1146  void set_oerands(const SgAsmExpressionPtrList&);
1148 #else
1149  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1150  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1151 #endif
1152 
1153  DECLARE_OTHERS(AsmOperandList);
1154 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1155 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1156  private:
1157  friend class boost::serialization::access;
1158 
1159  template<class S>
1160  void serialize(S &s, const unsigned /*version*/) {
1161  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1162  s & BOOST_SERIALIZATION_NVP(p_operands);
1163  }
1164 #endif
1165 
1166  public:
1168  void append_operand(SgAsmExpression* operand);
1169 #endif // SgAsmOperandList_OTHERS
1170 
1171 #ifdef DOCUMENTATION
1172  };
1173 #endif
1174 
1175  // FIXME[Robb P Matzke 2016-10-31]
1176  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1177 
1179 
1180  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1181  IS_SERIALIZABLE(AsmBinaryAdd);
1182 
1183 #ifdef DOCUMENTATION
1184 
1186  public:
1187 #endif
1188 
1189  DECLARE_OTHERS(AsmBinaryAdd);
1190 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1191 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1192  private:
1193  friend class boost::serialization::access;
1194 
1195  template<class S>
1196  void serialize(S &s, const unsigned /*version*/) {
1197  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1198  }
1199 #endif
1200 #endif // SgAsmBinaryAdd_OTHERS
1201 
1202 #ifdef DOCUMENTATION
1203  };
1204 #endif
1205 
1207 
1208  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1209  IS_SERIALIZABLE(AsmBinarySubtract);
1210 
1211 #ifdef DOCUMENTATION
1212 
1214  public:
1215 #endif
1216 
1217  DECLARE_OTHERS(AsmBinarySubtract);
1218 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1219 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1220  private:
1221  friend class boost::serialization::access;
1222 
1223  template<class S>
1224  void serialize(S &s, const unsigned /*version*/) {
1225  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1226  }
1227 #endif
1228 #endif // SgAsmBinarySubtract_OTHERS
1229 
1230 #ifdef DOCUMENTATION
1231  };
1232 #endif
1233 
1235 
1236  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1237  IS_SERIALIZABLE(AsmBinaryMultiply);
1238 
1239 #ifdef DOCUMENTATION
1240 
1242  public:
1243 #endif
1244 
1245  DECLARE_OTHERS(AsmBinaryMultiply);
1246 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1247 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1248  private:
1249  friend class boost::serialization::access;
1250 
1251  template<class S>
1252  void serialize(S &s, const unsigned /*version*/) {
1253  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1254  }
1255 #endif
1256 #endif // SgAsmBinaryMultiply_OTHERS
1257 
1258 #ifdef DOCUMENTATION
1259  };
1260 #endif
1261 
1263 
1264  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1265  IS_SERIALIZABLE(AsmBinaryDivide);
1266 
1267 #ifdef DOCUMENTATION
1268 
1270  public:
1271 #endif
1272 
1273  DECLARE_OTHERS(AsmBinaryDivide);
1274 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1275 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1276  private:
1277  friend class boost::serialization::access;
1278 
1279  template<class S>
1280  void serialize(S &s, const unsigned /*version*/) {
1281  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1282  }
1283 #endif
1284 #endif // SgAsmBinaryDivide_OTHERS
1285 
1286 #ifdef DOCUMENTATION
1287  };
1288 #endif
1289 
1291 
1292  DECLARE_LEAF_CLASS(AsmBinaryMod);
1293  IS_SERIALIZABLE(AsmBinaryMod);
1294 
1295 #ifdef DOCUMENTATION
1296 
1298  public:
1299 #endif
1300 
1301  DECLARE_OTHERS(AsmBinaryMod);
1302 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1303 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1304  private:
1305  friend class boost::serialization::access;
1306 
1307  template<class S>
1308  void serialize(S &s, const unsigned /*version*/) {
1309  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1310  }
1311 #endif
1312 #endif // SgAsmBinaryMod_OTHERS
1313 
1314 #ifdef DOCUMENTATION
1315  };
1316 #endif
1317 
1319 
1320  DECLARE_LEAF_CLASS(AsmBinaryAddPreupdate);
1321  IS_SERIALIZABLE(AsmBinaryAddPreupdate);
1322 
1323 #ifdef DOCUMENTATION
1324 
1326  public:
1327 #endif
1328 
1329  DECLARE_OTHERS(AsmBinaryAddPreupdate);
1330 #if defined(SgAsmBinaryAddPreupdate_OTHERS) || defined(DOCUMENTATION)
1331 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1332  private:
1333  friend class boost::serialization::access;
1334 
1335  template<class S>
1336  void serialize(S &s, const unsigned /*version*/) {
1337  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1338  }
1339 #endif
1340 #endif // SgAsmBinaryAddPreupdate_OTHERS
1341 
1342 #ifdef DOCUMENTATION
1343  };
1344 #endif
1345 
1347 
1348  DECLARE_LEAF_CLASS(AsmBinarySubtractPreupdate);
1349  IS_SERIALIZABLE(AsmBinarySubtractPreupdate);
1350 
1351 #ifdef DOCUMENTATION
1352 
1354  public:
1355 #endif
1356 
1357  DECLARE_OTHERS(AsmBinarySubtractPreupdate);
1358 #if defined(SgAsmBinarySubtractPreupdate_OTHERS) || defined(DOCUMENTATION)
1359 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1360  private:
1361  friend class boost::serialization::access;
1362 
1363  template<class S>
1364  void serialize(S &s, const unsigned /*version*/) {
1365  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1366  }
1367 #endif
1368 #endif // SgAsmBinarySubtractPreupdate_OTHERS
1369 
1370 #ifdef DOCUMENTATION
1371  };
1372 #endif
1373 
1375 
1376  DECLARE_LEAF_CLASS(AsmBinaryAddPostupdate);
1377  IS_SERIALIZABLE(AsmBinaryAddPostupdate);
1378 
1379 #ifdef DOCUMENTATION
1380 
1382  public:
1383 #endif
1384 
1385  DECLARE_OTHERS(AsmBinaryAddPostupdate);
1386 #if defined(SgAsmBinaryAddPostupdate_OTHERS) || defined(DOCUMENTATION)
1387 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1388  private:
1389  friend class boost::serialization::access;
1390 
1391  template<class S>
1392  void serialize(S &s, const unsigned /*version*/) {
1393  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1394  }
1395 #endif
1396 #endif // SgAsmBinaryAddPostupdate_OTHERS
1397 
1398 #ifdef DOCUMENTATION
1399  };
1400 #endif
1401 
1403 
1404  DECLARE_LEAF_CLASS(AsmBinarySubtractPostupdate);
1405  IS_SERIALIZABLE(AsmBinarySubtractPostupdate);
1406 
1407 #ifdef DOCUMENTATION
1408 
1410  public:
1411 #endif
1412 
1413  DECLARE_OTHERS(AsmBinarySubtractPostupdate);
1414 #if defined(SgAsmBinarySubtractPostupdate_OTHERS) || defined(DOCUMENTATION)
1415 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1416  private:
1417  friend class boost::serialization::access;
1418 
1419  template<class S>
1420  void serialize(S &s, const unsigned /*version*/) {
1421  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1422  }
1423 #endif
1424 #endif // SgAsmBinarySubtractPostupdate_OTHERS
1425 
1426 #ifdef DOCUMENTATION
1427  };
1428 #endif
1429 
1431 
1432  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1433  IS_SERIALIZABLE(AsmBinaryLsl);
1434 
1435 #ifdef DOCUMENTATION
1436 
1438  public:
1439 #endif
1440 
1441  DECLARE_OTHERS(AsmBinaryLsl);
1442 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1443 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1444  private:
1445  friend class boost::serialization::access;
1446 
1447  template<class S>
1448  void serialize(S &s, const unsigned /*version*/) {
1449  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1450  }
1451 #endif
1452 #endif // SgAsmBinaryLsl_OTHERS
1453 
1454 #ifdef DOCUMENTATION
1455  };
1456 #endif
1457 
1459 
1460  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1461  IS_SERIALIZABLE(AsmBinaryLsr);
1462 
1463 #ifdef DOCUMENTATION
1464 
1466  public:
1467 #endif
1468 
1469  DECLARE_OTHERS(AsmBinaryLsr);
1470 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1471 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1472  private:
1473  friend class boost::serialization::access;
1474 
1475  template<class S>
1476  void serialize(S &s, const unsigned /*version*/) {
1477  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1478  }
1479 #endif
1480 #endif // SgAsmBinaryLsr_OTHERS
1481 
1482 #ifdef DOCUMENTATION
1483  };
1484 #endif
1485 
1487 
1488  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1489  IS_SERIALIZABLE(AsmBinaryAsr);
1490 
1491 #ifdef DOCUMENTATION
1492 
1494  public:
1495 #endif
1496 
1497  DECLARE_OTHERS(AsmBinaryAsr);
1498 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1499 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1500  private:
1501  friend class boost::serialization::access;
1502 
1503  template<class S>
1504  void serialize(S &s, const unsigned /*version*/) {
1505  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1506  }
1507 #endif
1508 #endif // SgAsmBinaryAsr_OTHERS
1509 
1510 #ifdef DOCUMENTATION
1511  };
1512 #endif
1513 
1515 
1516  DECLARE_LEAF_CLASS(AsmBinaryRor);
1517  IS_SERIALIZABLE(AsmBinaryRor);
1518 
1519 #ifdef DOCUMENTATION
1520 
1522  public:
1523 #endif
1524 
1525  DECLARE_OTHERS(AsmBinaryRor);
1526 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1527 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1528  private:
1529  friend class boost::serialization::access;
1530 
1531  template<class S>
1532  void serialize(S &s, const unsigned /*version*/) {
1533  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1534  }
1535 #endif
1536 #endif // SgAsmBinaryRor_OTHERS
1537 
1538 #ifdef DOCUMENTATION
1539  };
1540 #endif
1541 
1543 
1544  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1545  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1546  AsmBinaryDivide | AsmBinaryMod | AsmBinaryAddPreupdate |
1547  AsmBinarySubtractPreupdate | AsmBinaryAddPostupdate | AsmBinarySubtractPostupdate |
1548  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1549  AsmBinaryRor,
1550  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1551  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1552  IS_SERIALIZABLE(AsmBinaryExpression);
1553 
1554 #ifdef DOCUMENTATION
1555 
1557  public:
1558 #endif
1559 
1560 #ifdef DOCUMENTATION
1561 
1564  SgAsmExpression* get_lhs() const;
1565  void set_lhs(SgAsmExpression*);
1567 #else
1568  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
1569  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1570 #endif
1571 
1572 #ifdef DOCUMENTATION
1573 
1576  SgAsmExpression* get_rhs() const;
1577  void set_rhs(SgAsmExpression*);
1579 #else
1580  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
1581  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1582 #endif
1583 
1584  DECLARE_OTHERS(AsmBinaryExpression);
1585 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
1586 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1587  private:
1588  friend class boost::serialization::access;
1589 
1590  template<class S>
1591  void serialize(S &s, const unsigned /*version*/) {
1592  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1593  s & BOOST_SERIALIZATION_NVP(p_lhs);
1594  s & BOOST_SERIALIZATION_NVP(p_rhs);
1595  }
1596 #endif
1597 #endif // SgAsmBinaryExpression_OTHERS
1598 
1599 #ifdef DOCUMENTATION
1600  };
1601 #endif
1602 
1604 
1605  DECLARE_LEAF_CLASS(AsmUnaryPlus);
1606  IS_SERIALIZABLE(AsmUnaryPlus);
1607 
1608 #ifdef DOCUMENTATION
1609 
1611  public:
1612 #endif
1613 
1614  DECLARE_OTHERS(AsmUnaryPlus);
1615 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
1616 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1617  private:
1618  friend class boost::serialization::access;
1619 
1620  template<class S>
1621  void serialize(S &s, const unsigned /*version*/) {
1622  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1623  }
1624 #endif
1625 #endif // SgAsmUnaryPlus_OTHERS
1626 
1627 #ifdef DOCUMENTATION
1628  };
1629 #endif
1630 
1632 
1633  DECLARE_LEAF_CLASS(AsmUnaryMinus);
1634  IS_SERIALIZABLE(AsmUnaryMinus);
1635 
1636 #ifdef DOCUMENTATION
1637 
1639  public:
1640 #endif
1641 
1642  DECLARE_OTHERS(AsmUnaryMinus);
1643 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
1644 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1645  private:
1646  friend class boost::serialization::access;
1647 
1648  template<class S>
1649  void serialize(S &s, const unsigned /*version*/) {
1650  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1651  }
1652 #endif
1653 #endif // SgAsmUnaryMinus_OTHERS
1654 
1655 #ifdef DOCUMENTATION
1656  };
1657 #endif
1658 
1660 
1661  DECLARE_LEAF_CLASS(AsmUnaryRrx);
1662  IS_SERIALIZABLE(AsmUnaryRrx);
1663 
1664 #ifdef DOCUMENTATION
1665  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1667  public:
1668 #endif
1669 
1670  DECLARE_OTHERS(AsmUnaryRrx);
1671 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
1672 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1673  private:
1674  friend class boost::serialization::access;
1675 
1676  template<class S>
1677  void serialize(S &s, const unsigned /*version*/) {
1678  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1679  }
1680 #endif
1681 #endif // SgAsmUnaryRrx_OTHERS
1682 
1683 #ifdef DOCUMENTATION
1684  };
1685 #endif
1686 
1688 
1689  DECLARE_LEAF_CLASS(AsmUnaryArmSpecialRegisterList);
1690  IS_SERIALIZABLE(AsmUnaryArmSpecialRegisterList);
1691 
1692 #ifdef DOCUMENTATION
1693  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
1695  public:
1696 #endif
1697 
1698  DECLARE_OTHERS(AsmUnaryArmSpecialRegisterList);
1699 #if defined(SgAsmUnaryArmSpecialRegisterList_OTHERS) || defined(DOCUMENTATION)
1700 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1701  private:
1702  friend class boost::serialization::access;
1703 
1704  template<class S>
1705  void serialize(S &s, const unsigned /*version*/) {
1706  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
1707  }
1708 #endif
1709 #endif // SgAsmUnaryArmSpecialRegisterList_OTHERS
1710 
1711 #ifdef DOCUMENTATION
1712  };
1713 #endif
1714 
1716 
1717  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
1718  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryArmSpecialRegisterList,
1719  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
1720  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1721  IS_SERIALIZABLE(AsmUnaryExpression);
1722 
1723 #ifdef DOCUMENTATION
1724 
1726  public:
1727 #endif
1728 
1729 #ifdef DOCUMENTATION
1730 
1733  SgAsmExpression* get_operand() const;
1736 #else
1737  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
1738  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1739 #endif
1740 
1741  DECLARE_OTHERS(AsmUnaryExpression);
1742 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
1743 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1744  private:
1745  friend class boost::serialization::access;
1746 
1747  template<class S>
1748  void serialize(S &s, const unsigned /*version*/) {
1749  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1750  s & BOOST_SERIALIZATION_NVP(p_operand);
1751  }
1752 #endif
1753 #endif // SgAsmUnaryExpression_OTHERS
1754 
1755 #ifdef DOCUMENTATION
1756  };
1757 #endif
1758 
1760 
1761  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
1762  IS_SERIALIZABLE(AsmDirectRegisterExpression);
1763 
1764 #ifdef DOCUMENTATION
1765 
1767  public:
1768 #endif
1769 
1770 #ifdef DOCUMENTATION
1771 
1774  unsigned get_psr_mask() const;
1775  void set_psr_mask(unsigned);
1777 #else
1778  AsmDirectRegisterExpression.setDataPrototype("unsigned", "psr_mask", "=0", // for ARM
1779  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1780  NO_DELETE);
1781 #endif
1782 
1783  DECLARE_OTHERS(AsmDirectRegisterExpression);
1784 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1785 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1786  private:
1787  friend class boost::serialization::access;
1788 
1789  template<class S>
1790  void serialize(S &s, const unsigned /*version*/) {
1791  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1792  s & BOOST_SERIALIZATION_NVP(p_psr_mask);
1793  }
1794 #endif
1795 
1796  private:
1797  // Default c'tor needed for serialization
1799  : p_psr_mask(0) {}
1800 #endif // SgAsmDirectRegisterExpression_OTHERS
1801 
1802 #ifdef DOCUMENTATION
1803  };
1804 #endif
1805 
1807 
1808  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
1809  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
1810 
1811 #ifdef DOCUMENTATION
1812 
1829  public:
1830 #endif
1831 
1832 #ifdef DOCUMENTATION
1833 
1841 #else
1842  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "stride", "",
1843  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1844 #endif
1845 
1846 #ifdef DOCUMENTATION
1847 
1855 #else
1856  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "offset", "",
1857  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1858 #endif
1859 
1860 #ifdef DOCUMENTATION
1861 
1866  size_t get_index() const;
1867  void set_index(size_t);
1869 #else
1870  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
1871  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1872 #endif
1873 
1874 #ifdef DOCUMENTATION
1875 
1880  size_t get_modulus() const;
1881  void set_modulus(size_t);
1883 #else
1884  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
1885  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1886 #endif
1887 
1888  DECLARE_OTHERS(AsmIndirectRegisterExpression);
1889 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
1890 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1891  private:
1892  friend class boost::serialization::access;
1893 
1894  template<class S>
1895  void serialize(S &s, const unsigned /*version*/) {
1896  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
1897  s & BOOST_SERIALIZATION_NVP(p_stride);
1898  s & BOOST_SERIALIZATION_NVP(p_offset);
1899  s & BOOST_SERIALIZATION_NVP(p_index);
1900  s & BOOST_SERIALIZATION_NVP(p_modulus);
1901  }
1902 #endif
1903 
1904  private:
1905  // Default c'tor needed for serialization
1907  : p_index(0), p_modulus(0) {}
1908 #endif // SgAsmIndirectRegisterExpression_OTHERS
1909 
1910 #ifdef DOCUMENTATION
1911  };
1912 #endif
1913 
1915 
1916  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
1917  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
1918  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
1919  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
1920 
1921 #ifdef DOCUMENTATION
1922 
1924  public:
1925 #endif
1926 
1927 #ifdef DOCUMENTATION
1928 
1934 #else
1935  AsmRegisterReferenceExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "descriptor", "",
1936  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1937 #endif
1938 
1939 #ifdef DOCUMENTATION
1940 
1945  int get_adjustment() const;
1946  void set_adjustment(int);
1948 #else
1949  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
1950  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
1951  NO_DELETE);
1952 #endif
1953 
1954  DECLARE_OTHERS(AsmRegisterReferenceExpression);
1955 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
1956 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1957  private:
1958  friend class boost::serialization::access;
1959 
1960  template<class S>
1961  void serialize(S &s, const unsigned /*version*/) {
1962  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
1963  s & BOOST_SERIALIZATION_NVP(p_descriptor);
1964  s & BOOST_SERIALIZATION_NVP(p_adjustment);
1965  }
1966 #endif
1967 
1968  protected:
1969  // Default c'tor needed for serialization
1971  : p_adjustment(0) {}
1972 #endif // SgAsmRegisterReferenceExpression_OTHERS
1973 
1974 #ifdef DOCUMENTATION
1975  };
1976 #endif
1977 
1979 
1980  DECLARE_LEAF_CLASS(AsmRegisterNames);
1981  IS_SERIALIZABLE(AsmRegisterNames);
1982 
1983 #ifdef DOCUMENTATION
1984 
1986  public:
1987 #endif
1988 
1989 #ifdef DOCUMENTATION
1990 
1996  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
1997  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
1999 #else
2000  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
2001  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2002 #endif
2003 
2004 #ifdef DOCUMENTATION
2005 
2011  unsigned get_mask() const;
2012  void set_mask(unsigned);
2014 #else
2015  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
2016  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2017 #endif
2018 
2019  DECLARE_OTHERS(AsmRegisterNames);
2020 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
2021 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2022  private:
2023  friend class boost::serialization::access;
2024 
2025  template<class S>
2026  void serialize(S &s, const unsigned /*version*/) {
2027  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2028  s & BOOST_SERIALIZATION_NVP(p_registers);
2029  s & BOOST_SERIALIZATION_NVP(p_mask);
2030  }
2031 #endif
2032 #endif // SgAsmRegisterNames_OTHERS
2033 
2034 #ifdef DOCUMENTATION
2035  };
2036 #endif
2037 
2039 
2040  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2041  IS_SERIALIZABLE(AsmIntegerValueExpression);
2042 
2043 #ifdef DOCUMENTATION
2044 
2060  public:
2061 #endif
2062 
2063 #ifdef DOCUMENTATION
2064 
2074  SgNode* get_baseNode() const;
2075  void set_baseNode(SgNode*);
2077 #else
2078  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2079  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2080 #endif
2081 
2082  DECLARE_OTHERS(AsmIntegerValueExpression);
2083 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2084 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2085  private:
2086  friend class boost::serialization::access;
2087 
2088  template<class S>
2089  void serialize(S &s, const unsigned /*version*/) {
2090  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2091  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2092  }
2093 #endif
2094 
2095  public:
2100  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2101 
2108 
2110  static uint64_t virtualAddress(SgNode*);
2111 
2131  std::string get_label(bool quiet=false) const;
2132 
2134  size_t get_significantBits() const;
2135 
2141  void makeRelativeTo(SgNode *baseNode);
2142 
2147  uint64_t get_baseAddress() const;
2148 
2154  uint64_t get_absoluteValue(size_t nbits=0) const;
2155 
2159  void set_absoluteValue(uint64_t);
2160 
2162  int64_t get_signedValue() const;
2163 
2167  int64_t get_relativeValue() const;
2168 
2173  void set_relativeValue(int64_t v, size_t nbits=64);
2174 
2175  uint64_t get_value() const { return get_absoluteValue(); }
2176 
2177 #endif // SgAsmIntegerValueExpression_OTHERS
2178 
2179 #ifdef DOCUMENTATION
2180  };
2181 #endif
2182 
2184 
2185  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2186  IS_SERIALIZABLE(AsmFloatValueExpression);
2187 
2188 #ifdef DOCUMENTATION
2189 
2194  public:
2195 #endif
2196 
2197  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2198 
2199  DECLARE_OTHERS(AsmFloatValueExpression);
2200 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
2201  private:
2202  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
2203  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
2204  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
2205  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
2206  // understand "mutable".
2207  mutable double p_nativeValue;
2208  mutable bool p_nativeValueIsValid;
2209 
2210 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2211  private:
2212  friend class boost::serialization::access;
2213 
2214  template<class S>
2215  void serialize(S &s, const unsigned /*version*/) {
2216  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2217  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
2218  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
2219  }
2220 #endif
2221 
2222  public:
2227  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
2228 
2234  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
2235 
2242 
2244  void set_nativeValue(double);
2245 
2247  double get_nativeValue() const;
2248 
2253  void updateBitVector();
2254 
2259  void updateNativeValue() const;
2260 #endif // SgAsmFloatValueExpression_OTHERS
2261 
2262 #ifdef DOCUMENTATION
2263  };
2264 #endif
2265 
2267 
2268  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
2269  AsmIntegerValueExpression | AsmFloatValueExpression,
2270  "AsmConstantExpression", "AsmConstantExpressionTag", false);
2271  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
2272  IS_SERIALIZABLE(AsmConstantExpression);
2273 
2274  DECLARE_HEADERS(AsmConstantExpression);
2275 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
2276  #include <Sawyer/BitVector.h>
2277 #endif // SgAsmConstantExpression_HEADERS
2278 
2279 #ifdef DOCUMENTATION
2280 
2285  public:
2286 #endif
2287 
2288 #ifndef DOCUMENTATION
2289  // Documented below. Implemented below due to ROSETTA limitations.
2290  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
2291  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2292 #endif
2293 
2294  DECLARE_OTHERS(AsmConstantExpression);
2295 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
2296 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2297  private:
2298  friend class boost::serialization::access;
2299 
2300  template<class S>
2301  void serialize(S &s, const unsigned /*version*/) {
2302  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
2303  s & BOOST_SERIALIZATION_NVP(p_bitVector);
2304  }
2305 #endif
2306 
2307  public:
2313  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
2314  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
2315  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
2317 #endif // SgAsmConstantExpression_OTHERS
2318 
2319 #ifdef DOCUMENTATION
2320  };
2321 #endif
2322 
2324 
2325  NEW_NONTERMINAL_MACRO(AsmValueExpression,
2326  AsmConstantExpression,
2327  "AsmValueExpression", "AsmValueExpressionTag", false);
2328  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
2329  IS_SERIALIZABLE(AsmValueExpression);
2330 
2331 #ifdef DOCUMENTATION
2332 
2340  public:
2341 #endif
2342 
2343 #ifdef DOCUMENTATION
2344 
2354 #else
2355  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
2356  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2357 #endif
2358 
2359 #ifdef DOCUMENTATION
2360 
2368  unsigned short get_bit_offset() const;
2369  void set_bit_offset(unsigned short);
2371 #else
2372  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
2373  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2374 #endif
2375 
2376 #ifdef DOCUMENTATION
2377 
2383  unsigned short get_bit_size() const;
2384  void set_bit_size(unsigned short);
2386 #else
2387  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
2388  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2389 #endif
2390 
2391 #ifdef DOCUMENTATION
2392 
2398  SgSymbol* get_symbol() const;
2399  void set_symbol(SgSymbol*);
2401 #else
2402  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
2403  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2404 #endif
2405 
2406  DECLARE_OTHERS(AsmValueExpression);
2407 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
2408 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2409  private:
2410  friend class boost::serialization::access;
2411 
2412  template<class S>
2413  void serialize(S &s, const unsigned /*version*/) {
2414  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2415  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
2416  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
2417  s & BOOST_SERIALIZATION_NVP(p_bit_size);
2418 #if 1
2419  ASSERT_require2(p_symbol == NULL, "not implemented yet");
2420 #else
2421  s & BOOST_SERIALIZATION_NVP(p_symbol);
2422 #endif
2423  }
2424 #endif
2425 #endif // SgAsmValueExpression_OTHERS
2426 
2427 #ifdef DOCUMENTATION
2428  };
2429 #endif
2430 
2432 
2433  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
2434  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
2435 
2436 #ifdef DOCUMENTATION
2437 
2439  public:
2440 #endif
2441 
2442 #ifdef DOCUMENTATION
2443 
2450  SgAsmExpression* get_address() const;
2453 #else
2454  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
2455  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2456 #endif
2457 
2458 #ifdef DOCUMENTATION
2459 
2466  SgAsmExpression* get_segment() const;
2469 #else
2470  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
2471  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2472 #endif
2473 
2474  DECLARE_OTHERS(AsmMemoryReferenceExpression);
2475 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2476 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2477  private:
2478  friend class boost::serialization::access;
2479 
2480  template<class S>
2481  void serialize(S &s, const unsigned /*version*/) {
2482  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2483  s & BOOST_SERIALIZATION_NVP(p_address);
2484  s & BOOST_SERIALIZATION_NVP(p_segment);
2485  }
2486 #endif
2487 #endif // SgAsmMemoryReferenceExpression_OTHERS
2488 
2489 #ifdef DOCUMENTATION
2490  };
2491 #endif
2492 
2494 
2495  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
2496  IS_SERIALIZABLE(AsmControlFlagsExpression);
2497 
2498 #ifdef DOCUMENTATION
2499  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2501  public:
2502 #endif
2503 
2504 #ifndef DOCUMENTATION
2505  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
2506  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2507 #endif
2508 
2509  DECLARE_OTHERS(AsmControlFlagsExpression);
2510 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
2511 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2512  private:
2513  friend class boost::serialization::access;
2514 
2515  template<class S>
2516  void serialize(S &s, const unsigned /*version*/) {
2517  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2518  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
2519  }
2520 #endif
2521 #endif // SgAsmControlFlagsExpression_OTHERS
2522 
2523 #ifdef DOCUMENTATION
2524  };
2525 #endif
2526 
2528 
2529  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
2530  IS_SERIALIZABLE(AsmCommonSubExpression);
2531 
2532 #ifdef DOCUMENTATION
2533  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2535  public:
2536 #endif
2537 
2538 #ifndef DOCUMENTATION
2539  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
2540  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2541 #endif
2542 
2543  DECLARE_OTHERS(AsmCommonSubExpression);
2544 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
2545 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2546  private:
2547  friend class boost::serialization::access;
2548 
2549  template<class S>
2550  void serialize(S &s, const unsigned /*version*/) {
2551  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2552  s & BOOST_SERIALIZATION_NVP(p_subexpression);
2553  }
2554 #endif
2555 #endif // SgAsmCommonSubExpression_OTHERS
2556 
2557 #ifdef DOCUMENTATION
2558  };
2559 #endif
2560 
2562 
2563  DECLARE_LEAF_CLASS(AsmRiscOperation);
2564  IS_SERIALIZABLE(AsmRiscOperation);
2565 
2566 #ifdef DOCUMENTATION
2567 
2576  public:
2577 #endif
2578 
2579 #ifdef DOCUMENTATION
2580 
2589 #else
2590  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
2591  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
2592 #endif
2593 
2594 #ifdef DOCUMENTATION
2595 
2601  SgAsmExprListExp* get_operands() const;
2604 #else
2605  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
2606  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2607 #endif
2608 
2609  DECLARE_OTHERS(AsmRiscOperation);
2610 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
2611  public:
2618  OP_NONE,
2619  OP_bottom,
2620  OP_undefined,
2621  OP_unspecified,
2622  OP_filterCallTarget,
2623  OP_filterReturnTarget,
2624  OP_filterIndirectJumpTarget,
2625  OP_hlt,
2626  OP_cpuid,
2627  OP_rdtsc,
2628  OP_and_,
2629  OP_or_,
2630  OP_xor_,
2631  OP_invert,
2632  OP_extract,
2633  OP_concat,
2634  OP_leastSignificantSetBit,
2635  OP_mostSignificantSetBit,
2636  OP_rotateLeft,
2637  OP_rotateRight,
2638  OP_shiftLeft,
2639  OP_shiftRight,
2640  OP_shiftRightArithmetic,
2641  OP_equalToZero,
2642  OP_ite,
2643  OP_isEqual,
2644  OP_isNotEqual,
2645  OP_isUnsignedLessThan,
2646  OP_isUnsignedLessThanOrEqual,
2647  OP_isUnsignedGreaterThan,
2648  OP_isUnsignedGreaterThanOrEqual,
2649  OP_isSignedLessThan,
2650  OP_isSignedLessThanOrEqual,
2651  OP_isSignedGreaterThan,
2652  OP_isSignedGreaterThanOrEqual,
2653  OP_unsignedExtend,
2654  OP_signExtend,
2657  OP_subtract,
2658  OP_negate,
2659  OP_signedDivide,
2660  OP_signedModulo,
2661  OP_signedMultiply,
2662  OP_unsignedDivide,
2663  OP_unsignedModulo,
2664  OP_unsignedMultiply,
2665  OP_interrupt,
2666  OP_readRegister,
2667  OP_peekRegister,
2668  OP_writeRegister,
2670  OP_peekMemory,
2672  OP_N_OPERATORS // MUST BE LAST!
2673  };
2674 
2675 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2676  private:
2677  friend class boost::serialization::access;
2678 
2679  template<class S>
2680  void serialize(S &s, const unsigned /*version*/) {
2681  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2682  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
2683  s & BOOST_SERIALIZATION_NVP(p_operands);
2684  }
2685 #endif
2686 #endif // SgAsmRiscOperation_OTHERS
2687 
2688 #ifdef DOCUMENTATION
2689  };
2690 #endif
2691 
2693 
2694  DECLARE_LEAF_CLASS(AsmExprListExp);
2695  IS_SERIALIZABLE(AsmExprListExp);
2696 
2697 #ifdef DOCUMENTATION
2698 
2700  public:
2701 #endif
2702 
2703 #ifdef DOCUMENTATION
2704 
2710  const SgAsmExpressionPtrList& get_expressions() const;
2711  void set_expressions(const SgAsmExpressionPtrList&);
2713 #else
2714  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
2715  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2716 #endif
2717 
2718  DECLARE_OTHERS(AsmExprListExp);
2719 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
2720 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2721  private:
2722  friend class boost::serialization::access;
2723 
2724  template<class S>
2725  void serialize(S &s, const unsigned /*version*/) {
2726  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2727  s & BOOST_SERIALIZATION_NVP(p_expressions);
2728  }
2729 #endif
2730 #endif // SgAsmExprListExp_OTHERS
2731 
2732 #ifdef DOCUMENTATION
2733  };
2734 #endif
2735 
2737 
2738  NEW_NONTERMINAL_MACRO(AsmExpression,
2739  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
2740  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
2741  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
2742  AsmRiscOperation,
2743  "AsmExpression", "AsmExpressionTag", false);
2744  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
2745  IS_SERIALIZABLE(AsmExpression);
2746 
2747 #ifdef DOCUMENTATION
2748 
2749  class SgAsmExpression: public SgAsmNode {
2750  public:
2751 #endif
2752 
2753 #ifdef DOCUMENTATION
2754 
2759  SgAsmType* get_type() const;
2760  void set_type(SgAsmType*);
2762 #else
2763  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
2764  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2765 #endif
2766 
2767 #ifdef DOCUMENTATION
2768 
2773  const std::string& get_comment() const;
2774  void set_comment(const std::string&);
2776 #else
2777  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
2778  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2779 #endif
2780 
2781  DECLARE_OTHERS(AsmExpression);
2782 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
2783 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2784  private:
2785  friend class boost::serialization::access;
2786 
2787  template<class S>
2788  void serialize(S &s, const unsigned /*version*/) {
2789  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
2790  s & BOOST_SERIALIZATION_NVP(p_type);
2791  s & BOOST_SERIALIZATION_NVP(p_comment);
2792  }
2793 #endif
2794 
2795  public:
2799  size_t get_nBits() const;
2800 
2806 
2812 
2813 #endif // SgAsmExpression_OTHERS
2814 
2815 #ifdef DOCUMENTATION
2816  };
2817 #endif
2818 
2819 
2820 
2821 
2823 
2824  /***************************************************************************************************************************
2825  * Data Types (new interface 2014-07)
2826  *
2827  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
2828  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
2829  * 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
2830  * don't allow types to be modified after they're created.
2831  ***************************************************************************************************************************/
2832 
2834 
2835  DECLARE_LEAF_CLASS(AsmIntegerType);
2836  IS_SERIALIZABLE(AsmIntegerType);
2837 
2838 #ifdef DOCUMENTATION
2839 
2841  public:
2842 #endif
2843 
2844 #ifndef DOCUMENTATION
2845  // Documented below due to ROSETTA limitations
2846  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
2847  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2848 #endif
2849 
2850  DECLARE_OTHERS(AsmIntegerType);
2851 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
2852 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2853  private:
2854  friend class boost::serialization::access;
2855 
2856  template<class S>
2857  void serialize(S &s, const unsigned /*version*/) {
2858  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2859  s & BOOST_SERIALIZATION_NVP(p_isSigned);
2860  }
2861 #endif
2862 
2863  public:
2867  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
2868 
2872  bool get_isSigned() const;
2873 
2874  // Overrides documented in base class
2875  virtual void check() const $ROSE_OVERRIDE;
2876  virtual std::string toString() const $ROSE_OVERRIDE;
2877 #endif // SgAsmIntegerType_OTHERS
2878 
2879 #ifdef DOCUMENTATION
2880  };
2881 #endif
2882 
2884 
2885  DECLARE_LEAF_CLASS(AsmFloatType);
2886  IS_SERIALIZABLE(AsmFloatType);
2887 
2888  DECLARE_HEADERS(AsmFloatType);
2889 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
2890  #include <Sawyer/BitVector.h>
2891 #endif // SgAsmFloatType_HEADERS
2892 
2893 #ifdef DOCUMENTATION
2894 
2896  public:
2897 #endif
2898 
2899 #ifndef DOCUMENTATION
2900  // Documented below because of ROSETTA limitations (they're read-only)
2901  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
2902  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2903  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
2904  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2905  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
2906  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2907  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
2908  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2909  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
2910  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2911  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
2912  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2913  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
2914  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2915 #endif
2916 
2917  DECLARE_OTHERS(AsmFloatType);
2918 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
2919 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2920  private:
2921  friend class boost::serialization::access;
2922 
2923  template<class S>
2924  void serialize(S &s, const unsigned /*version*/) {
2925  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
2926  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
2927  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
2928  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
2929  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
2930  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
2931  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
2932  s & BOOST_SERIALIZATION_NVP(p_flags);
2933  }
2934 #endif
2935 
2936  public:
2937  enum {
2938  GRADUAL_UNDERFLOW = 0x00000001,
2939  NORMALIZED_SIGNIFICAND = 0x00000002
2940  };
2941 
2943 
2945  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
2946  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
2947  uint64_t exponentBias, unsigned flags);
2948 
2950  BitRange significandBits() const;
2951 
2953  BitRange exponentBits() const;
2954 
2956  size_t signBit() const;
2957 
2959  uint64_t exponentBias() const;
2960 
2962  unsigned flags() const;
2963 
2965  bool gradualUnderflow() const;
2966 
2968  bool normalizedSignificand() const;
2969 
2970  // Overrides documented in base class
2971  virtual void check() const $ROSE_OVERRIDE;
2972  virtual std::string toString() const $ROSE_OVERRIDE;
2973 #endif // SgAsmFloatType_OTHERS
2974 
2975 #ifdef DOCUMENTATION
2976  };
2977 #endif
2978 
2980 
2981  NEW_NONTERMINAL_MACRO(AsmScalarType,
2982  AsmIntegerType | AsmFloatType,
2983  "AsmScalarType", "AsmScalarTypeTag", false);
2984  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
2985  IS_SERIALIZABLE(AsmScalarType);
2986 
2987 #ifdef DOCUMENTATION
2988 
2989  class SgAsmScalarType: public SgAsmType {
2990  public:
2991 #endif
2992 
2993 #ifndef DOCUMENTATION
2994  // Documented below due to ROSETTA limitations (read-only)
2995  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2996  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2997  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
2998  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2999  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
3000  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3001  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
3002  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3003 #endif
3004 
3005  DECLARE_OTHERS(AsmScalarType);
3006 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
3007 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3008  private:
3009  friend class boost::serialization::access;
3010 
3011  template<class S>
3012  void serialize(S &s, const unsigned /*version*/) {
3013  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3014  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
3015  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
3016  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
3017  s & BOOST_SERIALIZATION_NVP(p_nBits);
3018  }
3019 #endif
3020 
3021  protected:
3026  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
3027 
3028  public:
3030  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3031 
3033  ByteOrder::Endianness get_minorOrder() const;
3034 
3036  ByteOrder::Endianness get_majorOrder() const;
3037 
3039  size_t get_majorNBytes() const;
3040 
3041  // Overrides documented in base class
3042  virtual void check() const $ROSE_OVERRIDE;
3043  virtual std::string toString() const $ROSE_OVERRIDE;
3044 #endif // SgAsmScalarType_OTHERS
3045 
3046 #ifdef DOCUMENTATION
3047  };
3048 #endif
3049 
3051 
3052  DECLARE_LEAF_CLASS(AsmVectorType);
3053  IS_SERIALIZABLE(AsmVectorType);
3054 
3055 #ifdef DOCUMENTATION
3056 
3057  class SgAsmVectorType: public SgAsmType {
3058  public:
3059 #endif
3060 
3061 #ifndef DOCUMENTATION
3062  // Documented below due to ROSETTA limitations (read-only)
3063  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3064  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3065  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3066  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3067 #endif
3068 
3069  DECLARE_OTHERS(AsmVectorType);
3070 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3071 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3072  private:
3073  friend class boost::serialization::access;
3074 
3075  template<class S>
3076  void serialize(S &s, const unsigned /*version*/) {
3077  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3078  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3079  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3080  }
3081 #endif
3082 
3083  public:
3085  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
3086 
3088  size_t get_nElmts() const;
3089 
3091  SgAsmType* get_elmtType() const;
3092 
3093  // Overrides documented in base class
3094  virtual void check() const $ROSE_OVERRIDE;
3095  virtual std::string toString() const $ROSE_OVERRIDE;
3096  virtual size_t get_nBits() const $ROSE_OVERRIDE;
3097 #endif // SgAsmVectorType_OTHERS
3098 
3099 #ifdef DOCUMENTATION
3100  };
3101 #endif
3102 
3104 
3105  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
3106  AsmType.setCppCondition("!defined(DOCUMENTATION)");
3107  IS_SERIALIZABLE(AsmType);
3108 
3109 #ifdef DOCUMENTATION
3110 
3111  class SgAsmType: public SgAsmNode {
3112  public:
3113 #endif
3114 
3115  DECLARE_OTHERS(AsmType);
3116 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
3117  private:
3119 
3120 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3121  private:
3122  friend class boost::serialization::access;
3123 
3124  template<class S>
3125  void serialize(S &s, const unsigned /*version*/) {
3126  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3127  }
3128 #endif
3129 
3130  public:
3138  virtual void check() const;
3139 
3145  virtual std::string toString() const {
3146  abort(); // ROSETTA limitation: intended pure virtual
3147  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
3148  }
3149 
3151  virtual size_t get_nBits() const {
3152  abort(); // ROSETTA limitation: intended pure virtual
3153  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
3154  }
3155 
3157  virtual size_t get_nBytes() const;
3158 
3164  template<class Type> // Type is a subclass of SgAsmType
3165  static Type* registerOrDelete(Type *toInsert) {
3166  ASSERT_not_null(toInsert);
3167  std::string key = toInsert->toString();
3168  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
3169  ASSERT_not_null(retval);
3170  if (retval!=toInsert)
3171  delete toInsert;
3172  return retval;
3173  }
3174 #endif // SgAsmType_OTHERS
3175 
3176 #ifdef DOCUMENTATION
3177  };
3178 #endif
3179 
3180 
3181 
3183 
3184  /**************************************************************************************************************************
3185  * Collections of Instructions
3186  **************************************************************************************************************************/
3187 
3189 
3190  DECLARE_LEAF_CLASS(AsmFunction);
3191  IS_SERIALIZABLE(AsmFunction);
3192 
3193 #ifdef DOCUMENTATION
3194 
3210  public:
3211 #endif
3212 
3213 #ifdef DOCUMENTATION
3214 
3219  const std::string& get_name() const;
3220  void set_name(const std::string&);
3222 #else
3223  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
3224  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3225 #endif
3226 
3227 #ifdef DOCUMENTATION
3228 
3234  unsigned get_reason() const;
3235  void set_reason(unsigned);
3237 #else
3238  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
3239  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3240 #endif
3241 
3242 #ifdef DOCUMENTATION
3243 
3250  const std::string& get_reasonComment() const;
3251  void set_reasonComment(const std::string&);
3253 #else
3254  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
3255  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3256 #endif
3257 
3258 #ifdef DOCUMENTATION
3259 
3267 #else
3268  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
3269  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3270 #endif
3271 
3272 #ifdef DOCUMENTATION
3273 
3276  MayReturn get_may_return() const;
3277  void set_may_return(MayReturn);
3279 #else
3280  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
3281  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3282 #endif
3283 
3284 #ifdef DOCUMENTATION
3285 
3290  const std::string& get_name_md5() const;
3291  void set_name_md5(const std::string&);
3293 #else
3294  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
3295  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3296 #endif
3297 
3298 #ifdef DOCUMENTATION
3299 
3304  const SgAsmStatementPtrList& get_statementList() const;
3305  void set_statementList(const SgAsmStatementPtrList&);
3307 #else
3308  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3309  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3310 #endif
3311 
3312 #ifdef DOCUMENTATION
3313  // FIXME[Robb P Matzke 2017-02-13]: unused?
3314 #else
3315  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
3316  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3317 #endif
3318 
3319 #ifdef DOCUMENTATION
3320 
3326  rose_addr_t get_entry_va() const;
3327  void set_entry_va(rose_addr_t);
3329 #else
3330  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
3331  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3332 #endif
3333 
3334 #ifdef DOCUMENTATION
3335 
3344 #else
3345  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
3346  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
3347 #endif
3348 
3349 #ifdef DOCUMENTATION
3350  // FIXME[Robb P Matzke 2017-02-13]: what is this?
3351 #else
3352  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
3353  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3354 #endif
3355 
3356 #ifdef DOCUMENTATION
3357 
3366  int64_t get_stackDelta() const;
3367  void set_stackDelta(int64_t);
3369 #else
3370  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
3371  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3372 #endif
3373 
3374 #ifdef DOCUMENTATION
3375 
3383  const std::string& get_callingConvention() const;
3384  void set_callingConvention(const std::string&);
3386 #else
3387  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
3388  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3389 #endif
3390 
3391  DECLARE_OTHERS(AsmFunction);
3392 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
3393 
3394 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3395  private:
3396  friend class boost::serialization::access;
3397 
3398  template<class S>
3399  void serialize(S &s, const unsigned /*version*/) {
3400  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
3401  s & BOOST_SERIALIZATION_NVP(p_name);
3402  s & BOOST_SERIALIZATION_NVP(p_reason);
3403  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
3404  s & BOOST_SERIALIZATION_NVP(p_function_kind);
3405  s & BOOST_SERIALIZATION_NVP(p_may_return);
3406  s & BOOST_SERIALIZATION_NVP(p_name_md5);
3407  s & BOOST_SERIALIZATION_NVP(p_statementList);
3408  s & BOOST_SERIALIZATION_NVP(p_dest);
3409  s & BOOST_SERIALIZATION_NVP(p_entry_va);
3410  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
3411  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3412  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
3413  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
3414  }
3415 #endif
3416 
3417  public:
3420 
3424  void remove_statement(SgAsmStatement* statement);
3425 
3430  SgAsmBlock* get_entry_block() const;
3431 
3433  enum MayReturn {
3438  };
3439 
3444  // NOTE: If you add more here, then fix Partitioner::parse_switches()
3445  // Also fix SgAsmFunction::reason_key()
3446  FUNC_NONE = 0x00000000,
3448  = 0x00008000,
3449  FUNC_ENTRY_POINT = 0x00010000,
3450  FUNC_CALL_TARGET = 0x00020000,
3453  FUNC_CALL_INSN = 0x00040000,
3459  FUNC_EH_FRAME = 0x00080000,
3460  FUNC_SYMBOL = 0x00100000,
3461  FUNC_PATTERN = 0x00200000,
3466  FUNC_GRAPH = 0x00400000,
3470  FUNC_USERDEF = 0x00800000,
3471  FUNC_PADDING = 0x01000000,
3476  FUNC_DISCONT = 0x02000000,
3479  FUNC_INSNHEAD = 0x04000000,
3480  FUNC_IMPORT = 0x08000000,
3483  FUNC_LEFTOVERS = 0x10000000,
3487  FUNC_INTRABLOCK = 0x20000000,
3495  FUNC_THUNK = 0x40000000,
3504  FUNC_EXPORT = 0x80000000,
3506  FUNC_DEFAULT = 0xefff80ff,
3508  /*========= Miscellaneous Reasons ===========================================================================
3509  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3510  * availalble for users to use as they see fit. */
3511  FUNC_MISCMASK = 0x000000ff,
3526  };
3527 
3531  static std::string reason_key(const std::string &prefix="");
3532 
3534  std::string reason_str(bool pad) const;
3535 
3539  static std::string reason_str(bool pad, unsigned reason);
3540 
3543  public:
3544  virtual ~NodeSelector() {}
3545  virtual bool operator()(SgNode*) = 0;
3546  };
3547 
3587  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
3588  NodeSelector *selector=NULL);
3589 
3595  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
3596 
3599  e_unknown = 0,
3600  e_standard = 1,
3601  e_library = 2,
3602  e_imported = 3,
3603  e_thunk = 4,
3604  e_last
3605  };
3606 #endif // SgAsmFunction_OTHERS
3607 
3608 
3609 #ifdef DOCUMENTATION
3610  };
3611 #endif
3612 
3613 
3615 
3616  DECLARE_LEAF_CLASS(AsmBlock);
3617  IS_SERIALIZABLE(AsmBlock);
3618 
3619 #ifdef DOCUMENTATION
3620 
3640  class SgAsmBlock: public SgAsmStatement {
3641  public:
3642 #endif
3643 
3644 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3645  // [tps 05Apr07] needed for the control_flow_graph
3646  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
3647  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3648 #endif
3649 
3650 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
3651  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
3652  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3653 #endif
3654 
3655 #ifdef DOCUMENTATION
3656 
3661  rose_addr_t get_id() const;
3662  void set_id(rose_addr_t);
3664 #else
3665  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
3666  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3667 #endif
3668 
3669 #ifdef DOCUMENTATION
3670 
3675  unsigned get_reason() const;
3676  void set_reason(unsigned);
3678 #else
3679  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
3680  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3681 #endif
3682 
3683 #ifdef DOCUMENTATION
3684  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3685  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3686  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3687  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3694  const SgAsmStatementPtrList& get_statementList() const;
3695  void set_statementList(const SgAsmStatementPtrList&);
3697 #else
3698  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
3699  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3700 #endif
3701 
3702 #ifdef DOCUMENTATION
3703  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
3704  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
3705  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
3706  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
3714  const SgAsmIntegerValuePtrList& get_successors() const;
3715  void set_successors(const SgAsmIntegerValuePtrList&);
3717 #else
3718  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
3719  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3720 #endif
3721 
3722 #ifdef DOCUMENTATION
3723 
3733  bool get_successors_complete() const;
3734  void set_successors_complete(bool);
3736 #else
3737  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
3738  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3739 #endif
3740 
3741 #ifdef DOCUMENTATION
3742 
3754 #else
3755  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
3756  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3757 #endif
3758 
3759 #ifdef DOCUMENTATION
3760 
3768  size_t get_cached_vertex() const;
3769  void set_cached_vertex(size_t);
3771 #else
3772  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
3773  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3774 #endif
3775 
3776 #ifdef DOCUMENTATION
3777 
3783  double get_code_likelihood() const;
3784  void set_code_likelihood(double);
3786 #else
3787  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
3788  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3789 #endif
3790 
3791 #ifdef DOCUMENTATION
3792 
3800  int64_t get_stackDeltaOut() const;
3801  void set_stackDeltaOut(int64_t);
3803 #else
3804  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
3805  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3806 #endif
3807 
3808  DECLARE_OTHERS(AsmBlock);
3809 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
3810 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3811  private:
3812  friend class boost::serialization::access;
3813 
3814  template<class S>
3815  void serialize(S &s, const unsigned /*version*/) {
3816  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3817  s & BOOST_SERIALIZATION_NVP(p_reason);
3818  s & BOOST_SERIALIZATION_NVP(p_statementList);
3819  s & BOOST_SERIALIZATION_NVP(p_successors);
3820  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
3821  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
3822  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
3823  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
3824  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
3825  }
3826 #endif
3827 
3828  public:
3830  enum Reason {
3831  // Please update SgAsmBlock::reason_str() if you change this enum!
3832  BLK_NONE = 0x00000000,
3833  BLK_ENTRY_POINT = 0x00010000,
3834  BLK_PADDING = 0x00020000,
3835  BLK_FRAGMENT = 0x00080000,
3837  BLK_CFGHEAD = 0x00100000,
3838  BLK_USERDEF = 0x00200000,
3839  BLK_LEFTOVERS = 0x00400000,
3841  BLK_JUMPTABLE = 0x00800000,
3842  BLK_GRAPH1 = 0x01000000,
3843  BLK_GRAPH2 = 0x02000000,
3844  BLK_GRAPH3 = 0x04000000,
3846  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
3847 
3848  // ========= Miscellaneous Reasons ===========================================================================
3849  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
3850  // availalble for users to use as they see fit.
3851  BLK_MISCMASK = 0x000000ff,
3853  BLK_FINDDATA = 0x00000001,
3855  BLK_POSTFUNC = 0x00000002
3857  };
3858 
3863 
3868 
3869  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
3874  void remove_children();
3875 
3880  rose_addr_t get_fallthrough_va();
3881 
3886 
3892  bool has_instructions() const;
3893 
3899  bool is_basic_block() const { return has_instructions(); }
3900 
3910  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
3911 
3915  static std::string reason_key(const std::string &prefix="");
3916 
3920  std::string reason_str(bool pad) const;
3921 
3927  static std::string reason_str(bool pad, unsigned reason);
3928 #endif // SgAsmBlock_OTHERS
3929 
3930 #ifdef DOCUMENTATION
3931  };
3932 #endif
3933 
3934 
3936 
3937  DECLARE_LEAF_CLASS(AsmStaticData);
3938  IS_SERIALIZABLE(AsmStaticData);
3939 
3940 #ifdef DOCUMENTATION
3941 
3949  public:
3950 #endif
3951 
3952 #ifdef DOCUMENTATION
3953 
3959  const SgUnsignedCharList& get_raw_bytes() const;
3960  void set_raw_bytes(const SgUnsignedCharList&);
3962 #else
3963  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
3964  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3965 #endif
3966 
3967  DECLARE_OTHERS(AsmStaticData);
3968 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
3969 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3970  private:
3971  friend class boost::serialization::access;
3972 
3973  template<class S>
3974  void serialize(S &s, const unsigned /*version*/) {
3975  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
3976  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
3977  }
3978 #endif
3979 
3980  public:
3984  size_t get_size() const { return p_raw_bytes.size(); }
3985 #endif // SgAsmStaticData_OTHERS
3986 
3987 #ifdef DOCUMENTATION
3988  };
3989 #endif
3990 
3991 
3993 
3994  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
3995  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
3996 
3997 #ifdef DOCUMENTATION
3998 
4009  public:
4010 #endif
4011 
4012  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4013 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4014 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4015  private:
4016  friend class boost::serialization::access;
4017 
4018  template<class S>
4019  void serialize(S & s, const unsigned /*version*/) {
4020  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4021  }
4022 #endif
4023  protected:
4024  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4025 
4026  public:
4029  p_declarationList.push_back(declaration);
4030  }
4031 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4032 
4033 #ifdef DOCUMENTATION
4034  };
4035 #endif
4036 
4037 
4039 
4040  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4041  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4042 
4043 #ifdef DOCUMENTATION
4044  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4046  public:
4047 #endif
4048 
4049 #ifdef DOCUMENTATION
4050 
4053  const std::string& get_name() const;
4054  void set_name(const std::string&);
4056 #else
4057  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4058  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4059  NO_DELETE);
4060 #endif
4061 
4062 #ifdef DOCUMENTATION
4063  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4067  uint64_t get_offset() const;
4068  void set_ofset(uint64_t);
4070 #else
4071  // Not clear if we want to store the offset explicitly
4072  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4073  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4074  NO_DELETE);
4075 #endif
4076 
4077  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4078 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4079 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4080  private:
4081  friend class boost::serialization::access;
4082 
4083  template<class S>
4084  void serialize(S &s, const unsigned /*version*/) {
4085  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4086  }
4087 #endif
4088 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
4089 
4090 #ifdef DOCUMENTATION
4091  };
4092 #endif
4093 
4094 
4096 
4097  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
4098  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
4099  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
4100  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
4101  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
4102 
4103 #ifdef DOCUMENTATION
4104 
4111  public:
4112 #endif
4113 
4114  DECLARE_OTHERS(AsmSynthesizedDeclaration);
4115 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
4116 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4117  private:
4118  friend class boost::serialization::access;
4119 
4120  template<class S>
4121  void serialize(S &s, const unsigned /*version*/) {
4122  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4123  };
4124 #endif
4125 #endif // SgAsmSynthesizedDeclaration_OTHERS
4126 
4127 #ifdef DOCUMENTATION
4128  };
4129 #endif
4130 
4131 
4133 
4134  NEW_NONTERMINAL_MACRO(AsmStatement,
4135  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
4136  "AsmStatement", "AsmStatementTag", false);
4137  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
4138  IS_SERIALIZABLE(AsmStatement);
4139 
4140 #ifdef DOCUMENTATION
4141 
4145  class SgAsmStatement: public SgAsmNode {
4146  public:
4147 #endif
4148 
4149 #ifdef DOCUMENTATION
4150 
4155  rose_addr_t get_address() const;
4156  void set_address(rose_addr_t);
4158 #else
4159  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
4160  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4161 #endif
4162 
4163 
4164 #ifdef DOCUMENTATION
4165 
4168  const std::string& get_comment() const;
4169  void set_comment(const std::string&);
4171 #else
4172  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
4173  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4174 #endif
4175 
4176  DECLARE_OTHERS(AsmStatement);
4177 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
4178 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4179  private:
4180  friend class boost::serialization::access;
4181 
4182  template<class S>
4183  void serialize(S &s, const unsigned /*version*/) {
4184  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
4185  s & BOOST_SERIALIZATION_NVP(p_address);
4186  s & BOOST_SERIALIZATION_NVP(p_comment);
4187  }
4188 #endif
4189 #endif // SgAsmStatement_OTHERS
4190 
4191 #ifdef DOCUMENTATION
4192  };
4193 #endif
4194 
4195 
4196 
4197 
4199 
4200  /*************************************************************************************************************************
4201  * Binary Interpretations
4202  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
4203  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
4204  * an AST that represents a single, coherent sub-part of the file.
4205  *************************************************************************************************************************/
4206 
4208 
4209  DECLARE_LEAF_CLASS(AsmInterpretationList);
4210  IS_SERIALIZABLE(AsmInterpretationList);
4211 
4212 #ifdef DOCUMENTATION
4213 
4215  public:
4216 #endif
4217 
4218 #ifdef DOCUMENTATION
4219 
4228 #else
4229  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
4230  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
4231  NO_DELETE);
4232 #endif
4233 
4234  DECLARE_OTHERS(AsmInterpretationList);
4235 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
4236 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4237  private:
4238  friend class boost::serialization::access;
4239 
4240  template<class S>
4241  void serialize(S &s, const unsigned /*version*/) {
4242  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4243  s & BOOST_SERIALIZATION_NVP(p_interpretations);
4244  }
4245 #endif
4246 #endif // SgAsmInterpretationList_OTHERS
4247 
4248 #ifdef DOCUMENTATION
4249  };
4250 #endif
4251 
4253 
4254  DECLARE_LEAF_CLASS(AsmInterpretation);
4255  IS_SERIALIZABLE(AsmInterpretation);
4256 
4257  DECLARE_HEADERS(AsmInterpretation);
4258 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
4259  #include <MemoryMap.h>
4260  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
4261 #endif // SgAsmInterpretation_HEADERS
4262 
4263 #ifdef DOCUMENTATION
4264 
4271  public:
4272 #endif
4273 
4274 #ifdef DOCUMENTATION
4275  // documentation and definition are below
4276 #else
4277  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
4278 #endif
4279 
4280 #ifdef DOCUMENTATION
4281 
4292 #else
4293  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
4294  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4295 #endif
4296 
4297 #ifdef DOCUMENTATION
4298 
4303  SgAsmBlock* get_global_block() const;
4306 #else
4307  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
4308  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4309 #endif
4310 
4311  DECLARE_OTHERS(AsmInterpretation);
4312 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
4313  private:
4315  const Rose::BinaryAnalysis::RegisterDictionary *p_registers;
4316  bool coverageComputed; // true iff percentageCoverage has been computed
4317  mutable InstructionMap instruction_map; // cached instruction map
4318 
4320  // disassembly into instructions.
4321  double percentageCoverage;
4322 
4323 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4324  private:
4325  friend class boost::serialization::access;
4326 
4327  template<class S>
4328  void serialize(S &s, const unsigned /*version*/) {
4329  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4330  s & BOOST_SERIALIZATION_NVP(p_headers);
4331  s & BOOST_SERIALIZATION_NVP(p_global_block);
4332  s & BOOST_SERIALIZATION_NVP(p_map);
4333  s & BOOST_SERIALIZATION_NVP(p_registers);
4334  s & BOOST_SERIALIZATION_NVP(coverageComputed);
4335  s & BOOST_SERIALIZATION_NVP(instruction_map);
4336  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
4337  }
4338 #endif
4339 
4340  public:
4343  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
4344  ctor();
4345  }
4346 
4351  SgAsmGenericFilePtrList get_files() const;
4352 
4379  InstructionMap& get_instruction_map(bool recompute=false);
4380  void set_instruction_map(const InstructionMap&);
4387  void insert_instructions(InstructionMap&/*in,out*/);
4388 
4393  void erase_instructions(InstructionMap&/*in,out*/);
4394 
4400  void set_coverageComputed(bool x) { coverageComputed = x; }
4401  void set_percentageCoverage(double x) { percentageCoverage = x; }
4404  private:
4405  void ctor(); // finalize construction
4406 #endif // SgAsmInterpretation_OTHERS
4407 
4408 #ifdef DOCUMENTATION
4409  };
4410 #endif
4411 
4412 
4413 
4415 
4416  /*************************************************************************************************************************
4417  * ELF File Header
4418  *************************************************************************************************************************/
4419 
4421 
4422  DECLARE_LEAF_CLASS(AsmElfFileHeader);
4423  IS_SERIALIZABLE(AsmElfFileHeader);
4424 
4425 #ifdef DOCUMENTATION
4426 
4435  public:
4436 #endif
4437 
4438 #ifdef DOCUMENTATION
4439 
4444  unsigned char get_e_ident_file_class() const;
4445  void set_e_ident_file_class(unsigned char);
4447 #else
4448  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
4449  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4450 #endif
4451 
4452 #ifdef DOCUMENTATION
4453 
4458  unsigned char get_e_ident_data_encoding() const;
4459  void set_e_ident_data_encoding(unsigned char);
4461 #else
4462  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
4463  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4464 #endif
4465 
4466 #ifdef DOCUMENTATION
4467 
4472  unsigned char get_e_ident_file_version() const;
4473  void set_e_ident_file_version(unsigned char*);
4475 #else
4476  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
4477  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4478 #endif
4479 
4480 #ifdef DOCUMENTATION
4481 
4486  const SgUnsignedCharList& get_e_ident_padding() const;
4487  void set_e_ident_padding(const SgUnsignedCharList&);
4489 #else
4490  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
4491  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4492 #endif
4493 
4494 #ifdef DOCUMENTATION
4495 
4500  unsigned long get_e_type() const;
4501  void set_e_type(unsigned long);
4503 #else
4504  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
4505  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4506 #endif
4507 
4508 #ifdef DOCUMENTATION
4509 
4514  unsigned long get_e_machine() const;
4515  void set_e_machine(unsigned long);
4517 #else
4518  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
4519  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4520 #endif
4521 
4522 #ifdef DOCUMENTATION
4523 
4528  unsigned long get_e_flags() const;
4529  void set_e_flags(unsigned long);
4531 #else
4532  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
4533  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4534 #endif
4535 
4536 #ifdef DOCUMENTATION
4537 
4542  unsigned long get_e_ehsize() const;
4543  void set_e_ehsize(unsigned long);
4545 #else
4546  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
4547  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4548 #endif
4549 
4550 #ifdef DOCUMENTATION
4551 
4556  unsigned long get_phextrasz() const;
4557  void set_phextrasz(unsigned long);
4559 #else
4560  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
4561  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4562 #endif
4563 
4564 #ifdef DOCUMENTATION
4565 
4570  unsigned long get_e_phnum() const;
4571  void set_e_phnum(unsigned long);
4573 #else
4574  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
4575  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4576 #endif
4577 
4578 #ifdef DOCUMENTATION
4579 
4584  unsigned long get_shextrasz() const;
4585  void set_shextrasz(unsigned long);
4587 #else
4588  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
4589  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4590 #endif
4591 
4592 #ifdef DOCUMENTATION
4593 
4598  unsigned long get_e_shnum() const;
4599  void set_e_shnum(unsigned long);
4601 #else
4602  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
4603  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4604 #endif
4605 
4606 #ifdef DOCUMENTATION
4607 
4612  unsigned long get_e_shstrndx() const;
4613  void set_e_shstrndx(unsigned long);
4615 #else
4616  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
4617  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4618 #endif
4619 
4620 #ifdef DOCUMENTATION
4621 
4631 #else
4632  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
4633  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4634 #endif
4635 
4636 #ifdef DOCUMENTATION
4637 
4646 #else
4647  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
4648  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4649 #endif
4650 
4651  DECLARE_OTHERS(AsmElfFileHeader);
4652 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
4653 
4654 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4655  private:
4656  friend class boost::serialization::access;
4657 
4658  template<class S>
4659  void serialize(S &s, const unsigned /*version*/) {
4660  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
4661  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
4662  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
4663  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
4664  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
4665  s & BOOST_SERIALIZATION_NVP(p_e_type);
4666  s & BOOST_SERIALIZATION_NVP(p_e_machine);
4667  s & BOOST_SERIALIZATION_NVP(p_e_flags);
4668  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
4669  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
4670  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
4671  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
4672  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
4673  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
4674  s & BOOST_SERIALIZATION_NVP(p_section_table);
4675  s & BOOST_SERIALIZATION_NVP(p_segment_table);
4676  }
4677 #endif
4678 
4679  public:
4681  enum ObjectType {
4682  ET_NONE = 0
4683  ,ET_REL = 1
4684  ,ET_EXEC = 2
4685  ,ET_DYN = 3
4686  ,ET_CORE = 4
4688  ,ET_LOOS = 0xfe00
4689  ,ET_HIOS = 0xfeff
4690  ,ET_LOPROC = 0xff00
4691  ,ET_HIPROC = 0xffff
4692  };
4693 
4694  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
4695  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
4696  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
4697  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
4698  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
4699 #ifdef _MSC_VER
4700 # pragma pack (1)
4701 #endif
4702 
4709  unsigned char e_ident_magic[4];
4710  unsigned char e_ident_file_class;
4711  unsigned char e_ident_data_encoding;
4712  unsigned char e_ident_file_version;
4713  unsigned char e_ident_padding[9];
4714  uint16_t e_type;
4715  uint16_t e_machine;
4716  uint32_t e_version;
4717  uint32_t e_entry;
4718  uint32_t e_phoff;
4719  uint32_t e_shoff;
4720  uint32_t e_flags;
4721  uint16_t e_ehsize;
4722  uint16_t e_phentsize;
4723  uint16_t e_phnum;
4724  uint16_t e_shentsize;
4725  uint16_t e_shnum;
4726  uint16_t e_shstrndx;
4727  }
4728 #if !defined(SWIG) && !defined(_MSC_VER)
4729  __attribute__((packed))
4730 #endif
4731  ;
4732 
4734  unsigned char e_ident_magic[4];
4735  unsigned char e_ident_file_class;
4736  unsigned char e_ident_data_encoding;
4737  unsigned char e_ident_file_version;
4738  unsigned char e_ident_padding[9];
4739  uint16_t e_type;
4740  uint16_t e_machine;
4741  uint32_t e_version;
4742  uint64_t e_entry;
4743  uint64_t e_phoff;
4744  uint64_t e_shoff;
4745  uint32_t e_flags;
4746  uint16_t e_ehsize;
4747  uint16_t e_phentsize;
4748  uint16_t e_phnum;
4749  uint16_t e_shentsize;
4750  uint16_t e_shnum;
4751  uint16_t e_shstrndx;
4752  }
4753 #if !defined(SWIG) && !defined(_MSC_VER)
4754  __attribute__((packed))
4755 #endif
4756  ;
4757 
4758 #ifdef _MSC_VER
4759 # pragma pack ()
4760 #endif
4761 
4769  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
4770  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
4771  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
4772  ctor();
4773  }
4774 
4780  uint64_t max_page_size();
4781 
4784 
4787 
4793  virtual SgAsmElfFileHeader *parse() $ROSE_OVERRIDE;
4794 
4796  virtual bool reallocate() $ROSE_OVERRIDE;
4797 
4799  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4800 
4802  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4803 
4805  static bool is_ELF(SgAsmGenericFile*);
4806 
4808  SgAsmGenericSectionPtrList get_sectab_sections();
4809 
4811  SgAsmGenericSectionPtrList get_segtab_sections();
4812 
4813  // Overrides documented in base class
4814  virtual const char *format_name() const $ROSE_OVERRIDE;
4815 
4816  private:
4817  void ctor(); // called by constructors
4818  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
4819  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
4820 #endif // SgAsmElfFileHeader_OTHERS
4821 
4822 #ifdef DOCUMENTATION
4823  };
4824 #endif
4825 
4826 
4827 
4829 
4830  /*************************************************************************************************************************
4831  * ELF Section Tables
4832  *************************************************************************************************************************/
4833 
4835 
4836  DECLARE_LEAF_CLASS(AsmElfSectionTable);
4837  IS_SERIALIZABLE(AsmElfSectionTable);
4838 
4839 #ifdef DOCUMENTATION
4840 
4846  public:
4847 #endif
4848 
4849  DECLARE_OTHERS(AsmElfSectionTable);
4850 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
4851 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4852  private:
4853  friend class boost::serialization::access;
4854 
4855  template<class S>
4856  void serialize(S &s, const unsigned /*version*/) {
4857  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
4858  }
4859 #endif
4860 
4861  public:
4864  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
4865  ctor();
4866  }
4867 
4873  virtual SgAsmElfSectionTable *parse() $ROSE_OVERRIDE;
4874 
4886 
4890  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
4891 
4893  virtual bool reallocate() $ROSE_OVERRIDE;
4894 
4896  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
4897 
4899  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
4900 
4901  private:
4902  void ctor();
4903 #endif // SgAsmElfSectionTable_OTHERS
4904 
4905 #ifdef DOCUMENTATION
4906  };
4907 #endif
4908 
4909 
4911 
4912  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
4913  IS_SERIALIZABLE(AsmElfSectionTableEntry);
4914 
4915 #ifdef DOCUMENTATION
4916 
4918  public:
4919 #endif
4920 
4921 #ifdef DOCUMENTATION
4922 
4927  unsigned get_sh_name() const;
4928  void set_sh_name(unsigned);
4930 #else
4931  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
4932  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4933 #endif
4934 
4935 #ifdef DOCUMENTATION
4936 
4941  SectionType get_sh_type() const;
4942  void set_sh_type(SectionType);
4944 #else
4945  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
4946  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4947 #endif
4948 
4949 #ifdef DOCUMENTATION
4950 
4955  unsigned long get_sh_link() const;
4956  void set_sh_link(unsigned long);
4958 #else
4959  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
4960  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4961 #endif
4962 
4963 #ifdef DOCUMENTATION
4964 
4969  unsigned long get_sh_info() const;
4970  void set_sh_info(unsigned long);
4972 #else
4973  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
4974  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4975 #endif
4976 
4977 #ifdef DOCUMENTATION
4978 
4983  uint64_t get_sh_flags() const;
4984  void set_sh_flags(uint64_t);
4986 #else
4987  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
4988  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4989 #endif
4990 
4991 #ifdef DOCUMENTATION
4992 
4997  rose_addr_t get_sh_addr() const;
4998  void set_sh_addr(rose_addr_t);
5000 #else
5001  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
5002  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5003 #endif
5004 
5005 #ifdef DOCUMENTATION
5006 
5011  rose_addr_t get_sh_offset() const;
5012  void set_sh_offset(rose_addr_t);
5014 #else
5015  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
5016  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5017 #endif
5018 
5019 #ifdef DOCUMENTATION
5020 
5025  rose_addr_t get_sh_size() const;
5026  void set_sh_size(rose_addr_t);
5028 #else
5029  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
5030  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5031 #endif
5032 
5033 #ifdef DOCUMENTATION
5034 
5039  rose_addr_t get_sh_addralign() const;
5040  void set_sh_addralign(rose_addr_t);
5042 #else
5043  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
5044  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5045 #endif
5046 
5047 #ifdef DOCUMENTATION
5048 
5053  rose_addr_t get_sh_entsize() const;
5054  void set_sh_entsize(rose_addr_t);
5056 #else
5057  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
5058  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5059 #endif
5060 
5061 #ifdef DOCUMENTATION
5062 
5067  const SgUnsignedCharList& get_extra() const;
5068  void set_extra(const SgUnsignedCharLit&);
5070 #else
5071  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5072  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
5073  NO_DELETE);
5074 #endif
5075 
5076  DECLARE_OTHERS(AsmElfSectionTableEntry);
5077 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
5078 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5079  private:
5080  friend class boost::serialization::access;
5081 
5082  template<class S>
5083  void serialize(S &s, const unsigned /*version*/) {
5084  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5085  s & BOOST_SERIALIZATION_NVP(p_sh_name);
5086  s & BOOST_SERIALIZATION_NVP(p_sh_type);
5087  s & BOOST_SERIALIZATION_NVP(p_sh_link);
5088  s & BOOST_SERIALIZATION_NVP(p_sh_info);
5089  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
5090  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
5091  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
5092  s & BOOST_SERIALIZATION_NVP(p_sh_size);
5093  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
5094  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
5095  s & BOOST_SERIALIZATION_NVP(p_extra);
5096  }
5097 #endif
5098 
5099  public:
5102  SHT_NULL = 0,
5106  SHT_RELA = 4,
5107  SHT_HASH = 5,
5109  SHT_NOTE = 7,
5111  SHT_REL = 9,
5112  SHT_SHLIB = 10,
5113  SHT_DYNSYM = 11,
5115  SHT_LOOS = 0x60000000,
5116  SHT_GNU_verdef = 0x6ffffffd,
5117  SHT_GNU_verneed = 0x6ffffffe,
5118  SHT_GNU_versym = 0x6fffffff,
5119  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
5120 
5121  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
5122  SHT_HIPROC = 0x7fffffff,
5123  SHT_LOUSER = 0x80000000, /* Application specific semantics */
5124  SHT_HIUSER = 0xffffffff
5125  };
5126 
5130  SHF_WRITE= (1 << 0),
5131  SHF_ALLOC= (1 << 1),
5132  SHF_EXECINSTR= (1 << 2),
5133  SHF_MERGE= (1 << 4),
5134  SHF_STRINGS= (1 << 5),
5135  SHF_INFO_LINK= (1 << 6),
5136  SHF_LINK_ORDER= (1 << 7),
5138  SHF_GROUP= (1 << 9),
5139  SHF_TLS= (1 << 10),
5140  SHF_MASKOS= 0x0ff00000,
5141  SHF_MASKPROC= 0xf0000000
5142  };
5143 
5150 #ifdef _MSC_VER
5151 # pragma pack (1)
5152 #endif
5154  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
5155  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
5156  uint32_t sh_flags; /* 0x08 Bit flags */
5157  uint32_t sh_addr; /* 0x0c Desired mapped address */
5158  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
5159  uint32_t sh_size; /* 0x14 Section size in bytes */
5160  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
5161  uint32_t sh_info; /* 0x1c Extra info depending on section type */
5162  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
5163  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
5164  } /* 0x28 */
5165 #if !defined(SWIG) && !defined(_MSC_VER)
5166  __attribute__((packed))
5167 #endif
5168  ;
5169 
5171  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
5172  uint32_t sh_type; /* 0x04 */
5173  uint64_t sh_flags; /* 0x08 */
5174  uint64_t sh_addr; /* 0x10 */
5175  uint64_t sh_offset; /* 0x18 */
5176  uint64_t sh_size; /* 0x20 */
5177  uint32_t sh_link; /* 0x28 */
5178  uint32_t sh_info; /* 0x2c */
5179  uint64_t sh_addralign; /* 0x30 */
5180  uint64_t sh_entsize; /* 0x38 */
5181  } /* 0x40 */
5182 #if !defined(SWIG) && !defined(_MSC_VER)
5183  __attribute__((packed))
5184 #endif
5185  ;
5186 #ifdef _MSC_VER
5187 # pragma pack ()
5188 #endif
5189 
5191  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5193 
5195  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
5197 
5201  void *encode(ByteOrder::Endianness sex,
5203  void *encode(ByteOrder::Endianness sex,
5209 
5211  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5212 
5213  // Use Rose::stringify... function instead.
5214  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
5215  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
5216 
5217  private:
5218  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
5219  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
5220 #endif // SgAsmElfSectionTableEntry_OTHERS
5221 
5222 #ifdef DOCUMENTATION
5223  };
5224 #endif
5225 
5226 
5227 
5229 
5230  /*************************************************************************************************************************
5231  * ELF Segment Tables
5232  *************************************************************************************************************************/
5233 
5235 
5236  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
5237  IS_SERIALIZABLE(AsmElfSegmentTable);
5238 
5239 #ifdef DOCUMENTATION
5240 
5247  public:
5248 #endif
5249 
5250  DECLARE_OTHERS(AsmElfSegmentTable);
5251 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
5252 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5253  private:
5254  friend class boost::serialization::access;
5255 
5256  template<class S>
5257  void serialize(S &s, const unsigned /*version*/) {
5258  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5259  }
5260 #endif
5261 
5262  public:
5265  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
5266  ctor();
5267  }
5268 
5273  virtual SgAsmElfSegmentTable *parse() $ROSE_OVERRIDE;
5274 
5289 
5293  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
5294 
5296  virtual bool reallocate() $ROSE_OVERRIDE;
5297 
5299  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5300 
5302  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5303 
5304  private:
5305  void ctor();
5306 #endif // SgAsmElfSegmentTable_OTHERS
5307 
5308 #ifdef DOCUMENTATION
5309  };
5310 #endif
5311 
5313 
5314  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
5315  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
5316 
5317 #ifdef DOCUMENTATION
5319  public:
5320 #endif
5321 
5322 #ifdef DOCUMENTATION
5323 
5329  const SgAsmElfSegmentTableEntryPtrList& get_entries();
5330  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
5332 #else
5333  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
5334  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5335  NO_DELETE);
5336 #endif
5337 
5338  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
5339 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
5340 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5341  private:
5342  friend class boost::serialization::access;
5343 
5344  template<class S>
5345  void serialize(S &s, const unsigned /*version*/) {
5346  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5347  }
5348 #endif
5349 #endif // SgAsmElfSegmentTableEntryList_OTHERS
5350 
5351 #ifdef DOCUMENTATION
5352  };
5353 #endif
5354 
5355 
5357 
5358  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
5359  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
5360 
5361 #ifdef DOCUMENTATION
5362 
5364  public:
5365 #endif
5366 
5367 #ifdef DOCUMENTATION
5368 
5373  size_t get_index() const;
5374  void set_index(size_t);
5376 #else
5377  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
5378  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5379 #endif
5380 
5381 #ifdef DOCUMENTATION
5382 
5385  SegmentType get_type() const;
5386  void set_type(SegmentType);
5388 #else
5389  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
5390  "= SgAsmElfSegmentTableEntry::PT_LOAD",
5391  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5392 #endif
5393 
5394 #ifdef DOCUMENTATION
5395 
5398  SegmentFlags get_flags() const;
5399  void set_flags(SegmentFlags);
5401 #else
5402  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
5403  "= SgAsmElfSegmentTableEntry::PF_NONE",
5404  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5405 #endif
5406 
5407 #ifdef DOCUMENTATION
5408 
5413  rose_addr_t get_offset() const;
5414  void set_offset(rose_addr_t);
5416 #else
5417  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
5418  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5419 #endif
5420 
5421 #ifdef DOCUMENTATION
5422 
5428  rose_addr_t get_vaddr() const;
5429  void set_vaddr(rose_addr_t);
5431 #else
5432  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
5433  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5434 #endif
5435 
5436 #ifdef DOCUMENTATION
5437 
5442  rose_addr_t get_paddr() const;
5443  void set_paddr(rose_addr_t);
5445 #else
5446  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
5447  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5448 #endif
5449 
5450 #ifdef DOCUMENTATION
5451 
5456  rose_addr_t get_filesz() const;
5457  void set_filesz(rose_addr_t);
5459 #else
5460  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
5461  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5462 #endif
5463 
5464 #ifdef DOCUMENTATION
5465 
5470  rose_addr_t get_memsz() const;
5471  void set_memsz(rose_addr_t);
5473 #else
5474  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
5475  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5476 #endif
5477 
5478 #ifdef DOCUMENTATION
5479 
5484  rose_addr_t get_align() const;
5485  void set_align(rose_addr_t);
5487 #else
5488  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
5489  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5490 #endif
5491 
5492 #ifdef DOCUMENTATION
5493 
5498  const SgUnsignedCharList& get_extra() const;
5499  void set_extra(const SgUnsignedCharList&);
5501 #else
5502  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
5503  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5504 #endif
5505 
5506  DECLARE_OTHERS(AsmElfSegmentTableEntry);
5507 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
5508 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5509  private:
5510  friend class boost::serialization::access;
5511 
5512  template<class S>
5513  void serialize(S &s, const unsigned /*version*/) {
5514  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5515  s & BOOST_SERIALIZATION_NVP(p_index);
5516  s & BOOST_SERIALIZATION_NVP(p_type);
5517  s & BOOST_SERIALIZATION_NVP(p_flags);
5518  s & BOOST_SERIALIZATION_NVP(p_offset);
5519  s & BOOST_SERIALIZATION_NVP(p_vaddr);
5520  s & BOOST_SERIALIZATION_NVP(p_paddr);
5521  s & BOOST_SERIALIZATION_NVP(p_filesz);
5522  s & BOOST_SERIALIZATION_NVP(p_memsz);
5523  s & BOOST_SERIALIZATION_NVP(p_align);
5524  s & BOOST_SERIALIZATION_NVP(p_extra);
5525  }
5526 #endif
5527 
5528  public:
5531  PT_NULL = 0,
5532  PT_LOAD = 1,
5535  PT_NOTE = 4,
5536  PT_SHLIB = 5,
5537  PT_PHDR = 6,
5538  PT_TLS = 7,
5540  // OS- and Processor-specific ranges
5541  PT_LOOS = 0x60000000,
5542  PT_HIOS = 0x6fffffff,
5543  PT_LOPROC = 0x70000000,
5544  PT_HIPROC = 0x7fffffff,
5545 
5546  // OS-specific values for GNU/Linux
5547  PT_GNU_EH_FRAME = 0x6474e550,
5548  PT_GNU_STACK = 0x6474e551,
5549  PT_GNU_RELRO = 0x6474e552,
5550  PT_PAX_FLAGS = 0x65041580,
5552  // OS-specific values for Sun
5553  PT_SUNWBSS = 0x6ffffffa,
5554  PT_SUNWSTACK = 0x6ffffffb
5555  };
5556 
5559  PF_NONE = 0,
5560  PF_RESERVED = 0x000ffff8,
5561  PF_XPERM = 0x00000001,
5562  PF_WPERM = 0x00000002,
5563  PF_RPERM = 0x00000004,
5564  PF_OS_MASK = 0x0ff00000,
5565  PF_PROC_MASK = 0xf0000000
5566  };
5567 
5568 #ifdef _MSC_VER
5569 # pragma pack (1)
5570 #endif
5571 
5579  uint32_t p_type;
5580  uint32_t p_offset;
5581  uint32_t p_vaddr;
5582  uint32_t p_paddr;
5583  uint32_t p_filesz;
5584  uint32_t p_memsz;
5585  uint32_t p_flags;
5586  uint32_t p_align;
5587  } /* 0x30 */
5588 #if !defined(SWIG) && !defined(_MSC_VER)
5589  __attribute__((packed))
5590 #endif
5591  ;
5592 
5594  uint32_t p_type; /* 0x00 */
5595  uint32_t p_flags; /* 0x04 */
5596  uint64_t p_offset; /* 0x08 */
5597  uint64_t p_vaddr; /* 0x10 */
5598  uint64_t p_paddr; /* 0x18 */
5599  uint64_t p_filesz; /* 0x20 */
5600  uint64_t p_memsz; /* 0x28 */
5601  uint64_t p_align; /* 0x30 */
5602  } /* 0x38 */
5603 #if !defined(SWIG) && !defined(_MSC_VER)
5604  __attribute__((packed))
5605 #endif
5606  ;
5607 #ifdef _MSC_VER
5608 # pragma pack ()
5609 #endif
5610 
5612  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5614 
5616  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
5618 
5622  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
5623  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
5628 
5630  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
5631 
5634 
5637 
5638  private:
5639  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
5640  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
5641 #endif // SgAsmElfSegmentTableEntry_OTHERS
5642 
5643 #ifdef DOCUMENTATION
5644  };
5645 #endif
5646 
5647 
5648 
5650 
5651  /*************************************************************************************************************************
5652  * ELF Symbol Tables
5653  *************************************************************************************************************************/
5654 
5656 
5657  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
5658  IS_SERIALIZABLE(AsmElfSymbolSection);
5659 
5660 #ifdef DOCUMENTATION
5661 
5663  public:
5664 #endif
5665 
5666 #ifdef DOCUMENTATION
5667 
5670  bool get_is_dynamic() const;
5671  void set_is_dynamic(bool);
5673 #else
5674  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
5675  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5676 #endif
5677 
5678 #ifdef DOCUMENTATION
5679 
5688 #else
5689  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
5690  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5691 #endif
5692 
5693  DECLARE_OTHERS(AsmElfSymbolSection);
5694 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
5695 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5696  private:
5697  friend class boost::serialization::access;
5698 
5699  template<class S>
5700  void serialize(S &s, const unsigned /*version*/) {
5701  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
5702  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
5703  s & BOOST_SERIALIZATION_NVP(p_symbols);
5704  }
5705 #endif
5706 
5707  public:
5710  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
5711  ctor(strsec);
5712  }
5713 
5715  virtual SgAsmElfSymbolSection* parse() $ROSE_OVERRIDE;
5716 
5729  virtual void finish_parsing() $ROSE_OVERRIDE;
5730 
5732  size_t index_of(SgAsmElfSymbol*);
5733 
5738  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
5739 
5743  virtual bool reallocate() $ROSE_OVERRIDE;
5744 
5746  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
5747 
5749  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5750 
5751  private:
5752  void ctor(SgAsmElfStringSection*);
5753 #endif // SgAsmElfSymbolSection_OTHERS
5754 
5755 #ifdef DOCUMENTATION
5756  };
5757 #endif
5758 
5760 
5761  DECLARE_LEAF_CLASS(AsmElfSymbolList);
5762  IS_SERIALIZABLE(AsmElfSymbolList);
5763 
5764 #ifdef DOCUMENTATION
5766  public:
5767 #endif
5768 
5769 #ifdef DOCUMENTATION
5770 
5776  const SgAsmElfSymbolPtrList& get_symbols() const;
5777  void set_symbols(const SgAsmElfSymbolPtrList&);
5779 #else
5780  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
5781  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5782 #endif
5783 
5784  DECLARE_OTHERS(AsmElfSymbolList);
5785 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
5786 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5787  private:
5788  friend class boost::serialization::access;
5789 
5790  template<class S>
5791  void serialize(S &s, const unsigned /*version*/) {
5792  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
5793  s & BOOST_SERIALIZATION_NVP(p_symbols);
5794  }
5795 #endif
5796 #endif // SgAsmElfSymbolList_OTHERS
5797 
5798 #ifdef DOCUMENTATION
5799  };
5800 #endif
5801 
5803 
5804  DECLARE_LEAF_CLASS(AsmElfSymbol);
5805  IS_SERIALIZABLE(AsmElfSymbol);
5806 
5807 #ifdef DOCUMENTATION
5808 
5813  public:
5814 #endif
5815 
5816 #ifdef DOCUMENTATION
5817 
5822  unsigned char get_st_info() const;
5823  void set_st_info(unsigned char);
5825 #else
5826  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
5827  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5828 #endif
5829 
5830 #ifdef DOCUMENTATION
5831 
5836  unsigned char get_st_res1() const;
5837  void set_st_res1(unsigned char);
5839 #else
5840  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
5841  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5842 #endif
5843 
5844 #ifdef DOCUMENTATION
5845 
5850  unsigned get_st_shndx() const;
5851  void set_st_shndx(unsigned);
5853 #else
5854  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
5855  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5856 #endif
5857 
5858 #ifdef DOCUMENTATION
5859 
5864  rose_addr_t get_st_size() const;
5865  void set_st_size(rose_addr_t);
5867 #else
5868  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
5869  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5870 #endif
5871 
5872 #ifdef DOCUMENTATION
5873 
5878  const SgUnsignedCharList& get_extra() const;
5879  void set_extra(const SgUnsignedCharList&);
5881 #else
5882  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
5883  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5884 #endif
5885 
5886  DECLARE_OTHERS(AsmElfSymbol);
5887 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
5888 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5889  private:
5890  friend class boost::serialization::access;
5891 
5892  template<class S>
5893  void serialize(S &s, const unsigned /*version*/) {
5894  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
5895  s & BOOST_SERIALIZATION_NVP(p_st_info);
5896  s & BOOST_SERIALIZATION_NVP(p_st_res1);
5897  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
5898  s & BOOST_SERIALIZATION_NVP(p_st_size);
5899  s & BOOST_SERIALIZATION_NVP(p_extra);
5900  }
5901 #endif
5902 
5903  public:
5904  enum ElfSymBinding {
5905  STB_LOCAL=0,
5906  STB_GLOBAL=1,
5907  STB_WEAK=2
5908  };
5909 
5910  enum ElfSymType {
5913  STT_FUNC = 2,
5915  STT_FILE = 4,
5917  STT_TLS = 6,
5919  };
5920 
5921 #ifdef _MSC_VER
5922 # pragma pack (1)
5923 #endif
5924 
5927  uint32_t st_name;
5928  uint32_t st_value;
5929  uint32_t st_size;
5930  unsigned char st_info;
5931  unsigned char st_res1;
5932  uint16_t st_shndx;
5933  }
5934 #if !defined(SWIG) && !defined(_MSC_VER)
5935  __attribute__((packed))
5936 #endif
5937  ;
5938 
5940  uint32_t st_name;
5941  unsigned char st_info;
5942  unsigned char st_res1;
5943  uint16_t st_shndx;
5944  uint64_t st_value;
5945  uint64_t st_size;
5946  }
5947 #if !defined(SWIG) && !defined(_MSC_VER)
5948  __attribute__((packed))
5949 #endif
5950  ;
5951 
5952 #ifdef _MSC_VER
5953 # pragma pack ()
5954 #endif
5955 
5957  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
5958 
5962  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
5963 
5967  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
5968 
5972  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
5973  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
5981  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
5982  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
5986  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
5987 
5990 
5992  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
5993 
5995  static std::string to_string(SgAsmElfSymbol::ElfSymType);
5996 
5997  private:
5998  void ctor(SgAsmElfSymbolSection*);
5999  void parse_common(); // initialization common to all parse() methods
6000 #endif // SgAsmElfSymbol_OTHERS
6001 
6002 #ifdef DOCUMENTATION
6003  };
6004 #endif
6005 
6006 
6007 
6009 
6010  /*************************************************************************************************************************
6011  * ELF Symbol Version Tables
6012  *************************************************************************************************************************/
6013 
6015 
6016  DECLARE_LEAF_CLASS(AsmElfSymverSection);
6017  IS_SERIALIZABLE(AsmElfSymverSection);
6018 
6019 #ifdef DOCUMENTATION
6020 
6025  public:
6026 #endif
6027 
6028 #ifdef DOCUMENTATION
6029 
6038 #else
6039  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
6040  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6041 #endif
6042 
6043  DECLARE_OTHERS(AsmElfSymverSection);
6044 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
6045 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6046  private:
6047  friend class boost::serialization::access;
6048 
6049  template<class S>
6050  void serialize(S &s, const unsigned /*version*/) {
6051  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6052  s & BOOST_SERIALIZATION_NVP(p_entries);
6053  }
6054 #endif
6055 
6056  public:
6059  : SgAsmElfSection(fhdr) {
6060  ctor();
6061  }
6062 
6064  virtual SgAsmElfSymverSection* parse() $ROSE_OVERRIDE;
6065 
6070  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6071 
6073  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6074 
6076  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6077  private:
6078  void ctor();
6079 #endif // SgAsmElfSymverSection_OTHERS
6080 
6081 #ifdef DOCUMENTATION
6082  };
6083 #endif
6084 
6086 
6087  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
6088  IS_SERIALIZABLE(AsmElfSymverEntry);
6089 
6090 #ifdef DOCUMENTATION
6091 
6093  public:
6094 #endif
6095 
6096 #ifdef DOCUMENTATION
6097 
6102  size_t get_value() const;
6103  void set_value(size_t);
6105 #else
6106  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
6107  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6108 #endif
6109 
6110  DECLARE_OTHERS(AsmElfSymverEntry);
6111 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
6112 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6113  private:
6114  friend class boost::serialization::access;
6115 
6116  template<class S>
6117  void serialize(S &s, const unsigned /*version*/) {
6118  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6119  s & BOOST_SERIALIZATION_NVP(p_value);
6120  }
6121 #endif
6122 
6123  public:
6126  : p_value(0) {
6127  ctor(symver);
6128  }
6129 
6131  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6132 
6133  private:
6134  void ctor(SgAsmElfSymverSection*);
6135 #endif // SgAsmElfSymverEntry_OTHERS
6136 
6137 #ifdef DOCUMENTATION
6138  };
6139 #endif
6140 
6142 
6143 
6144  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
6145  IS_SERIALIZABLE(AsmElfSymverEntryList);
6146 
6147 #ifdef DOCUMENTATION
6148 
6153  public:
6154 #endif
6155 
6156 #ifdef DOCUMENTATION
6157 
6160  const SgAsmElfSymverEntryPtrList& get_entries() const;
6161  void set_entries(const SgAsmElfSymverEntryPtrList&);
6163 #else
6164  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
6165  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6166  NO_DELETE);
6167 #endif
6168 
6169  DECLARE_OTHERS(AsmElfSymverEntryList);
6170 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
6171 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6172  private:
6173  friend class boost::serialization::access;
6174 
6175  template<class S>
6176  void serialize(S &s, const unsigned /*version*/) {
6177  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6178  s & BOOST_SERIALIZATION_NVP(p_entries);
6179  }
6180 #endif
6181 #endif // SgAsmElfSymverEntryList_OTHERS
6182 
6183 #ifdef DOCUMENTATION
6184  };
6185 #endif
6186 
6188 
6189  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
6190  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
6191 
6192 #ifdef DOCUMENTATION
6193 
6199  public:
6200 #endif
6201 
6202 #ifdef DOCUMENTATION
6203 
6212 #else
6213  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
6214  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6215  NO_DELETE);
6216 #endif
6217 
6218  DECLARE_OTHERS(AsmElfSymverDefinedSection);
6219 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
6220 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6221  private:
6222  friend class boost::serialization::access;
6223 
6224  template<class S>
6225  void serialize(S &s, const unsigned /*version*/) {
6226  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6227  s & BOOST_SERIALIZATION_NVP(p_entries);
6228  }
6229 #endif
6230 
6231  public:
6234  : SgAsmElfSection(fhdr) {
6235  ctor(strsec);
6236  }
6237 
6306  virtual SgAsmElfSymverDefinedSection* parse() $ROSE_OVERRIDE;
6307 
6310  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6311 
6315  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6316 
6318  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6319 
6320  private:
6321  void ctor(SgAsmElfStringSection*);
6322 #endif // SgAsmElfSymverDefinedSection_OTHERS
6323 
6324 #ifdef DOCUMENTATION
6325  };
6326 #endif
6327 
6329 
6330  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
6331  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
6332 
6333 #ifdef DOCUMENTATION
6334 
6339  public:
6340 #endif
6341 
6342 #ifdef DOCUMENTATION
6343 
6346  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
6347  void set_entries(const SgAsmElfSymverDefinedPtrList&);
6349 #else
6350  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
6351  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6352  NO_DELETE);
6353 #endif
6354 
6355  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
6356 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
6357 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6358  private:
6359  friend class boost::serialization::access;
6360 
6361  template<class S>
6362  void serialize(S &s, const unsigned /*version*/) {
6363  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6364  s & BOOST_SERIALIZATION_NVP(p_entries);
6365  }
6366 #endif
6367 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
6368 
6369 #ifdef DOCUMENTATION
6370  };
6371 #endif
6372 
6374 
6375  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
6376  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
6377 
6378 #ifdef DOCUMENTATION
6379 
6381  public:
6382 #endif
6383 
6384 #ifdef DOCUMENTATION
6385 
6390  size_t get_version() const;
6391  void set_version(size_t);
6393 #else
6394  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
6395  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6396 #endif
6397 
6398 #ifdef DOCUMENTATION
6399 
6404  int get_flags() const;
6405  void set_flags(int);
6407 #else
6408  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
6409  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6410 #endif
6411 
6412 #ifdef DOCUMENTATION
6413 
6418  size_t get_index() const;
6419  void set_index(size_t);
6421 #else
6422  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
6423  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6424 #endif
6425 
6426 #ifdef DOCUMENTATION
6427 
6432  uint32_t get_hash() const;
6433  void set_hash(uint32_t);
6435 #else
6436  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
6437  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6438 #endif
6439 
6440 #ifdef DOCUMENTATION
6441 
6450 #else
6451  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
6452  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6453 #endif
6454 
6455  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
6456 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
6457 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6458  private:
6459  friend class boost::serialization::access;
6460 
6461  template<class S>
6462  void serialize(S &s, const unsigned /*version*/) {
6463  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6464  s & BOOST_SERIALIZATION_NVP(p_version);
6465  s & BOOST_SERIALIZATION_NVP(p_flags);
6466  s & BOOST_SERIALIZATION_NVP(p_index);
6467  s & BOOST_SERIALIZATION_NVP(p_hash);
6468  s & BOOST_SERIALIZATION_NVP(p_entries);
6469  }
6470 #endif
6471 
6472  public:
6473 #ifdef _MSC_VER
6474 # pragma pack (1)
6475 #endif
6476 
6478  uint16_t vd_version;
6479  uint16_t vd_flags;
6480  uint16_t vd_ndx;
6481  uint16_t vd_cnt;
6482  uint32_t vd_hash;
6483  uint32_t vd_aux;
6484  uint32_t vd_next;
6485  }
6486 #if !defined(SWIG) && !defined(_MSC_VER)
6487  __attribute__((packed))
6488 #endif
6489  ;
6490 
6491 #ifdef _MSC_VER
6492 # pragma pack ()
6493 #endif
6494 
6497  ctor(symver_defined);
6498  }
6499 
6501  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
6502 
6504  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
6505 
6507  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6508 
6509  private:
6510  void ctor(SgAsmElfSymverDefinedSection*);
6511 #endif // SgAsmElfSymverDefinedEntry_OTHERS
6512 
6513 #ifdef DOCUMENTATION
6514  };
6515 #endif
6516 
6518 
6519  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
6520  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
6521 
6522 #ifdef DOCUMENTATION
6523 
6528  pbulic:
6529 #endif
6530 
6531 #ifdef DOCUMENTATION
6532 
6535  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
6536  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
6538 #else
6539  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
6540  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6541  NO_DELETE);
6542 #endif
6543 
6544  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
6545 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
6546 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6547  private:
6548  friend class boost::serialization::access;
6549 
6550  template<class S>
6551  void serialize(S &s, const unsigned /*version*/) {
6552  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6553  s & BOOST_SERIALIZATION_NVP(p_entries);
6554  }
6555 #endif
6556 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
6557 
6558 #ifdef DOCUMENTATION
6559  };
6560 #endif
6561 
6563 
6564  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
6565  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
6566 
6567 #ifdef DOCUMENTATION
6569  public:
6570 #endif
6571 
6572 #ifdef DOCUMENTATION
6573 
6576  SgAsmGenericString* get_name() const;
6579 #else
6580  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6581  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6582 #endif
6583 
6584  DECLARE_OTHERS(AsmElfSymverDefinedAux);
6585 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
6586 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6587  private:
6588  friend class boost::serialization::access;
6589 
6590  template<class S>
6591  void serialize(S &s, const unsigned /*version*/) {
6592  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6593  s & BOOST_SERIALIZATION_NVP(p_name);
6594  }
6595 #endif
6596 
6597  public:
6598 #ifdef _MSC_VER
6599 # pragma pack (1)
6600 #endif
6601 
6604  uint32_t vda_name;
6605  uint32_t vda_next;
6606  }
6607 #if !defined(SWIG) && !defined(_MSC_VER)
6608  __attribute__((packed))
6609 #endif
6610  ;
6611 
6612 #ifdef _MSC_VER
6613 # pragma pack ()
6614 #endif
6615 
6620  SgAsmElfSymverDefinedSection *symver_def_sec)
6621  : p_name(NULL) {
6622  ctor(symver_def_entry,symver_def_sec);
6623  }
6624 
6626  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
6627 
6629  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
6630 
6636  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6637 
6638  private:
6639  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
6640 #endif // SgAsmElfSymverDefinedAux_OTHERS
6641 
6642 #ifdef DOCUMENTATION
6643  };
6644 #endif
6645 
6647 
6648  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
6649  IS_SERIALIZABLE(AsmElfSymverNeededSection);
6650 
6651 #ifdef DOCUMENTATION
6652 
6658  public:
6659 #endif
6660 
6661 #ifdef DOCUMENTATION
6662 
6671 #else
6672  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
6673  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6674 #endif
6675 
6676  DECLARE_OTHERS(AsmElfSymverNeededSection);
6677 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
6678 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6679  private:
6680  friend class boost::serialization::access;
6681 
6682  template<class S>
6683  void serialize(S &s, const unsigned /*version*/) {
6684  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6685  s & BOOST_SERIALIZATION_NVP(p_entries);
6686  }
6687 #endif
6688 
6689  public:
6694  : SgAsmElfSection(fhdr) {
6695  ctor(strsec);
6696  }
6697 
6707  virtual SgAsmElfSymverNeededSection* parse() $ROSE_OVERRIDE;
6708 
6713  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const $ROSE_OVERRIDE;
6714 
6718  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
6719 
6721  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
6722 
6723  private:
6724  void ctor(SgAsmElfStringSection*);
6725 #endif // SgAsmElfSymverNeededSection_OTHERS
6726 
6727 #ifdef DOCUMENTATION
6728  };
6729 #endif
6730 
6732 
6733  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
6734  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
6735 
6736 #ifdef DOCUMENTATION
6737 
6742  public:
6743 #endif
6744 
6745 #ifdef DOCUMENTATION
6746 
6749  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
6750  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
6752 #else
6753  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
6754  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6755  NO_DELETE);
6756 #endif
6757 
6758  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
6759 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
6760 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6761  private:
6762  friend class boost::serialization::access;
6763 
6764  template<class S>
6765  void serialize(S &s, const unsigned /*version*/) {
6766  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6767  s & BOOST_SERIALIZATION_NVP(p_entries);
6768  }
6769 #endif
6770 #endif // SgAsmElfSymverNeededEntryList_OTHERS
6771 
6772 #ifdef DOCUMENTATION
6773  };
6774 #endif
6775 
6777 
6778  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
6779  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
6780 
6781 #ifdef DOCUMENTATION
6782 
6784  public:
6785 #endif
6786 
6787 #ifdef DOCUMENTATION
6788 
6793  size_t get_version() const;
6794  void set_version(size_t);
6796 #else
6797  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
6798  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6799 #endif
6800 
6801 #ifdef DOCUMENTATION
6802 
6808 #else
6809  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
6810  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6811 #endif
6812 
6813 #ifdef DOCUMENTATION
6814 
6823 #else
6824  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
6825  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6826 #endif
6827 
6828  DECLARE_OTHERS(AsmElfSymverNeededEntry);
6829 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
6830 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6831  private:
6832  friend class boost::serialization::access;
6833 
6834  template<class S>
6835  void serialize(S &s, const unsigned /*version*/) {
6836  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6837  s & BOOST_SERIALIZATION_NVP(p_version);
6838  s & BOOST_SERIALIZATION_NVP(p_file_name);
6839  s & BOOST_SERIALIZATION_NVP(p_entries);
6840  }
6841 #endif
6842 
6843  public:
6844 #ifdef _MSC_VER
6845 # pragma pack (1)
6846 #endif
6847 
6850  uint16_t vn_version;
6851  uint16_t vn_cnt;
6852  uint32_t vn_file;
6853  uint32_t vn_aux;
6854  uint32_t vn_next;
6855  }
6856 #if !defined(SWIG) && !defined(_MSC_VER)
6857  __attribute__((packed))
6858 #endif
6859  ;
6860 
6861 #ifdef _MSC_VER
6862 # pragma pack ()
6863 #endif
6864 
6867  : p_file_name(NULL) {
6868  ctor(symver_needed);
6869  }
6870 
6872  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
6873 
6875  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
6876 
6878  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
6879 
6880  private:
6881  void ctor(SgAsmElfSymverNeededSection*);
6882 #endif // SgAsmElfSymverNeededEntry_OTHERS
6883 
6884 #ifdef DOCUMENTATION
6885  };
6886 #endif
6887 
6889 
6890  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
6891  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
6892 
6893 #ifdef DOCUMENTATION
6894 
6899  public:
6900 #endif
6901 
6902 #ifdef DOCUMENTATION
6903 
6906  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
6907  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
6909 #else
6910  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
6911  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6912  NO_DELETE);
6913 #endif
6914 
6915  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
6916 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
6917 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6918  private:
6919  friend class boost::serialization::access;
6920 
6921  template<class S>
6922  void serialize(S &s, const unsigned /*version*/) {
6923  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6924  s & BOOST_SERIALIZATION_NVP(p_entries);
6925  }
6926 #endif
6927 #endif // SgAsmElfSymverNeededAuxList_OTHERS
6928 
6929 #ifdef DOCUMENTATION
6930  };
6931 #endif
6932 
6934 
6935  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
6936  IS_SERIALIZABLE(AsmElfSymverNeededAux);
6937 
6938 #ifdef DOCUMENTATION
6939 
6941  public:
6942 #endif
6943 
6944 #ifdef DOCUMENTATION
6945 
6950  uint32_t get_hash() const;
6951  void set_hash(uint32_t);
6953 #else
6954  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
6955  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6956 #endif
6957 
6958 #ifdef DOCUMENTATION
6959 
6964  int get_flags() const;
6965  void set_flags(int);
6967 #else
6968  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
6969  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6970 #endif
6971 
6972 #ifdef DOCUMENTATION
6973 
6978  size_t get_other() const;
6979  void set_other(size_t);
6981 #else
6982  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
6983  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6984 #endif
6985 
6986 #ifdef DOCUMENTATION
6987 
6990  SgAsmGenericString* get_name() const;
6993 #else
6994  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
6995  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6996 #endif
6997 
6998  DECLARE_OTHERS(AsmElfSymverNeededAux);
6999 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
7000 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7001  private:
7002  friend class boost::serialization::access;
7003 
7004  template<class S>
7005  void serialize(S &s, const unsigned /*version*/) {
7006  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7007  s & BOOST_SERIALIZATION_NVP(p_hash);
7008  s & BOOST_SERIALIZATION_NVP(p_flags);
7009  s & BOOST_SERIALIZATION_NVP(p_other);
7010  s & BOOST_SERIALIZATION_NVP(p_name);
7011  }
7012 #endif
7013 
7014  public:
7015 #ifdef _MSC_VER
7016 # pragma pack (1)
7017 #endif
7018 
7021  uint32_t vna_hash;
7022  uint16_t vna_flags;
7023  uint16_t vna_other;
7024  uint32_t vna_name;
7025  uint32_t vna_next;
7026  }
7027 #if !defined(SWIG) && !defined(_MSC_VER)
7028  __attribute__((packed))
7029 #endif
7030  ;
7031 
7032 #ifdef _MSC_VER
7033 # pragma pack ()
7034 #endif
7035 
7041  : p_name(NULL) {
7042  ctor(symver_needed_entry,symver_needed_sec);
7043  }
7044 
7046  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
7047 
7049  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
7050 
7056  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7057 
7058  private:
7060 #endif // SgAsmElfSymverNeededAux_OTHERS
7061 
7062 #ifdef DOCUMENTATION
7063  };
7064 #endif
7065 
7066 
7067 
7068 
7070 
7071  /*************************************************************************************************************************
7072  * ELF Relocation Tables
7073  *************************************************************************************************************************/
7074 
7076 
7077  DECLARE_LEAF_CLASS(AsmElfRelocSection);
7078  IS_SERIALIZABLE(AsmElfRelocSection);
7079 
7080 #ifdef DOCUMENTATION
7081 
7083  public:
7084 #endif
7085 
7086 #ifdef DOCUMENTATION
7087 
7090  bool get_uses_addend() const;
7091  void set_uses_addend(bool);
7093 #else
7094  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
7095  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7096 #endif
7097 
7098 #ifdef DOCUMENTATION
7099 
7105 #else
7106  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
7107  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7108 #endif
7109 
7110 #ifdef DOCUMENTATION
7111 
7119 #else
7120  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
7121  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7122 #endif
7123 
7124  DECLARE_OTHERS(AsmElfRelocSection);
7125 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
7126 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7127  private:
7128  friend class boost::serialization::access;
7129 
7130  template<class S>
7131  void serialize(S &s, const unsigned /*version*/) {
7132  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7133  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
7134  s & BOOST_SERIALIZATION_NVP(p_target_section);
7135  s & BOOST_SERIALIZATION_NVP(p_entries);
7136  }
7137 #endif
7138 
7139  public:
7141  : SgAsmElfSection(fhdr) {
7142  ctor(symsec,targetsec);
7143  }
7144 
7147  virtual SgAsmElfRelocSection *parse() $ROSE_OVERRIDE;
7148 
7150  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7151 
7153  virtual bool reallocate() $ROSE_OVERRIDE;
7154 
7156  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7157 
7159  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7160 
7161  private:
7163 #endif // SgAsmElfRelocSection_OTHERS
7164 
7165 #ifdef DOCUMENTATION
7166  };
7167 #endif
7168 
7170 
7171  DECLARE_LEAF_CLASS(AsmElfRelocEntryList);
7172  IS_SERIALIZABLE(AsmElfRelocEntryList);
7173 
7174 #ifdef DOCUMENTATION
7175 
7180  public:
7181 #endif
7182 
7183 #ifdef DOCUMENTATION
7184 
7187  const SgAsmElfRelocEntryPtrList& get_entries() const;
7188  void set_entries(const SgAsmElfRelocEntryPtrList&);
7190 #else
7191  AsmElfRelocEntryList.setDataPrototype("SgAsmElfRelocEntryPtrList", "entries", "",
7192  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7193  NO_DELETE);
7194 #endif
7195 
7196  DECLARE_OTHERS(AsmElfRelocEntryList);
7197 #if defined(SgAsmElfRelocEntryList_OTHERS) || defined(DOCUMENTATION)
7198 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7199  private:
7200  friend class boost::serialization::access;
7201 
7202  template<class S>
7203  void serialize(S &s, const unsigned /*version*/) {
7204  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7205  s & BOOST_SERIALIZATION_NVP(p_entries);
7206  }
7207 #endif
7208 #endif // SgAsmElfRelocEntryList_OTHERS
7209 
7210 #ifdef DOCUMENTATION
7211  };
7212 #endif
7213 
7215 
7216  DECLARE_LEAF_CLASS(AsmElfRelocEntry);
7217  IS_SERIALIZABLE(AsmElfRelocEntry);
7218 
7219 #ifdef DOCUMENTATION
7220 
7222  public:
7223 #endif
7224 
7225 #ifdef DOCUMENTATION
7226 
7231  rose_addr_t get_r_offset() const;
7232  void set_r_offset(rose_addr_t);
7234 #else
7235  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_offset", "= 0",
7236  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7237 #endif
7238 
7239 #ifdef DOCUMENTATION
7240 
7245  rose_addr_t get_r_addend() const;
7246  void set_r_addend(rose_addr_t);
7248 #else
7249  AsmElfRelocEntry.setDataPrototype("rose_addr_t", "r_addend", "= 0",
7250  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7251 #endif
7252 
7253 #ifdef DOCUMENTATION
7254 
7259  unsigned long get_sym() const;
7260  void set_sym(unsigned long);
7262 #else
7263  AsmElfRelocEntry.setDataPrototype("unsigned long", "sym", "= 0",
7264  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7265 #endif
7266 
7267 #ifdef DOCUMENTATION
7268 
7273  RelocType get_type() const;
7274  void set_type(RelocType);
7276 #else
7277  AsmElfRelocEntry.setDataPrototype("SgAsmElfRelocEntry::RelocType", "type", "= R_386_NONE",
7278  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7279 #endif
7280 
7281 #ifdef DOCUMENTATION
7282 
7285  const SgUnsignedCharList& get_extra() const;
7286  void set_extra(const SgUnsignedCharList&);
7288 #else
7289  AsmElfRelocEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7290  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7291 #endif
7292 
7293  DECLARE_OTHERS(AsmElfRelocEntry);
7294 #if defined(SgAsmElfRelocEntry_OTHERS) || defined(DOCUMENTATION)
7295 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7296  private:
7297  friend class boost::serialization::access;
7298 
7299  template<class S>
7300  void serialize(S &s, const unsigned /*version*/) {
7301  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7302  s & BOOST_SERIALIZATION_NVP(p_r_offset);
7303  s & BOOST_SERIALIZATION_NVP(p_r_addend);
7304  s & BOOST_SERIALIZATION_NVP(p_sym);
7305  s & BOOST_SERIALIZATION_NVP(p_type);
7306  s & BOOST_SERIALIZATION_NVP(p_extra);
7307  }
7308 #endif
7309 
7310  public:
7313  // Intel 80386 specific definitions.
7325  R_386_32PLT =11,
7332  R_386_16 =20,
7333  R_386_PC16 =21,
7334  R_386_8 =22,
7335  R_386_PC8 =23,
7351  // First Entry for X86-64
7366  R_X86_64_8 =114,
7376  };
7377 
7378 #ifdef _MSC_VER
7379 # pragma pack (1)
7380 #endif
7381 
7383  uint32_t r_offset;
7384  uint32_t r_info;
7385  uint32_t r_addend;
7386  }
7387 #if !defined(SWIG) && !defined(_MSC_VER)
7388  __attribute__((packed))
7389 #endif
7390  ;
7391 
7393  uint64_t r_offset;
7394  uint64_t r_info;
7395  uint64_t r_addend;
7396  }
7397 #if !defined(SWIG) && !defined(_MSC_VER)
7398  __attribute__((packed))
7399 #endif
7400  ;
7401 
7403  uint32_t r_offset;
7404  uint32_t r_info;
7405  }
7406 #if !defined(SWIG) && !defined(_MSC_VER)
7407  __attribute__((packed))
7408 #endif
7409  ;
7410 
7412  uint64_t r_offset;
7413  uint64_t r_info;
7414  }
7415 #if !defined(SWIG) && !defined(_MSC_VER)
7416  __attribute__((packed))
7417 #endif
7418  ;
7419 
7420 #ifdef _MSC_VER
7421 # pragma pack ()
7422 #endif
7423 
7426  : p_r_offset(0), p_r_addend(0), p_sym(0), p_type(R_386_NONE) {
7427  ctor(section);
7428  }
7429 
7433  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelaEntry_disk *disk);
7434  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelaEntry_disk *disk);
7435  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf32RelEntry_disk *disk);
7436  void parse(ByteOrder::Endianness sex, const SgAsmElfRelocEntry::Elf64RelEntry_disk *disk);
7442  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelaEntry_disk*) const;
7443  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelaEntry_disk*) const;
7444  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf32RelEntry_disk*) const;
7445  void *encode(ByteOrder::Endianness, SgAsmElfRelocEntry::Elf64RelEntry_disk*) const;
7451  void dump(FILE *f, const char *prefix, ssize_t idx, SgAsmElfSymbolSection *symtab) const;
7452  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const {
7453  dump(f, prefix, idx, NULL);
7454  }
7458  std::string reloc_name() const;
7459 
7460  private:
7461  void ctor(SgAsmElfRelocSection*);
7462 #endif // SgAsmElfRelocEntry_OTHERS
7463 
7464 #ifdef DOCUMENTATION
7465  };
7466 #endif
7467 
7468 
7469 
7471 
7472  /*************************************************************************************************************************
7473  * ELF Dynamic Linking
7474  *************************************************************************************************************************/
7475 
7477 
7478  DECLARE_LEAF_CLASS(AsmElfDynamicSection);
7479  IS_SERIALIZABLE(AsmElfDynamicSection);
7480 
7481 #ifdef DOCUMENTATION
7482 
7484  public:
7485 #endif
7486 
7487 #ifdef DOCUMENTATION
7488 
7497 #else
7498  AsmElfDynamicSection.setDataPrototype("SgAsmElfDynamicEntryList*", "entries", "= NULL",
7499  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7500 #endif
7501 
7502  DECLARE_OTHERS(AsmElfDynamicSection);
7503 #if defined(SgAsmElfDynamicSection_OTHERS) || defined(DOCUMENTATION)
7504 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7505  private:
7506  friend class boost::serialization::access;
7507 
7508  template<class S>
7509  void serialize(S &s, const unsigned /*version*/) {
7510  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7511  s & BOOST_SERIALIZATION_NVP(p_entries);
7512  }
7513 #endif
7514 
7515  public:
7518  : SgAsmElfSection(fhdr) {
7519  ctor(strsec);
7520  }
7521 
7523  virtual SgAsmElfDynamicSection* parse() $ROSE_OVERRIDE;
7524 
7526  virtual void finish_parsing() $ROSE_OVERRIDE;
7527 
7530  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const $ROSE_OVERRIDE;
7531 
7533  virtual bool reallocate() $ROSE_OVERRIDE;
7534 
7536  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7537 
7539  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7540 
7541  private:
7542  void ctor(SgAsmElfStringSection*);
7543 #endif // SgAsmElfDynamicSection_OTHERS
7544 
7545 #ifdef DOCUMENTATION
7546  };
7547 #endif
7548 
7550 
7551  DECLARE_LEAF_CLASS(AsmElfDynamicEntryList);
7552  IS_SERIALIZABLE(AsmElfDynamicEntryList);
7553 
7554 #ifdef DOCUMENTATION
7555 
7560  public:
7561 #endif
7562 
7563 #ifdef DOCUMENTATION
7564 
7567  const SgAsmElfDynamicEntryPtrList& get_entries() const;
7568  void set_entries(const SgAsmElfDynamicEntryPtrList&);
7570 #else
7571  AsmElfDynamicEntryList.setDataPrototype("SgAsmElfDynamicEntryPtrList", "entries", "",
7572  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
7573  NO_DELETE);
7574 #endif
7575 
7576  DECLARE_OTHERS(AsmElfDynamicEntryList);
7577 #if defined(SgAsmElfDynamicEntryList_OTHERS) || defined(DOCUMENTATION)
7578 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7579  private:
7580  friend class boost::serialization::access;
7581 
7582  template<class S>
7583  void serialize(S &s, const unsigned /*version*/) {
7584  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7585  s & BOOST_SERIALIZATION_NVP(p_entries);
7586  }
7587 #endif
7588 #endif // SgAsmElfDynamicEntryList_OTHERS
7589 
7590 #ifdef DOCUMENTATION
7591  };
7592 #endif
7593 
7595 
7596  DECLARE_LEAF_CLASS(AsmElfDynamicEntry);
7597  IS_SERIALIZABLE(AsmElfDynamicEntry);
7598 
7599 #ifdef DOCUMENTATION
7600 
7602  public:
7603 #endif
7604 
7605 #ifdef DOCUMENTATION
7606 
7611  EntryType get_d_tag() const;
7612  void set_d_tag(EntryType);
7614 #else
7615  AsmElfDynamicEntry.setDataPrototype("SgAsmElfDynamicEntry::EntryType", "d_tag", "= SgAsmElfDynamicEntry::DT_NULL",
7616  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7617 #endif
7618 
7619 #ifdef DOCUMENTATION
7620 
7625  rose_rva_t get_d_val() const;
7626  void set_d_val(rose_rva_t);
7628 #else
7629  AsmElfDynamicEntry.setDataPrototype("rose_rva_t", "d_val", "",
7630  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7631 #endif
7632 
7633 #ifdef DOCUMENTATION
7634  // declared and documented below
7635 #else
7636  AsmElfDynamicEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
7637  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7638 #endif
7639 
7640 #ifdef DOCUMENTATION
7641 
7644  const SgUnsignedCharList& get_extra() const;
7645  void set_extra(const SgUnsignedCharList&);
7647 #else
7648  AsmElfDynamicEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
7649  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7650 #endif
7651 
7652  DECLARE_OTHERS(AsmElfDynamicEntry);
7653 #if defined(SgAsmElfDynamicEntry_OTHERS) || defined(DOCUMENTATION)
7654 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7655  private:
7656  friend class boost::serialization::access;
7657 
7658  template<class S>
7659  void serialize(S &s, const unsigned /*version*/) {
7660  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7661  s & BOOST_SERIALIZATION_NVP(p_d_tag);
7662  s & BOOST_SERIALIZATION_NVP(p_d_val);
7663  s & BOOST_SERIALIZATION_NVP(p_name);
7664  s & BOOST_SERIALIZATION_NVP(p_extra);
7665  }
7666 #endif
7667 
7668  public:
7669  enum EntryType { /* Type Executable SharedObj Purpose */
7670  DT_NULL = 0, /* ignored mandatory mandatory Marks end of dynamic array */
7671  DT_NEEDED = 1, /* value optional optional Name of needed library */
7672  DT_PLTRELSZ = 2, /* value optional optional Size of reloc entries associated with PLT */
7673  DT_PLTGOT = 3, /* pointer optional optional PLT and/or GOT */
7674  DT_HASH = 4, /* pointer mandatory mandatory Symbol hash table */
7675  DT_STRTAB = 5, /* pointer mandatory mandatory String table for symbols, lib names, etc. */
7676  DT_SYMTAB = 6, /* pointer mandatory mandatory Symbol table */
7677  DT_RELA = 7, /* pointer mandatory optional Relocation table */
7678  DT_RELASZ = 8, /* value mandatory optional Size of RELA relocation table */
7679  DT_RELAENT = 9, /* value mandatory optional Size of each RELA table entry */
7680  DT_STRSZ = 10, /* value mandatory mandatory Size of string table */
7681  DT_SYMENT = 11, /* value mandatory mandatory Size of symbol table entry */
7682  DT_INIT = 12, /* pointer optional optional Initialization function */
7683  DT_FINI = 13, /* pointer optional optional Termination function */
7684  DT_SONAME = 14, /* value ignored optional Name of shared object */
7685  DT_RPATH = 15, /* value optional ignored NUL-term library search path */
7686  DT_SYMBOLIC = 16, /* ignored ignored optional Bool determines dynamic linker symbol resolution */
7687  DT_REL = 17, /* pointer mandatory optional Relocation table */
7688  DT_RELSZ = 18, /* value mandatory optional Size of REL relocation table */
7689  DT_RELENT = 19, /* value mandatory optional Size of each REL table entry */
7690  DT_PLTREL = 20, /* value optional optional Reloc type for PLT; value is DT_RELA or DT_REL */
7691  DT_DEBUG = 21, /* pointer optional ignored Contents are not specified at ABI level */
7692  DT_TEXTREL = 22, /* ignored optional optional presence => relocs to nonwritable segments OK */
7693  DT_JMPREL = 23, /* pointer optional optional Addr of relocation entries for PLT */
7694  DT_BIND_NOW = 24, /* ignored optional optional Shall dynlinker do relocs before xfering control?*/
7695  DT_INIT_ARRAY = 25, /* pointer optional ? Array with addresses of init fct */
7696  DT_FINI_ARRAY = 26, /* pointer optional ? Array with address of fini fct */
7697  DT_INIT_ARRAYSZ = 27, /* value optional ? Size in bytes of DT_INIT_ARRAY */
7698  DT_FINI_ARRAYSZ = 28, /* value optional ? Size in bytes of DT_FINI_ARRAY */
7699  DT_RUNPATH = 29, /* ? optional ? Library search path (how diff from DT_RPATH?) */
7700  DT_FLAGS = 30, /* value optional ? Bit flags */
7701  DT_PREINIT_ARRAY = 32, /* pointer optional ? Array with addrs of preinit fct (aka DT_ENCODING)*/
7702  DT_PREINIT_ARRAYSZ = 33,/* value optional ? size in bytes of DT_PREINIT_ARRAY */
7703  DT_NUM = 34, /* ? ? ? "number used"? */
7704 
7705  DT_GNU_PRELINKED =0x6ffffdf5,/*value ? ? Prelinking time stamp */
7706  DT_GNU_CONFLICTSZ=0x6ffffdf6,/*value ? ? Size of conflict section */
7707  DT_GNU_LIBLISTSZ=0x6ffffdf7,/*value ? ? Size of library list */
7708  DT_CHECKSUM = 0x6ffffdf8, /* value ? ? ? */
7709  DT_PLTPADSZ = 0x6ffffdf9, /* value ? ? ? */
7710  DT_MOVEENT = 0x6ffffdfa, /* value ? ? ? */
7711  DT_MOVESZ = 0x6ffffdfb, /* value ? ? ? */
7712  DT_FEATURE_1= 0x6ffffdfc, /* value ? ? Feature selection (DTF_*) */
7713  DT_POSFLAG_1= 0x6ffffdfd, /* value ? ? Flag for DT_* entries affecting next entry */
7714  DT_SYMINSZ = 0x6ffffdfe, /* value ? ? Size of syminfo table in bytes */
7715  DT_SYMINENT = 0x6ffffdff, /* value ? ? Size of each syminfo table entry */
7716 
7717  DT_GNU_HASH = 0x6ffffef5, /* pointer ? ? GNU-style hash table */
7718  DT_TLSDESC_PLT=0x6ffffef6,/* pointer ? ? ? */
7719  DT_TLSDESC_GOT=0x6ffffef7,/* pointer ? ? ? */
7720  DT_GNU_CONFLICT=0x6ffffef8,/*pointer ? ? Start of conflict section */
7721  DT_GNU_LIBLIST=0x6ffffef9,/* pointer ? ? Library list */
7722  DT_CONFIG = 0x6ffffefa, /* pointer ? ? Configuration information */
7723  DT_DEPAUDIT = 0x6ffffefb, /* pointer ? ? Dependency auditing */
7724  DT_AUDIT = 0x6ffffefc, /* pointer ? ? Object auditing */
7725  DT_PLTPAD = 0x6ffffefd, /* pointer ? ? PLT padding */
7726  DT_MOVETAB = 0x6ffffefe, /* pointer ? ? Move table */
7727  DT_SYMINFO = 0x6ffffeff, /* pointer ? ? Syminfo table */
7728 
7729  DT_VERSYM = 0x6ffffff0, /* pointer ? ? ? */
7730  DT_RELACOUNT= 0x6ffffff9, /* value ? ? ? */
7731  DT_RELCOUNT = 0x6ffffffa, /* value ? ? ? */
7732  DT_FLAGS_1 = 0x6ffffffb, /* value ? ? Sun state flags */
7733  DT_VERDEF = 0x6ffffffc, /* pointer ? ? Sun version definition table */
7734  DT_VERDEFNUM= 0x6ffffffd, /* value ? ? Sun number of version definitions */
7735  DT_VERNEED = 0x6ffffffe, /* pointer ? ? Sun needed versions table */
7736  DT_VERNEEDNUM=0x6fffffff, /* value ? ? Sun number of needed versions */
7737 
7738  DT_AUXILIARY= 0x7ffffffd, /* pointer ? ? Sun shared obj to load before self */
7739  DT_FILTER = 0x7fffffff /* pointer ? ? Shared object ot get values from */
7740  };
7741 
7742 #ifdef _MSC_VER
7743 # pragma pack (1)
7744 #endif
7745 
7748  uint32_t d_tag;
7749  uint32_t d_val;
7750  }
7751 #if !defined(SWIG) && !defined(_MSC_VER)
7752  __attribute__((packed))
7753 #endif
7754  ;
7755 
7757  uint64_t d_tag;
7758  uint64_t d_val;
7759  }
7760 #if !defined(SWIG) && !defined(_MSC_VER)
7761  __attribute__((packed))
7762 #endif
7763  ;
7764 
7765 #ifdef _MSC_VER
7766 # pragma pack ()
7767 #endif
7768 
7771  : p_d_tag(DT_NULL), p_name(NULL) {
7772  ctor(dynsec);
7773  }
7774 
7778  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*);
7779  void parse(ByteOrder::Endianness, const SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*);
7785  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf32DynamicEntry_disk*) const;
7786  void *encode(ByteOrder::Endianness, SgAsmElfDynamicEntry::Elf64DynamicEntry_disk*) const;
7790  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
7791 
7793  static std::string to_string(SgAsmElfDynamicEntry::EntryType);
7794 
7798  SgAsmGenericString* get_name() const { return p_name; }
7802  private:
7803  void ctor(SgAsmElfDynamicSection*);
7804 #endif // SgAsmElfDynamicEntry_OTHERS
7805 
7806 #ifdef DOCUMENTATION
7807  };
7808 #endif
7809 
7810 
7811 
7812 
7814 
7815  /*************************************************************************************************************************
7816  * ELF String Tables
7817  *************************************************************************************************************************/
7818 
7820 
7821  DECLARE_LEAF_CLASS(AsmElfStringSection);
7822  IS_SERIALIZABLE(AsmElfStringSection);
7823  AsmElfStringSection.setAutomaticGenerationOfDestructor(false);
7824 
7825 #ifdef DOCUMENTATION
7826 
7830  public:
7831 #endif
7832 
7833 #ifdef DOCUMENTATION
7834 
7839  SgAsmElfStrtab* get_strtab() const;
7840  void set_strtab(SgAsmElfStrtab*);
7842 #else
7843  AsmElfStringSection.setDataPrototype("SgAsmElfStrtab*", "strtab", "= NULL",
7844  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7845 #endif
7846 
7847  DECLARE_OTHERS(AsmElfStringSection);
7848 #if defined(SgAsmElfStringSection_OTHERS) || defined(DOCUMENTATION)
7849 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7850  private:
7851  friend class boost::serialization::access;
7852 
7853  template<class S>
7854  void serialize(S &s, const unsigned /*version*/) {
7855  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7856  s & BOOST_SERIALIZATION_NVP(p_strtab);
7857  }
7858 #endif
7859 
7860  public:
7863  : SgAsmElfSection(fhdr), p_strtab(NULL) {
7864  ctor();
7865  }
7866 
7868  virtual SgAsmElfStringSection *parse() $ROSE_OVERRIDE;
7869 
7871  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
7872 
7877  virtual void set_size(rose_addr_t newsize) $ROSE_OVERRIDE;
7878 
7885  virtual bool reallocate() $ROSE_OVERRIDE;
7886 
7888  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
7889 
7890  private:
7891  void ctor();
7892  void ctor(SgAsmElfSectionTable*);
7893 #endif // SgAsmElfStringSection_OTHERS
7894 
7895 #ifdef DOCUMENTATION
7896  };
7897 #endif
7898 
7900 
7901  DECLARE_LEAF_CLASS(AsmElfStrtab);
7902  IS_SERIALIZABLE(AsmElfStrtab);
7903  AsmElfStrtab.setAutomaticGenerationOfDestructor(false);
7904 
7905 #ifdef DOCUMENTATION
7906 
7907  class SgAsmElfStrtab: public SgAsmGenericStrtab {
7908  public:
7909 #endif
7910 
7911  DECLARE_OTHERS(AsmElfStrtab);
7912 #if defined(SgAsmElfStrtab_OTHERS) || defined(DOCUMENTATION)
7913 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7914  private:
7915  friend class boost::serialization::access;
7916 
7917  template<class S>
7918  void serialize(S &s, const unsigned /*version*/) {
7919  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericStrtab);
7920  }
7921 #endif
7922 
7923  public:
7927  explicit SgAsmElfStrtab(class SgAsmElfSection *containing_section)
7928  : SgAsmGenericStrtab(containing_section) {
7929  ctor();
7930  }
7931 
7938  virtual ~SgAsmElfStrtab();
7939 
7943  virtual SgAsmElfStrtab *parse() $ROSE_OVERRIDE;
7944 
7948  virtual void unparse(std::ostream&) const;
7949 
7955  virtual SgAsmStringStorage *create_storage(rose_addr_t offset, bool shared) $ROSE_OVERRIDE;
7956 
7960  virtual rose_addr_t get_storage_size(const SgAsmStringStorage*) $ROSE_OVERRIDE;
7961 
7971  virtual void allocate_overlap(SgAsmStringStorage*) $ROSE_OVERRIDE;
7972 
7974  virtual void rebind(SgAsmStringStorage*, rose_addr_t) $ROSE_OVERRIDE;
7975 
7976  private:
7977  void ctor();
7978 #endif // SgAsmElfStrtab_OTHERS
7979 
7980 #ifdef DOCUMENTATION
7981  };
7982 #endif
7983 
7984 
7985 
7986 
7988 
7989  /*************************************************************************************************************************
7990  * ELF Notes
7991  *************************************************************************************************************************/
7992 
7994 
7995  DECLARE_LEAF_CLASS(AsmElfNoteSection);
7996  IS_SERIALIZABLE(AsmElfNoteSection);
7997 
7998 #ifdef DOCUMENTATION
8000  public:
8001 #endif
8002 
8003 #ifdef DOCUMENTATION
8004 
8013 #else
8014  AsmElfNoteSection.setDataPrototype("SgAsmElfNoteEntryList*", "entries", "= NULL",
8015  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8016 #endif
8017 
8018  DECLARE_OTHERS(AsmElfNoteSection);
8019 #if defined(SgAsmElfNoteSection_OTHERS) || defined(DOCUMENTATION)
8020 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8021  private:
8022  friend class boost::serialization::access;
8023 
8024  template<class S>
8025  void serialize(S &s, const unsigned /*version*/) {
8026  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8027  s & BOOST_SERIALIZATION_NVP(p_entries);
8028  }
8029 #endif
8030 
8031  public:
8034  : SgAsmElfSection(fhdr) {
8035  ctor();
8036  }
8037  virtual SgAsmElfNoteSection *parse() $ROSE_OVERRIDE;
8038 
8040  virtual bool reallocate() $ROSE_OVERRIDE;
8041 
8043  virtual void unparse(std::ostream&) const $ROSE_OVERRIDE;
8044 
8046  virtual void dump(FILE*, const char *prefix, ssize_t idx) const $ROSE_OVERRIDE;
8047 
8048  private:
8049  void ctor();
8050 #endif // SgAsmElfNoteSection_OTHERS
8051 
8052 #ifdef DOCUMENTATION
8053  };
8054 #endif
8055 
8057 
8058  DECLARE_LEAF_CLASS(AsmElfNoteEntryList);
8059  IS_SERIALIZABLE(AsmElfNoteEntryList);
8060 
8061 #ifdef DOCUMENTATION
8062 
8067  public:
8068 #endif
8069 
8070 #ifdef DOCUMENTATION
8071 
8074  const SgAsmElfNoteEntryPtrList& get_entries() const;
8075  void set_entries(const SgAsmElfNoteEntryPtrList&);
8077 #else
8078  AsmElfNoteEntryList.setDataPrototype("SgAsmElfNoteEntryPtrList", "entries", "",
8079  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8080 #endif
8081 
8082  DECLARE_OTHERS(AsmElfNoteEntryList);
8083 #if defined(SgAsmElfNoteEntryList_OTHERS) || defined(DOCUMENTATION)
8084 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8085  private:
8086  friend class boost::serialization::access;
8087 
8088  template<class S>
8089  void serialize(S &s, const unsigned /*version*/) {
8090  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8091  s & BOOST_SERIALIZATION_NVP(p_entries);
8092  }
8093 #endif
8094 #endif // SgAsmElfNoteEntryList_OTHERS
8095 
8096 #ifdef DOCUMENTATION
8097  };
8098 #endif
8099 
8101 
8102  DECLARE_LEAF_CLASS(AsmElfNoteEntry);
8103  IS_SERIALIZABLE(AsmElfNoteEntry);
8104 
8105 #ifdef DOCUMENTATION
8106 
8108  public:
8109 #endif
8110 
8111 #ifdef DOCUMENTATION
8112 
8117  unsigned get_type() const;
8118  void set_type(unsigned);
8120 #else
8121  AsmElfNoteEntry.setDataPrototype("unsigned", "type", "= 0",
8122  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8123 #endif
8124 
8125 #ifdef DOCUMENTATION
8126  // documented below
8127 #else
8128  AsmElfNoteEntry.setDataPrototype("SgAsmGenericString*", "name", "= NULL",
8129  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8130 #endif
8131 
8132 #ifdef DOCUMENTATION
8133 
8138  const SgUnsignedCharList& get_payload() const;
8139  void set_payload(const SgUnsignedCharList&);
8141 #else
8142  AsmElfNoteEntry.setDataPrototype("SgUnsignedCharList", "payload", "",
8143  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8144 #endif
8145 
8146  DECLARE_OTHERS(AsmElfNoteEntry);
8147 #if defined(SgAsmElfNoteEntry_OTHERS) || defined(DOCUMENTATION)
8148 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8149  private:
8150  friend class boost::serialization::access;
8151 
8152  template<class S>
8153  void serialize(S &s, const unsigned /*version*/) {
8154  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8155  s & BOOST_SERIALIZATION_NVP(p_type);
8156  s & BOOST_SERIALIZATION_NVP(p_name);
8157  s & BOOST_SERIALIZATION_NVP(p_payload);
8158  }
8159 #endif
8160 
8161  public:
8164  : p_type(0), p_name(NULL) {
8165  ctor(section);
8166  }
8167 
8174  SgAsmGenericString *get_name() const;
8175  void set_name(SgAsmGenericString *name);
8181  rose_addr_t parse(rose_addr_t starting_offset);
8182 
8186  rose_addr_t unparse(std::ostream &f, rose_addr_t starting_offset);
8187 
8189  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
8190 
8194  void set_payload(const void*, size_t nbytes);
8195 
8197  rose_addr_t calculate_size() const;
8198 
8199  private:
8200  void ctor(SgAsmElfNoteSection *section);
8201 #endif // SgAsmElfNoteEntry_OTHERS
8202 
8203 #ifdef DOCUMENTATION
8204  };
8205 #endif
8206 
8207 
8208 
8210 
8211  /*************************************************************************************************************************</