ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Disassembler::Exception Class Reference

Exception thrown by the disassemblers. More...

#include <Disassembler.h>

Inheritance diagram for Disassembler::Exception:
Collaboration diagram for Disassembler::Exception:

Public Member Functions

 Exception (const std::string &reason)
 A bare exception not bound to any particular instruction. More...
 
 Exception (const std::string &reason, rose_addr_t ip)
 An exception bound to a virtual address but no raw data or instruction. More...
 
 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. More...
 
 Exception (const std::string &reason, SgAsmInstruction *insn)
 An exception bound to a particular instruction being assembled. More...
 
 ~Exception () throw ()
 
void print (std::ostream &) const
 

Public Attributes

rose_addr_t ip
 Virtual address where failure occurred; zero if no associated instruction. More...
 
SgUnsignedCharList bytes
 Bytes (partial) of failed disassembly, including byte at failure. More...
 
size_t bit
 Bit offset in instruction byte sequence where disassembly failed (bit/8 is the index into the "bytes" list, while bit%8 is the bit within that byte. More...
 
SgAsmInstructioninsn
 Instruction associated with an assembly error. More...
 

Friends

std::ostream & operator<< (std::ostream &o, const Exception &e)
 

Detailed Description

Exception thrown by the disassemblers.

Definition at line 119 of file Disassembler.h.

Constructor & Destructor Documentation

Disassembler::Exception::Exception ( const std::string &  reason)
inline

A bare exception not bound to any particular instruction.

Definition at line 122 of file Disassembler.h.

Disassembler::Exception::Exception ( const std::string &  reason,
rose_addr_t  ip 
)
inline

An exception bound to a virtual address but no raw data or instruction.

Definition at line 126 of file Disassembler.h.

Disassembler::Exception::Exception ( const std::string &  reason,
rose_addr_t  ip,
const SgUnsignedCharList raw_data,
size_t  bit 
)
inline

An exception bound to a particular instruction being disassembled.

Definition at line 130 of file Disassembler.h.

Disassembler::Exception::Exception ( const std::string &  reason,
SgAsmInstruction insn 
)
inline

An exception bound to a particular instruction being assembled.

Definition at line 134 of file Disassembler.h.

Disassembler::Exception::~Exception ( )
throw (
)
inline

Definition at line 137 of file Disassembler.h.

Member Function Documentation

void Disassembler::Exception::print ( std::ostream &  o) const

Definition at line 32 of file Disassembler.C.

References StringUtility::addrToString(), bit, bytes, insn, and ip.

Referenced by operator<<().

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const Exception e 
)
friend

Definition at line 55 of file Disassembler.C.

Member Data Documentation

rose_addr_t Disassembler::Exception::ip

Virtual address where failure occurred; zero if no associated instruction.

Definition at line 142 of file Disassembler.h.

Referenced by Disassembler::disassembleBlock(), DisassemblerArm::make_unknown_instruction(), and print().

SgUnsignedCharList Disassembler::Exception::bytes

Bytes (partial) of failed disassembly, including byte at failure.

Empty if the exception is not associated with a particular byte sequence, such as if an attempt was made to disassemble at an invalid address.

Definition at line 143 of file Disassembler.h.

Referenced by Disassembler::disassembleBlock(), DisassemblerArm::make_unknown_instruction(), DisassemblerX86::make_unknown_instruction(), and print().

size_t Disassembler::Exception::bit

Bit offset in instruction byte sequence where disassembly failed (bit/8 is the index into the "bytes" list, while bit%8 is the bit within that byte.

Definition at line 146 of file Disassembler.h.

Referenced by print().

SgAsmInstruction* Disassembler::Exception::insn

Instruction associated with an assembly error.

Definition at line 148 of file Disassembler.h.

Referenced by print().


The documentation for this class was generated from the following files: