LargeIntegersPlugin simulation?

Stephan Rudlof sr at evolgo.de
Sat Jan 7 03:45:47 UTC 2006


Hello Craig,

On 07.01.2006 01:15, Craig Latta wrote:
> Hi all--
> 
> 	Does anyone have working LargeIntegersPlugin simulation support? I need 
> it for debugging Spoon, and am hoping someone's already written it 
> (>>primDigitAdd etc.).

I'm not having LargeIntegersPlugin simulation support (along the lines
in 3. below).
But some of the following may help:

1.
I've used PrimCallController to switch the plugin on/off for testing.

2.
Naturally the calls to the LargeIntegers prims in the plugin are located
in Integer, but this makes testing more difficult. So there are some
methods for testing which avoid sending messages to a (Large)Integer
object; e.g.
  primDigitAdd: firstInteger with: secondInteger
instead of
  primDigitAdd: secondInteger
called from the firstInteger object in Integer>>digitAdd: (both should
return the same result).

3.
At last some general solution seems to be to follow the advice in
+++
SmartSyntaxInterpreterPlugin>>
simulatorClass
	"For running from Smalltalk - answer a class that can be used to
simulate the receiver, or nil if you want the primitives in this module
to always fail, causing simulation to fall through to the Smalltalk code.
	By default SmartSyntaxInterpreterPlugin answers nil because methods in
these plugins are intended to be embedded in code that pushes and pops
from the stack and therefore cannot be run independently.  This wrapper
code is generated when translated to C.  But, unfortunately, this code
is missing during simulation.  There was an attempt to simulate this,
but only the prologue code (getting arg from the stack) is simulated
(see simulatePrologInContext:). The epologue code (popping args and
pushing result) is not.  So I am making this nil until this can be fixed.
	Also, beware that primitive methods that take no args exactly match
their primitive name (faking out
InterpreterSimulator>>callExternalPrimitive:).  They should only be
called from within wrapper code that simulates the prologue and
epilogue.  Primitive method that take args don't have this accidental
matching problem since their names contain colons while their primitive
names do not. - ajh 8/21/2002"

	^ nil
+++
(this comment may have changed (I have looked into an older Squeak
version)), but I don't know how this relates to the previous problem.



Greetings,
Stephan

> 
> 
> 	thanks,
> 
> -C
> 

-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3



More information about the Squeak-dev mailing list