ROSE 0.11.145.147
Unparser/Mips.h
1#ifndef ROSE_BinaryAnalysis_Unparser_Mips_H
2#define ROSE_BinaryAnalysis_Unparser_Mips_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 unparseMipsMnemonic(SgAsmMipsInstruction*);
14std::string unparseMipsRegister(SgAsmInstruction*, RegisterDescriptor, RegisterDictionaryPtr);
15std::string unparseMipsExpression(SgAsmExpression*, const LabelMap*, const RegisterDictionaryPtr&);
16
18struct MipsSettings: public Settings {};
19
21class Mips: public Base {
22 MipsSettings settings_;
23
24protected:
25 explicit Mips(const Architecture::BaseConstPtr&, const MipsSettings&);
26
27public:
28 ~Mips();
29
30public:
31 static Ptr instance(const Architecture::BaseConstPtr&, const MipsSettings& = MipsSettings());
32
33 Ptr copy() const override;
34
35 const MipsSettings& settings() const override { return settings_; }
36 MipsSettings& settings() override { return settings_; }
37
38protected:
39 void emitInstruction(std::ostream&, SgAsmInstruction*, State&) const override;
40 void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const override;
41
42private:
43 void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
44};
45
46} // namespace
47} // namespace
48} // namespace
49
50#endif
51#endif
Abstract base class for unparsers.
Unparser for the MIPS instruction set.
void emitOperandBody(std::ostream &, SgAsmExpression *, State &) const override
Mid-level unparser function.
MipsSettings & settings() override
Property: Settings associated with this unparser.
const MipsSettings & settings() const override
Property: Settings associated with this unparser.
void emitInstruction(std::ostream &, SgAsmInstruction *, State &) const override
Mid-level unparser function.
Base class for expressions.
Base class for machine instructions.
Represents one MIPS 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 specific to the MIP unparser.
Settings that control unparsing.