klee
|
ExecutionState representing a path under exploration. More...
#include <ExecutionState.h>
Public Types | |
using | stack_ty = std::vector< StackFrame > |
Public Member Functions | |
ExecutionState (KFunction *kf) | |
ExecutionState & | operator= (const ExecutionState &)=delete |
ExecutionState (ExecutionState &&) noexcept=delete | |
ExecutionState & | operator= (ExecutionState &&) noexcept=delete |
~ExecutionState () | |
ExecutionState * | branch () |
void | pushFrame (KInstIterator caller, KFunction *kf) |
void | popFrame () |
void | addSymbolic (const MemoryObject *mo, const Array *array) |
void | addConstraint (ref< Expr > e) |
void | addCexPreference (const ref< Expr > &cond) |
bool | merge (const ExecutionState &b) |
void | dumpStack (llvm::raw_ostream &out) const |
std::uint32_t | getID () const |
void | setID () |
Public Attributes | |
KInstIterator | pc |
Pointer to instruction to be executed after the current instruction. More... | |
KInstIterator | prevPC |
Pointer to instruction which is currently executed. More... | |
stack_ty | stack |
Stack representing the current instruction stream. More... | |
std::uint32_t | incomingBBIndex |
Remember from which Basic Block control flow arrived (i.e. to select the right phi values) More... | |
std::uint32_t | depth = 0 |
Exploration depth, i.e., number of times KLEE branched for this state. More... | |
AddressSpace | addressSpace |
Address space used by this state (e.g. Global and Heap) More... | |
ConstraintSet | constraints |
Constraints collected so far. More... | |
SolverQueryMetaData | queryMetaData |
Statistics and information. More... | |
TreeOStream | pathOS |
History of complete path: represents branches taken to reach/create this state (both concrete and symbolic) More... | |
TreeOStream | symPathOS |
History of symbolic path: represents symbolic branches taken to reach/create this state. More... | |
std::map< const std::string *, std::set< std::uint32_t > > | coveredLines |
Set containing which lines in which files are covered by this state. More... | |
PTreeNode * | ptreeNode = nullptr |
Pointer to the process tree of the current state Copies of ExecutionState should not copy ptreeNode. More... | |
std::vector< std::pair< ref< const MemoryObject >, const Array * > > | symbolics |
Ordered list of symbolics: used to generate test cases. More... | |
ImmutableSet< ref< Expr > > | cexPreferences |
A set of boolean expressions the user has requested be true of a counterexample. More... | |
std::set< std::string > | arrayNames |
Set of used array names for this state. Used to avoid collisions. More... | |
std::vector< ref< MergeHandler > > | openMergeStack |
The objects handling the klee_open_merge calls this state ran through. More... | |
std::uint64_t | steppedInstructions = 0 |
The numbers of times this state has run through Executor::stepInstruction. More... | |
std::uint32_t | instsSinceCovNew = 0 |
Counts how many instructions were executed since the last new instruction was covered. More... | |
std::unique_ptr< UnwindingInformation > | unwindingInformation |
Keep track of unwinding state while unwinding, otherwise empty. More... | |
std::uint32_t | id = 0 |
the state id More... | |
bool | coveredNew = false |
Whether a new instruction was covered in this state. More... | |
bool | forkDisabled = false |
Disables forking for this state. Set by user code. More... | |
Static Public Attributes | |
static std::uint32_t | nextID = 1 |
the global state counter More... | |
Private Member Functions | |
ExecutionState (const ExecutionState &state) | |
ExecutionState representing a path under exploration.
Definition at line 147 of file ExecutionState.h.
using klee::ExecutionState::stack_ty = std::vector<StackFrame> |
Definition at line 157 of file ExecutionState.h.
|
private |
Definition at line 87 of file ExecutionState.cpp.
References openMergeStack.
Referenced by branch().
|
explicit |
Definition at line 73 of file ExecutionState.cpp.
References pushFrame(), and setID().
|
deletenoexcept |
ExecutionState::~ExecutionState | ( | ) |
Definition at line 79 of file ExecutionState.cpp.
References openMergeStack, popFrame(), and stack.
Definition at line 356 of file ExecutionState.cpp.
References cexPreferences.
Definition at line 351 of file ExecutionState.cpp.
References klee::ConstraintManager::addConstraint(), and constraints.
Referenced by klee::Executor::addConstraint(), and klee::Executor::replaceReadWithSymbolic().
void ExecutionState::addSymbolic | ( | const MemoryObject * | mo, |
const Array * | array | ||
) |
Definition at line 135 of file ExecutionState.cpp.
References symbolics.
Referenced by klee::Executor::executeMakeSymbolic().
ExecutionState * ExecutionState::branch | ( | ) |
Definition at line 113 of file ExecutionState.cpp.
References depth, and ExecutionState().
Referenced by klee::Executor::branch(), and klee::Executor::fork().
void ExecutionState::dumpStack | ( | llvm::raw_ostream & | out | ) | const |
Definition at line 317 of file ExecutionState.cpp.
References klee::InstructionInfo::assemblyLine, klee::StackFrame::caller, klee::InstructionInfo::file, klee::KFunction::function, klee::KFunction::getArgRegister(), klee::KInstruction::info, klee::StackFrame::kf, klee::InstructionInfo::line, klee::StackFrame::locals, prevPC, stack, and klee::Cell::value.
Referenced by klee::Executor::terminateStateOnError().
|
inline |
Definition at line 272 of file ExecutionState.h.
References id.
Referenced by klee::ExecutionStateIDCompare::operator()(), klee::Executor::printDebugInstructions(), and klee::Executor::terminateStateOnError().
bool ExecutionState::merge | ( | const ExecutionState & | b | ) |
Definition at line 154 of file ExecutionState.cpp.
References klee::ConstraintManager::addConstraint(), addressSpace, klee::ConstantExpr::alloc(), klee::ImmutableMap< K, D, CMP >::begin(), klee::ConstraintSet::begin(), klee::Expr::Bool, constraints, klee::SelectExpr::create(), klee::ImmutableMap< K, D, CMP >::end(), klee::ConstraintSet::end(), klee::AddressSpace::findObject(), klee::AddressSpace::getWriteable(), klee::StackFrame::kf, klee::StackFrame::locals, klee::KFunction::numRegisters, klee::AddressSpace::objects, pc, klee::ObjectState::read8(), klee::ObjectState::readOnly, klee::MemoryObject::size, stack, symbolics, klee::Cell::value, and klee::ObjectState::write().
|
delete |
|
deletenoexcept |
void ExecutionState::popFrame | ( | ) |
Definition at line 128 of file ExecutionState.cpp.
References addressSpace, klee::StackFrame::allocas, stack, and klee::AddressSpace::unbindObject().
Referenced by klee::Executor::executeInstruction(), klee::Executor::unwindToNextLandingpad(), and ~ExecutionState().
void ExecutionState::pushFrame | ( | KInstIterator | caller, |
KFunction * | kf | ||
) |
Definition at line 124 of file ExecutionState.cpp.
References stack.
Referenced by klee::Executor::executeCall(), ExecutionState(), and klee::Executor::unwindToNextLandingpad().
|
inline |
Definition at line 273 of file ExecutionState.h.
References nextID.
Referenced by ExecutionState().
AddressSpace klee::ExecutionState::addressSpace |
Address space used by this state (e.g. Global and Heap)
Definition at line 181 of file ExecutionState.h.
Referenced by klee::Executor::bindObjectInState(), klee::Executor::callExternalFunction(), klee::Executor::doImpliedValueConcretization(), klee::Executor::executeAlloc(), klee::Executor::executeCall(), klee::Executor::executeInstruction(), klee::Executor::executeMemoryOperation(), klee::Executor::getAddressInfo(), klee::Executor::initializeGlobalObjects(), merge(), popFrame(), klee::SpecialFunctionHandler::readStringAtAddress(), and klee::Executor::resolveExact().
std::set<std::string> klee::ExecutionState::arrayNames |
Set of used array names for this state. Used to avoid collisions.
Definition at line 216 of file ExecutionState.h.
Referenced by klee::Executor::executeMakeSymbolic().
ImmutableSet<ref<Expr> > klee::ExecutionState::cexPreferences |
A set of boolean expressions the user has requested be true of a counterexample.
Definition at line 213 of file ExecutionState.h.
Referenced by addCexPreference(), and klee::Executor::getSymbolicSolution().
ConstraintSet klee::ExecutionState::constraints |
Constraints collected so far.
Definition at line 184 of file ExecutionState.h.
Referenced by klee::Executor::addConstraint(), addConstraint(), klee::Executor::branch(), klee::Executor::callExternalFunction(), klee::AddressSpace::checkPointerInObject(), klee::Executor::executeAlloc(), klee::Executor::executeGetValue(), klee::Executor::executeInstruction(), klee::Executor::executeMemoryOperation(), klee::ObjectState::flushToConcreteStore(), klee::Executor::fork(), klee::Executor::getAddressInfo(), klee::Executor::getConstraintLog(), klee::Executor::getSymbolicSolution(), klee::Executor::maxStaticPctChecks(), merge(), klee::SeedInfo::patchSeed(), klee::AddressSpace::resolve(), klee::AddressSpace::resolveOne(), klee::Executor::toConstant(), and klee::Executor::toUnique().
std::map<const std::string *, std::set<std::uint32_t> > klee::ExecutionState::coveredLines |
Set containing which lines in which files are covered by this state.
Definition at line 200 of file ExecutionState.h.
Referenced by klee::Executor::fork(), klee::Executor::getCoveredLines(), and klee::StatsTracker::stepInstruction().
bool klee::ExecutionState::coveredNew = false |
Whether a new instruction was covered in this state.
Definition at line 238 of file ExecutionState.h.
Referenced by klee::Executor::fork(), klee::StatsTracker::markBranchVisited(), shouldWriteTest(), and klee::StatsTracker::stepInstruction().
std::uint32_t klee::ExecutionState::depth = 0 |
Exploration depth, i.e., number of times KLEE branched for this state.
Definition at line 178 of file ExecutionState.h.
Referenced by branch(), and klee::WeightedRandomSearcher::getWeight().
bool klee::ExecutionState::forkDisabled = false |
Disables forking for this state. Set by user code.
Definition at line 241 of file ExecutionState.h.
Referenced by klee::Executor::branchingPermitted(), and klee::Executor::fork().
std::uint32_t klee::ExecutionState::id = 0 |
std::uint32_t klee::ExecutionState::incomingBBIndex |
Remember from which Basic Block control flow arrived (i.e. to select the right phi values)
Definition at line 173 of file ExecutionState.h.
Referenced by klee::Executor::executeInstruction(), and klee::Executor::transferToBasicBlock().
std::uint32_t klee::ExecutionState::instsSinceCovNew = 0 |
Counts how many instructions were executed since the last new instruction was covered.
Definition at line 226 of file ExecutionState.h.
Referenced by klee::WeightedRandomSearcher::getWeight(), klee::StatsTracker::markBranchVisited(), and klee::StatsTracker::stepInstruction().
|
static |
std::vector<ref<MergeHandler> > klee::ExecutionState::openMergeStack |
The objects handling the klee_open_merge calls this state ran through.
Definition at line 219 of file ExecutionState.h.
Referenced by ExecutionState(), and ~ExecutionState().
TreeOStream klee::ExecutionState::pathOS |
History of complete path: represents branches taken to reach/create this state (both concrete and symbolic)
Definition at line 193 of file ExecutionState.h.
Referenced by klee::Executor::fork(), klee::Executor::getPathStreamID(), and klee::Executor::runFunctionAsMain().
KInstIterator klee::ExecutionState::pc |
Pointer to instruction to be executed after the current instruction.
Definition at line 163 of file ExecutionState.h.
Referenced by klee::Executor::callExternalFunction(), klee::StatsTracker::computeReachableUncovered(), klee::Executor::executeCall(), klee::Executor::executeInstruction(), klee::Executor::executeMemoryOperation(), klee::Executor::fork(), klee::WeightedRandomSearcher::getWeight(), merge(), klee::Executor::printDebugInstructions(), klee::Executor::run(), klee::Executor::runFunctionAsMain(), klee::StatsTracker::stepInstruction(), klee::Executor::stepInstruction(), klee::Executor::terminateState(), klee::Executor::toConstant(), klee::Executor::transferToBasicBlock(), klee::Executor::unwindToNextLandingpad(), and klee::StatsTracker::updateStateStatistics().
KInstIterator klee::ExecutionState::prevPC |
Pointer to instruction which is currently executed.
Definition at line 166 of file ExecutionState.h.
Referenced by dumpStack(), klee::Executor::executeAlloc(), klee::Executor::executeCall(), klee::Executor::executeMemoryOperation(), klee::Executor::fork(), klee::Executor::getLastNonKleeInternalInstruction(), klee::Executor::maxStaticPctChecks(), klee::Executor::stepInstruction(), klee::Executor::terminateState(), and klee::Executor::unwindToNextLandingpad().
PTreeNode* klee::ExecutionState::ptreeNode = nullptr |
Pointer to the process tree of the current state Copies of ExecutionState should not copy ptreeNode.
Definition at line 204 of file ExecutionState.h.
Referenced by klee::PTree::attach(), klee::Executor::branch(), klee::Executor::fork(), klee::PTree::PTree(), klee::PTreeNode::PTreeNode(), klee::Executor::terminateState(), and klee::Executor::updateStates().
|
mutable |
Statistics and information.
Metadata utilized and collected by solvers for this state
Definition at line 189 of file ExecutionState.h.
Referenced by klee::Executor::addConstraint(), klee::Executor::branch(), klee::Executor::callExternalFunction(), klee::AddressSpace::checkPointerInObject(), klee::Executor::executeAlloc(), klee::Executor::executeGetValue(), klee::Executor::executeInstruction(), klee::Executor::executeMemoryOperation(), klee::ObjectState::flushToConcreteStore(), klee::Executor::fork(), klee::Executor::getAddressInfo(), klee::Executor::getSymbolicSolution(), klee::WeightedRandomSearcher::getWeight(), klee::Executor::maxStaticPctChecks(), klee::SeedInfo::patchSeed(), klee::AddressSpace::resolve(), klee::AddressSpace::resolveOne(), klee::Executor::toConstant(), and klee::Executor::toUnique().
stack_ty klee::ExecutionState::stack |
Stack representing the current instruction stream.
Definition at line 169 of file ExecutionState.h.
Referenced by klee::Executor::bindObjectInState(), klee::StatsTracker::computeReachableUncovered(), dumpStack(), klee::Executor::eval(), klee::Executor::executeCall(), klee::Executor::executeInstruction(), klee::StatsTracker::framePushed(), klee::Executor::getArgumentCell(), klee::Executor::getDestCell(), klee::Executor::getLastNonKleeInternalInstruction(), klee::WeightedRandomSearcher::getWeight(), klee::Executor::maxStaticPctChecks(), merge(), popFrame(), pushFrame(), klee::StatsTracker::stepInstruction(), klee::Executor::transferToBasicBlock(), klee::Executor::unwindToNextLandingpad(), klee::StatsTracker::updateStateStatistics(), and ~ExecutionState().
std::uint64_t klee::ExecutionState::steppedInstructions = 0 |
The numbers of times this state has run through Executor::stepInstruction.
Definition at line 222 of file ExecutionState.h.
Referenced by klee::MergeHandler::getInstructionDistance(), and klee::Executor::stepInstruction().
std::vector<std::pair<ref<const MemoryObject>, const Array *> > klee::ExecutionState::symbolics |
Ordered list of symbolics: used to generate test cases.
Definition at line 209 of file ExecutionState.h.
Referenced by addSymbolic(), klee::Executor::getSymbolicSolution(), and merge().
TreeOStream klee::ExecutionState::symPathOS |
History of symbolic path: represents symbolic branches taken to reach/create this state.
Definition at line 197 of file ExecutionState.h.
Referenced by klee::Executor::fork(), klee::Executor::getSymbolicPathStreamID(), and klee::Executor::runFunctionAsMain().
std::unique_ptr<UnwindingInformation> klee::ExecutionState::unwindingInformation |
Keep track of unwinding state while unwinding, otherwise empty.
Definition at line 229 of file ExecutionState.h.
Referenced by klee::Executor::executeInstruction(), and klee::Executor::unwindToNextLandingpad().