VM debugging trick: browsing object memory snapshots made from the C debugger in the simulator
Recently I made use of a virtual machine debugging trick that I don’t think I’ve written about here. The virtual machine simulator is a great way to browse around the state of object memory at the point of a VM crash, but it’s relatively slow (I measured it at about 3,000 instructions per second in my sonification work). The time it takes to get to that point might be prohibitively long.
Instead, you can run to that point in the C debugger (I use lldb on Mac OS), and make a snapshot by invoking primitiveSnapshot() manually. Then, open a simulator on that snapshot and browse the objects to your heart’s content. Depending on the error, you might even be able to modify the objects such that the active process may proceed, and you can snapshot a repaired object memory from the simulator.
24 December 2013 at 4:22 pm
I’m pretty sure Eliot described this trick the other month, in the context of his own VM hacking adventures. It’s certainly a very neat trick!
LikeLike
24 December 2013 at 11:22 pm
Yeah, I think I mentioned it on the Squeak list in 1998 or somesuch… time for another one. :)
LikeLike