On 4/17/16 12:05 PM, Mariano Martinez
Peck wrote:
I had to head out shortly, so I was hoping for a solution when I got back. so I didn't try anything at the time ... I don't think that worked in the old FFI and debugging segmentation faults from incorrect specs is always a pain ... I was in the process of writing a test case for another feature when I realized I could use GciSaveObjs and then :) Upon reflection I realize that it is probably similar to the declaration for GciPerformNoDebug_( OopType receiver, const char selector[], const OopType args[], int numArgs, int flags, ushort environmentId), which doesn't use `GsGciOopType[] args`, using `ulong args` --- so I'll be brave and see if `self ffiCall: #( GciSaveObjs(GsGciOopType[] theOops, int numOops) )` since converting FFI calls to "alternate but equivalent" is not the best solution ... Thanks a ton, I should have a bit of time to try things out .. Dale -- You received this message because you are subscribed to the Google Groups "tODE" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
On Sun, Apr 17, 2016 at 8:16 PM, Dale Henrichs <[hidden email]> wrote:
OKok, if you finally get that reproducible test case, it would be even simpler for me!
that's right!!! that's exactly the same situation.
uhhhg good finding. I honestly don't remember doing that on purpose. I think I simply copied it from old FFI? I am checking old ffi now: apiGciPerformNoDebug: anOopType a: aString a: anArray a: anInteger a: flagInteger " EXTERN_GCI_DEC(OopType) GciPerformNoDebug( OopType receiver, const char selector[], const OopType args[], int numArgs, int flags);" <apicall: OopType64 'GciPerformNoDebug' (OopType64 char* ulong long long) > ^self externalCallFailed So... what I can tell you, is that GsGciOopType is considered a ulonglong (see FFIGemstone64HandleType >> externalType) So.....I suspect the correct mapping could be (for 64 bits gemstone):
if that doesn't work, you can try the original I said (which looks much better!!!)
Let me know how it goes!
You received this message because you are subscribed to the Google Groups "tODE" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Mariano Martinez Peck
Dale,
-- Please read Esteban answer (he is not in the list) let me know how things go!! ---------- Forwarded message ---------- From: Esteban Lorenzano <[hidden email]> Date: Mon, Apr 18, 2016 at 8:54 AM Subject: Re: [tode_st] tODE & GCI in Pharo 5? To: Mariano Peck <[hidden email]> Cc: [hidden email] no direct support for arrays yet (NB didn’t have it either)… I started an implementation but is still far from ready. In this case, I think you can declare the [] as pointer… something like: self ffiCall: #( void GciSaveObjs(GsGciOopType *theOops, int numOops) ) should work, but you need to call it with something like this (supposing your function is called by method GciSaveObjs:size:): | array | array := FFIExternalArray newType: GsGciOopType size: 42. self GciSaveObjs: array getHandle size: 42 Notice the #getHandle message. This is because function cannot directly transform the array into a reference. You could also declare your function as this: self ffiCall: #( void GciSaveObjs(FFIExternalArray theOops, int numOops) ) then you can call it like this: self GciSaveObjs: array size: 42. Both approaches should work… Esteban
You received this message because you are subscribed to the Google Groups "tODE" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Dale Henrichs-3
On Sunday, April 17, 2016 at 12:59:06 AM UTC+2, Dale Henrichs wrote: So in your use case, you _could_ install a custom builder for the That sounds interesting, indeed.
I was just doing result := aSession executeString: 'String streamContents: [:stream | |obj index | obj := (Object _objectForOop: ',oop asString,'). index := 1. obj class allInstVarNames do: [:each | |instVarValue | stream nextPutAll: each;crlf. instVarValue := obj instVarAt: index. stream nextPutAll: instVarValue asOop asString;crlf. stream nextPutAll: instVarValue inspectorName;crlf. index := index+1]]'. You received this message because you are subscribed to the Google Groups "tODE" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Mariano Martinez Peck
Mariano,
Thanks for chasing this down ... the method used in "perform withArgs" was similar to what Esteban suggest, but I was creating the Handle directly ... I much prefer the getHandle technique and will use it shortly... Da On 04/18/2016 08:17 AM, Mariano
Martinez Peck wrote:
-- You received this message because you are subscribed to the Google Groups "tODE" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Stephan Eggermont-3
On 04/18/2016 08:19 AM, Stephan
Eggermont wrote:
Okay ... not quite as expensive as it would have been if you had been doing all of the work on the client:) and running code on the server _is_ the idea ... I've made good progress on the Minimal tODE client[1] and before I turn it loose for you. I expect to include support for running a tODE command from the client, handling the result for simple commands (i.e., "eval `3+4`") and also providing a hook for handling client elements (i.e., "eval `3+4`; edit") --- no windows will come up but it will give you and opportunity to build an inspector example based on the standard client element produced by tODE --- including menu items and "on click" actions ... then you can consider creating different client elements to support the functionality you want in your inspector GUI and I can show you how to arrange to create your new client elements ... Dale [1] https://github.com/dalehenrich/tode/issues/253 -- You received this message because you are subscribed to the Google Groups "tODE" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Free forum by Nabble | Edit this page |