ExprEngine; Improved debug output, show constraints.
This commit is contained in:
parent
a7fb946ab8
commit
2e96cc932d
|
@ -339,7 +339,7 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ifSplit(const Token *tok, unsigned int thenIndex, unsigned int elseIndex) {
|
void ifSplit(const Token *tok, unsigned int thenIndex, unsigned int elseIndex) {
|
||||||
mMap[tok].push_back("Split. Then:" + std::to_string(thenIndex) + " Else:" + std::to_string(elseIndex));
|
mMap[tok].push_back(std::to_string(thenIndex) + ": Split. Then:" + std::to_string(thenIndex) + " Else:" + std::to_string(elseIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -534,13 +534,17 @@ namespace {
|
||||||
return;
|
return;
|
||||||
const SymbolDatabase * const symbolDatabase = tokenizer->getSymbolDatabase();
|
const SymbolDatabase * const symbolDatabase = tokenizer->getSymbolDatabase();
|
||||||
std::ostringstream s;
|
std::ostringstream s;
|
||||||
s << mDataIndex << ":" << "{";
|
s << mDataIndex << ":" << "memory:{";
|
||||||
|
bool first = true;
|
||||||
for (auto mem : memory) {
|
for (auto mem : memory) {
|
||||||
ExprEngine::ValuePtr value = mem.second;
|
ExprEngine::ValuePtr value = mem.second;
|
||||||
const Variable *var = symbolDatabase->getVariableFromVarId(mem.first);
|
const Variable *var = symbolDatabase->getVariableFromVarId(mem.first);
|
||||||
if (!var)
|
if (!var)
|
||||||
continue;
|
continue;
|
||||||
s << " " << var->name() << "=";
|
if (!first)
|
||||||
|
s << " ";
|
||||||
|
first = false;
|
||||||
|
s << var->name() << "=";
|
||||||
if (!value)
|
if (!value)
|
||||||
s << "(null)";
|
s << "(null)";
|
||||||
else if (value->name[0] == '$' && value->getSymbolicExpression() != value->name)
|
else if (value->name[0] == '$' && value->getSymbolicExpression() != value->name)
|
||||||
|
@ -549,6 +553,18 @@ namespace {
|
||||||
s << value->name;
|
s << value->name;
|
||||||
}
|
}
|
||||||
s << "}";
|
s << "}";
|
||||||
|
|
||||||
|
if (!constraints.empty()) {
|
||||||
|
s << " constraints:{";
|
||||||
|
first = true;
|
||||||
|
for (auto constraint: constraints) {
|
||||||
|
if (!first)
|
||||||
|
s << " ";
|
||||||
|
first = false;
|
||||||
|
s << constraint->getSymbolicExpression();
|
||||||
|
}
|
||||||
|
s << "}";
|
||||||
|
}
|
||||||
mTrackExecution->state(tok, s.str());
|
mTrackExecution->state(tok, s.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue