diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index ea202090f..b3bc44030 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -3935,6 +3935,28 @@ void SymbolDatabase::setValueTypeInTokenList(Token *tokens, bool cpp, char defau } } +void SymbolDatabase::debugValueType() const +{ + unsigned int linenr = 0U; + std::cout << std::endl << "### ValueType ###" << std::endl; + for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) { + if (tok->linenr() != linenr) + std::cout << std::endl << tok->linenr() << ": "; + linenr = tok->linenr(); + std::cout << tok->str(); + if (tok->valueType()) { + std::string t = tok->valueType()->str(); + std::string::size_type pos; + while ((pos = t.find(" ")) != std::string::npos) + t[pos] = '_'; + std::cout << ':' << t; + } + std::cout << ' '; + } + std::cout << std::endl << std::endl; +} + + std::string ValueType::str() const { std::string ret; diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index b737290df..4c2976099 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -1035,6 +1035,8 @@ public: /** Set valuetype in provided tokenlist */ static void setValueTypeInTokenList(Token *tokens, bool cpp, char defaultSignedness); + void debugValueType() const; + private: friend class Scope; friend class Function; diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 1ef5be3c5..2d6967fe3 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -3828,8 +3828,10 @@ void Tokenizer::printDebugOutput(unsigned int simplification) const if (_symbolDatabase) { if (_settings->xml) _symbolDatabase->printXml(std::cout); - else if (_settings->verbose) + else if (_settings->verbose) { _symbolDatabase->printOut("Symbol database"); + _symbolDatabase->debugValueType(); + } } if (_settings->verbose)