1 #ifndef ROSE_BinaryAnalysis_InstructionSemantics_DispatcherAarch32_H
2 #define ROSE_BinaryAnalysis_InstructionSemantics_DispatcherAarch32_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_ASM_AARCH32
6 #include <Rose/BinaryAnalysis/BasicTypes.h>
7 #include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics.h>
9 #include <boost/serialization/access.hpp>
10 #include <boost/serialization/base_object.hpp>
11 #include <boost/serialization/export.hpp>
12 #include <boost/serialization/split_member.hpp>
15 namespace BinaryAnalysis {
16 namespace InstructionSemantics {
19 using DispatcherAarch32Ptr = boost::shared_ptr<class DispatcherAarch32>;
27 using Ptr = DispatcherAarch32Ptr;
36 RegisterDescriptor REG_PC, REG_SP, REG_LR;
37 RegisterDescriptor REG_PSTATE_N, REG_PSTATE_Z, REG_PSTATE_C, REG_PSTATE_V, REG_PSTATE_T;
38 RegisterDescriptor REG_PSTATE_E, REG_PSTATE_Q, REG_PSTATE_GE;
39 RegisterDescriptor REG_PSTATE_NZCV;
40 RegisterDescriptor REG_SPSR, REG_CPSR;
41 RegisterDescriptor REG_DTRTX;
42 RegisterDescriptor REG_UNKNOWN;
45 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
47 friend class boost::serialization::access;
50 void save(S &s,
const unsigned )
const {
51 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
55 void load(S &s,
const unsigned ) {
56 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
57 initializeRegisterDescriptors();
58 initializeInsnDispatchTable();
62 BOOST_SERIALIZATION_SPLIT_MEMBER();
77 static DispatcherAarch32Ptr instance();
91 void initializeRegisterDescriptors();
96 void initializeInsnDispatchTable();
99 void initializeMemory();
103 RegisterDescriptor instructionPointerRegister()
const override;
104 RegisterDescriptor stackPointerRegister()
const override;
105 RegisterDescriptor stackFrameRegister()
const override;
106 RegisterDescriptor callReturnRegister()
const override;
129 void setThumbMode(SgAsmAarch32Instruction*);
156 using TwoValues = std::tuple<BaseSemantics::SValuePtr, BaseSemantics::SValuePtr>;
158 enum class SrType { LSL, LSR, ASR, ROR, RRX };
192 BranchType branchType);
220 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
221 BOOST_CLASS_EXPORT_KEY(Rose::BinaryAnalysis::InstructionSemantics::DispatcherAarch32);
const char * SrType(int64_t)
Convert Rose::BinaryAnalysis::InstructionSemantics::DispatcherAarch32::SrType enum constant to a stri...
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
const char * BranchType(int64_t)
Convert Rose::BinaryAnalysis::InstructionSemantics::DispatcherAarch32::BranchType enum constant to a ...
Base class for machine instructions.
Unsigned signExtend(Unsigned src, size_t n)
Sign extend part of a value to the full width of the src type.
bool signBit(T value)
Returns true if the sign bit is set, false if clear.
Sawyer::SharedPointer< RegisterDictionary > RegisterDictionaryPtr
Reference counting pointer.
Main namespace for the ROSE library.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
Dispatches instructions through the RISC layer.
ROSE_DLL_API void load(SgProject *project, std::list< std::string > const &filepaths)
Load ASTs that have been saved to files.
Base class for expressions.
std::string join(const std::string &separator, const Container &container)
Join individual items to form a single string.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.