ROSE  0.9.10.91
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::Unparser::X86 Class Reference

Description

Definition at line 12 of file BinaryUnparserX86.h.

Inheritance diagram for Rose::BinaryAnalysis::Unparser::X86:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::Unparser::X86:
Collaboration graph
[legend]

Public Member Functions

Ptr copy () const ROSE_OVERRIDE
 
const X86Settingssettings () const ROSE_OVERRIDE
 
X86Settingssettings () ROSE_OVERRIDE
 
- Public Member Functions inherited from Rose::BinaryAnalysis::Unparser::Base
Ptr nextUnparser () const
 
void operator() (std::ostream &out, const Partitioner2::Partitioner &p) const
 Emit the entity to an output stream. More...
 
void operator() (std::ostream &out, const Partitioner2::Partitioner &p, SgAsmInstruction *insn) const
 Emit the entity to an output stream. More...
 
void operator() (std::ostream &out, const Partitioner2::Partitioner &p, const Partitioner2::BasicBlockPtr &bb) const
 Emit the entity to an output stream. More...
 
void operator() (std::ostream &out, const Partitioner2::Partitioner &p, const Partitioner2::DataBlockPtr &db) const
 Emit the entity to an output stream. More...
 
void operator() (std::ostream &out, const Partitioner2::Partitioner &p, const Partitioner2::FunctionPtr &f) const
 Emit the entity to an output stream. More...
 
std::string operator() (const Partitioner2::Partitioner &p) const
 Emit the entity to a string. More...
 
std::string operator() (const Partitioner2::Partitioner &p, SgAsmInstruction *insn) const
 Emit the entity to a string. More...
 
std::string operator() (const Partitioner2::Partitioner &p, const Partitioner2::BasicBlockPtr &bb) const
 Emit the entity to a string. More...
 
std::string operator() (const Partitioner2::Partitioner &p, const Partitioner2::DataBlockPtr &db) const
 Emit the entity to a string. More...
 
std::string operator() (const Partitioner2::Partitioner &p, const Partitioner2::FunctionPtr &f) const
 Emit the entity to a string. More...
 
void unparse (std::ostream &, const Partitioner2::Partitioner &) const
 High-level unparsing function. More...
 
void unparse (std::ostream &, const Partitioner2::Partitioner &, SgAsmInstruction *) const
 High-level unparsing function. More...
 
void unparse (std::ostream &, const Partitioner2::Partitioner &, const Partitioner2::BasicBlockPtr &) const
 High-level unparsing function. More...
 
void unparse (std::ostream &, const Partitioner2::Partitioner &, const Partitioner2::DataBlockPtr &) const
 High-level unparsing function. More...
 
void unparse (std::ostream &, const Partitioner2::Partitioner &, const Partitioner2::FunctionPtr &) const
 High-level unparsing function. More...
 
std::string unparse (const Partitioner2::Partitioner &) const
 High-level unparsing function. More...
 
std::string unparse (const Partitioner2::Partitioner &, SgAsmInstruction *) const
 High-level unparsing function. More...
 
std::string unparse (const Partitioner2::Partitioner &, const Partitioner2::BasicBlockPtr &) const
 High-level unparsing function. More...
 
std::string unparse (const Partitioner2::Partitioner &, const Partitioner2::DataBlockPtr &) const
 High-level unparsing function. More...
 
std::string unparse (const Partitioner2::Partitioner &, const Partitioner2::FunctionPtr &) const
 High-level unparsing function. More...
 
