[squeak-dev] literals in compiled method

Helmut Rohregger helmut.rohregger at gmail.com
Fri Mar 15 14:20:14 UTC 2013


Am 15.03.2013 15:14, schrieb Bert Freudenberg:
> On 2013-03-15, at 14:47, Helmut Rohregger <helmut.rohregger at gmail.com> wrote:
>
>> Am 15.03.2013 14:29, schrieb Bert Freudenberg:
>>> On 2013-03-15, at 11:30, Helmut Rohregger <helmut.rohregger at gmail.com> wrote:
>>>
>>>> Hi all
>>>>
>>>> maybe someone of you can help me.
>>>> i am trying to read in a Squeak4.3.image in Java. My question is about the image-format.
>>>> when i read in a compiled method, there is a object header, then a compiled method header and then some literals. The last 2 literals are always a ByteSymbol (message selector) and an association which contains the class. I know the address of this association is at 0x1631470 in my image.
>>>> But the address stored as literal in the compiled method is 0x4801470. This is 0x31D0000 more then expected.
>>>> Anyone an idea, where this comes from?
>>>> Or maybe some help, where to look, to discover this?!?
>>> I'd say look at Interpreter>>readImageFromFile:HeapSize:StartingAt:, the oldBaseAddr is stored in the image header. Could it be 0x31D0000?
>> Thank you very much. That's it.
>>> OTOH, how did you get the address of the compiled method in the first place?
>> I am using a squeak-image-tool written at the Hasso Plattner Institut at the university of Potsdam. This tool gives me the address of the compiled method. But the tool doesn't translate the content of the compiled method. So this is raw data in this byte array and of course I have to correct the address with the memory base address!!!
>> Thanks again :)
> That tool must use the base address internally. You're probably just using it incorrectly ;)
yes i was :)
> Sounds interesting though: is the tool available publicly?
the tool was written by Tobias Pape and Arian Treffer at HPI. They have 
not published it yet, but they told me, they will. There is no official 
link available yet. Do you want me to send you the contacts, so you can 
ask them about a download link?

Helmut


More information about the Squeak-dev mailing list