ROSE 0.11.145.147
Rose/BinaryAnalysis/Disassembler/Jvm.h
1#ifndef ROSE_BinaryAnalysis_Disassembler_Jvm_H
2#define ROSE_BinaryAnalysis_Disassembler_Jvm_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5
6#include <Rose/BinaryAnalysis/Architecture/BasicTypes.h>
7#include <Rose/BinaryAnalysis/Disassembler/Base.h>
8#include <boost/serialization/access.hpp>
9#include <boost/serialization/base_object.hpp>
10
11namespace Rose {
12namespace BinaryAnalysis {
13namespace Disassembler {
14
19class Jvm: public Base {
20public:
23
25 // Constructors
27protected:
28 explicit Jvm(const Architecture::BaseConstPtr&);
29
30public:
33
34 virtual ~Jvm();
35
36 virtual Base::Ptr clone() const override;
37
39 // Public methods
41public:
42 virtual SgAsmInstruction* disassembleOne(const MemoryMap::Ptr&, rose_addr_t va,
43 AddressSet* successors=nullptr) override;
44
46
47private:
48 size_t appendTableswitch(const MemoryMap::Ptr &map, rose_addr_t start,
49 SgUnsignedCharList &chars, SgAsmOperandList* operands);
50 size_t appendLookupswitch(const MemoryMap::Ptr &map, rose_addr_t start,
51 SgUnsignedCharList &chars, SgAsmOperandList* operands);
52 template <class T>
53 size_t appendOperand(const MemoryMap::Ptr &map, rose_addr_t va,
54 SgUnsignedCharList &chars, SgAsmOperandList* operands);
55
56 /* beginning offset to code segment being processed */
57 rose_addr_t codeOffset_;
58
59public:
60 rose_addr_t codeOffset();
61 void codeOffset(rose_addr_t offset);
62
64 // Serialization
66#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
67private:
68 friend class boost::serialization::access;
69
70 template<class S>
71 void serialize(S &s, const unsigned /*version*/) {
72 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Disassembler::Base);
73 }
74#endif
75};
76
77} // namespace
78} // namespace
79} // namespace
80
81#endif
82#endif
Virtual base class for instruction disassemblers.
virtual SgAsmInstruction * makeUnknownInstruction(const Disassembler::Exception &) override
Makes an unknown instruction from an exception.
static Ptr instance(const Architecture::BaseConstPtr &)
Allocating constructor.
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...
Reference-counting intrusive smart pointer.
Base class for machine instructions.
List of operands for an instruction.
std::shared_ptr< const Base > BaseConstPtr
Reference counted pointer for Architecture::Base.
The ROSE library.