ROSE  0.11.96.0
X86.h
1 #ifndef ROSE_BinaryAnalysis_Unparser_X86_H
2 #define ROSE_BinaryAnalysis_Unparser_X86_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/Unparser/Base.h>
6 
7 namespace Rose {
8 namespace BinaryAnalysis {
9 namespace Unparser {
10 
11 std::string unparseX86Mnemonic(SgAsmX86Instruction*);
12 std::string unparseX86Register(SgAsmInstruction*, RegisterDescriptor, const RegisterDictionary*);
13 std::string unparseX86Register(RegisterDescriptor, const RegisterDictionary*);
14 std::string unparseX86Expression(SgAsmExpression*, const LabelMap*, const RegisterDictionary*, bool leaMode);
15 std::string unparseX86Expression(SgAsmExpression*, const LabelMap*, const RegisterDictionary*);
16 
17 struct X86Settings: public Settings {};
18 
19 class X86: public Base {
20  X86Settings settings_;
21 
22 protected:
23  explicit X86(const X86Settings &settings)
24  : settings_(settings) {}
25 
26 public:
27  static Ptr instance(const X86Settings &settings = X86Settings()) {
28  return Ptr(new X86(settings));
29  }
30 
31  Ptr copy() const override {
32  return instance(settings());
33  }
34 
35  const X86Settings& settings() const override { return settings_; }
36  X86Settings& settings() override { return settings_; }
37 
38 protected:
39  void emitInstructionMnemonic(std::ostream&, SgAsmInstruction*, State&) const override;
40  void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const override;
41  void emitTypeName(std::ostream&, SgAsmType*, State&) const override;
42 
43 private:
44  void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
45 };
46 
47 } // namespace
48 } // namespace
49 } // namespace
50 
51 #endif
52 #endif
Base class for machine instructions.
Main namespace for the ROSE library.
Settings that control unparsing.
Represents one Intel x86 machine instruction.
Base class for expressions.
Base class for binary types.