[Vm-dev] VM Maker: Cog-eem.61.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jul 19 18:40:45 UTC 2013


Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.61.mcz

==================== Summary ====================

Name: Cog-eem.61
Author: eem
Time: 19 July 2013, 11:40:38.157 am
UUID: 3dba03de-7a41-4da2-bdf4-d8276f5665da
Ancestors: Cog-lw.60

Add versions of run and single-step to the processor plugins that
take a maximum address parameter to allow trapping writes beyond
freeStart (not used yet in VMMaker).

=============== Diff against Cog-lw.60 ===============

Item was added:
+ ----- Method: BochsIA32Alien>>primitiveRunInMemory:minimumAddress:maximumAddress:readOnlyBelow: (in category 'primitives') -----
+ primitiveRunInMemory: memoryArray "<Bitmap|ByteArray>" minimumAddress: minimumAddress "<Integer>" maximumAddress: maximimAddress "<Integer>" readOnlyBelow: minimumWritableAddress "<Integer>"
+ 	"Run the receiver using the argument as the store.  Origin the argument at 0. i.e. the first byte of the
+ 	 memoryArray is address 0.  Make addresses below minimumAddress illegal.  Convert out-of-range
+ 	 calls, jumps and memory read/writes into ProcessorSimulationTrap signals."
+ 	<primitive: 'primitiveRunInMemoryMinAddressMaxAddressReadWrite' module: 'BochsIA32Plugin' error: ec>
+ 	^ec == #'inappropriate operation'
+ 		ifTrue: [self handleExecutionPrimitiveFailureIn: memoryArray
+ 					minimumAddress: minimumAddress
+ 					readOnlyBelow: minimumWritableAddress]
+ 		ifFalse: [self reportPrimitiveFailure]
+ 
+ 	"self printRegistersOn: Transcript"!

Item was changed:
  ----- Method: BochsIA32Alien>>primitiveRunInMemory:minimumAddress:readOnlyBelow: (in category 'primitives') -----
  primitiveRunInMemory: memoryArray "<Bitmap|ByteArray>" minimumAddress: minimumAddress "<Integer>" readOnlyBelow: minimumWritableAddress "<Integer>"
  	"Run the receiver using the argument as the store.  Origin the argument at 0. i.e. the first byte of the
  	 memoryArray is address 0.  Make addresses below minimumAddress illegal.  Convert out-of-range
+ 	 calls, jumps and memory read/writes into ProcessorSimulationTrap signals."
- 	 call, jump and memory read/writes into register instructions into ProcessorSimulationTrap signals."
  	<primitive: 'primitiveRunInMemoryMinimumAddressReadWrite' module: 'BochsIA32Plugin' error: ec>
  	^ec == #'inappropriate operation'
  		ifTrue: [self handleExecutionPrimitiveFailureIn: memoryArray
  					minimumAddress: minimumAddress
  					readOnlyBelow: minimumWritableAddress]
  		ifFalse: [self reportPrimitiveFailure]
  
  	"self printRegistersOn: Transcript"!

Item was added:
+ ----- Method: BochsIA32Alien>>primitiveSingleStepInMemory:minimumAddress:maximumAddress:readOnlyBelow: (in category 'primitives') -----
+ primitiveSingleStepInMemory: memoryArray "<Bitmap|ByteArray>" minimumAddress: minimumAddress "<Integer>" maximumAddress: maximimAddress "<Integer>" readOnlyBelow: minimumWritableAddress "<Integer>"
+ 	"Single-step the receiver using the argument as the store.  Origin the argument at 0. i.e. the first byte of the
+ 	 memoryArray is address 0.  Make addresses below minimumAddress illegal.  Convert out-of-range
+ 	 calls, jumps and memory read/writes into ProcessorSimulationTrap signals."
+ 	<primitive: 'primitiveSingleStepInMemoryMinAddressMaxAddressReadWrite' module: 'BochsIA32Plugin' error: ec>
+ 	^ec == #'inappropriate operation'
+ 		ifTrue: [self handleExecutionPrimitiveFailureIn: memoryArray
+ 					minimumAddress: minimumAddress
+ 					readOnlyBelow: minimumWritableAddress]
+ 		ifFalse: [self reportPrimitiveFailure]!

