ROSE 0.11.145.237
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
9#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
10#include <boost/serialization/access.hpp>
11#include <boost/serialization/base_object.hpp>
12#endif
13
14namespace Rose {
15namespace BinaryAnalysis {
16namespace Disassembler {
17
22class Jvm: public Base {
23public:
26
28 // Constructors
30protected:
31 explicit Jvm(const Architecture::BaseConstPtr&);
32
33public:
36
37 virtual ~Jvm();
38
39 virtual Base::Ptr clone() const override;
40
42 // Public methods
44public:
45 virtual SgAsmInstruction* disassembleOne(const MemoryMap::Ptr&, Address va, AddressSet* successors=nullptr) override;
46
48
49private:
50 size_t appendTableswitch(const MemoryMap::Ptr &map, Address start, SgUnsignedCharList &chars, SgAsmOperandList* operands);
51 size_t appendLookupswitch(const MemoryMap::Ptr &map, Address start, SgUnsignedCharList &chars, SgAsmOperandList* operands);
52 template <class T>
53 size_t appendOperand(const MemoryMap::Ptr &map, Address va, SgUnsignedCharList &chars, SgAsmOperandList* operands);
54
55 /* beginning offset to code segment being processed */
56 Address codeOffset_;
57
58public:
59 Address codeOffset();
60 void codeOffset(Address offset);
61
63 // Serialization
65#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
66private:
67 friend class boost::serialization::access;
68
69 template<class S>
70 void serialize(S &s, const unsigned /*version*/) {
71 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Disassembler::Base);
72 }
73#endif
74};
75
76} // namespace
77} // namespace
78} // namespace
79
80#endif
81#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 &, Address 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.
std::uint64_t Address
Address.
Definition Address.h:11
The ROSE library.