It seems like the existing behaviour is perhaps not quite correct, because now that the actual mappings for the snapshot/scratch region can easily change (and do on most snapshot restores!), dbg_mem_access_fn will end up pointing at the wrong memory. Furthermore, the snapshot code has a very similar (although slightly different) need to access memory, and it might be nice if we could factor out at least the logic for determining which memory (snapshot, scratch, mapped region) a given GVA maps to.
See also comments introduced here and here.
It seems like the existing behaviour is perhaps not quite correct, because now that the actual mappings for the snapshot/scratch region can easily change (and do on most snapshot restores!),
dbg_mem_access_fnwill end up pointing at the wrong memory. Furthermore, the snapshot code has a very similar (although slightly different) need to access memory, and it might be nice if we could factor out at least the logic for determining which memory (snapshot, scratch, mapped region) a given GVA maps to.See also comments introduced here and here.