ROSE 0.11.145.192
Classes | Typedefs | Enumerations | Functions | Variables
Rose::BinaryAnalysis::CallingConvention Namespace Reference

Description

Support for binary calling conventions.

This namespace has three main classes and a number of auxiliary classes. The main classes are:

Classes

class  AllocationError
 Error allocating argument or return value storage. More...
 
class  Allocator
 Allocates storage for an argument or return value. More...
 
class  Analysis
 Function calling convention. More...
 
class  Declaration
 Function declaration. More...
 
class  Definition
 Information about calling conventions. More...
 
class  Exception
 Error related to calling convention problems. More...
 
class  ParseError
 Error occuring when parsing a declaration. More...
 
class  StoragePoolBase
 Base class for pool of locations. More...
 
class  StoragePoolEnumerated
 A storage pool for explicit locations. More...
 
class  StoragePoolStack
 A storage pool for stack-based argument locations. More...
 
class  TypePredicate
 Base class for type predicates. More...
 
class  TypePredicateFunctor
 

Typedefs

using AnalysisPtr = Sawyer::SharedPointer< Analysis >
 Shared-ownership pointer to Analysis.
 
using DeclarationPtr = Sawyer::SharedPointer< Declaration >
 Shared-ownership pointer to Declaration.
 
using DefinitionPtr = Sawyer::SharedPointer< Definition >
 Shared-ownership pointer for Definition.
 
using Dictionary = std::vector< DefinitionPtr >
 An ordered collection of calling convention definitions.
 
using AllocatorPtr = std::shared_ptr< Allocator >
 Shared-ownership pointer to Allocator.
 
using AllocatorConstPtr = std::shared_ptr< const Allocator >
 Shared-ownership pointer to Allocator.
 
using StoragePoolBasePtr = std::shared_ptr< StoragePoolBase >
 Shared-ownership pointer to StoragePoolBase.
 
using StoragePoolBaseConstPtr = std::shared_ptr< const StoragePoolBase >
 Shared-ownership pointer to StoragePoolBase.
 
using StoragePoolEnumeratedPtr = std::shared_ptr< StoragePoolEnumerated >
 Shared-ownership pointer to StoragePoolEnumerated.
 
using StoragePoolEnumeratedConstPtr = std::shared_ptr< const StoragePoolEnumerated >
 Shared-ownership pointer to StoragePoolEnumerated.
 
using StoragePoolStackPtr = std::shared_ptr< StoragePoolStack >
 Shared-ownership pointer to StoragePoolStack.
 
using StoragePoolStackConstPtr = std::shared_ptr< const StoragePoolStack >
 Shared-ownership pointer to StoragePoolStack.
 
using TypePredicatePtr = std::shared_ptr< TypePredicate >
 Shared-ownership pointer to TypePredicate.
 
using TypePredicateConstPtr = std::shared_ptr< const TypePredicate >
 Shared-ownership pointer to TypePredicate.
 

Enumerations

enum class  StackParameterOrder {
  LEFT_TO_RIGHT ,
  RIGHT_TO_LEFT ,
  UNSPECIFIED
}
 The order that arguments are pushed onto the stack. More...
 
enum class  StackDirection {
  GROWS_UP ,
  GROWS_DOWN
}
 The direction in which the stack grows. More...
 
enum class  StackCleanup {
  BY_CALLER ,
  BY_CALLEE ,
  UNSPECIFIED
}
 Who is responsible for popping stack parameters. More...
 

Functions

void initDiagnostics ()
 Initialize diagnostics.
 
InstructionSemantics::BaseSemantics::SValuePtr readArgument (const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &, const DefinitionPtr &, size_t argNumber)
 Read a function argument from a semantic state.
 
void writeArgument (const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &, const DefinitionPtr &, size_t argNumber, const InstructionSemantics::BaseSemantics::SValuePtr &value)
 Write a function argument to a semantic state.
 
InstructionSemantics::BaseSemantics::SValuePtr readReturnValue (const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &, const DefinitionPtr &)
 Read the return value that a function is returning.
 
void writeReturnValue (const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &, const DefinitionPtr &, const InstructionSemantics::BaseSemantics::SValuePtr &returnValue)
 Write a value to a function return semantic state.
 
