From e0dd061dcbc152fe67c3ee695e9e6264bd387814 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Sat, 28 Mar 2015 12:46:15 +0100 Subject: [PATCH] CompareDump: add debug trace of past push/pop operations to assist debugging. --- tools/assimp_cmd/CompareDump.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/assimp_cmd/CompareDump.cpp b/tools/assimp_cmd/CompareDump.cpp index 5027a1fc4..9940c18a6 100644 --- a/tools/assimp_cmd/CompareDump.cpp +++ b/tools/assimp_cmd/CompareDump.cpp @@ -137,12 +137,13 @@ public: else history.back().second[s] = 1; history.push_back(HistoryEntry(s,PerChunkCounter())); - + debug_trace.push_back("PUSH " + s); } /* leave current scope */ void pop_elem() { ai_assert(history.size()); + debug_trace.push_back("POP "+ history.back().first); history.pop_back(); } @@ -250,11 +251,15 @@ private: last = (*rev).first.c_str(); } + ss << std::endl << "Debug trace: "<< std::endl; + for (const std::string& s : debug_trace) { + ss << s << std::endl; + } return ss.str(); } - /* read from both streams simult.*/ + /* read from both streams at the same time */ template void read(T& filla,T& fille) { if(1 != fread(&filla,sizeof(T),1,actual)) { EOFActual(); @@ -291,6 +296,8 @@ private: typedef std::deque ChunkHistory; ChunkHistory history; + std::vector debug_trace; + typedef std::stack > LengthStack; LengthStack lengths;