1#ifndef ROSE_BinaryAnalysis_Partitioner2_Configuration_H
2#define ROSE_BinaryAnalysis_Partitioner2_Configuration_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5#include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
7#include <Rose/FileSystem.h>
9#include <Sawyer/Optional.h>
10#include <Rose/SourceLocation.h>
15namespace BinaryAnalysis {
16namespace Partitioner2 {
20 rose_addr_t address_ = 0;
23 std::set<rose_addr_t> successorVas_;
36 rose_addr_t
address()
const {
return address_; }
43 const std::string&
comment()
const {
return comment_; }
72 const std::set<rose_addr_t>&
successorVas()
const {
return successorVas_; }
98 rose_addr_t
address()
const {
return address_; }
105 const std::string &
name()
const {
return name_; }
114 const std::string&
comment()
const {
return comment_; }
130 std::string name_, defaultName_, comment_;
172 const std::string&
name()
const {
return name_; }
190 const std::string&
comment()
const {
return comment_; }
240 rose_addr_t address_ = 0;
242 std::string comment_;
256 rose_addr_t
address()
const {
return address_; }
261 const std::string &
name()
const {
return name_; }
268 const std::string &
comment()
const {
return comment_; }
Configuration for individual addresses.
rose_addr_t address() const
Property: address.
AddressConfiguration & comment(const std::string &s)
Property: comment string.
AddressConfiguration & name(const std::string &s)
Property: name.
AddressConfiguration & sourceLocation(const SourceLocation &loc)
Property: Location of address within source code.
const std::string & comment() const
Property: comment string.
AddressConfiguration(rose_addr_t va)
Construct a new address configuration object.
const std::string & name() const
Property: name.
const SourceLocation & sourceLocation() const
Property: Location of address within source code.
Configuration information for a basic block.
const std::string & comment() const
Property: comment.
BasicBlockConfiguration & insertSuccessorVa(rose_addr_t va)
Property: control flow successors.
BasicBlockConfiguration & clearSuccessorVas()
Property: control flow successors.
BasicBlockConfiguration & sourceLocation(const SourceLocation &loc)
Property: location of basic block in source code.
Sawyer::Optional< rose_addr_t > finalInstructionVa() const
Property: last instruction.
BasicBlockConfiguration & successorVas(const std::set< rose_addr_t > &vas)
Property: control flow successors.
std::set< rose_addr_t > & successorVas()
Property: control flow successors.
const std::set< rose_addr_t > & successorVas() const
Property: control flow successors.
BasicBlockConfiguration & comment(const std::string &s)
Property: comment.
rose_addr_t address() const
Property: starting address.
BasicBlockConfiguration & finalInstructionVa(const Sawyer::Optional< rose_addr_t > &va)
Property: last instruction.
BasicBlockConfiguration(rose_addr_t va)
Configuration information for a basic block.
const SourceLocation & sourceLocation() const
Property: location of basic block in source code.
Holds configuration information.
bool insertConfiguration(const BasicBlockConfiguration &)
Insert basic block configuration information.
Sawyer::Optional< int64_t > functionStackDelta(const std::string &functionName) const
Function stack delta.
std::string dataBlockName(rose_addr_t dblockVa) const
Data block name.
std::string addressComment(rose_addr_t va) const
Address comment.
const FunctionConfigurationsByName & functionConfigurationsByName() const
All function configuration details for configs that have no address.
FunctionConfiguration & insertMaybeFunction(rose_addr_t va, const std::string &name="")
Lookup or insert a function.
FunctionConfigurationsByName & functionConfigurationsByName()
All function configuration details for configs that have no address.
bool insertConfiguration(const AddressConfiguration &)
Insert address configuration information.
DataBlockConfiguration & insertMaybeDataBlock(rose_addr_t va)
Lookup or insert a data block.
const FunctionConfigurationsByAddress & functionConfigurationsByAddress() const
All function configuration details for function configs that have addresses.
std::string basicBlockComment(rose_addr_t bblockVa) const
Basic block comment.
const AddressConfigurations & addresses() const
All address configuration details.
BasicBlockConfigurations & basicBlocks()
All basic block configuration details.
DataBlockConfigurations & dataBlocks()
All data block configuration details.
const DataBlockConfiguration & dataBlock(rose_addr_t) const
Configuration for a particular data block.
std::string functionDefaultName(rose_addr_t functionVa) const
Function default name.
bool insertConfiguration(const FunctionConfiguration &)
Insert function configuration information.
void loadFromFile(const FileSystem::Path &fileName)
Loads configuration from a file.
Sawyer::Optional< int64_t > functionStackDelta(rose_addr_t functionVa) const
Function stack delta.
AddressConfigurations & addresses()
All address configuration details.
std::string functionComment(const std::string &functionName) const
Function comment.
Sawyer::Optional< bool > functionMayReturn(rose_addr_t functionVa) const
Function may-return status.
FunctionConfigurationsByAddress & functionConfigurationsByAddress()
All function configuration details for function configs that have addresses.
std::string comment(rose_addr_t va) const
Address comment.
const AddressConfiguration & address(rose_addr_t) const
Configuration for a particular address.
const DataBlockConfigurations & dataBlocks() const
All data block configuration details.
BasicBlockConfiguration & insertMaybeBasicBlock(rose_addr_t va)
Lookup or insert a basic block.
Sawyer::Optional< bool > functionMayReturn(const FunctionPtr &) const
Function may-return status.
std::string dataBlockComment(rose_addr_t dblockVa) const
Data block comment.
static std::string fileFormatDoc()
Documentation string describing the file format.
bool insertConfiguration(const DataBlockConfiguration &)
Insert data block configuration information.
const FunctionConfiguration & function(rose_addr_t) const
Configuration for a particular function.
AddressConfiguration & insertMaybeAddress(rose_addr_t va)
Lookup or insert address details.
Sawyer::Optional< int64_t > functionStackDelta(const FunctionPtr &) const
Function stack delta.
const BasicBlockConfigurations & basicBlocks() const
All basic block configuration details.
std::set< rose_addr_t > basicBlockSuccessorVas(rose_addr_t bblockVa) const
Basic block successor addresses.
const BasicBlockConfiguration & basicBlock(rose_addr_t) const
Configuration for a particular basic block.
std::string functionComment(const FunctionPtr &) const
Function comment.
void print(std::ostream &) const
Generate a YAML file.
Sawyer::Optional< rose_addr_t > basicBlockFinalInstructionVa(rose_addr_t bblockVa) const
Basic block final instruction address.
const FunctionConfiguration & function(const std::string &name) const
Configuration for a particular function.
FunctionConfiguration & insertMaybeFunction(const std::string &name)
Lookup or insert a function.
Sawyer::Optional< bool > functionMayReturn(const std::string &functionName) const
Function may-return status.
std::string functionComment(rose_addr_t functionVa) const
Function comment.
std::string functionName(rose_addr_t functionVa) const
Function name.
Configuration information for a data block.
const SourceLocation & sourceLocation() const
Property: Location of data block in source code.
DataBlockConfiguration & name(const std::string &s)
Property: name.
rose_addr_t address() const
Property: starting address.
const std::string & name() const
Property: name.
DataBlockConfiguration(rose_addr_t va)
Configuration information for a data block.
DataBlockConfiguration & sourceLocation(const SourceLocation &loc)
Property: Location of data block in source code.
const std::string & comment() const
Property: comment.
DataBlockConfiguration & comment(const std::string &s)
Property: comment.
Configuration information for a function.
FunctionConfiguration & defaultName(const std::string &s)
Property: default name.
const SourceLocation & sourceLocation() const
Property: Location of function in source code.
FunctionConfiguration & stackDelta(const Sawyer::Optional< int64_t > &n)
Property: stack delta.
const std::string & name() const
Property: name.
FunctionConfiguration(const std::string &name)
Configuration information for a function.
FunctionConfiguration & name(const std::string &s)
Property: name.
Sawyer::Optional< rose_addr_t > address() const
Property: address.
const std::string & defaultName() const
Property: default name.
const std::string & comment() const
Property: comment.
FunctionConfiguration & comment(const std::string &s)
Property: comment.
FunctionConfiguration & mayReturn(const Sawyer::Optional< bool > &b)
Property: may-return.
FunctionConfiguration & sourceLocation(const SourceLocation &loc)
Property: Location of function in source code.
FunctionConfiguration(const Sawyer::Optional< rose_addr_t > &va, const std::string &name)
Configuration information for a function.
FunctionConfiguration(rose_addr_t va, const std::string &name="")
Configuration information for a function.
Sawyer::Optional< bool > mayReturn() const
Property: may-return.
Sawyer::Optional< int64_t > stackDelta() const
Property: stack delta.
Information about a source location.
Container associating values with keys.
Holds a value or nothing.
boost::filesystem::path Path
Name of entities in a filesystem.