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

Description

Holds configuration information.

Definition at line 281 of file Configuration.h.

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

Public Types

typedef Sawyer::Container::Map< rose_addr_t, BasicBlockConfigurationBasicBlockConfigurations
 
typedef Sawyer::Container::Map< rose_addr_t, DataBlockConfigurationDataBlockConfigurations
 
typedef Sawyer::Container::Map< rose_addr_t, FunctionConfigurationFunctionConfigurationsByAddress
 
typedef Sawyer::Container::Map< std::string, FunctionConfigurationFunctionConfigurationsByName
 
typedef Sawyer::Container::Map< rose_addr_t, AddressConfigurationAddressConfigurations
 

Public Member Functions

void loadFromFile (const FileSystem::Path &fileName)
 Loads configuration from a file. More...
 
const BasicBlockConfigurationbasicBlock (rose_addr_t) const
 Configuration for a particular basic block. More...
 
const DataBlockConfigurationdataBlock (rose_addr_t) const
 Configuration for a particular data block. More...
 
const AddressConfigurationaddress (rose_addr_t) const
 Configuration for a particular address. More...
 
BasicBlockConfigurationinsertMaybeBasicBlock (rose_addr_t va)
 Lookup or insert a basic block. More...
 
DataBlockConfigurationinsertMaybeDataBlock (rose_addr_t va)
 Lookup or insert a data block. More...
 
AddressConfigurationinsertMaybeAddress (rose_addr_t va)
 Lookup or insert address details. More...
 
bool insertConfiguration (const BasicBlockConfiguration &)
 Insert basic block configuration information. More...
 
bool insertConfiguration (const DataBlockConfiguration &)
 Insert data block configuration information. More...
 
bool insertConfiguration (const FunctionConfiguration &)
 Insert function configuration information. More...
 
bool insertConfiguration (const AddressConfiguration &)
 Insert address 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...
 
std::string addressComment (rose_addr_t va) const
 Address comment. More...
 
std::string comment (rose_addr_t va) const
 Address comment. More...
 
void print (std::ostream &) const
 Generate a YAML file. More...
 
const BasicBlockConfigurationsbasicBlocks () const
 All basic block configuration details.
 
BasicBlockConfigurationsbasicBlocks ()
 All basic block configuration details.
 
const DataBlockConfigurationsdataBlocks () const
 All data block configuration details.
 
DataBlockConfigurationsdataBlocks ()
 All data block configuration details.
 
const FunctionConfigurationsByAddressfunctionConfigurationsByAddress () const
 All function configuration details for function configs that have addresses.
 
FunctionConfigurationsByAddressfunctionConfigurationsByAddress ()
 All function configuration details for function configs that have addresses.
 
const FunctionConfigurationsByNamefunctionConfigurationsByName () const
 All function configuration details for configs that have no address.
 
FunctionConfigurationsByNamefunctionConfigurationsByName ()
 All function configuration details for configs that have no address.
 
const FunctionConfigurationfunction (rose_addr_t) const
 Configuration for a particular function. More...
 
const FunctionConfigurationfunction (const std::string &name) const
 Configuration for a particular function. More...
 
const AddressConfigurationsaddresses () const
 All address configuration details.
 
AddressConfigurationsaddresses ()
 All address configuration details.
 
FunctionConfigurationinsertMaybeFunction (rose_addr_t va, const std::string &name="")
 Lookup or insert a function. More...
 
FunctionConfigurationinsertMaybeFunction (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...
 

Static Public Member Functions

static std::string fileFormatDoc ()
 Documentation string describing the file format. More...
 

Member Function Documentation

static std::string Rose::BinaryAnalysis::Partitioner2::Configuration::fileFormatDoc ( )
static

Documentation string describing the file format.

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

Loads configuration from a file.

const BasicBlockConfiguration& Rose::BinaryAnalysis::Partitioner2::Configuration::basicBlock ( rose_addr_t  ) const

Configuration for a particular basic block.

If no configuration exists for a basic block starting at the specified address, then a reference to an empty configuration record is returned.

const DataBlockConfiguration& Rose::BinaryAnalysis::Partitioner2::Configuration::dataBlock ( rose_addr_t  ) const

Configuration for a particular data block.

If no configuration exists for a data block starting at the specified address, then a reference to an empty configuration record is returned.

const FunctionConfiguration& Rose::BinaryAnalysis::Partitioner2::Configuration::function ( rose_addr_t  ) const

Configuration for a particular function.

If no configuration exists for a function block starting at the specified address or having the specified name, then a reference to an empty configuration record is returned.

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

Configuration for a particular function.

If no configuration exists for a function block starting at the specified address or having the specified name, then a reference to an empty configuration record is returned.

const AddressConfiguration& Rose::BinaryAnalysis::Partitioner2::Configuration::address ( rose_addr_t  ) const

Configuration for a particular address.

If no configuration exists for the specified address, then a reference to an empty configuration record is returned.

BasicBlockConfiguration& 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.

DataBlockConfiguration& 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.

FunctionConfiguration& 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.

FunctionConfiguration& 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.

AddressConfiguration& Rose::BinaryAnalysis::Partitioner2::Configuration::insertMaybeAddress ( rose_addr_t  va)

Lookup or insert address details.

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

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

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 DataBlockConfiguration )

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 FunctionConfiguration )

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.

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

Insert address configuration information.

Inserts address configuration information, overwriting any config information that was already present at the same address. 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.

See also, comment.

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.

See also, comment.

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).

See also, comment.

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).

See also, comment.

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).

See also, comment.

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.

std::string Rose::BinaryAnalysis::Partitioner2::Configuration::addressComment ( rose_addr_t  va) const

Address comment.

Returns the comment associated with the details for the specified address, if any.

See also, comment.

std::string Rose::BinaryAnalysis::Partitioner2::Configuration::comment ( rose_addr_t  va) const

Address comment.

Returns the comment for the specified address by search first within the address details, then basic block details, then data block details, and finally function details. Returns the first non-empty comment that's found, or the empty string.

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

Generate a YAML file.


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