ROSE  0.9.9.139
Public Types | Public Member Functions | List of all members
Rose::BinaryAnalysis::Partitioner2::Configuration Class Reference

Description

Holds configuration information.

Definition at line 210 of file Config.h.

#include <Config.h>

Public Types

typedef Sawyer::Container::Map< rose_addr_t, BasicBlockConfigBasicBlockConfigs
 
typedef Sawyer::Container::Map< rose_addr_t, DataBlockConfigDataBlockConfigs
 
typedef Sawyer::Container::Map< rose_addr_t, FunctionConfigFunctionConfigsByAddress
 
typedef Sawyer::Container::Map< std::string, FunctionConfigFunctionConfigsByName
 

Public Member Functions

void loadFromFile (const FileSystem::Path &fileName)
 Loads configuration from a file. More...
 
BasicBlockConfiginsertMaybeBasicBlock (rose_addr_t va)
 Lookup or insert a basic block. More...
 
DataBlockConfiginsertMaybeDataBlock (rose_addr_t va)
 Lookup or insert a data block. More...
 
bool insertConfiguration (const BasicBlockConfig &)
 Insert basic block configuration information. More...
 
bool insertConfiguration (const DataBlockConfig &)
 Insert data block configuration information. More...
 
bool insertConfiguration (const FunctionConfig &)
 Insert function configuration information. More...
 
std::string basicBlockComment (rose_addr_t bblockVa) const
 Basic block comment. More...
 
Sawyer::Optional< rose_addr_t > basicBlockFinalInstructionVa (rose_addr_t bblockVa) const
 Basic block final instruction address. More...
 
std::set< rose_addr_t > basicBlockSuccessorVas (rose_addr_t bblockVa) const
 Basic block successor addresses. More...
 
std::string dataBlockName (rose_addr_t dblockVa) const
 Data block name. More...
 
std::string dataBlockComment (rose_addr_t dblockVa) const
 Data block comment. More...
 
std::string functionName (rose_addr_t functionVa) const
 Function name. More...
 
std::string functionDefaultName (rose_addr_t functionVa) const
 Function default name. More...
 
void print (std::ostream &) const
 Generate a YAML file. More...
 
const BasicBlockConfigsbasicBlocks () const
 All basic block configuration details.
 
BasicBlockConfigsbasicBlocks ()
 All basic block configuration details.
 
const DataBlockConfigsdataBlocks () const
 All data block configuration details.
 
DataBlockConfigsdataBlocks ()
 All data block configuration details.
 
const FunctionConfigsByAddressfunctionConfigsByAddress () const
 All function configuration details for function configs that have addresses.
 
FunctionConfigsByAddressfunctionConfigsByAddress ()
 All function configuration details for function configs that have addresses.
 
const FunctionConfigsByNamefunctionConfigsByName () const
 All function configuration details for configs that have no address.
 
FunctionConfigsByNamefunctionConfigsByName ()
 All function configuration details for configs that have no address.
 
FunctionConfiginsertMaybeFunction (rose_addr_t va, const std::string &name="")
 Lookup or insert a function. More...
 
FunctionConfiginsertMaybeFunction (const std::string &name)
 Lookup or insert a function. More...
 
std::string functionComment (rose_addr_t functionVa) const
 Function comment. More...
 
std::string functionComment (const std::string &functionName) const
 Function comment. More...
 
std::string functionComment (const Function::Ptr &) const
 Function comment. More...
 
Sawyer::Optional< int64_t > functionStackDelta (rose_addr_t functionVa) const
 Function stack delta. More...
 
Sawyer::Optional< int64_t > functionStackDelta (const std::string &functionName) const
 Function stack delta. More...
 
Sawyer::Optional< int64_t > functionStackDelta (const Function::Ptr &) const
 Function stack delta. More...
 
Sawyer::Optional< bool > functionMayReturn (rose_addr_t functionVa) const
 Function may-return status. More...
 
Sawyer::Optional< bool > functionMayReturn (const std::string &functionName) const
 Function may-return status. More...
 
Sawyer::Optional< bool > functionMayReturn (const Function::Ptr &) const
 Function may-return status. More...
 

Member Function Documentation

void Rose::BinaryAnalysis::Partitioner2::Configuration::loadFromFile ( const FileSystem::Path fileName)

Loads configuration from a file.

BasicBlockConfig& Rose::BinaryAnalysis::Partitioner2::Configuration::insertMaybeBasicBlock ( rose_addr_t  va)

Lookup or insert a basic block.

If the basic block exists then return a reference to its configuration, otherwise create a new configuration for it.

DataBlockConfig& Rose::BinaryAnalysis::Partitioner2::Configuration::insertMaybeDataBlock ( rose_addr_t  va)

Lookup or insert a data block.

If the data block exists then return a reference to its configuration, otherwise create a new configuration for it.

FunctionConfig& Rose::BinaryAnalysis::Partitioner2::Configuration::insertMaybeFunction ( rose_addr_t  va,
const std::string &  name = "" 
)

Lookup or insert a function.

If the function exists then return a reference to its configuration, otherwise create a new configuration for it.

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

Lookup or insert a function.

If the function exists then return a reference to its configuration, otherwise create a new configuration for it.

bool Rose::BinaryAnalysis::Partitioner2::Configuration::insertConfiguration ( const BasicBlockConfig )

Insert basic block configuration information.

Inserts basic block configuration information, overwriting any config information that was already present for the same basic block address. Returns true if information was inserted rather than overwritten.

