1#ifndef ROSE_BinaryAnalysis_Disassembler_Base_H
2#define ROSE_BinaryAnalysis_Disassembler_Base_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/Architecture/BasicTypes.h>
7#include <Rose/BinaryAnalysis/Disassembler/BasicTypes.h>
8#include <Rose/BinaryAnalysis/Disassembler/Exception.h>
9#include <Rose/BinaryAnalysis/InstructionMap.h>
10#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics.h>
11#include <Rose/BinaryAnalysis/MemoryMap.h>
12#include <Rose/BinaryAnalysis/Unparser/Settings.h>
13#include <Rose/Diagnostics.h>
15#include "integerOps.h"
18#include <boost/serialization/access.hpp>
19#include <boost/serialization/string.hpp>
20#include <boost/serialization/version.hpp>
28namespace BinaryAnalysis {
29namespace Disassembler {
71#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
73 friend class boost::serialization::access;
76 void serialize(S &s,
const unsigned version) {
77 s & BOOST_SERIALIZATION_NVP(REG_IP);
78 s & BOOST_SERIALIZATION_NVP(REG_SS);
80 s & BOOST_SERIALIZATION_NVP(REG_SF);
114 virtual const std::string&
name()
const;
192 size_t wordSizeBytes() const ROSE_DEPRECATED("use
bytesPerWord()");
206BOOST_CLASS_VERSION(
Rose::BinaryAnalysis::Disassembler::
Base, 3);
Virtual base class for instruction disassemblers.
size_t instructionAlignment() const
Property: Instruction alignment requirement.
virtual SgAsmInstruction * makeUnknownInstruction(const Exception &)=0
Makes an unknown instruction from an exception.
virtual const std::string & name() const
Property: Name.
Unparser::BasePtr unparser() const
Unparser.
size_t instructionAlignment_
Positive alignment constraint for instruction addresses.
virtual Ptr clone() const =0
Creates a new copy of a disassembler.
virtual size_t bytesPerWord() const
Property: Bytes per word for the architecture.
SgAsmInstruction * disassembleOne(const unsigned char *buf, rose_addr_t buf_va, size_t buf_size, rose_addr_t start_va, AddressSet *successors=NULL)
Similar in functionality to the disassembleOne method that takes a MemoryMap argument,...
Architecture::BaseConstPtr architecture() const
Property: Architecture.
virtual SgAsmInstruction * disassembleOne(const MemoryMap::Ptr &map, rose_addr_t start_va, AddressSet *successors=NULL)=0
This is the lowest level disassembly function and is implemented in the architecture-specific subclas...
static SgAsmInstruction * find_instruction_containing(const InstructionMap &insns, rose_addr_t va)
Finds the highest-address instruction that contains the byte at the specified virtual address.
RegisterDescriptor REG_LINK
Register descriptors initialized during construction.
void mark_referenced_instructions(SgAsmInterpretation *, const MemoryMap::Ptr &, const InstructionMap &)
Marks parts of the file that correspond to instructions as having been referenced.
virtual ByteOrder::Endianness byteOrder() const
Property: Byte order of memory.
AddressSet get_block_successors(const InstructionMap &, bool &complete)
Calculates the successor addresses of a basic block and adds them to a successors set.
Exception thrown by the disassemblers.
Describes (part of) a physical CPU register.
Base class for reference counted objects.
Base class for machine instructions.
Represents an interpretation of a binary container.
std::shared_ptr< const Base > BaseConstPtr
Reference counted pointer for Architecture::Base.