ROSE 0.11.145.147
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.
 
const BasicBlockConfigurationbasicBlock (rose_addr_t) const
 Configuration for a particular basic block.
 
const DataBlockConfigurationdataBlock (rose_addr_t) const
 Configuration for a particular data block.
 
const AddressConfigurationaddress (rose_addr_t) const
 Configuration for a particular address.
 
BasicBlockConfigurationinsertMaybeBasicBlock (rose_addr_t va)
 Lookup or insert a basic block.
 
DataBlockConfigurationinsertMaybeDataBlock (rose_addr_t va)
 Lookup or insert a data block.
 
AddressConfigurationinsertMaybeAddress (rose_addr_t va)
 Lookup or insert address details.
 
bool insertConfiguration (const BasicBlockConfiguration &)
 Insert basic block configuration information.
 
bool insertConfiguration (const DataBlockConfiguration &)
 Insert data block configuration information.
 
bool insertConfiguration (const FunctionConfiguration &)
 Insert function configuration information.
 
bool insertConfiguration (const AddressConfiguration &)
 Insert address configuration information.
 
std::string basicBlockComment (rose_addr_t bblockVa) const
 Basic block comment.
 
Sawyer::Optional< rose_addr_t > basicBlockFinalInstructionVa (rose_addr_t bblockVa) const
 Basic block final instruction address.
 
std::set< rose_addr_t > basicBlockSuccessorVas (rose_addr_t bblockVa) const
 Basic block successor addresses.
 
std::string dataBlockName (rose_addr_t dblockVa) const
 Data block name.
 
std::string dataBlockComment (rose_addr_t dblockVa) const
 Data block comment.
 
std::string functionName (rose_addr_t functionVa) const
 Function name.
 
std::string functionDefaultName (rose_addr_t functionVa) const
 Function default name.
 
std::string addressComment (rose_addr_t va) const
 Address comment.
 
std::string comment (rose_addr_t va) const
 Address comment.
 
void print (std::ostream &) const
 Generate a YAML file.
 
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.
 
const FunctionConfigurationfunction (const std::string &name) const
 Configuration for a particular function.
 
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.
 
FunctionConfigurationinsertMaybeFunction (const std::string &name)
 Lookup or insert a function.
 
std::string functionComment (rose_addr_t functionVa) const
 Function comment.
 
std::string functionComment (const std::string &functionName) const
 Function comment.
 
std::string functionComment (const FunctionPtr &) const
 Function comment.
 
Sawyer::Optional< int64_t > functionStackDelta (rose_addr_t functionVa) const
 Function stack delta.
 
Sawyer::Optional< int64_t > functionStackDelta (const std::string &functionName) const
 Function stack delta.
 
Sawyer::Optional< int64_t > functionStackDelta (const FunctionPtr &) const
 Function stack delta.
 
Sawyer::Optional< bool > functionMayReturn (rose_addr_t functionVa) const
 Function may-return status.
 
Sawyer::Optional< bool > functionMayReturn (const std::string &functionName) const
 Function may-return status.
 
Sawyer::Optional< bool > functionMayReturn (const FunctionPtr &) const
 Function may-return status.
 

Static Public Member Functions

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

Member Typedef Documentation

◆ BasicBlockConfigurations

Definition at line 283 of file Configuration.h.

◆ DataBlockConfigurations

Definition at line 284 of file Configuration.h.

◆ FunctionConfigurationsByAddress

Definition at line 285 of file Configuration.h.

◆ FunctionConfigurationsByName

Definition at line 286 of file Configuration.h.

◆ AddressConfigurations

Definition at line 287 of file Configuration.h.

Member Function Documentation

◆ basicBlocks() [1/2]

const BasicBlockConfigurations & Rose::BinaryAnalysis::Partitioner2::Configuration::basicBlocks ( ) const
inline

All basic block configuration details.

Definition at line 306 of file Configuration.h.

◆ basicBlocks() [2/2]

