ROSE 0.11.145.147
|
Provides functions for testing binary instruction semantics.
Most instruction semantics errors occur in two situations: an author of a subclass instantiates an incorrect SValue type, or a subclass fails to implement a virtual allocator (either due to the subclass author not implementing it, or due the the super class author adding new methods or changing method signatures). This test harness attempts to catch most of those kinds of changes.
To use this test harness, instantiate a RiscOperators object and call the TestSemantics<>::test() method. A BaseSemantics::Exception is thrown if an error is detected.
The template arguments for TestSemantics should be the smart pointer types of the classes used to build the RiscOperators that's passed to the test() method.
Definition at line 29 of file TestSemantics.h.
#include <Rose/BinaryAnalysis/InstructionSemantics/TestSemantics.h>
Classes | |
class | Exception |
class | MemoryStateSubclass |
class | RegisterStateSubclass |
class | RiscOperatorsSubclass |
class | StateSubclass |
class | SValueSubclass |
Public Types | |
typedef SValuePtr::Pointee | SValue |
typedef RegisterStatePtr::element_type | RegisterState |
typedef MemoryStatePtr::element_type | MemoryState |
typedef StatePtr::element_type | State |
typedef RiscOperatorsPtr::element_type | RiscOperators |
Public Member Functions | |
void | require (bool assertion, const std::string &what_failed) |
template<typename Pointer > | |
void | nonnull (const Pointer &x, const std::string &what_failed) |
template<class ToPtr , class FromPtr > | |
void | check_type (const FromPtr &x, const std::string &what_failed) |
void | check_sval_type (const BaseSemantics::SValuePtr &x, const std::string &what_failed) |
void | test (const BaseSemantics::RiscOperatorsPtr &ops) |
void | test (const BaseSemantics::SValuePtr &protoval, const BaseSemantics::StatePtr &state, const BaseSemantics::RiscOperatorsPtr &ops) |
typedef SValuePtr::Pointee Rose::BinaryAnalysis::InstructionSemantics::TestSemantics< SValuePtr, RegisterStatePtr, MemoryStatePtr, StatePtr, RiscOperatorsPtr >::SValue |
Definition at line 31 of file TestSemantics.h.
typedef RegisterStatePtr::element_type Rose::BinaryAnalysis::InstructionSemantics::TestSemantics< SValuePtr, RegisterStatePtr, MemoryStatePtr, StatePtr, RiscOperatorsPtr >::RegisterState |
Definition at line 32 of file TestSemantics.h.
typedef MemoryStatePtr::element_type Rose::BinaryAnalysis::InstructionSemantics::TestSemantics< SValuePtr, RegisterStatePtr, MemoryStatePtr, StatePtr, RiscOperatorsPtr >::MemoryState |
Definition at line 33 of file TestSemantics.h.
typedef StatePtr::element_type Rose::BinaryAnalysis::InstructionSemantics::TestSemantics< SValuePtr, RegisterStatePtr, MemoryStatePtr, StatePtr, RiscOperatorsPtr >::State |
Definition at line 34 of file TestSemantics.h.
typedef RiscOperatorsPtr::element_type Rose::BinaryAnalysis::InstructionSemantics::TestSemantics< SValuePtr, RegisterStatePtr, MemoryStatePtr, StatePtr, RiscOperatorsPtr >::RiscOperators |
Definition at line 35 of file TestSemantics.h.
|
inline |
Definition at line 42 of file TestSemantics.h.
|
inline |
Definition at line 48 of file TestSemantics.h.
|
inline |
Definition at line 55 of file TestSemantics.h.
|
inline |
Definition at line 64 of file TestSemantics.h.
|
inline |
Definition at line 111 of file TestSemantics.h.
|
inline |
Definition at line 120 of file TestSemantics.h.