literals in compiled method

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

literals in compiled method

Helmut Rohregger
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?!?

thanks,
Helmut

Reply | Threaded
Open this post in threaded view
|

Re: literals in compiled method

Bert Freudenberg

On 2013-03-15, at 11:30, Helmut Rohregger <[hidden email]> 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?

OTOH, how did you get the address of the compiled method in the first place?

Also, you could look at Dan's Squeak interpreter written in Java.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: literals in compiled method

Helmut Rohregger
Am 15.03.2013 14:29, schrieb Bert Freudenberg:

> On 2013-03-15, at 11:30, Helmut Rohregger <[hidden email]> 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 :)
> Also, you could look at Dan's Squeak interpreter written in Java.
>
> - Bert -
>
Helmut

Reply | Threaded
Open this post in threaded view
|

Re: literals in compiled method

Bert Freudenberg
On 2013-03-15, at 14:47, Helmut Rohregger <[hidden email]> wrote:

> Am 15.03.2013 14:29, schrieb Bert Freudenberg:
>> On 2013-03-15, at 11:30, Helmut Rohregger <[hidden email]> 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 ;)

Sounds interesting though: is the tool available publicly?

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: literals in compiled method

Helmut Rohregger
Am 15.03.2013 15:14, schrieb Bert Freudenberg:

> On 2013-03-15, at 14:47, Helmut Rohregger <[hidden email]> wrote:
>
>> Am 15.03.2013 14:29, schrieb Bert Freudenberg:
>>> On 2013-03-15, at 11:30, Helmut Rohregger <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: literals in compiled method

Bert Freudenberg
On 2013-03-15, at 15:20, Helmut Rohregger <[hidden email]> wrote:

> Am 15.03.2013 15:14, schrieb Bert Freudenberg:
>> On 2013-03-15, at 14:47, Helmut Rohregger <[hidden email]> wrote:
>>
>>> I am using a squeak-image-tool written at the Hasso Plattner Institut at the university of Potsdam.
>> 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.

Okay.

> Do you want me to send you the contacts, so you can ask them about a download link?

That would be quite unnecessary ;)

- Bert -