ROSE  0.11.98.0
Unparser/Powerpc.h
1 #ifndef ROSE_BinaryAnalysis_Unparser_Powerpc_H
2 #define ROSE_BinaryAnalysis_Unparser_Powerpc_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/Unparser/Base.h>
6 
7 #include <Rose/BinaryAnalysis/BasicTypes.h>
8 
9 namespace Rose {
10 namespace BinaryAnalysis {
11 namespace Unparser {
12 
13 std::string unparsePowerpcMnemonic(SgAsmPowerpcInstruction*);
14 std::string unparsePowerpcExpression(SgAsmExpression*, const LabelMap*, const RegisterDictionaryPtr&);
15 
16 struct PowerpcSettings: public Settings {};
17 
18 class Powerpc: public Base {
19  PowerpcSettings settings_;
20 
21 protected:
22  explicit Powerpc(const PowerpcSettings &settings)
23  : settings_(settings) {}
24 
25 public:
26  static Ptr instance(const PowerpcSettings &settings = PowerpcSettings()) {
27  return Ptr(new Powerpc(settings));
28  }
29 
30  Ptr copy() const override {
31  return instance(settings());
32  }
33 
34  const PowerpcSettings& settings() const override { return settings_; }
35  PowerpcSettings& settings() override { return settings_; }
36 
37 protected:
38  void emitInstruction(std::ostream&, SgAsmInstruction*, State&) const override;
39  void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const override;
40 
41 private:
42  void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
43 };
44 
45 } // namespace
46 } // namespace
47 } // namespace
48 
49 #endif
50 #endif
Base class for machine instructions.
Main namespace for the ROSE library.
Settings that control unparsing.
Represents one PowerPC machine instruction.
Base class for expressions.
Binary analysis.