""" This mechanism exists to retrieve per-instruction program snapshots from QEMU, specifically including memory dumps. This is surprisingly nontrivial (we don't have a log option like `-d memory`), and the mechanism we have implemented to achieve this is accordingly complicated. In short: We use QEMU's feature to interact with the emulation via a GDB server interface together with parsing QEMU's logs to record register and memory state at single-instruction intervals. We need QEMU's log in addition to the GDB server because QEMU's GDB server does not support querying memory mapping information. We need this information to know from where we need to read memory, so we parse memory mappings from the log (option `-d page`). We need two scripts (this one and the primary `qemu_tool.py`) because we can't pass arguments to scripts executed via `gdb -x