Item was changed:
  ----- Method: BochsIA32Alien>>primitiveSingleStepInMemory:minimumAddress:readOnlyBelow: (in category 'primitives') -----
  primitiveSingleStepInMemory: memoryArray "<Bitmap|ByteArray>" minimumAddress: minimumAddress "<Integer>" readOnlyBelow: minimumWritableAddress "<Integer>"
  	"Single-step the receiver using the argument as the store.  Origin the argument at 0. i.e. the first byte of the
  	 memoryArray is address 0.  Make addresses below minimumAddress illegal.  Convert out-of-range
+ 	 calls, jumps and memory read/writes into ProcessorSimulationTrap signals."
- 	 call, jump and memory read/writes into register instructions into ProcessorSimulationTrap signals."
  	<primitive: 'primitiveSingleStepInMemoryMinimumAddressReadWrite' module: 'BochsIA32Plugin' error: ec>
  	^ec == #'inappropriate operation'
  		ifTrue: [self handleExecutionPrimitiveFailureIn: memoryArray
  					minimumAddress: minimumAddress
  					readOnlyBelow: minimumWritableAddress]
  		ifFalse: [self reportPrimitiveFailure]!

Item was added:
+ ----- Method: BochsIA32Plugin>>primitiveRunInMemory:minimumAddress:maximumAddress:readOnlyBelow: (in category 'primitives') -----
+ "cpuAlien <BochsIA32Alien>" primitiveRunInMemory: memory "<Bitmap|ByteArray|WordArray>" minimumAddress: minAddress "<Integer>" maximumAddress: maxAddress "<Integer>" readOnlyBelow: minWriteMaxExecAddress "<Integer>"
+ 	"Run the cpu using the first argument as the memory and the following arguments defining valid addresses, running until it halts or hits an exception."
+ 	| cpuAlien cpu memorySize maybeErr |
+ 	<var: #cpu type: #'void *'>
+ 	cpuAlien := self primitive: #primitiveRunInMemoryMinAddressMaxAddressReadWrite
+ 					parameters: #(WordsOrBytes Unsigned Unsigned Unsigned)
+ 					receiver: #Oop.
+ 	(cpu := self startOfData: cpuAlien) = 0 ifTrue:
+ 		[^interpreterProxy primitiveFailFor: PrimErrBadReceiver].
+ 	prevInterruptCheckChain := interpreterProxy setInterruptCheckChain: #forceStopOnInterrupt asSymbol.
+ 	prevInterruptCheckChain = #forceStopOnInterrupt asSymbol ifTrue:
+ 		[prevInterruptCheckChain = 0].
+ 	memorySize := interpreterProxy byteSizeOf: memory cPtrAsOop.
+ 	maybeErr := self runCPU: cpu
+ 					In: memory
+ 					Size: (memorySize min: maxAddress)
+ 					MinAddressRead: minAddress
+ 					Write: minWriteMaxExecAddress.
+ 	interpreterProxy setInterruptCheckChain: prevInterruptCheckChain.
+ 	maybeErr ~= 0 ifTrue:
+ 		[^interpreterProxy primitiveFailFor: PrimErrInappropriate].
+ 	^cpuAlien!

Item was added:
+ ----- Method: BochsIA32Plugin>>primitiveSingleStepInMemory:minimumAddress:maximumAddress:readOnlyBelow: (in category 'primitives') -----
+ "cpuAlien <BochsIA32Alien>" primitiveSingleStepInMemory: memory "<Bitmap|ByteArray|WordArray>" minimumAddress: minAddress "<Integer>" maximumAddress: maxAddress "<Integer>" readOnlyBelow: minWriteMaxExecAddress "<Integer>"
+ 	"Single-step the cpu using the first argument as the memory and the following arguments defining valid addresses."
+ 	| cpuAlien cpu memorySize maybeErr |
+ 	<var: #cpu type: #'void *'>
+ 	cpuAlien := self primitive: #primitiveSingleStepInMemoryMinAddressMaxAddressReadWrite
+ 					parameters: #(WordsOrBytes Unsigned Unsigned Unsigned)
+ 					receiver: #Oop.
+ 	(cpu := self startOfData: cpuAlien) = 0 ifTrue:
+ 		[^interpreterProxy primitiveFailFor: PrimErrBadReceiver].
+ 	memorySize := interpreterProxy byteSizeOf: memory cPtrAsOop.
+ 	maybeErr := self singleStepCPU: cpu
+ 					In: memory
+ 					Size: (memorySize min: maxAddress)
+ 					MinAddressRead: minAddress
+ 					Write: minWriteMaxExecAddress.
+ 	maybeErr ~= 0 ifTrue:
+ 		[^interpreterProxy primitiveFailFor: PrimErrInappropriate].
+ 	^cpuAlien!