void simulateFunctionReturn (const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &, const DefinitionPtr &)
 Simulate a function return.
 
std::ostream & operator<< (std::ostream &, const Definition &)
 Print a definition.
 
std::ostream & operator<< (std::ostream &, const Analysis &)
 Print analysis information.
 
TypePredicate::Ptr isAnyType ()
 Functor returning true for any non-null type.
 
TypePredicate::Ptr isFpNotWiderThan (size_t nBits)
 Functor returning true for floating-point types not wider than specified.
 
TypePredicate::Ptr isIntegerNotWiderThan (size_t nBits)
 Functor returning true for integer types not wider than specified.
 
TypePredicate::Ptr isPointerNotWiderThan (size_t nBits)
 Functor returning true for pointers not wider than specified.
 
TypePredicate::Ptr isNonFpNotWiderThan (size_t nBits)
 Functor returning true for non-floating-point types not wider than specified.
 

Variables

Sawyer::Message::Facility mlog
 Facility for diagnostic output.
 

Typedef Documentation

◆ AllocatorPtr

Shared-ownership pointer to Allocator.

Definition at line 51 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ AllocatorConstPtr

Shared-ownership pointer to Allocator.

Definition at line 52 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ AnalysisPtr

Shared-ownership pointer to Analysis.

Definition at line 58 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ DeclarationPtr

Shared-ownership pointer to Declaration.

Definition at line 63 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ DefinitionPtr

Shared-ownership pointer for Definition.

Definition at line 68 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ Dictionary

An ordered collection of calling convention definitions.

Definition at line 71 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ StoragePoolBasePtr

Shared-ownership pointer to StoragePoolBase.

Definition at line 78 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ StoragePoolBaseConstPtr

Shared-ownership pointer to StoragePoolBase.

Definition at line 79 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ StoragePoolEnumeratedPtr

Shared-ownership pointer to StoragePoolEnumerated.

Definition at line 87 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ StoragePoolEnumeratedConstPtr

Shared-ownership pointer to StoragePoolEnumerated.

Definition at line 88 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ StoragePoolStackPtr

Shared-ownership pointer to StoragePoolStack.

Definition at line 96 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ StoragePoolStackConstPtr

Shared-ownership pointer to StoragePoolStack.

Definition at line 97 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ TypePredicatePtr

Shared-ownership pointer to TypePredicate.

Definition at line 105 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ TypePredicateConstPtr

Shared-ownership pointer to TypePredicate.

Definition at line 106 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

Enumeration Type Documentation

◆ StackParameterOrder

The order that arguments are pushed onto the stack.

Enumerator
LEFT_TO_RIGHT 

Stack parameters pushed left to right (Pascal order).

RIGHT_TO_LEFT 

Stack parameters pushed right to left (C order).

UNSPECIFIED 

Stack parameter order is unknown or unspecified.

Definition at line 27 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ StackDirection

The direction in which the stack grows.

Enumerator
GROWS_UP 

A push increments the stack pointer.

GROWS_DOWN 

A push decrements the stack pointer.

Definition at line 34 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

◆ StackCleanup

Who is responsible for popping stack parameters.

Enumerator
BY_CALLER 

The caller pops all stack parameters.

BY_CALLEE 

The called function pops all stack parameters.

UNSPECIFIED 

Stack parameter cleanup is unknown or unspecified.

Definition at line 40 of file Rose/BinaryAnalysis/CallingConvention/BasicTypes.h.

Function Documentation

◆ initDiagnostics()

void Rose::BinaryAnalysis::CallingConvention::initDiagnostics ( )

Initialize diagnostics.

This is normally called as part of ROSE's diagnostics initialization, but it doesn't hurt to call it often.

◆ simulateFunctionReturn()

void Rose::BinaryAnalysis::CallingConvention::simulateFunctionReturn ( const InstructionSemantics::BaseSemantics::RiscOperatorsPtr ,
const DefinitionPtr  
)

Simulate a function return.

The RISC operator's current state is adjusted as if a function with the specified calling convention returned.

Variable Documentation

◆ mlog

Sawyer::Message::Facility Rose::BinaryAnalysis::CallingConvention::mlog
extern

Facility for diagnostic output.

The facility can be controlled directly or via ROSE's command-line.