ROSE 0.11.145.147
|
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, BasicBlockConfiguration > | BasicBlockConfigurations |
typedef Sawyer::Container::Map< rose_addr_t, DataBlockConfiguration > | DataBlockConfigurations |
typedef Sawyer::Container::Map< rose_addr_t, FunctionConfiguration > | FunctionConfigurationsByAddress |
typedef Sawyer::Container::Map< std::string, FunctionConfiguration > | FunctionConfigurationsByName |
typedef Sawyer::Container::Map< rose_addr_t, AddressConfiguration > | AddressConfigurations |
Public Member Functions | |
void | loadFromFile (const FileSystem::Path &fileName) |
Loads configuration from a file. | |
const BasicBlockConfiguration & | basicBlock (rose_addr_t) const |
Configuration for a particular basic block. | |
const DataBlockConfiguration & | dataBlock (rose_addr_t) const |
Configuration for a particular data block. | |
const AddressConfiguration & | address (rose_addr_t) const |
Configuration for a particular address. | |
BasicBlockConfiguration & | insertMaybeBasicBlock (rose_addr_t va) |
Lookup or insert a basic block. | |
DataBlockConfiguration & | insertMaybeDataBlock (rose_addr_t va) |
Lookup or insert a data block. | |
AddressConfiguration & | insertMaybeAddress (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 BasicBlockConfigurations & | basicBlocks () const |
All basic block configuration details. | |
BasicBlockConfigurations & | basicBlocks () |
All basic block configuration details. | |
const DataBlockConfigurations & | dataBlocks () const |
All data block configuration details. | |
DataBlockConfigurations & | dataBlocks () |
All data block configuration details. | |
const FunctionConfigurationsByAddress & | functionConfigurationsByAddress () const |
All function configuration details for function configs that have addresses. | |
FunctionConfigurationsByAddress & | functionConfigurationsByAddress () |
All function configuration details for function configs that have addresses. | |
const FunctionConfigurationsByName & | functionConfigurationsByName () const |
All function configuration details for configs that have no address. | |
FunctionConfigurationsByName & | functionConfigurationsByName () |
All function configuration details for configs that have no address. | |
const FunctionConfiguration & | function (rose_addr_t) const |
Configuration for a particular function. | |
const FunctionConfiguration & | function (const std::string &name) const |
Configuration for a particular function. | |
const AddressConfigurations & | addresses () const |
All address configuration details. | |
AddressConfigurations & | addresses () |
All address configuration details. | |
FunctionConfiguration & | insertMaybeFunction (rose_addr_t va, const std::string &name="") |
Lookup or insert a function. | |
FunctionConfiguration & | insertMaybeFunction (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. | |
typedef Sawyer::Container::Map<rose_addr_t, BasicBlockConfiguration> Rose::BinaryAnalysis::Partitioner2::Configuration::BasicBlockConfigurations |
Definition at line 283 of file Configuration.h.
typedef Sawyer::Container::Map<rose_addr_t, DataBlockConfiguration> Rose::BinaryAnalysis::Partitioner2::Configuration::DataBlockConfigurations |
Definition at line 284 of file Configuration.h.
typedef Sawyer::Container::Map<rose_addr_t, FunctionConfiguration> Rose::BinaryAnalysis::Partitioner2::Configuration::FunctionConfigurationsByAddress |
Definition at line 285 of file Configuration.h.
typedef Sawyer::Container::Map<std::string, FunctionConfiguration> Rose::BinaryAnalysis::Partitioner2::Configuration::FunctionConfigurationsByName |
Definition at line 286 of file Configuration.h.
typedef Sawyer::Container::Map<rose_addr_t, AddressConfiguration> Rose::BinaryAnalysis::Partitioner2::Configuration::AddressConfigurations |
Definition at line 287 of file Configuration.h.
|
inline |
All basic block configuration details.
Definition at line 306 of file Configuration.h.
|
inline |
All basic block configuration details.
Definition at line 307 of file Configuration.h.
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.
|
inline |
All data block configuration details.
Definition at line 319 of file Configuration.h.
|
inline |
All data block configuration details.
Definition at line 320 of file Configuration.h.
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.
|
inline |
All function configuration details for function configs that have addresses.
Definition at line 332 of file Configuration.h.
|
inline |
All function configuration details for function configs that have addresses.
Definition at line 333 of file Configuration.h.
|
inline |
All function configuration details for configs that have no address.
Definition at line 339 of file Configuration.h.
|
inline |
All function configuration details for configs that have no address.
Definition at line 340 of file Configuration.h.
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.
|
inline |
All address configuration details.
Definition at line 356 of file Configuration.h.
|
inline |
All address configuration details.
Definition at line 357 of file Configuration.h.
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.
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.
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 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.
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 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).
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 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
.
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.