ROSE 0.11.145.147
Public Member Functions | List of all members
Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration Class Reference

Description

Configuration information for a function.

Definition at line 128 of file Configuration.h.

#include <Rose/BinaryAnalysis/Partitioner2/Configuration.h>

Public Member Functions

Sawyer::Optional< rose_addr_t > address () const
 Property: address.
 
 FunctionConfiguration (rose_addr_t va, const std::string &name="")
 Configuration information for a function.
 
 FunctionConfiguration (const std::string &name)
 Configuration information for a function.
 
 FunctionConfiguration (const Sawyer::Optional< rose_addr_t > &va, const std::string &name)
 Configuration information for a function.
 
const std::string & name () const
 Property: name.
 
FunctionConfigurationname (const std::string &s)
 Property: name.
 
const std::string & defaultName () const
 Property: default name.
 
FunctionConfigurationdefaultName (const std::string &s)
 Property: default name.
 
const std::string & comment () const
 Property: comment.
 
FunctionConfigurationcomment (const std::string &s)
 Property: comment.
 
const SourceLocationsourceLocation () const
 Property: Location of function in source code.
 
FunctionConfigurationsourceLocation (const SourceLocation &loc)
 Property: Location of function in source code.
 
Sawyer::Optional< int64_t > stackDelta () const
 Property: stack delta.
 
FunctionConfigurationstackDelta (const Sawyer::Optional< int64_t > &n)
 Property: stack delta.
 
Sawyer::Optional< bool > mayReturn () const
 Property: may-return.
 
FunctionConfigurationmayReturn (const Sawyer::Optional< bool > &b)
 Property: may-return.
 

Constructor & Destructor Documentation

◆ FunctionConfiguration() [1/4]

Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::FunctionConfiguration ( )
inline

Definition at line 137 of file Configuration.h.

◆ FunctionConfiguration() [2/4]

Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::FunctionConfiguration ( rose_addr_t  va,
const std::string &  name = "" 
)
inlineexplicit

Configuration information for a function.

Definition at line 142 of file Configuration.h.

◆ FunctionConfiguration() [3/4]

Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::FunctionConfiguration ( const std::string &  name)
inlineexplicit

Configuration information for a function.

Definition at line 143 of file Configuration.h.

◆ FunctionConfiguration() [4/4]

Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::FunctionConfiguration ( const Sawyer::Optional< rose_addr_t > &  va,
const std::string &  name 
)
inline

Configuration information for a function.

Definition at line 144 of file Configuration.h.

Member Function Documentation

◆ address()

Sawyer::Optional< rose_addr_t > Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::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:

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";
Configuration information for a function.
Sawyer::Optional< rose_addr_t > address() const
Property: address.

Definition at line 162 of file Configuration.h.

◆ name() [1/2]

const std::string & Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::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 172 of file Configuration.h.

◆ name() [2/2]

FunctionConfiguration & Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::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

◆ defaultName() [1/2]

const std::string & Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::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 181 of file Configuration.h.

◆ defaultName() [2/2]

FunctionConfiguration & Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::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 182 of file Configuration.h.

◆ comment() [1/2]

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

Property: comment.

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

Definition at line 190 of file Configuration.h.

◆ comment() [2/2]

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

Property: comment.

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

Definition at line 191 of file Configuration.h.

◆ sourceLocation() [1/2]

const SourceLocation & Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::sourceLocation ( ) const
inline

Property: Location of function in source code.

Definition at line 197 of file Configuration.h.

◆ sourceLocation() [2/2]

FunctionConfiguration & Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::sourceLocation ( const SourceLocation loc)
inline

Property: Location of function in source code.

Definition at line 198 of file Configuration.h.

◆ stackDelta() [1/2]

Sawyer::Optional< int64_t > Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::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:

fconfig.stackDelta(Sawyer::Nothing()); // clear the stack delta
fconfig.stackDelta(4); // set the stack delta
Sawyer::Optional< int64_t > stackDelta() const
Property: stack delta.
Represents no value.
Definition Optional.h:36

Definition at line 216 of file Configuration.h.

◆ stackDelta() [2/2]

FunctionConfiguration & Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::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:

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

Definition at line 217 of file Configuration.h.

◆ mayReturn() [1/2]

Sawyer::Optional< bool > Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::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 231 of file Configuration.h.

◆ mayReturn() [2/2]

FunctionConfiguration & Rose::BinaryAnalysis::Partitioner2::FunctionConfiguration::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 232 of file Configuration.h.


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