os/trace_buffer.h: fix wraparound

If the buffer contains padding at the end, the iteration must continue
in order to restart iteration from the start of the buffer.

genodelabs/genode#4244
This commit is contained in:
Johannes Schlatow 2022-02-07 15:57:52 +01:00 committed by Norman Feske
parent b31bbfe14c
commit 47cb44c6eb

View File

@ -79,8 +79,14 @@ class Trace_buffer
if (wrapped && entry.last()) { if (wrapped && entry.last()) {
wrapped = false; wrapped = false;
entry = _buffer.first(); entry = _buffer.first();
if (entry.last()) if (entry.last()) {
new_curr = entry;
break; break;
}
}
if (!entry.length()) {
continue;
} }
if (!functor(entry)) if (!functor(entry))