From 9197e70a8d122fcdb7cf7a5324b38b9948bc8499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 26 Jul 2015 15:36:09 +0200 Subject: [PATCH] ValueFlow: Changed --debug output so we can see if a variable is known or possible --- lib/token.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/token.cpp b/lib/token.cpp index 1fb0f930f..ec5f21641 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -1311,8 +1311,11 @@ void Token::printValueFlow(bool xml, std::ostream &out) const else if (line != tok->linenr()) out << "Line " << tok->linenr() << std::endl; line = tok->linenr(); - if (!xml) - out << " " << tok->str() << ":{"; + if (!xml) { + out << " " << tok->str() << ' ' << (tok->values.front().isKnown() ? "= " : ": "); + if (tok->values.size() > 1U) + out << '{'; + } for (std::list::const_iterator it=tok->values.begin(); it!=tok->values.end(); ++it) { if (xml) { out << " intvalue << '\"'; if (it->condition) out << " condition-line=\"" << it->condition->linenr() << '\"'; + if (it->isKnown()) + out << " known=\"true\""; + else if (it->isPossible()) + out << " possible=\"true\""; out << "/>" << std::endl; } @@ -1336,8 +1343,10 @@ void Token::printValueFlow(bool xml, std::ostream &out) const } if (xml) out << " " << std::endl; + else if (tok->values.size() > 1U) + out << '}' << std::endl; else - out << "}" << std::endl; + out << std::endl; } if (xml) out << " " << std::endl;