Item was added:
+ ----- Method: GdbARMAlien>>primitiveRunInMemory:minimumAddress:maximumAddress:readOnlyBelow: (in category 'primitives') -----
+ primitiveRunInMemory: memoryArray "<Bitmap|ByteArray>" minimumAddress: minimumAddress "<Integer>" maximumAddress: maximimAddress "<Integer>" readOnlyBelow: minimumWritableAddress "<Integer>"
+ 	"Run the receiver using the argument as the store.  Origin the argument at 0. i.e. the first byte of the
+ 	 memoryArray is address 0.  Make addresses below minimumAddress illegal.  Convert out-of-range
+ 	 calls, jumps and memory read/writes into ProcessorSimulationTrap signals."
+ 	<primitive: 'primitiveRunInMemoryMinAddressMaxAddressReadWrite' module: 'GdbARMPlugin' error: ec>
+ 	^ec == #'inappropriate operation'
+ 		ifTrue: [self handleExecutionPrimitiveFailureIn: memoryArray
+ 					minimumAddress: minimumAddress
+ 					readOnlyBelow: minimumWritableAddress]
+ 		ifFalse: [self reportPrimitiveFailure]
+ 
+ 	"self printRegistersOn: Transcript"!

Item was changed:
  ----- Method: GdbARMAlien>>primitiveRunInMemory:minimumAddress:readOnlyBelow: (in category 'primitives') -----
  primitiveRunInMemory: memoryArray "<Bitmap|ByteArray>" minimumAddress: minimumAddress "<Integer>" readOnlyBelow: minimumWritableAddress "<Integer>"
  	"Run the receiver using the argument as the store.  Origin the argument at 0. i.e. the first byte of the
  	 memoryArray is address 0.  Make addresses below minimumAddress illegal.  Convert out-of-range
+ 	 calls, jumps and memory read/writes into ProcessorSimulationTrap signals."
- 	 call, jump and memory read/writes into register instructions into ProcessorSimulationTrap signals."
  	<primitive: 'primitiveRunInMemoryMinimumAddressReadWrite' module: 'GdbARMPlugin' error: ec>
  	^ec == #'inappropriate operation'
  		ifTrue: [self handleExecutionPrimitiveFailureIn: memoryArray
  					minimumAddress: minimumAddress
  					readOnlyBelow: minimumWritableAddress]
  		ifFalse: [self reportPrimitiveFailure]
  
  	"self printRegistersOn: Transcript"!

Item was added:
+ ----- Method: GdbARMAlien>>primitiveSingleStepInMemory:minimumAddress:maximumAddress:readOnlyBelow: (in category 'primitives') -----
+ primitiveSingleStepInMemory: memoryArray "<Bitmap|ByteArray>" minimumAddress: minimumAddress "<Integer>" maximumAddress: maximimAddress "<Integer>" readOnlyBelow: minimumWritableAddress "<Integer>"
+ 	"Single-step the receiver using the argument as the store.  Origin the argument at 0. i.e. the first byte of the
+ 	 memoryArray is address 0.  Make addresses below minimumAddress illegal.  Convert out-of-range
+ 	 calls, jumps and memory read/writes into ProcessorSimulationTrap signals."
+ 	<primitive: 'primitiveSingleStepInMemoryMinAddressMaxAddressReadWrite' module: 'GdbARMPlugin' error: ec>
+ 	^ec == #'inappropriate operation'
+ 		ifTrue: [self handleExecutionPrimitiveFailureIn: memoryArray
+ 					minimumAddress: minimumAddress
+ 					readOnlyBelow: minimumWritableAddress]
+ 		ifFalse: [self reportPrimitiveFailure]!

Item was changed:
  ----- Method: GdbARMAlien>>primitiveSingleStepInMemory:minimumAddress:readOnlyBelow: (in category 'primitives') -----
  primitiveSingleStepInMemory: memoryArray "<Bitmap|ByteArray>" minimumAddress: minimumAddress "<Integer>" readOnlyBelow: minimumWritableAddress "<Integer>"
  	"Single-step the receiver using the argument as the store.  Origin the argument at 0. i.e. the first byte of the
  	 memoryArray is address 0.  Make addresses below minimumAddress illegal.  Convert out-of-range
