Change in NativeLinux32>>getGlobalSymbolPointer

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

Change in NativeLinux32>>getGlobalSymbolPointer

Jesus Nuñez
I have made a small change in the code because NBExternalAdress does not inherit from NBExternalStructure anymore. It is safe?. I mean so far no problems but my understanding is limited so I haven't make any commit.

getGlobalSymbolPointer: symbolName 
| bytes addr |
bytes := ByteArray new: 8.
self bootstrapGetGlobalSymbolPointer: symbolName into: bytes.
addr := bytes unsignedLongAt: 1 bigEndian: false.
addr = 0
ifTrue: [self error: 'failed to get a symbol address: ' , symbolName].
+^ NBExternalAddress ulongAt: addr
-^ NBExternalAddress value: addr

Cheers
Reply | Threaded
Open this post in threaded view
|

Re: Change in NativeLinux32>>getGlobalSymbolPointer

Jesus Nuñez
Sorry. NBExternalAddress new ulongAt: adress


2013/1/12 Jesus Nuñez <[hidden email]>
I have made a small change in the code because NBExternalAdress does not inherit from NBExternalStructure anymore. It is safe?. I mean so far no problems but my understanding is limited so I haven't make any commit.

getGlobalSymbolPointer: symbolName 
| bytes addr |
bytes := ByteArray new: 8.
self bootstrapGetGlobalSymbolPointer: symbolName into: bytes.
addr := bytes unsignedLongAt: 1 bigEndian: false.
addr = 0
ifTrue: [self error: 'failed to get a symbol address: ' , symbolName].
+^ NBExternalAddress ulongAt: addr
-^ NBExternalAddress value: addr

Cheers

Reply | Threaded
Open this post in threaded view
|

Re: Change in NativeLinux32>>getGlobalSymbolPointer

Igor Stasenko
No, it should be
NBExternalAddress value: addr
because method should answer an instance of NBExternalAddress
not integer.

On 12 January 2013 15:25, Jesus Nuñez <[hidden email]> wrote:

> Sorry. NBExternalAddress new ulongAt: adress
>
>
> 2013/1/12 Jesus Nuñez <[hidden email]>
>>
>> I have made a small change in the code because NBExternalAdress does not
>> inherit from NBExternalStructure anymore. It is safe?. I mean so far no
>> problems but my understanding is limited so I haven't make any commit.
>>
>> getGlobalSymbolPointer: symbolName
>> | bytes addr |
>> bytes := ByteArray new: 8.
>> self bootstrapGetGlobalSymbolPointer: symbolName into: bytes.
>> addr := bytes unsignedLongAt: 1 bigEndian: false.
>> addr = 0
>> ifTrue: [self error: 'failed to get a symbol address: ' , symbolName].
>> +^ NBExternalAddress ulongAt: addr
>> -^ NBExternalAddress value: addr
>>
>> Cheers
>
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: Change in NativeLinux32>>getGlobalSymbolPointer

Jesus Nuñez
Ok, but happens that #value: uses #fieldAt: was inherited from NBExternalStructure, which is no longer in the hierarchy. But I understand that it will no longer work with the change I made, any idea?


Best Regards,

Jesus


2013/1/12 Igor Stasenko <[hidden email]>
No, it should be
NBExternalAddress value: addr
because method should answer an instance of NBExternalAddress
not integer.

On 12 January 2013 15:25, Jesus Nuñez <[hidden email]> wrote:
> Sorry. NBExternalAddress new ulongAt: adress
>
>
> 2013/1/12 Jesus Nuñez <[hidden email]>
>>
>> I have made a small change in the code because NBExternalAdress does not
>> inherit from NBExternalStructure anymore. It is safe?. I mean so far no
>> problems but my understanding is limited so I haven't make any commit.
>>
>> getGlobalSymbolPointer: symbolName
>> | bytes addr |
>> bytes := ByteArray new: 8.
>> self bootstrapGetGlobalSymbolPointer: symbolName into: bytes.
>> addr := bytes unsignedLongAt: 1 bigEndian: false.
>> addr = 0
>> ifTrue: [self error: 'failed to get a symbol address: ' , symbolName].
>> +^ NBExternalAddress ulongAt: addr
>> -^ NBExternalAddress value: addr
>>
>> Cheers
>
>



