[Pharo-project] Fwd: [squeak-dev] Re: Debug-it and external calls

Schwab,Wilhelm K bschwab at anest.ufl.edu
Mon Jul 19 20:10:14 UTC 2010


If the FFI call is flawed, why does it work when not stepping in the debugger?  I'm not buying it :)




-----Original Message-----
From: pharo-project-bounces at lists.gforge.inria.fr [mailto:pharo-project-bounces at lists.gforge.inria.fr] On Behalf Of Igor Stasenko
Sent: Monday, July 19, 2010 3:02 PM
To: Pharo Development
Subject: [Pharo-project] Fwd: [squeak-dev] Re: Debug-it and external calls

---------- Forwarded message ----------
From: Igor Stasenko <siguctua at gmail.com>
Date: 19 July 2010 23:00
Subject: Re: [squeak-dev] Re: [Pharo-project] Debug-it and external calls
To: The general-purpose Squeak developers list <squeak-dev at lists.squeakfoundation.org>


On 19 July 2010 21:42, Andreas Raab <andreas.raab at gmx.de> wrote:
> On 7/19/2010 9:29 AM, Igor Stasenko wrote:
>>
>> No, debugger, actually doing a primitive call, but in order to 
>> intercept a primitive failure and 'step into' method, it does the 
>> trick with replacing the subject method with temporary method (which 
>> will call the same primitive with same arguments&  recevier).
>> Then, if primitive runs ok, it simply behaves as a 'step over', and 
>> if primitive fails, then debugger itercepts it and creates a context 
>> for subject method, which should handle primitive failure.
>
> Correct. Stepping over FFI calls will only fail if the FFI call 
> actually fails. So whatever the problem it's somewhere in your FFI call.
>
But! The problem which i discovered not long ago, that if FFI method contains many arguments (close to max 15), then debugger is unable to invoke it, because #perform:... method works in a way, that its using temps of context, where it were invoked. I fixed it by setting a #perform method's frame to be a large one.


See http://bugs.squeak.org/view.php?id=7534

> Cheers,
>  - Andreas
>
>> On 19 July 2010 19:22, Schwab,Wilhelm K<bschwab at anest.ufl.edu>  wrote:
>>>
>>> So the external call does not happen and the fall-back code executes.
>>>  That explains it.  It might be nice if FFI calls could be made to 
>>> happen, or at least to have a more informative error message, such 
>>> as "Primitive not executed by the debugger" rather than "Unable to find function address."
>>>
>>> Bill
>>>
>>>
>>>
>>>
>>> ________________________________________
>>> From: pharo-project-bounces at lists.gforge.inria.fr
>>> [pharo-project-bounces at lists.gforge.inria.fr] On Behalf Of Levente 
>>> Uzonyi [leves at elte.hu]
>>> Sent: Monday, July 19, 2010 12:20 PM
>>> To: Pharo-project at lists.gforge.inria.fr
>>> Subject: Re: [Pharo-project] Debug-it and external calls
>>>
>>> On Mon, 19 Jul 2010, Schwab,Wilhelm K wrote:
>>>
>>>> I often (not always??) find that using the Debug-it command and 
>>>> debugging into an external call (FFI) leads to a false claim of 
>>>> "Unable to find function address."  Stepping over the call works; 
>>>> stepping into it make it look like it fails.
>>>>
>>>> I am curently using a 1.1 RC2 image and the 4.0.3 vm on Ubuntu.  I 
>>>> cannot easily move the offending code to Windows, nor do I 
>>>> particularly care to do so (feels good<g>), and FFI is fairly uncommon in Squeak/Pharo.
>>>>
>>>> Can anyone else tinker with this to see if it is real?
>>>
>>> IIRC when you're using the debugger, primitives are not evaluated.
>>>
>>>
>>> Levente
>>>
>>>>
>>>> Bill
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> Pharo-project at lists.gforge.inria.fr
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> Pharo-project at lists.gforge.inria.fr
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>
>>
>>
>
>
>



--
Best regards,
Igor Stasenko AKA sig.



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
Pharo-project at lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


More information about the Squeak-dev mailing list