htm: Fix dumping trace when wrapped
htm: Fix dumping trace when wrapped

Currently we only dump from the start of the buffer to the last
location written which means we can miss a lot of the trace. This is
fine for the record command (which never wraps), but is sub-optimal for
start/stop commands.

This fixes the dumping so it detects if the buffer has wrapped, and if
so, dump the last part of the buffer first, then the rest after.

Signed-off-by: Michael Neuling <7b0ab45a730e48a69239010b5b8fe5fa4e8eaac6@neuling.org>

open-power/pdbg,open-power/pdbg,open-power/pdbg