1#ifndef ROSE_BinaryAnalysis_InstructionProvider_H
2#define ROSE_BinaryAnalysis_InstructionProvider_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/BasicTypes.h>
7#include <Rose/BinaryAnalysis/ByteOrder.h>
8#include <Rose/BinaryAnalysis/CallingConvention/BasicTypes.h>
10#include <Sawyer/HashMap.h>
11#include <Sawyer/SharedPointer.h>
13#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
14#include <boost/serialization/access.hpp>
18namespace BinaryAnalysis {
46#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
48 friend class boost::serialization::access;
50 template<
class Archive>
51 void save(Archive&,
const unsigned version)
const;
53 template<
class Archive>
54 void load(Archive&,
const unsigned version);
56 BOOST_SERIALIZATION_SPLIT_MEMBER();
Provides and caches instructions.
void showStatistics() const
Print some partitioner performance statistics.
static Ptr instance(const Architecture::BaseConstPtr &, const MemoryMapPtr &)
Allocating Constructor.
Sawyer::SharedPointer< InstructionProvider > Ptr
Shared-ownership pointer.
RegisterDescriptor instructionPointerRegister() const
Register used as the instruction pointer.
Disassembler::BasePtr disassembler() const
Returns the disassembler.
size_t wordSize() const
Word size in bits.
InstructionSemantics::BaseSemantics::DispatcherPtr dispatcher(const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &) const
Instruction dispatcher.
RegisterDescriptor stackSegmentRegister() const
Register used as a segment to access stack memory.
void insert(SgAsmInstruction *)
Insert an instruction into the cache.
size_t instructionAlignment() const
Alignment requirement for instructions.
RegisterDictionaryPtr registerDictionary() const
Returns the register dictionary.
Sawyer::Container::HashMap< rose_addr_t, SgAsmInstruction * > InsnMap
Mapping from address to instruction.
RegisterDescriptor stackPointerRegister() const
Register used as a user-mode stack pointer.
SgAsmInstruction * operator[](rose_addr_t va) const
Returns the instruction at the specified virtual address, or null.
ByteOrder::Endianness defaultByteOrder() const
Default memory byte order.
RegisterDescriptor stackFrameRegister() const
Register used for function call frames.
RegisterDescriptor callReturnRegister() const
Register holding a function call's return address.
size_t nCached() const
Returns number of cached starting addresses.
const CallingConvention::Dictionary & callingConventions() const
Returns the calling convention dictionary.
bool isDisassemblerEnabled() const
Enable or disable the disassembler.
Describes (part of) a physical CPU register.
Container associating values with keys.
size_t size() const
Number of nodes, keys, or values in this container.
Base class for reference counted objects.
Reference-counting intrusive smart pointer.
Base class for machine instructions.
std::shared_ptr< const Base > BaseConstPtr
Reference counted pointer for Architecture::Base.
std::vector< DefinitionPtr > Dictionary
An ordered collection of calling convention definitions.
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.