--
Best regards,
Igor Stasenko.


Reply | Threaded
Open this post in threaded view
|

Re: Change in NativeLinux32>>getGlobalSymbolPointer

Jesus Nuñez
BTW I also tried returning with ";yourself" but no luck in the test I made.


2013/1/12 Jesus Nuñez <[hidden email]>
Ok, but happens that #value: uses #fieldAt: was inherited from NBExternalStructure, which is no longer in the hierarchy. But I understand that it will no longer work with the change I made, any idea?


Best Regards,

Jesus


2013/1/12 Igor Stasenko <[hidden email]>
No, it should be
NBExternalAddress value: addr
because method should answer an instance of NBExternalAddress
not integer.

On 12 January 2013 15:25, Jesus Nuñez <[hidden email]> wrote:
> Sorry. NBExternalAddress new ulongAt: adress
>
>
> 2013/1/12 Jesus Nuñez <[hidden email]>
>>
>> I have made a small change in the code because NBExternalAdress does not
>> inherit from NBExternalStructure anymore. It is safe?. I mean so far no
>> problems but my understanding is limited so I haven't make any commit.
>>
>> getGlobalSymbolPointer: symbolName
>> | bytes addr |
>> bytes := ByteArray new: 8.
>> self bootstrapGetGlobalSymbolPointer: symbolName into: bytes.
>> addr := bytes unsignedLongAt: 1 bigEndian: false.
>> addr = 0
>> ifTrue: [self error: 'failed to get a symbol address: ' , symbolName].
>> +^ NBExternalAddress ulongAt: addr
>> -^ NBExternalAddress value: addr
>>
>> Cheers
>
>



--
Best regards,
Igor Stasenko.



Reply | Threaded
Open this post in threaded view
|

Re: Change in NativeLinux32>>getGlobalSymbolPointer

Igor Stasenko
In reply to this post by Jesus Nuñez
On 12 January 2013 18:57, Jesus Nuñez <[hidden email]> wrote:
> Ok, but happens that #value: uses #fieldAt: was inherited from
> NBExternalStructure, which is no longer in the hierarchy. But I understand
> that it will no longer work with the change I made, any idea?
>
Yes, because address is not a structure.
Initially it was like that to reuse some code pieces, but it not worth it.

>
> Best Regards,
>
> Jesus
>
>
> 2013/1/12 Igor Stasenko <[hidden email]>
>>
>> No, it should be
>> NBExternalAddress value: addr
>> because method should answer an instance of NBExternalAddress
>> not integer.
>>
>> On 12 January 2013 15:25, Jesus Nuñez <[hidden email]> wrote:
>> > Sorry. NBExternalAddress new ulongAt: adress
>> >
>> >
>> > 2013/1/12 Jesus Nuñez <[hidden email]>
>> >>
>> >> I have made a small change in the code because NBExternalAdress does
>> >> not
>> >> inherit from NBExternalStructure anymore. It is safe?. I mean so far no
>> >> problems but my understanding is limited so I haven't make any commit.
>> >>
>> >> getGlobalSymbolPointer: symbolName
>> >> | bytes addr |
>> >> bytes := ByteArray new: 8.
>> >> self bootstrapGetGlobalSymbolPointer: symbolName into: bytes.
>> >> addr := bytes unsignedLongAt: 1 bigEndian: false.
>> >> addr = 0
>> >> ifTrue: [self error: 'failed to get a symbol address: ' , symbolName].
>> >> +^ NBExternalAddress ulongAt: addr
>> >> -^ NBExternalAddress value: addr
>> >>
>> >> Cheers
>> >
>> >
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko.
>>
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: Change in NativeLinux32>>getGlobalSymbolPointer

Igor Stasenko
In reply to this post by Jesus Nuñez
On 12 January 2013 19:00, Jesus Nuñez <[hidden email]> wrote:
> BTW I also tried returning with ";yourself" but no luck in the test I made.
>
>
i dont know what you trying to change there. this code works fine, because
if it would not, then nothing else would work at all.


