ROSE 0.11.145.147
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::SymbolicExpressionParser::MemorySubstituter Class Reference

Description

Expand "memory" function to placeholder.

This parser replaces functions of the form (memory[NBYTES] ADDRESS) to placeholders that are later substituted with the actual value read from ROSE's semantic memory state.

Definition at line 368 of file SymbolicExpressionParser.h.

#include <Rose/BinaryAnalysis/SymbolicExpressionParser.h>

Inheritance diagram for Rose::BinaryAnalysis::SymbolicExpressionParser::MemorySubstituter:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::SymbolicExpressionParser::MemorySubstituter:
Collaboration graph
[legend]

Public Types

typedef Sawyer::SharedPointer< MemorySubstituterPtr
 Shared-ownership pointer.
 
typedef Sawyer::Container::Map< SymbolicExpression::Ptr, SymbolicExpression::PtrExprToMem
 
- Public Types inherited from Rose::BinaryAnalysis::SymbolicExpressionParser::OperatorExpansion
typedef Sawyer::SharedPointer< OperatorExpansionPtr
 Shared-ownership pointer.
 
- Public Types inherited from Rose::BinaryAnalysis::SymbolicExpressionParser::Expansion
typedef Sawyer::SharedPointer< ExpansionPtr
 Shared-ownership pointer to an Expansion.
 

Public Member Functions

virtual SymbolicExpression::Ptr immediateExpansion (const Token &name, const SymbolicExpression::Nodes &operands) override
 Operator to expand a list into an expression tree.
 
virtual SymbolicExpression::Ptr delayedExpansion (const SymbolicExpression::Ptr &, const SymbolicExpressionParser *) override
 Substitute one expression with another.
 
InstructionSemantics::BaseSemantics::RiscOperatorsPtr riscOperators () const
 Property: Semantic state used during delayed expansion.
 
void riscOperators (const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &ops)
 Property: Semantic state used during delayed expansion.
 
- Public Member Functions inherited from Rose::BinaryAnalysis::SymbolicExpressionParser::Expansion
const std::string & title () const
 Property: Title to use for documentation.
 
void title (const std::string &s)
 Property: Title to use for documentation.
 
const std::string & docString () const
 Property: Documentation string.
 
void docString (const std::string &s)
 Property: Documentation string.
 
- Public Member Functions inherited from Sawyer::SharedObject
 SharedObject ()
 Default constructor.
 
 SharedObject (const SharedObject &)
 Copy constructor.
 
virtual ~SharedObject ()
 Virtual destructor.
 
SharedObjectoperator= (const SharedObject &)
 Assignment.
 

Static Public Member Functions

static Ptr instance (const SmtSolver::Ptr &solver)
 Allocating constructor.
 

Protected Member Functions

 MemorySubstituter (const SmtSolver::Ptr &solver)
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::SymbolicExpressionParser::OperatorExpansion
 OperatorExpansion (const SmtSolverPtr &solver)
 

Additional Inherited Members

- Protected Attributes inherited from Rose::BinaryAnalysis::SymbolicExpressionParser::OperatorExpansion
SmtSolverPtr solver
 

Member Typedef Documentation

◆ Ptr

Shared-ownership pointer.

See Shared ownership.

Definition at line 371 of file SymbolicExpressionParser.h.

◆ ExprToMem

Definition at line 374 of file SymbolicExpressionParser.h.

Constructor & Destructor Documentation

◆ MemorySubstituter()

Rose::BinaryAnalysis::SymbolicExpressionParser::MemorySubstituter::MemorySubstituter ( const SmtSolver::Ptr solver)
inlineprotected

Definition at line 381 of file SymbolicExpressionParser.h.

Member Function Documentation

◆ riscOperators() [1/2]

InstructionSemantics::BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::SymbolicExpressionParser::MemorySubstituter::riscOperators ( ) const
inline

Property: Semantic state used during delayed expansion.

This property holds a pointer to the semantic operators and its current state that's used during the second phase of expansion (delayedExpansion).

Definition at line 394 of file SymbolicExpressionParser.h.

◆ riscOperators() [2/2]

void Rose::BinaryAnalysis::SymbolicExpressionParser::MemorySubstituter::riscOperators ( const InstructionSemantics::BaseSemantics::RiscOperatorsPtr ops)
inline

Property: Semantic state used during delayed expansion.

This property holds a pointer to the semantic operators and its current state that's used during the second phase of expansion (delayedExpansion).

Definition at line 397 of file SymbolicExpressionParser.h.

◆ immediateExpansion()

virtual SymbolicExpression::Ptr Rose::BinaryAnalysis::SymbolicExpressionParser::MemorySubstituter::immediateExpansion ( const Token name,
const SymbolicExpression::Nodes &  operands 
)
overridevirtual

Operator to expand a list into an expression tree.

The width in bits is either the width specified in square brackets for the function symbol, or zero. Functors are all called for each symbol, and the first one to return non-null is the one that's used to generate the symbolic expression.

Implements Rose::BinaryAnalysis::SymbolicExpressionParser::OperatorExpansion.

◆ delayedExpansion()

virtual SymbolicExpression::Ptr Rose::BinaryAnalysis::SymbolicExpressionParser::MemorySubstituter::delayedExpansion ( const SymbolicExpression::Ptr src,
const SymbolicExpressionParser  
)
overridevirtual

Substitute one expression with another.

This second phase of expansion occurs after parsing (perhaps much later) and is able to dynamically replace the given expression with some other expression. For instance, if this object recognizes register names, it it might replace the register names with variables in the first phase, and during the second phase read register values from a provided state.

If the input expression does not need to be substituted, then this function should return the original expression.

Reimplemented from Rose::BinaryAnalysis::SymbolicExpressionParser::Expansion.


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