ROSE 0.11.145.147
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
9namespace Rose {
10namespace BinaryAnalysis {
11namespace Unparser {
12
13std::string unparsePowerpcMnemonic(SgAsmPowerpcInstruction*);
14std::string unparsePowerpcExpression(SgAsmExpression*, const LabelMap*, const RegisterDictionaryPtr&);
15
17struct PowerpcSettings: public Settings {};
18
20class Powerpc: public Base {
21 PowerpcSettings settings_;
22
23protected:
24 explicit Powerpc(const Architecture::BaseConstPtr&, const PowerpcSettings&);
25
26public:
27 ~Powerpc();
28
29public:
30 static Ptr instance(const Architecture::BaseConstPtr&, const PowerpcSettings& = PowerpcSettings());
31
32 Ptr copy() const override;
33
34 const PowerpcSettings& settings() const override { return settings_; }
35 PowerpcSettings& settings() override { return settings_; }
36
37protected:
38 void emitInstruction(std::ostream&, SgAsmInstruction*, State&) const override;
39 void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const override;
40
41private:
42 void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
43};
44
45} // namespace
46} // namespace
47} // namespace
48
49#endif
50#endif
Abstract base class for unparsers.
Unparser for PowerPC instruction sets.
void emitOperandBody(std::ostream &, SgAsmExpression *, State &) const override
Mid-level unparser function.
PowerpcSettings & settings() override
Property: Settings associated with this unparser.
void emitInstruction(std::ostream &, SgAsmInstruction *, State &) const override
Mid-level unparser function.
const PowerpcSettings & settings() const override
Property: Settings associated with this unparser.
Base class for expressions.
Base class for machine instructions.
Represents one PowerPC 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 PowerPC unparser.
Settings that control unparsing.