> 2013/1/12 Jesus Nuñez <[hidden email]>
>>
>> Ok, but happens that #value: uses #fieldAt: was inherited from
>> NBExternalStructure, which is no longer in the hierarchy. But I understand
>> that it will no longer work with the change I made, any idea?
>>
>>
>> Best Regards,
>>
>> Jesus
>>
>>
>> 2013/1/12 Igor Stasenko <[hidden email]>
>>>
>>> No, it should be
>>> NBExternalAddress value: addr
>>> because method should answer an instance of NBExternalAddress
>>> not integer.
>>>
>>> On 12 January 2013 15:25, Jesus Nuñez <[hidden email]> wrote:
>>> > Sorry. NBExternalAddress new ulongAt: adress
>>> >
>>> >
>>> > 2013/1/12 Jesus Nuñez <[hidden email]>
>>> >>
>>> >> I have made a small change in the code because NBExternalAdress does
>>> >> not
>>> >> inherit from NBExternalStructure anymore. It is safe?. I mean so far
>>> >> no
>>> >> problems but my understanding is limited so I haven't make any commit.
>>> >>
>>> >> getGlobalSymbolPointer: symbolName
>>> >> | bytes addr |
>>> >> bytes := ByteArray new: 8.
>>> >> self bootstrapGetGlobalSymbolPointer: symbolName into: bytes.
>>> >> addr := bytes unsignedLongAt: 1 bigEndian: false.
>>> >> addr = 0
>>> >> ifTrue: [self error: 'failed to get a symbol address: ' , symbolName].
>>> >> +^ NBExternalAddress ulongAt: addr
>>> >> -^ NBExternalAddress value: addr
>>> >>
>>> >> Cheers
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko.
>>>
>>
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: Change in NativeLinux32>>getGlobalSymbolPointer

Jesus Nuñez
Yes Ok, I got it. The question is that the #value: selector is still there, with the old code. Sorry, I should have check the new code directly in the repository and compare it.

Thank you.


2013/1/12 Igor Stasenko <[hidden email]>
On 12 January 2013 19:00, Jesus Nuñez <[hidden email]> wrote:
> BTW I also tried returning with ";yourself" but no luck in the test I made.
>
>
i dont know what you trying to change there. this code works fine, because
if it would not, then nothing else would work at all.


> 2013/1/12 Jesus Nuñez <[hidden email]>
>>
>> Ok, but happens that #value: uses #fieldAt: was inherited from
>> NBExternalStructure, which is no longer in the hierarchy. But I understand
>> that it will no longer work with the change I made, any idea?
>>
>>
>> Best Regards,
>>
>> Jesus
>>
>>
>> 2013/1/12 Igor Stasenko <[hidden email]>
>>>
>>> No, it should be
>>> NBExternalAddress value: addr
>>> because method should answer an instance of NBExternalAddress
>>> not integer.
>>>
>>> On 12 January 2013 15:25, Jesus Nuñez <[hidden email]> wrote:
>>> > Sorry. NBExternalAddress new ulongAt: adress
>>> >
>>> >
>>> > 2013/1/12 Jesus Nuñez <[hidden email]>
>>> >>
>>> >> I have made a small change in the code because NBExternalAdress does
>>> >> not
>>> >> inherit from NBExternalStructure anymore. It is safe?. I mean so far
>>> >> no
>>> >> problems but my understanding is limited so I haven't make any commit.
>>> >>
>>> >> getGlobalSymbolPointer: symbolName
>>> >> | bytes addr |
>>> >> bytes := ByteArray new: 8.
>>> >> self bootstrapGetGlobalSymbolPointer: symbolName into: bytes.
>>> >> addr := bytes unsignedLongAt: 1 bigEndian: false.
>>> >> addr = 0
>>> >> ifTrue: [self error: 'failed to get a symbol address: ' , symbolName].
>>> >> +^ NBExternalAddress ulongAt: addr
>>> >> -^ NBExternalAddress value: addr
>>> >>
>>> >> Cheers
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko.
>>>
>>
>



--
Best regards,
Igor Stasenko.


Reply | Threaded
Open this post in threaded view
|

Re: Change in NativeLinux32>>getGlobalSymbolPointer

Jesus Nuñez
Sorry what operation should I do over the new versions in Montincello to load them safely??


