[Vm-dev] [Pharo-project] is there a way to avoid all the #tryNamedPrimitive:with: * in ProtoObject

Igor Stasenko siguctua at gmail.com
Thu Jan 26 10:38:47 UTC 2012

On 26 January 2012 11:25, stephane ducasse <stephane.ducasse at gmail.com> wrote:
>> phew... done reading through overquoting :)
>> +1000 to removing tryXYZprimitive:
>> I was always wondering what those methods for, until i met a need to
>> support debugging when invoking nativeboost-prim methods,
>> because it needs special handing when invoking methods with native
>> code via debugger.
>> Then i understood that this mechanism is necessary.. yet a bit awkward..
>> Funny. Even after implementing the fix, I still do not understand why all these is needed. Can someone explain to a newbie why invoking primitives (whether they are normal primitives, named primitives or NB primitives) from the debugger is different than invoking them normally (as when they are invoked by normal code)
> Yes I want to understand too.

Here the hint for you:
 - what should happen when you doing 'step in' on method, which has a primitive?

Apparently, it should invoke that primitive , otherwise you will have
difference between running and debugging modes,
and will have different results, which makes debugger useless.
So debugger should detect "somehow" if primitive was failed, and then
step in into given method,
or if its not, then step in = step over.

And these 'tryXYZ ... ' is exactly for solving this dilemma.

Best regards,
Igor Stasenko.

More information about the Vm-dev mailing list