[squeak-dev] Changing process exit status

David T. Lewis lewis at mail.msen.com
Sun May 12 21:36:20 UTC 2013


On Sun, May 12, 2013 at 10:18:51PM +0200, Levente Uzonyi wrote:
> On Sun, 12 May 2013, Frank Shearar wrote:
> 
> >http://build.squeak.org/job/ReleaseSqueakTrunk/239/console shows the
> >CommandLineToolSet correctly bailing a release because
> >ReleaseBuilderFor4dot5 no longer exists. Note the build's green light.
> >What I'd like is a means of quitting the image _with an error_.
> >
> >How do I do that?
> 
> CogVM has support for it - not sure about the interpreter, but there's 
> definitely no support code on the image-side. The way it works is that you 
> can add an argument to primitive 113. E.g.:

This feature is not in the interpreter VM. It requires an update from the
oscog platforms sources to the trunk platforms sources in Subversion, and
that has not yet been done.

FWIW, if you are compiling your own VM (Cog or interpreter) it is easy to
add a primitive to do the same thing:

InterpreterPrimitives>>primitiveQuitWithStatus
	"Exit the VM immediately, returning an exit value"
	<export: true>
	self exit: (self stackIntegerValue: 0).
	^self primitiveFail

Then add this to the image:

SmalltalkImage>>forceExitWithStatus: statusInteger
	"Smalltalk forceExitWithStatus: 7"
	<primitive: 'primitiveQuitWithStatus'>
	self primitiveFailed

Dave

> 
> quitPrimitive: exitCode
> 	"Primitive. Exit to another operating system on the host machine, if 
> 	one
> 	exists. All state changes in the object space since the last 
> 	snapshot are lost.
> 	Essential. See Object documentation whatIsAPrimitive."
> 
> 	<primitive: 113>
> 	self primitiveFailed
> 
> 
> Levente
> 
> >
> >frank
> >
> >


More information about the Squeak-dev mailing list