lightrec: Add the big-ass debugger
This debugger has this name because it doesn't even try to be suttle -
it will run the dynarec and interpreter versions of Lightrec in
parallel, comparing their behaviour at every exit point, and returning
any issue as soon as they appear.
By default, the emulator will print a checksum of the registers after
each exit point. When a mismatch is found, it is advised to re-start the
debugging setting the LIGHTREC_VERY_DEBUG=1 environment variable, and to
set the LIGHTREC_BEGIN_CYCLES environment variable to the cycle value of
the last known state. When the "very debug" mode is used, the
interpreter and dynarec will exit after each single block, and the
emulator will compute a checksum of the whole RAM and scratchpad and
print all registers. This two-level debugging allows to find a mismatch
point very fast, and then fine-tune until the exact breaking point is
found.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>