2013/1/12 Jesus Nuñez <[hidden email]>
Yes Ok, I got it. The question is that the #value: selector is still there, with the old code. Sorry, I should have check the new code directly in the repository and compare it.

Thank you.


2013/1/12 Igor Stasenko <[hidden email]>
On 12 January 2013 19:00, Jesus Nuñez <[hidden email]> wrote:
> BTW I also tried returning with ";yourself" but no luck in the test I made.
>
>
i dont know what you trying to change there. this code works fine, because
if it would not, then nothing else would work at all.


> 2013/1/12 Jesus Nuñez <[hidden email]>
>>
>> Ok, but happens that #value: uses #fieldAt: was inherited from
>> NBExternalStructure, which is no longer in the hierarchy. But I understand
>> that it will no longer work with the change I made, any idea?
>>
>>
>> Best Regards,
>>
>> Jesus
>>
>>
>> 2013/1/12 Igor Stasenko <[hidden email]>
>>>
>>> No, it should be
>>> NBExternalAddress value: addr
>>> because method should answer an instance of NBExternalAddress
>>> not integer.
>>>
>>> On 12 January 2013 15:25, Jesus Nuñez <[hidden email]> wrote:
>>> > Sorry. NBExternalAddress new ulongAt: adress
>>> >
>>> >
>>> > 2013/1/12 Jesus Nuñez <[hidden email]>
>>> >>
>>> >> I have made a small change in the code because NBExternalAdress does
>>> >> not
>>> >> inherit from NBExternalStructure anymore. It is safe?. I mean so far
>>> >> no
>>> >> problems but my understanding is limited so I haven't make any commit.
>>> >>
>>> >> getGlobalSymbolPointer: symbolName
>>> >> | bytes addr |
>>> >> bytes := ByteArray new: 8.
>>> >> self bootstrapGetGlobalSymbolPointer: symbolName into: bytes.
>>> >> addr := bytes unsignedLongAt: 1 bigEndian: false.
>>> >> addr = 0
>>> >> ifTrue: [self error: 'failed to get a symbol address: ' , symbolName].
>>> >> +^ NBExternalAddress ulongAt: addr
>>> >> -^ NBExternalAddress value: addr
>>> >>
>>> >> Cheers
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko.
>>>
>>
>



--
Best regards,
Igor Stasenko.



Reply | Threaded
Open this post in threaded view
|

Re: Change in NativeLinux32>>getGlobalSymbolPointer

Jesus Nuñez
Hi Igor,

Promise the last question today. 

What can be causing that issuing:

> "NativeBoost forCurrentPlatform callbackCounterAddress. "

returns "nil" ?.


In the trunk 1.8 is OK and it returns  "@16r282000" in my case.

Thanks in advance,

Jesus


2013/1/12 Jesus Nuñez <[hidden email]>
Sorry what operation should I do over the new versions in Montincello to load them safely??


2013/1/12 Jesus Nuñez <[hidden email]>
Yes Ok, I got it. The question is that the #value: selector is still there, with the old code. Sorry, I should have check the new code directly in the repository and compare it.

Thank you.


2013/1/12 Igor Stasenko <[hidden email]>
On 12 January 2013 19:00, Jesus Nuñez <[hidden email]> wrote:
> BTW I also tried returning with ";yourself" but no luck in the test I made.
>
>
i dont know what you trying to change there. this code works fine, because
if it would not, then nothing else would work at all.


