First public push of the first step of the hazelnut GSoC project :)<br><br><b>In a nutshell</b><br><br>For those who didn't know SystemTracer (the father):<br>
It is a tool that traces a graph of objects and writes an image from it.<br><br>ImageWriter is a refactored, renamed and repackaged version of SystemTracer2 with the following changes:<br>- The image format can be provided as a parameter.<br>
- You have to provide an SmalltalkImage object as root to write the image (so in the future we can write bootstrap with this).<br>- The object format was reified in objects. So the code is easier to understand + change, and people can learn how are our objects in memory easily :D.<br>
<br>Right now, only 32 bit image format is supported.<br><br><b>Structure</b><br><br>- ImageWriter-Core has the image formats and the image writer in itself<br>- ImageWriter-ObjectFormats contains objects that represent the memory layout of the objects and it's headers.<br>
- ImageWriter-Tests has some tests.<br><br><b>Tests done</b><br><br> - Only tested in Pharo-1.4<br> - There are specific tests written for the size and headers of the objects<br> - Also, I've written a Pharo-1.4 image and then run the tests in the copied image. Only one failure compared to the original :)<br>
<br><b>Known Bugs :)</b><br><br> - WeakRegistryTest>>#testFinalizationWithOnFork is failing, and when I run it manually it works :/. In the image I use to write, it does not happen, only in the clone.<br> - When opening the new image, the window is too small. It is not respecting the original image size. Don't know yet what is the problem.<br>
<br><b>How To Download</b><br><br>Gofer it<br> squeaksource3: 'ImageWriter';<br> package: 'ImageWriter-Core';<br> package: 'ImageWriter-ObjectFormats';<br> package: 'ImageWriter-Tests';<br>
load<br><br><b>How to Use it</b><br><br> HzImageWriter new<br> format: HzCogImageFormat new; "or HzInterpreterImageFormat new"<br> imageFileName: 'someFile.image';<br> onInitializeDo: [ "Some initialization?" ]; "this is optional, probably the same as an startup script, probably nonsense"<br>
writeImage: Smalltalk "Yes, we provide the our lovely global Smalltak, but any SmalltalkImage instance could be"<br><br><b>Next steps on this direction</b><br><br> - support to write an isolated image different from the host one (I'll know what I need later, hehe)<br>
- class comments!<br> - metacello configuration<br> - better api :)<br><br><b>Links</b><br><br><a href="http://ss3.gemstone.com/ss/ImageWriter.html">http://ss3.gemstone.com/ss/ImageWriter.html</a><br><br><br>Cheers,<br>Guille<br>