BasicBlockConfigurations & Rose::BinaryAnalysis::Partitioner2::Configuration::basicBlocks ( )
inline

All basic block configuration details.

Definition at line 307 of file Configuration.h.

◆ basicBlock()

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.

◆ dataBlocks() [1/2]

const DataBlockConfigurations & Rose::BinaryAnalysis::Partitioner2::Configuration::dataBlocks ( ) const
inline

All data block configuration details.

Definition at line 319 of file Configuration.h.

◆ dataBlocks() [2/2]

DataBlockConfigurations & Rose::BinaryAnalysis::Partitioner2::Configuration::dataBlocks ( )
inline

All data block configuration details.

Definition at line 320 of file Configuration.h.

◆ dataBlock()

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.

◆ functionConfigurationsByAddress() [1/2]

const FunctionConfigurationsByAddress & Rose::BinaryAnalysis::Partitioner2::Configuration::functionConfigurationsByAddress ( ) const
inline

All function configuration details for function configs that have addresses.

Definition at line 332 of file Configuration.h.

◆ functionConfigurationsByAddress() [2/2]

FunctionConfigurationsByAddress & Rose::BinaryAnalysis::Partitioner2::Configuration::functionConfigurationsByAddress ( )
inline

All function configuration details for function configs that have addresses.

Definition at line 333 of file Configuration.h.

◆ functionConfigurationsByName() [1/2]

const FunctionConfigurationsByName & Rose::BinaryAnalysis::Partitioner2::Configuration::functionConfigurationsByName ( ) const
inline

All function configuration details for configs that have no address.

Definition at line 339 of file Configuration.h.

◆ functionConfigurationsByName() [2/2]

FunctionConfigurationsByName & Rose::BinaryAnalysis::Partitioner2::Configuration::functionConfigurationsByName ( )
inline

All function configuration details for configs that have no address.

Definition at line 340 of file Configuration.h.

◆ function() [1/2]

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.

◆ function() [2/2]

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.

◆ addresses() [1/2]

const AddressConfigurations & Rose::BinaryAnalysis::Partitioner2::Configuration::addresses ( ) const
inline

All address configuration details.

Definition at line 356 of file Configuration.h.

◆ addresses() [2/2]

AddressConfigurations & Rose::BinaryAnalysis::Partitioner2::Configuration::addresses ( )
inline

All address configuration details.

Definition at line 357 of file Configuration.h.

◆ address()

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.

◆ insertMaybeBasicBlock()

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.

◆ insertMaybeDataBlock()

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.

◆ insertMaybeFunction() [1/2]

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.

◆ insertMaybeFunction() [2/2]

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.

◆ insertMaybeAddress()

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.

◆ insertConfiguration() [1/4]

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.

◆ insertConfiguration() [2/4]

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.

◆ insertConfiguration() [3/4]

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.

◆ insertConfiguration() [4/4]

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.

◆ basicBlockComment()

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.

◆ basicBlockFinalInstructionVa()

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.

◆ basicBlockSuccessorVas()

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.

◆ dataBlockName()

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.

◆ dataBlockComment()

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.

◆ functionName()

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

◆ 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

◆ functionComment() [1/3]

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.

◆ functionComment() [2/3]

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.

◆ functionComment() [3/3]

std::string Rose::BinaryAnalysis::Partitioner2::Configuration::functionComment ( const FunctionPtr ) 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.

◆ functionStackDelta() [1/3]

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

◆ functionStackDelta() [2/3]

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

◆ functionStackDelta() [3/3]

Sawyer::Optional< int64_t > Rose::BinaryAnalysis::Partitioner2::Configuration::functionStackDelta ( const FunctionPtr ) 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).

◆ functionMayReturn() [1/3]

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.

◆ functionMayReturn() [2/3]

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.

◆ functionMayReturn() [3/3]

Sawyer::Optional< bool > Rose::BinaryAnalysis::Partitioner2::Configuration::functionMayReturn ( const FunctionPtr ) 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.

◆ addressComment()

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.

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


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