+ 	 calls, jumps and memory read/writes into ProcessorSimulationTrap signals."
- 	 call, jump and memory read/writes into register instructions into ProcessorSimulationTrap signals."
  	<primitive: 'primitiveSingleStepInMemoryMinimumAddressReadWrite' module: 'GdbARMPlugin' error: ec>
  	^ec == #'inappropriate operation'
  		ifTrue: [self handleExecutionPrimitiveFailureIn: memoryArray
  					minimumAddress: minimumAddress
  					readOnlyBelow: minimumWritableAddress]
  		ifFalse: [self reportPrimitiveFailure]!

Item was added:
+ ----- Method: GdbARMPlugin>>primitiveRunInMemory:minimumAddress:maximumAddress:readOnlyBelow: (in category 'primitives') -----
+ "cpuAlien <GdbARMAlien>" primitiveRunInMemory: memory "<Bitmap|ByteArray|WordArray>" minimumAddress: minAddress "<Integer>" maximumAddress: maxAddress "<Integer>" readOnlyBelow: minWriteMaxExecAddress "<Integer>"
+ 	"Run the cpu using the first argument as the memory and the following arguments defining valid addresses, running until it halts or hits an exception."
+ 	| cpuAlien cpu memorySize maybeErr |
+ 	<var: #cpu type: #'void *'>
+ 	cpuAlien := self primitive: #primitiveRunInMemoryMinAddressMaxAddressReadWrite
+ 					parameters: #(WordsOrBytes Unsigned Unsigned Unsigned)
+ 					receiver: #Oop.
+ 	(cpu := self startOfData: cpuAlien) = 0 ifTrue:
+ 		[^interpreterProxy primitiveFailFor: PrimErrBadReceiver].
+ 	prevInterruptCheckChain := interpreterProxy setInterruptCheckChain: #forceStopOnInterrupt asSymbol.
+ 	prevInterruptCheckChain = #forceStopOnInterrupt asSymbol ifTrue:
+ 		[prevInterruptCheckChain = 0].
+ 	memorySize := interpreterProxy byteSizeOf: memory cPtrAsOop.
+ 	maybeErr := self runCPU: cpu
+ 					In: memory
+ 					Size: (memorySize min: maxAddress)
+ 					MinAddressRead: minAddress
+ 					Write: minWriteMaxExecAddress.
+ 	interpreterProxy setInterruptCheckChain: prevInterruptCheckChain.
+ 	maybeErr ~= 0 ifTrue:
+ 		[^interpreterProxy primitiveFailFor: PrimErrInappropriate].
+ 	^cpuAlien!

Item was added:
+ ----- Method: GdbARMPlugin>>primitiveSingleStepInMemory:minimumAddress:maximumAddress:readOnlyBelow: (in category 'primitives') -----
+ "cpuAlien <GdbARMAlien>" primitiveSingleStepInMemory: memory "<Bitmap|ByteArray|WordArray>" minimumAddress: minAddress "<Integer>" maximumAddress: maxAddress "<Integer>" readOnlyBelow: minWriteMaxExecAddress "<Integer>"
+ 	"Single-step the cpu using the first argument as the memory and the following arguments defining valid addresses."
+ 	| cpuAlien cpu memorySize maybeErr |
+ 	<var: #cpu type: #'void *'>
+ 	cpuAlien := self primitive: #primitiveSingleStepInMemoryMinAddressMaxAddressReadWrite
+ 					parameters: #(WordsOrBytes Unsigned Unsigned Unsigned)
+ 					receiver: #Oop.
+ 	(cpu := self startOfData: cpuAlien) = 0 ifTrue:
+ 		[^interpreterProxy primitiveFailFor: PrimErrBadReceiver].
+ 	memorySize := interpreterProxy byteSizeOf: memory cPtrAsOop.
+ 	maybeErr := self singleStepCPU: cpu
+ 					In: memory
+ 					Size: (memorySize min: maxAddress)
+ 					MinAddressRead: minAddress
+ 					Write: minWriteMaxExecAddress.
+ 	maybeErr ~= 0 ifTrue:
+ 		[^interpreterProxy primitiveFailFor: PrimErrInappropriate].
+ 	^cpuAlien!



More information about the Vm-dev mailing list