[Vm-dev] argCnt, argVec, engVec alternatives

David T. Lewis lewis at mail.msen.com
Thu Jan 6 01:56:12 UTC 2011


On Wed, Jan 05, 2011 at 03:30:19PM -0300, Esteban Lorenzano wrote:
> 
> ok... removing call to printAllStack in plugin and adding initialization
> of argCnt, argVec and engVec (plus the changes made last week),
> UnixOSProcessPlugin, without AioPlugin, is running in Cocoa Cog VM :D
> 

Excellent!

> I would like to commit a OSProcessPlugin package with modifications...
> or well, maybe project owner can do this changes for me (I just removed
> primitivePrintAllStacksOnSignal, printAllStacksFunctionAddress and
> printAllStacksOnSignal).
> 

Actually, if you don't mind working with me on this a bit more, I'd
like to debug it. I suspect we can can make this work on Cocoa.

We know now that external plugins can access global values such
as argVec and interpreterProxy, and we know that this works the
same on Unix and Mac. The last thing that is giving us problems
is when primitivePrintAllStacksOnSignal tries to access the address
of the function printAllStacks(). This happens here in the plugin:

  static void * printAllStacksFunctionAddress(void) {
      extern sqInt printAllStacks();
          return printAllStacks;
  }

So the declaration looks right, but apparently accessing the
address of a global function is not the same as accessing the
value of a global variable, and perhaps this is a difference
between the Unix/Linux systems and Mac.

So I am guessing that if, in the support code, we were to assign
the function address to a global variable, then the plugin would
be able to access it, and #primitivePrintAllStacksOnSignal would
work properly.

If this sounds like it might be right, I'll try to think of a way
to implement it without breaking the existing unix implementations.

> now... I will work on AioPlugin :P
> 
> Cheers,
> Esteban
> 
> pd: btw... CommandShell is really funny ;)

Well, I did write it mostly to entertain myself ;)

Cheers,
Dave



More information about the Vm-dev mailing list