[Pharo-project] Callback(?) debugging - bad number of arguments

Eliot Miranda eliot.miranda at gmail.com
Thu Mar 22 22:46:48 EDT 2012

On Thu, Mar 22, 2012 at 6:20 PM, Schwab,Wilhelm K <bschwab at anest.ufl.edu>wrote:

>  Eliot,
> I am calling something that I *think* simply tells GSL where to find the
> callbacks and a relevant structure.  But I am getting a primitive failure
> in VMCallbackContext32>>primReturnAs:fromContext:, which I assume means
> that the library is attempting to call into Pharo.
> In the debugger's context, ec is set to #'bad number of arguments'.  I
> have looked at the signatures and the blocks, and the argument counts look
> correct at first glance, albeit toward the end of a long day.
> Am I being naive?

Understandably so.  I believe the issue is the callback selector in place
in recreateSpecialObjectsArray.  It needs to be

  newArray at: 54 put: #invokeCallbackContext:.

not the older

newArray at: 54 put: #invokeCallback:stack:registers:jmpbuf:.

And you need to have invokeCallbackContext: implemented in Alien class.


> Any better ideas?  My next inclination is to set breakpoints in all of the
> callbacks to seee if any of them get hit.  I can't see why they would, but
> it's possible - especially given other weirdness that I have observed in
> GSL.  It work, but it's a little rough around the (design/elegance) edges
> at times.
> Bill

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20120322/eca2b32e/attachment-0001.html>

More information about the Pharo-dev mailing list