ROSE 0.11.145.147
DispatcherMips.h
1#ifndef ROSE_BinaryAnalysis_InstructionSemantics_DispatcherMips_H
2#define ROSE_BinaryAnalysis_InstructionSemantics_DispatcherMips_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5
6#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/Dispatcher.h>
7
8#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
9#include <boost/serialization/access.hpp>
10#include <boost/serialization/base_object.hpp>
11#include <boost/serialization/export.hpp>
12#include <boost/serialization/nvp.hpp>
13#include <boost/serialization/split_member.hpp>
14#endif
15
16namespace Rose {
17namespace BinaryAnalysis {
18namespace InstructionSemantics {
19
20namespace Mips {
21 struct IP_lwl;
22 struct IP_lwr;
23}
24
26using DispatcherMipsPtr = boost::shared_ptr<class DispatcherMips>;
27
32public:
35
38
39public:
48#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
49private:
50 friend class boost::serialization::access;
51
52 template<class S>
53 void save(S &s, const unsigned /*version*/) const {
54 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
55 }
56
57 template<class S>
58 void load(S &s, const unsigned /*version*/) {
59 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
60 initializeDispatchTable();
61 initializeMemoryState();
62 }
63
64 BOOST_SERIALIZATION_SPLIT_MEMBER();
65#endif
66
67public:
68 ~DispatcherMips();
69protected:
70 DispatcherMips() = delete;
71 explicit DispatcherMips(const Architecture::BaseConstPtr&);
73
74public:
79
82
85
86public:
87 // documented in the base class
89 virtual int iprocKey(SgAsmInstruction*) const override;
90
91private:
92 // Initialize the dispatch table that handles each kind of instruction
93 void initializeDispatchTable();
94
95 // Initialize memory state, such as the default byte order
96 void initializeMemoryState();
97
98
99 // Merge unaligned memory with contents of register
102
103 // Classes that are allowed to mergeLeft and mergeRight
104 friend struct Mips::IP_lwl;
105 friend struct Mips::IP_lwr;
106};
107
108} // namespace
109} // namespace
110} // namespace
111
112#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
114#endif
115
116#endif
117#endif
Dispatches instructions through the RISC layer.
Definition Dispatcher.h:43
Dispatches MIPS instructions through the semantics layer.
DispatcherMipsPtr Ptr
Shared-ownership pointer.
virtual BaseSemantics::DispatcherPtr create(const BaseSemantics::RiscOperatorsPtr &) const override
Virtual constructor.
const RegisterDescriptor REG_HI
Cached register.
const RegisterDescriptor REG_FP
Cached register.
const RegisterDescriptor REG_SP
Cached register.
static Ptr instance(const Architecture::BaseConstPtr &, const BaseSemantics::RiscOperatorsPtr &)
Constructor.
const RegisterDescriptor REG_R1
Cached register.
static Ptr promote(const BaseSemantics::DispatcherPtr &)
Dynamic cast to DispatcherMipsPtr with assertion.
const RegisterDescriptor REG_LO
Cached register.
const RegisterDescriptor REG_R0
Cached register.
static Ptr instance(const Architecture::BaseConstPtr &)
Construct a prototypical dispatcher.
virtual int iprocKey(SgAsmInstruction *) const override
Given an instruction, return the InsnProcessor key that can be used as an index into the iproc_table.
const RegisterDescriptor REG_RA
Cached register.
const RegisterDescriptor REG_PC
Cached register.
Describes (part of) a physical CPU register.
Base class for machine instructions.
std::shared_ptr< const Base > BaseConstPtr
Reference counted pointer for Architecture::Base.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
boost::shared_ptr< class DispatcherMips > DispatcherMipsPtr
Shared-ownership pointer to a MIPS instruction dispatcher.
The ROSE library.