ROSE 0.11.145.229
|
Definition at line 99 of file ReturnValueUsed.h.
Public Member Functions | |
Analysis () | |
Default constructor. | |
void | clearResults () |
Clear analysis results. | |
CallSiteResults | analyzeCallSite (const Partitioner2::PartitionerConstPtr &, const Partitioner2::ControlFlowGraph::ConstVertexIterator &) |
Analyze a call site to see if a function's return value is used. | |
CallingConvention::Definition::Ptr | defaultCallingConvention () const |
Property: Default calling convention. | |
void | defaultCallingConvention (const CallingConvention::DefinitionPtr &) |
Property: Default calling convention. | |
bool | assumeCallerReturnsValue () const |
Property: Assume caller returns value(s). | |
void | assumeCallerReturnsValue (bool) |
Property: Assume caller returns value(s). | |
Rose::BinaryAnalysis::ReturnValueUsed::Analysis::Analysis | ( | ) |
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.
CallingConvention::Definition::Ptr Rose::BinaryAnalysis::ReturnValueUsed::Analysis::defaultCallingConvention | ( | ) | const |
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.
void Rose::BinaryAnalysis::ReturnValueUsed::Analysis::defaultCallingConvention | ( | const CallingConvention::DefinitionPtr & | ) |
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.
bool Rose::BinaryAnalysis::ReturnValueUsed::Analysis::assumeCallerReturnsValue | ( | ) | const |
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:
Namely,
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.
void Rose::BinaryAnalysis::ReturnValueUsed::Analysis::assumeCallerReturnsValue | ( | bool | ) |
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:
Namely,
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.
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.