bool Rose::BinaryAnalysis::Partitioner2::Configuration::insertConfiguration ( const DataBlockConfig )

Insert data block configuration information.

Inserts data block configuration information, overwriting any config information that was already present for the same data block address. Returns true if information was inserted rather than overwritten.

bool Rose::BinaryAnalysis::Partitioner2::Configuration::insertConfiguration ( const FunctionConfig )

Insert function configuration information.

Inserts function configuration information, overwriting any config information that was already present at the same address or name. Returns true if information was inserted rather than overwritten.

std::string Rose::BinaryAnalysis::Partitioner2::Configuration::basicBlockComment ( rose_addr_t  bblockVa) const

Basic block comment.

Returns the comment configured for the basic block at the specified address, or an empty string.

Sawyer::Optional<rose_addr_t> Rose::BinaryAnalysis::Partitioner2::Configuration::basicBlockFinalInstructionVa ( rose_addr_t  bblockVa) const

Basic block final instruction address.

Returns the optional final instruction address for a basic block. If no such configuration information is avilable then nothing is returned.

std::set<rose_addr_t> Rose::BinaryAnalysis::Partitioner2::Configuration::basicBlockSuccessorVas ( rose_addr_t  bblockVa) const

Basic block successor addresses.

Returns the set of basic block successors. This set is only meaningful at the block's final instruction as returned by basicBlockFinalInstructionVa.

std::string Rose::BinaryAnalysis::Partitioner2::Configuration::dataBlockName ( rose_addr_t  dblockVa) const

Data block name.

Returns the name configured for a data block at the specified address, or an empty string.

std::string Rose::BinaryAnalysis::Partitioner2::Configuration::dataBlockComment ( rose_addr_t  dblockVa) const

Data block comment.

Returns the comment configured for the data block at the specified address, or an empty string.

std::string Rose::BinaryAnalysis::Partitioner2::Configuration::functionName ( rose_addr_t  functionVa) const

Function name.

Returns the configured name for a function at the specified address.

See also
functionDefaultName
std::string Rose::BinaryAnalysis::Partitioner2::Configuration::functionDefaultName ( rose_addr_t  functionVa) const

Function default name.

Returns the configured default name for a function at the specified address.

See also
functionName
std::string Rose::BinaryAnalysis::Partitioner2::Configuration::functionComment ( rose_addr_t  functionVa) const

Function comment.

Returns the configured comment for a function at the specified address or having the specified name. Function configuration is looked up by address or name-only (i.e., asking for config information for function "main" will not return anything if "main" has an address in the configuration).

std::string Rose::BinaryAnalysis::Partitioner2::Configuration::functionComment ( const std::string &  functionName) const

Function comment.

Returns the configured comment for a function at the specified address or having the specified name. Function configuration is looked up by address or name-only (i.e., asking for config information for function "main" will not return anything if "main" has an address in the configuration).

std::string Rose::BinaryAnalysis::Partitioner2::Configuration::functionComment ( const Function::Ptr ) const

Function comment.

Returns the configured comment for a function at the specified address or having the specified name. Function configuration is looked up by address or name-only (i.e., asking for config information for function "main" will not return anything if "main" has an address in the configuration).

Sawyer::Optional<int64_t> Rose::BinaryAnalysis::Partitioner2::Configuration::functionStackDelta ( rose_addr_t  functionVa) const

Function stack delta.

Returns the configured stack delta for a function at the specified address or having the specified name. Function configuration is looked up by address or name-only (i.e., asking for config information for function "main" will not return anything if "main" has an address in the configuration).

Sawyer::Optional<int64_t> Rose::BinaryAnalysis::Partitioner2::Configuration::functionStackDelta ( const std::string &  functionName) const

Function stack delta.

Returns the configured stack delta for a function at the specified address or having the specified name. Function configuration is looked up by address or name-only (i.e., asking for config information for function "main" will not return anything if "main" has an address in the configuration).

Sawyer::Optional<int64_t> Rose::BinaryAnalysis::Partitioner2::Configuration::functionStackDelta ( const Function::Ptr ) const

Function stack delta.

Returns the configured stack delta for a function at the specified address or having the specified name. Function configuration is looked up by address or name-only (i.e., asking for config information for function "main" will not return anything if "main" has an address in the configuration).

Sawyer::Optional<bool> Rose::BinaryAnalysis::Partitioner2::Configuration::functionMayReturn ( rose_addr_t  functionVa) const

Function may-return status.

Returns the configured may-return status for a function at the specified address or having the specified name. Function configuration is looked up by address or name-only (i.e., asking for config information for function "main" will not return anything if "main" has an address in the configuration).

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.

Sawyer::Optional<bool> Rose::BinaryAnalysis::Partitioner2::Configuration::functionMayReturn ( const std::string &  functionName) const

Function may-return status.

Returns the configured may-return status for a function at the specified address or having the specified name. Function configuration is looked up by address or name-only (i.e., asking for config information for function "main" will not return anything if "main" has an address in the configuration).

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.

Sawyer::Optional<bool> Rose::BinaryAnalysis::Partitioner2::Configuration::functionMayReturn ( const Function::Ptr ) const

Function may-return status.

Returns the configured may-return status for a function at the specified address or having the specified name. Function configuration is looked up by address or name-only (i.e., asking for config information for function "main" will not return anything if "main" has an address in the configuration).

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.

void Rose::BinaryAnalysis::Partitioner2::Configuration::print ( std::ostream &  ) const

Generate a YAML file.


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