<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks Eliot!<br>
<br>
The Cuis FFI package is now updated with your code, just taken from
Squeak FFI package.<br>
<br>
Cheers,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
<br>
On 8/27/2018 6:36 PM, Eliot Miranda via Cuis-dev wrote:
<blockquote
cite="mid:CAC20JE1H4rEFgNCpdaWtukYw0X0wL7PNCmMX8Pgiu6yM=RDHHg@mail.gmail.com"
type="cite">
<div dir="ltr">Hi All,
<div><br>
</div>
<div> the latest VMs support a new facility which catches and
reports exceptions during FFI calls as primitive failures.
That means that if you have the relevant support code loaded
(described below) and depending on dialect, you write your FFI
interface method to contain an error code, or you're using the
UnifiedFFI which uses invokeWithArguments:, then any exception
that occurs during the FFI call will be caught and reported to
use with the error code bound to an instance of
ExceptionInFFICall, which contains a platform-specific error
code and the pc at which it occurred.</div>
<div><br>
</div>
<div>To use this facility you'll need to download a VM built
yesterday or later (it should be derived from
VMMaker.oscog-eem.2435 or later), or build your own from the
tip of the Cog branch in opensmalltalk/vm. You'll then need
to update the image code to install ExceptionInFFICall
appropriately:</div>
<div>in Pharo6 load SLICE 22367</div>
<div>in Squeak load the latest FFI code from <a
moz-do-not-send="true" href="http://source.squeak.org/FFI">source.squeak.org/FFI</a>
and update your image from trunk</div>
<div>in Cuis, you'll need to adapt these changes to Cuis
(sorry!!)</div>
<div><br>
</div>
<div>There are two command-line flags to override the default
behavior. [-]-failonffiexception causes the handling to be
applied to all FFI calls, so if a method doesn't contain an
error, you'll just see a primitive failure, and if
ExceptionInFFICall is not installed you'll see only an error
number in the call's error code.</div>
<div><br>
</div>
<div>[-]-nofailonffiexception ignores exceptions during FFI
calls, hence defaulting to the old behavior of crashing the VM
(which may be useful if one is using a low-level debugger to
debug the VM and/or external code).</div>
<div><br>
</div>
<div>HTH<br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div><span style="font-size: small; border-collapse:
separate;">
<div>_,,,^..^,,,_<br>
</div>
<div>best, Eliot</div>
</span></div>
</div>
</div>
</div>
</div>
<br>
</blockquote>
<br>
</body>
</html>