ROSE 0.11.145.147
Unparser/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#include <Rose/BinaryAnalysis/BasicTypes.h>
8
9namespace Rose {
10namespace BinaryAnalysis {
11namespace Unparser {
12
13std::string unparseX86Mnemonic(SgAsmX86Instruction*);
14std::string unparseX86Register(SgAsmInstruction*, RegisterDescriptor, RegisterDictionaryPtr);
15std::string unparseX86Register(RegisterDescriptor, const RegisterDictionaryPtr&);
16std::string unparseX86Expression(SgAsmExpression*, const LabelMap*, const RegisterDictionaryPtr&, bool leaMode);
17std::string unparseX86Expression(SgAsmExpression*, const LabelMap*, const RegisterDictionaryPtr&);
18
20struct X86Settings: public Settings {};
21
23class X86: public Base {
24 X86Settings settings_;
25
26protected:
27 explicit X86(const Architecture::BaseConstPtr&, const X86Settings&);
28
29public:
30 ~X86();
31
32public:
33 static Ptr instance(const Architecture::BaseConstPtr&, const X86Settings& = X86Settings());
34
35 Ptr copy() const override;
36
37 const X86Settings& settings() const override { return settings_; }
38 X86Settings& settings() override { return settings_; }
39
40protected:
41 void emitInstructionMnemonic(std::ostream&, SgAsmInstruction*, State&) const override;
42 void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const override;
43 void emitTypeName(std::ostream&, SgAsmType*, State&) const override;
44
45private:
46 void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
47};
48
49} // namespace
50} // namespace
51} // namespace
52
53#endif
54#endif
Abstract base class for unparsers.
Unparser for x86 instruction sets.
X86Settings & settings() override
Property: Settings associated with this unparser.
void emitTypeName(std::ostream &, SgAsmType *, State &) const override
Mid-level unparser function.
void emitInstructionMnemonic(std::ostream &, SgAsmInstruction *, State &) const override
Mid-level unparser function.
const X86Settings & settings() const override
Property: Settings associated with this unparser.
void emitOperandBody(std::ostream &, SgAsmExpression *, State &) const override
Mid-level unparser function.
Base class for expressions.
Base class for machine instructions.
Base class for binary types.
Represents one Intel x86 machine instruction.
std::shared_ptr< const Base > BaseConstPtr
Reference counted pointer for Architecture::Base.
std::map< uint64_t, std::string > LabelMap
Map from address to label.
Sawyer::SharedPointer< RegisterDictionary > RegisterDictionaryPtr
Reference counting pointer.
The ROSE library.
Settings that control unparsing.
Settings specific to the x86 unparser.