ROSE  0.9.9.139
Public Member Functions | List of all members
Rose::BinaryAnalysis::ReturnValueUsed::Analysis Class Reference

Description

Definition at line 95 of file BinaryReturnValueUsed.h.

Public Member Functions

 Analysis ()
 Default constructor. More...
 
void clearResults ()
 Clear analysis results. More...
 
CallSiteResults analyzeCallSite (const Partitioner2::Partitioner &, const Partitioner2::ControlFlowGraph::ConstVertexIterator &)
 Analyze a call site to see if a function's return value is used. More...
 
CallingConvention::Definition::Ptr defaultCallingConvention () const
 Property: Default calling convention. More...
 
void defaultCallingConvention (const CallingConvention::Definition::Ptr &defn)
 Property: Default calling convention. More...
 
bool assumeCallerReturnsValue () const
 Property: Assume caller returns value(s). More...
 
void assumeCallerReturnsValue (bool b)
 Property: Assume caller returns value(s). More...
 

Constructor & Destructor Documentation

Rose::BinaryAnalysis::ReturnValueUsed::Analysis::Analysis ( )
inline

Default constructor.

This creates an analyzer that is not suitable for analysis since it doesn't know anything about the architecture it would be analyzing. This is mostly for use in situations where an analyzer must be constructed as a member of another class's default constructor, in containers that initialize their contents with default constructors, etc.

Definition at line 122 of file BinaryReturnValueUsed.h.

Member Function Documentation

CallingConvention::Definition::Ptr Rose::BinaryAnalysis::ReturnValueUsed::Analysis::defaultCallingConvention ( ) const
inline

Property: Default calling convention.

Use this calling convention any time we encounter a function that doesn't have a known calling convention. This is a calling convention definition that's used during data-flow. Even if the default calling convention is specified, the functions being analyzed (that function which is called at the analyzed call site) must still have already had a calling convention analysis run and have calling convention charactertics. The characterstics describe, among other things, which register and memory locations are actually outputs, whereas a calling convention definition only states which locations are permitted to be outputs.

Definition at line 135 of file BinaryReturnValueUsed.h.

void Rose::BinaryAnalysis::ReturnValueUsed::Analysis::defaultCallingConvention ( const CallingConvention::Definition::Ptr defn)
inline

Property: Default calling convention.

Use this calling convention any time we encounter a function that doesn't have a known calling convention. This is a calling convention definition that's used during data-flow. Even if the default calling convention is specified, the functions being analyzed (that function which is called at the analyzed call site) must still have already had a calling convention analysis run and have calling convention charactertics. The characterstics describe, among other things, which register and memory locations are actually outputs, whereas a calling convention definition only states which locations are permitted to be outputs.

Definition at line 136 of file BinaryReturnValueUsed.h.

bool Rose::BinaryAnalysis::ReturnValueUsed::Analysis::assumeCallerReturnsValue ( ) const
inline

Property: Assume caller returns value(s).

If true, then assume that the caller returns a value(s) in the location(s) indicated by its primary calling convention definition. This property affects whether a call to function B from A followed by a return from A implicitly uses the value returned from B. For example, these GCC generates identical code for these two functions:

int test1(void) {
return one();
}
void test2(void) {
one();
}

Namely,

L1: push ebp
mov ebp, esp
call function 0x080480de "one" ; returns value in EAX
pop ebp
ret

If this property is set, then the analysis will indicate that the return value of the CALL instruction is used implicitly by the RET instruction (since there was no intervening write to EAX). On the other hand, if this property is clear, then the analysis indicates that the call to function "one" returns a value in EAX which is unused.

Definition at line 170 of file BinaryReturnValueUsed.h.

void Rose::BinaryAnalysis::ReturnValueUsed::Analysis::assumeCallerReturnsValue ( bool  b)
inline

Property: Assume caller returns value(s).

If true, then assume that the caller returns a value(s) in the location(s) indicated by its primary calling convention definition. This property affects whether a call to function B from A followed by a return from A implicitly uses the value returned from B. For example, these GCC generates identical code for these two functions:

int test1(void) {
return one();
}
void test2(void) {
one();
}

Namely,

L1: push ebp
mov ebp, esp
call function 0x080480de "one" ; returns value in EAX
pop ebp
ret

If this property is set, then the analysis will indicate that the return value of the CALL instruction is used implicitly by the RET instruction (since there was no intervening write to EAX). On the other hand, if this property is clear, then the analysis indicates that the call to function "one" returns a value in EAX which is unused.

Definition at line 171 of file BinaryReturnValueUsed.h.

void Rose::BinaryAnalysis::ReturnValueUsed::Analysis::clearResults ( )

Clear analysis results.

Resets the analysis results so it looks like this analyzer is initialized but has not run yet. When this method returns, hasResults and didConverge will both retun false.

CallSiteResults Rose::BinaryAnalysis::ReturnValueUsed::Analysis::analyzeCallSite ( const Partitioner2::Partitioner ,
const Partitioner2::ControlFlowGraph::ConstVertexIterator &   
)

Analyze a call site to see if a function's return value is used.


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