Add some code for doing a register snapshot.