<div dir="ltr"><div dir="ltr">Hi Holger,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 3, 2019 at 7:36 AM Holger Freyther <<a href="mailto:holger@freyther.de">holger@freyther.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> <br>
Hi,<br>
<br>
Sorry if this sounds ignorant but I am not sure how to do this with Opensmalltalk VM. How do I get a working VMMaker loaded into a Pharo image these days? It was quite simple in the pharo-vm days but now I am not even sure where to start looking?<br>
<br>
<br>
<br>
I want to debug a FFI problem I see with Ben's clang-c bindings. I get a callback from C with three arguments and one of them is of type CXCursor (it needs to be passed on the stack):<br>
<br>
<br>
struct CXCursor {<br>
        int<br>
        enum<br>
        void *ptr[3];<br>
};<br>
<br>
It's represented as FFIExternalStructure subclass: #CXCursor. In the case of the callback the handle is an instance of FFIExternalStructureReferenceHandle with an Alien embedded into it.<br></blockquote><div><br></div><div>What is the C signature of the callback function, and what is the source of the marshaling method in the relevant Callback subclass's signatures protocol?</div><div>Also, what's the callout's signature and what is the Smalltalk code for the call?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
I am trying to understand if the bug is on handling the callback when the CXCursor is created or when trying to push it onto the stack when making a call.<br>
<br>
<br>
The memory on the stack is turned into an Alien. And Alien>>#referenceStructAt:length: doesn't return a ByteArray but the FFIExternalStructureReferenceHandle with the Alien in it.<br>
<br>
<br>
At the same time I think FFIPlugin>>#ffiPushStructureContentsOf: doesn't seem to deal with FFIExternalStructureReferencehandle (or handle being an Alien).<br>
<br>
<br>
Or do I chase it from the wrong end?<br></blockquote><div><br></div><div>Without the code I can't help, hence my questions above.</div><div></div></div><div><br></div><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>