ROSE 0.11.145.147
Rose/BinaryAnalysis/Disassembler/Exception.h
1#ifndef ROSE_BinaryAnalysis_Disassembler_Exception_H
2#define ROSE_BinaryAnalysis_Disassembler_Exception_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5
6#include <Rose/Exception.h>
7
8#include <Cxx_GrammarDeclarations.h>
9#include <sageContainer.h>
10
11#include <ostream>
12#include <string>
13
14namespace Rose {
15namespace BinaryAnalysis {
16namespace Disassembler {
17
20public:
22 Exception(const std::string &reason)
23 : Rose::Exception(reason), ip(0), bit(0), insn(NULL)
24 {}
25
27 Exception(const std::string &reason, rose_addr_t ip)
28 : Rose::Exception(reason), ip(ip), bit(0), insn(NULL)
29 {}
30
32 Exception(const std::string &reason, rose_addr_t ip, const SgUnsignedCharList &raw_data, size_t bit)
33 : Rose::Exception(reason), ip(ip), bytes(raw_data), bit(bit), insn(NULL)
34 {}
35
37 Exception(const std::string &reason, SgAsmInstruction*);
38
39 ~Exception() throw() {}
40
41 void print(std::ostream&) const;
42 friend std::ostream& operator<<(std::ostream &o, const Exception &e);
43
44 rose_addr_t ip;
45 SgUnsignedCharList bytes;
48 size_t bit;
51};
52
53} // namespace
54} // namespace
55} // namespace
56#endif
57#endif
Exception(const std::string &reason, SgAsmInstruction *)
An exception bound to a particular instruction being assembled.
Exception(const std::string &reason)
A bare exception not bound to any particular instruction.
size_t bit
Bit offset in instruction byte sequence where disassembly failed (bit/8 is the index into the "bytes"...
Exception(const std::string &reason, rose_addr_t ip, const SgUnsignedCharList &raw_data, size_t bit)
An exception bound to a particular instruction being disassembled.
SgAsmInstruction * insn
Instruction associated with an assembly error.
Exception(const std::string &reason, rose_addr_t ip)
An exception bound to a virtual address but no raw data or instruction.
SgUnsignedCharList bytes
Bytes (partial) of failed disassembly, including byte at failure.
rose_addr_t ip
Virtual address where failure occurred; zero if no associated instruction.
Base class for all ROSE exceptions.
Base class for machine instructions.
The ROSE library.