CompareDump: add debug trace of past push/pop operations to assist debugging.
parent
fafe5584b6
commit
e0dd061dcb
|
@ -137,12 +137,13 @@ public:
|
||||||
else history.back().second[s] = 1;
|
else history.back().second[s] = 1;
|
||||||
|
|
||||||
history.push_back(HistoryEntry(s,PerChunkCounter()));
|
history.push_back(HistoryEntry(s,PerChunkCounter()));
|
||||||
|
debug_trace.push_back("PUSH " + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* leave current scope */
|
/* leave current scope */
|
||||||
void pop_elem() {
|
void pop_elem() {
|
||||||
ai_assert(history.size());
|
ai_assert(history.size());
|
||||||
|
debug_trace.push_back("POP "+ history.back().first);
|
||||||
history.pop_back();
|
history.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,11 +251,15 @@ private:
|
||||||
last = (*rev).first.c_str();
|
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();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* read from both streams simult.*/
|
/* read from both streams at the same time */
|
||||||
template <typename T> void read(T& filla,T& fille) {
|
template <typename T> void read(T& filla,T& fille) {
|
||||||
if(1 != fread(&filla,sizeof(T),1,actual)) {
|
if(1 != fread(&filla,sizeof(T),1,actual)) {
|
||||||
EOFActual();
|
EOFActual();
|
||||||
|
@ -291,6 +296,8 @@ private:
|
||||||
typedef std::deque<HistoryEntry> ChunkHistory;
|
typedef std::deque<HistoryEntry> ChunkHistory;
|
||||||
ChunkHistory history;
|
ChunkHistory history;
|
||||||
|
|
||||||
|
std::vector<std::string> debug_trace;
|
||||||
|
|
||||||
typedef std::stack<std::pair<uint32_t,uint32_t> > LengthStack;
|
typedef std::stack<std::pair<uint32_t,uint32_t> > LengthStack;
|
||||||
LengthStack lengths;
|
LengthStack lengths;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue