ROSE  0.10.0.0
Public Member Functions | List of all members
Rose::BinaryAnalysis::Partitioner2::FunctionConfig Class Reference

Description

Configuration information for a function.

Definition at line 129 of file Config.h.

#include <Config.h>

Public Member Functions

Sawyer::Optional< rose_addr_t > address () const
 Property: address. More...
 
 FunctionConfig (rose_addr_t va, const std::string &name="")
 Configuration information for a function.
 
 FunctionConfig (const std::string &name)
 Configuration information for a function.
 
 FunctionConfig (const Sawyer::Optional< rose_addr_t > &va, const std::string &name)
 Configuration information for a function.
 
const std::string & name () const
 Property: name. More...
 
FunctionConfigname (const std::string &s)
 Property: name. More...
 
const std::string & defaultName () const
 Property: default name. More...
 
FunctionConfigdefaultName (const std::string &s)
 Property: default name. More...
 
const std::string & comment () const
 Property: comment. More...
 
FunctionConfigcomment (const std::string &s)
 Property: comment. More...
 
const SourceLocationsourceLocation () const
 Property: Location of function in source code.
 
FunctionConfigsourceLocation (const SourceLocation &loc)
 Property: Location of function in source code.
 
Sawyer::Optional< int64_t > stackDelta () const
 Property: stack delta. More...
 
FunctionConfigstackDelta (const Sawyer::Optional< int64_t > &n)
 Property: stack delta. More...
 
Sawyer::Optional< bool > mayReturn () const
 Property: may-return. More...
 
FunctionConfigmayReturn (const Sawyer::Optional< bool > &b)
 Property: may-return. More...
 

Member Function Documentation

Sawyer::Optional<rose_addr_t> Rose::BinaryAnalysis::Partitioner2::FunctionConfig::address ( ) const
inline

Property: address.

A function configuration has an optional address which is read-only, initialized by the constructor. The return value can be used in a boolean context to test whether the address is present and dereferenced to get the address. The Sawyer::Optional class has a number of other useful methods, such as getOrElse and assignTo:

FunctionConfig fconfig;
if (fconfig.address())
std::cout <<address is " <<*fconfig.address() <<"\n";
std::cout <<"address is " <<fconfig.address().orElse(0) <<"\n";
rose_addr_t va = 0;
if (fconfig.address().assignTo(va))
std::cout <<"address is " <<va <<"\n";

Definition at line 163 of file Config.h.

const std::string& Rose::BinaryAnalysis::Partitioner2::FunctionConfig::name ( ) const
inline

Property: name.

This is the name to use for the function regardless of what name has been given to this function's address by the ELF/PE container, symbol tables, etc. The name is read-only if the config has no address.

See also
defaultName

Definition at line 173 of file Config.h.

FunctionConfig& Rose::BinaryAnalysis::Partitioner2::FunctionConfig::name ( const std::string &  s)

Property: name.

This is the name to use for the function regardless of what name has been given to this function's address by the ELF/PE container, symbol tables, etc. The name is read-only if the config has no address.

See also
defaultName
const std::string& Rose::BinaryAnalysis::Partitioner2::FunctionConfig::defaultName ( ) const
inline

Property: default name.

This is the name to use for a function if it hasn't been given a name by any other means.

Definition at line 182 of file Config.h.

FunctionConfig& Rose::BinaryAnalysis::Partitioner2::FunctionConfig::defaultName ( const std::string &  s)
inline

Property: default name.

This is the name to use for a function if it hasn't been given a name by any other means.

Definition at line 183 of file Config.h.

const std::string& Rose::BinaryAnalysis::Partitioner2::FunctionConfig::comment ( ) const
inline

Property: comment.

A function may have a multi-line, plain-text, ASCII comment.

Definition at line 191 of file Config.h.

FunctionConfig& Rose::BinaryAnalysis::Partitioner2::FunctionConfig::comment ( const std::string &  s)
inline

Property: comment.

A function may have a multi-line, plain-text, ASCII comment.

Definition at line 192 of file Config.h.

Sawyer::Optional<int64_t> Rose::BinaryAnalysis::Partitioner2::FunctionConfig::stackDelta ( ) const
inline

Property: stack delta.

The stack delta is a numeric value that indicates the net effect this function has on the stack pointer. If a stack delta is specified then it will be used instead of performing a stack delta analysis.

This is an optional property; see address for typical uses of the return value. The stack delta can be set by passing a signed value, and cleared by passing Sawyer::Nothing:

FunctionConfig fconfig;
fconfig.stackDelta(Sawyer::Nothing()); // clear the stack delta
fconfig.stackDelta(4); // set the stack delta

Definition at line 217 of file Config.h.

FunctionConfig& Rose::BinaryAnalysis::Partitioner2::FunctionConfig::stackDelta ( const Sawyer::Optional< int64_t > &  n)
inline

Property: stack delta.

The stack delta is a numeric value that indicates the net effect this function has on the stack pointer. If a stack delta is specified then it will be used instead of performing a stack delta analysis.

This is an optional property; see address for typical uses of the return value. The stack delta can be set by passing a signed value, and cleared by passing Sawyer::Nothing:

FunctionConfig fconfig;
fconfig.stackDelta(Sawyer::Nothing()); // clear the stack delta
fconfig.stackDelta(4); // set the stack delta

Definition at line 218 of file Config.h.

Sawyer::Optional<bool> Rose::BinaryAnalysis::Partitioner2::FunctionConfig::mayReturn ( ) const
inline

Property: may-return.

This property specifies whether the function might return to its caller. If the function might return, the value should be true; if the function cannot possibly return then the value is false; indeterminate values indicate that a may-return analysis should be performed.

Be careful using this return value: the return value is a SawyerOptional, which when evaluated in a boolean context will tell you whether a may-return value is present, not what that value is! In order to get the value, if present, you'll need to either dereference the return value or call something like orElse or assignTo.

Definition at line 232 of file Config.h.

FunctionConfig& Rose::BinaryAnalysis::Partitioner2::FunctionConfig::mayReturn ( const Sawyer::Optional< bool > &  b)
inline

Property: may-return.

This property specifies whether the function might return to its caller. If the function might return, the value should be true; if the function cannot possibly return then the value is false; indeterminate values indicate that a may-return analysis should be performed.

Be careful using this return value: the return value is a SawyerOptional, which when evaluated in a boolean context will tell you whether a may-return value is present, not what that value is! In order to get the value, if present, you'll need to either dereference the return value or call something like orElse or assignTo.

Definition at line 233 of file Config.h.


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