> 2013/1/12 Jesus Nuñez <[hidden email]>
>>
>> Ok, but happens that #value: uses #fieldAt: was inherited from
>> NBExternalStructure, which is no longer in the hierarchy. But I understand
>> that it will no longer work with the change I made, any idea?
>>
>>
>> Best Regards,
>>
>> Jesus
>>
>>
>> 2013/1/12 Igor Stasenko <[hidden email]>
>>>
>>> No, it should be
>>> NBExternalAddress value: addr
>>> because method should answer an instance of NBExternalAddress
>>> not integer.
>>>
>>> On 12 January 2013 15:25, Jesus Nuñez <[hidden email]> wrote:
>>> > Sorry. NBExternalAddress new ulongAt: adress
>>> >
>>> >
>>> > 2013/1/12 Jesus Nuñez <[hidden email]>
>>> >>
>>> >> I have made a small change in the code because NBExternalAdress does
>>> >> not
>>> >> inherit from NBExternalStructure anymore. It is safe?. I mean so far
>>> >> no
>>> >> problems but my understanding is limited so I haven't make any commit.
>>> >>
>>> >> getGlobalSymbolPointer: symbolName
>>> >> | bytes addr |
>>> >> bytes := ByteArray new: 8.
>>> >> self bootstrapGetGlobalSymbolPointer: symbolName into: bytes.
>>> >> addr := bytes unsignedLongAt: 1 bigEndian: false.
>>> >> addr = 0
>>> >> ifTrue: [self error: 'failed to get a symbol address: ' , symbolName].
>>> >> +^ NBExternalAddress ulongAt: addr
>>> >> -^ NBExternalAddress value: addr
>>> >>
>>> >> Cheers
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko.
>>>
>>
>



--
Best regards,
Igor Stasenko.




Reply | Threaded
Open this post in threaded view
|

Re: Change in NativeLinux32>>getGlobalSymbolPointer

Jesus Nuñez
OK I fixed it. For some reason the session was opened but and I coudn't issue NativeBoost initilize, I just setted the Current variable to nil and the session was reinitialized at the next call to NativeBoost. 

Cheers,

Jesus


2013/1/12 Jesus Nuñez <[hidden email]>
Hi Igor,

Promise the last question today. 

What can be causing that issuing:

> "NativeBoost forCurrentPlatform callbackCounterAddress. "

returns "nil" ?.


In the trunk 1.8 is OK and it returns  "@16r282000" in my case.

Thanks in advance,

Jesus


2013/1/12 Jesus Nuñez <[hidden email]>
Sorry what operation should I do over the new versions in Montincello to load them safely??


2013/1/12 Jesus Nuñez <[hidden email]>
Yes Ok, I got it. The question is that the #value: selector is still there, with the old code. Sorry, I should have check the new code directly in the repository and compare it.

Thank you.


2013/1/12 Igor Stasenko <[hidden email]>
On 12 January 2013 19:00, Jesus Nuñez <[hidden email]> wrote:
> BTW I also tried returning with ";yourself" but no luck in the test I made.
>
>
i dont know what you trying to change there. this code works fine, because
if it would not, then nothing else would work at all.


> 2013/1/12 Jesus Nuñez <[hidden email]>
>>
>> Ok, but happens that #value: uses #fieldAt: was inherited from
>> NBExternalStructure, which is no longer in the hierarchy. But I understand
>> that it will no longer work with the change I made, any idea?
>>
>>
>> Best Regards,
>>
>> Jesus
>>
>>
>> 2013/1/12 Igor Stasenko <[hidden email]>
>>>
>>> No, it should be
>>> NBExternalAddress value: addr
>>> because method should answer an instance of NBExternalAddress
>>> not integer.
>>>
>>> On 12 January 2013 15:25, Jesus Nuñez <[hidden email]> wrote:
>>> > Sorry. NBExternalAddress new ulongAt: adress
>>> >
>>> >
>>> > 2013/1/12 Jesus Nuñez <[hidden email]>
>>> >>
>>> >> I have made a small change in the code because NBExternalAdress does
>>> >> not
>>> >> inherit from NBExternalStructure anymore. It is safe?. I mean so far
>>> >> no
>>> >> problems but my understanding is limited so I haven't make any commit.
>>> >>
>>> >> getGlobalSymbolPointer: symbolName
>>> >> | bytes addr |
>>> >> bytes := ByteArray new: 8.
>>> >> self bootstrapGetGlobalSymbolPointer: symbolName into: bytes.
>>> >> addr := bytes unsignedLongAt: 1 bigEndian: false.
>>> >> addr = 0
>>> >> ifTrue: [self error: 'failed to get a symbol address: ' , symbolName].
>>> >> +^ NBExternalAddress ulongAt: addr
>>> >> -^ NBExternalAddress value: addr
>>> >>
>>> >> Cheers
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko.
>>>
>>
>



--
Best regards,
Igor Stasenko.