[Vm-dev] VM Maker: Cog-eem.252.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Mar 26 18:31:15 UTC 2015
Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.252.mcz
==================== Summary ====================
Name: Cog-eem.252
Author: eem
Time: 26 March 2015, 11:30:55.219 am
UUID: bf53e4bb-7d66-47d0-9c35-583d67a51a6c
Ancestors: Cog-eem.251
Fix comments, and add the return codes as class vars.
=============== Diff against Cog-eem.251 ===============
Item was changed:
CogProcessorAlien variableByteSubclass: #GdbARMAlien
instanceVariableNames: ''
+ classVariableNames: 'BadCPUInstance ExecutionError InstructionPrefetchError LongConstReg LongConstStep LongConstValue MemoryLoadBoundsError MemoryWriteBoundsError NoError PanicError PostBuildStackDelta SomethingLoggedError UnsupportedOperationError'
- classVariableNames: 'LongConstReg LongConstStep LongConstValue PostBuildStackDelta'
poolDictionaries: ''
category: 'Cog-Processors'!
!GdbARMAlien commentStamp: 'lw 8/23/2012 19:17' prior: 0!
I am a wrapper around the ARMulator CPU instance and emulator routines and I give access to disassembling using libopcodes. My C-part must be compiled with -DMODET, because otherwise my offesets are wrong by one field.!
Item was changed:
----- Method: GdbARMAlien class>>initialize (in category 'class initialization') -----
initialize
"GdbARMAlien initialize"
+ PostBuildStackDelta := 0.
+
+ "Return errors from GdbARMPlugin.h"
+ NoError := 0.
+ ExecutionError := 1.
+ BadCPUInstance := 2.
+ MemoryLoadBoundsError := 3.
+ MemoryWriteBoundsError := 4.
+ InstructionPrefetchError := 5.
+ PanicError := 6.
+ UnsupportedOperationError := 7.
+ SomethingLoggedError := 8!
- PostBuildStackDelta := 0.!
Item was changed:
----- Method: GdbARMAlien>>handleExecutionPrimitiveFailureIn:minimumAddress: (in category 'error handling') -----
handleExecutionPrimitiveFailureIn: memoryArray "<Bitmap|ByteArray>" minimumAddress: minimumAddress "<Integer>"
"Handle an execution primitive failure. Convert out-of-range call and absolute
memory read into register instructions into ProcessorSimulationTrap signals."
"self printRegistersOn: Transcript"
| pcOnEntry pc |
pcOnEntry := self pc.
+ self endCondition = InstructionPrefetchError ifTrue:
- self endCondition = 5 ifTrue:
[self pc: self priorPc].
((pc := self pc) between: minimumAddress and: memoryArray byteSize - 1) ifTrue:
[(self instructionTypeAt: pc in: memoryArray)
caseOf: {
[#Call] -> [^self handleCallFailureAt: pc in: memoryArray].
[#LongCall] -> [^self handleLongCallFailureAt: pc in: memoryArray].
[#Jump] -> [^self handleJmpFailureAt: pc in: memoryArray].
[#LongJump] -> [^self handleLongJmpFailureAt: pc in: memoryArray].
[#MoveAwR] -> [^self handleMoveAwRFailureAt: pc in: memoryArray].
[#MoveMbrR] -> [^self handleMoveMbrRFailureAt: pc in: memoryArray].
[#MoveRAw] -> [^self handleMoveRAwFailureAt: pc in: memoryArray].
[#MoveRMbr] -> [^self handleMoveRMbrFailureAt: pc in: memoryArray].
[#Ret] -> [^self handleRetFailureAt: pc in: memoryArray].}
otherwise: [^self handleExecutionPrimitiveFailureAt: pc in: memoryArray]].
^self reportPrimitiveFailure!
Item was changed:
----- Method: GdbARMAlien>>handleRetFailureAt:in: (in category 'error handling') -----
handleRetFailureAt: pc "<Integer>" in: memoryArray "<Bitmap|ByteArray>"
"Convert an execution primitive failure for a ret into a ProcessorSimulationTrap signal."
- self halt.
^(ProcessorSimulationTrap
pc: pc
nextpc: pc + 4
+ address: self lr
+ type: #return)
- address: self lr " for popping off stack version of retiurn -> (memoryArray unsignedLongAt: self sp -3) "
- type: #return
- "don't quite know what to do with this yet ->accessor: #pc:")
signal!
More information about the Vm-dev
mailing list