virtual void emitFunction (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitFunctionPrologue (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitFunctionBody (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitFunctionEpilogue (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitFunctionReasons (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitFunctionCallers (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitFunctionCallees (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitFunctionComment (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitFunctionStackDelta (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitFunctionCallingConvention (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitFunctionNoopAnalysis (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitFunctionMayReturn (std::ostream &, const Partitioner2::FunctionPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitDataBlock (std::ostream &, const Partitioner2::DataBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitDataBlockPrologue (std::ostream &, const Partitioner2::DataBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitDataBlockBody (std::ostream &, const Partitioner2::DataBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitDataBlockEpilogue (std::ostream &, const Partitioner2::DataBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitBasicBlock (std::ostream &, const Partitioner2::BasicBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitBasicBlockPrologue (std::ostream &, const Partitioner2::BasicBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitBasicBlockBody (std::ostream &, const Partitioner2::BasicBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitBasicBlockEpilogue (std::ostream &, const Partitioner2::BasicBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitBasicBlockComment (std::ostream &, const Partitioner2::BasicBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitBasicBlockSharing (std::ostream &, const Partitioner2::BasicBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitBasicBlockPredecessors (std::ostream &, const Partitioner2::BasicBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitBasicBlockSuccessors (std::ostream &, const Partitioner2::BasicBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitBasicBlockReachability (std::ostream &, const Partitioner2::BasicBlockPtr &, State &) const
 Mid-level unparser function. More...
 
virtual void emitInstruction (std::ostream &, SgAsmInstruction *, State &) const
 Mid-level unparser function. More...
 
virtual void emitInstructionPrologue (std::ostream &, SgAsmInstruction *, State &) const
 Mid-level unparser function. More...
 
virtual void emitInstructionBody (std::ostream &, SgAsmInstruction *, State &) const
 Mid-level unparser function. More...
 
virtual void emitInstructionEpilogue (std::ostream &, SgAsmInstruction *, State &) const
 Mid-level unparser function. More...
 
virtual void emitInstructionAddress (std::ostream &, SgAsmInstruction *, State &) const
 Mid-level unparser function. More...
 
virtual void emitInstructionBytes (std::ostream &, SgAsmInstruction *, State &) const
 Mid-level unparser function. More...
 
virtual void emitInstructionStackDelta (std::ostream &, SgAsmInstruction *, State &) const
 Mid-level unparser function. More...
 
virtual void emitInstructionOperands (std::ostream &, SgAsmInstruction *, State &) const
 Mid-level unparser function. More...
 
virtual void emitInstructionComment (std::ostream &, SgAsmInstruction *, State &) const
 Mid-level unparser function. More...
 
virtual void emitInstructionSemantics (std::ostream &, SgAsmInstruction *, State &) const
 Mid-level unparser function. More...
 
virtual void emitOperand (std::ostream &, SgAsmExpression *, State &) const
 Mid-level unparser function. More...
 
virtual void emitOperandPrologue (std::ostream &, SgAsmExpression *, State &) const
 Mid-level unparser function. More...
 
virtual void emitOperandEpilogue (std::ostream &, SgAsmExpression *, State &) const
 Mid-level unparser function. More...
 
virtual void emitRegister (std::ostream &, RegisterDescriptor, State &) const
 Mid-level unparser function. More...
 
virtual std::vector< std::string > emitUnsignedInteger (std::ostream &, const Sawyer::Container::BitVector &, State &) const
 Mid-level unparser function. More...
 
virtual std::vector< std::string > emitSignedInteger (std::ostream &, const Sawyer::Container::BitVector &, State &) const
 Mid-level unparser function. More...
 
virtual std::vector< std::string > emitInteger (std::ostream &, const Sawyer::Container::BitVector &, State &, bool isSigned) const
 Mid-level unparser function. More...
 
virtual bool emitAddress (std::ostream &, rose_addr_t, State &, bool always=true) const
 Mid-level unparser function. More...
 
virtual bool emitAddress (std::ostream &, const Sawyer::Container::BitVector &, State &, bool always=true) const
 Mid-level unparser function. More...
 
virtual void emitCommentBlock (std::ostream &, const std::string &, State &, const std::string &prefix=";;; ") const
 Mid-level unparser function. More...
 
- Public Member Functions inherited from Sawyer::SharedObject
 SharedObject ()
 Default constructor. More...
 
 SharedObject (const SharedObject &)
 Copy constructor. More...
 
virtual ~SharedObject ()
 Virtual destructor. More...
 
SharedObjectoperator= (const SharedObject &)
 Assignment. More...
 

Static Public Member Functions

static Ptr instance (const X86Settings &settings=X86Settings())
 
- Static Public Member Functions inherited from Rose::BinaryAnalysis::Unparser::Base
static std::string leftJustify (const std::string &, size_t nchars)
 
static std::string juxtaposeColumns (const std::vector< std::string > &content, const std::vector< size_t > &minWidths, const std::string &columnSeparator=" ")
 

Protected Member Functions

 X86 (const X86Settings &settings)
 
void emitInstructionMnemonic (std::ostream &, SgAsmInstruction *, State &) const ROSE_OVERRIDE
 Mid-level unparser function. More...
 
void emitOperandBody (std::ostream &, SgAsmExpression *, State &) const ROSE_OVERRIDE
 Mid-level unparser function. More...
 
void emitTypeName (std::ostream &, SgAsmType *, State &) const ROSE_OVERRIDE
 Mid-level unparser function. More...
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::Unparser::Base
 Base (const Ptr &nextUnparser)
 

Additional Inherited Members

- Public Types inherited from Rose::BinaryAnalysis::Unparser::Base
typedef Sawyer::SharedPointer< BasePtr
 

Member Function Documentation

void Rose::BinaryAnalysis::Unparser::X86::emitInstructionMnemonic ( std::ostream &  ,
SgAsmInstruction ,
State  
) const
protectedvirtual

Mid-level unparser function.

This function emits some entity to the specified output stream. All call-specific state is supplied in the State reference so that this function can be called with a const parser references and is thread safe per state object. The high-level functions create the state – states are not intended for end users – before calling this mid-level function.

This mid-level function uses a combination of C++ virtual function calls and object chaining. The virtual functions allow subclasses to override or augment behavior from the base class, so that, e.g., an x86 operand expression can be output in a different format than an m68k expression. The object chaining allows one unparser to override or augment the behavior of another function and is used, for example, to provide HTML wrapping around various entities.

The object chaining is implemented in two parts: every unparser object has a nextUnparser pointer and the final unparser in the list has a null pointer for this property; the state object has a frontUnparser method that returns the first unparser in this list. This mid-level function is expected to always invoke functions on the front unparser in order to give every parser in the chain a chance to influence behavior. The base implementation of this mid-level function defers to the next parser in the chain if there is one, otherwise it performs some default output that's hopefully appropriate for most unparsers.

All such chained and virtual emitters begin with the letters "emit".

Reimplemented from Rose::BinaryAnalysis::Unparser::Base.

void Rose::BinaryAnalysis::Unparser::X86::emitOperandBody ( std::ostream &  ,
SgAsmExpression ,
State  
) const
protectedvirtual

Mid-level unparser function.

This function emits some entity to the specified output stream. All call-specific state is supplied in the State reference so that this function can be called with a const parser references and is thread safe per state object. The high-level functions create the state – states are not intended for end users – before calling this mid-level function.

This mid-level function uses a combination of C++ virtual function calls and object chaining. The virtual functions allow subclasses to override or augment behavior from the base class, so that, e.g., an x86 operand expression can be output in a different format than an m68k expression. The object chaining allows one unparser to override or augment the behavior of another function and is used, for example, to provide HTML wrapping around various entities.

The object chaining is implemented in two parts: every unparser object has a nextUnparser pointer and the final unparser in the list has a null pointer for this property; the state object has a frontUnparser method that returns the first unparser in this list. This mid-level function is expected to always invoke functions on the front unparser in order to give every parser in the chain a chance to influence behavior. The base implementation of this mid-level function defers to the next parser in the chain if there is one, otherwise it performs some default output that's hopefully appropriate for most unparsers.

All such chained and virtual emitters begin with the letters "emit".

Reimplemented from Rose::BinaryAnalysis::Unparser::Base.

void Rose::BinaryAnalysis::Unparser::X86::emitTypeName ( std::ostream &  ,
SgAsmType ,
State  
) const
protectedvirtual

Mid-level unparser function.

This function emits some entity to the specified output stream. All call-specific state is supplied in the State reference so that this function can be called with a const parser references and is thread safe per state object. The high-level functions create the state – states are not intended for end users – before calling this mid-level function.

This mid-level function uses a combination of C++ virtual function calls and object chaining. The virtual functions allow subclasses to override or augment behavior from the base class, so that, e.g., an x86 operand expression can be output in a different format than an m68k expression. The object chaining allows one unparser to override or augment the behavior of another function and is used, for example, to provide HTML wrapping around various entities.

The object chaining is implemented in two parts: every unparser object has a nextUnparser pointer and the final unparser in the list has a null pointer for this property; the state object has a frontUnparser method that returns the first unparser in this list. This mid-level function is expected to always invoke functions on the front unparser in order to give every parser in the chain a chance to influence behavior. The base implementation of this mid-level function defers to the next parser in the chain if there is one, otherwise it performs some default output that's hopefully appropriate for most unparsers.

All such chained and virtual emitters begin with the letters "emit".

Reimplemented from Rose::BinaryAnalysis::Unparser::Base.


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