ROSE 0.11.145.147
Disassembler/Cil.h
1#ifndef ROSE_BinaryAnalysis_Disassembler_Cil_H
2#define ROSE_BinaryAnalysis_Disassembler_Cil_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5#include <Rose/BinaryAnalysis/Disassembler/Base.h>
6
7#include <Rose/BinaryAnalysis/Architecture/BasicTypes.h>
8#include <Rose/BinaryAnalysis/InstructionEnumsCil.h>
9
10#include <boost/serialization/access.hpp>
11#include <boost/serialization/base_object.hpp>
12
13namespace Rose {
14namespace BinaryAnalysis {
15namespace Disassembler {
16
21class Cil: public Base {
22public:
25
27 // Constructors
29protected:
30 explicit Cil(const Architecture::BaseConstPtr&);
31
32public:
35
36 virtual ~Cil();
37
38 virtual Base::Ptr clone() const override;
39
41 // Public methods
43public:
44 virtual SgAsmInstruction* disassembleOne(const MemoryMap::Ptr&, rose_addr_t va,
45 AddressSet* successors=nullptr) override;
46
48
49private:
50 SgAsmCilInstruction* makeUnknownInstruction(rose_addr_t va, SgUnsignedCharList &bytes, size_t size);
51 SgAsmCilInstruction* makeInstruction(rose_addr_t, SgUnsignedCharList& bytes/*in,out*/, size_t, CilInstructionKind,
52 SgAsmExpression* operand=nullptr) const;
53
55 // Serialization
57#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
58private:
59 friend class boost::serialization::access;
60
61 template<class S>
62 void serialize(S &s, const unsigned /*version*/) {
63 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Disassembler::Base);
64 }
65#endif
66};
67
68} // namespace
69} // namespace
70} // namespace
71
72#endif
73#endif
Virtual base class for instruction disassemblers.
virtual SgAsmInstruction * makeUnknownInstruction(const Disassembler::Exception &) override
Makes an unknown instruction from an exception.
virtual Base::Ptr clone() const override
Creates a new copy of a disassembler.
virtual SgAsmInstruction * disassembleOne(const MemoryMap::Ptr &, rose_addr_t va, AddressSet *successors=nullptr) override
This is the lowest level disassembly function and is implemented in the architecture-specific subclas...
static Ptr instance(const Architecture::BaseConstPtr &)
Allocating constructor.
Reference-counting intrusive smart pointer.
Base class for expressions.
Base class for machine instructions.
std::shared_ptr< const Base > BaseConstPtr
Reference counted pointer for Architecture::Base.
The ROSE library.