Just another little VM debugging trick I use… In one of my VM plugins I include a little C function called “breakHere”, which Smalltalk can call as a primitive. I put a breakpoint on it in the C debugger, and then have a convenient way to break in the C debugger from Smalltalk.
Archive for debugging
Another VM debugging trick: halting
Posted in consulting, Smalltalk, Spoon with tags debugging, smalltalk, spoon, squeak, virtual machine on 31 December 2013 by Craig LattaVM debugging trick: browsing object memory snapshots made from the C debugger in the simulator
Posted in Smalltalk, Spoon with tags C debugger, debugging, smalltalk, snapshot, spoon, squeak, virtual machine on 17 December 2013 by Craig LattaRecently 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.
toward a virtual machine browser
Posted in Naiad, Smalltalk, Spoon with tags browser, debugging, virtual machine on 27 November 2013 by Craig LattaI just had an idea for the design of a “virtual machine browser”, for browsing the internal state of a running virtual machine simulator and the objects of the memory it’s running. Something more sophisticated than printing the debug support messages to the Transcript.
