private void OnAddress(SymByte aByte) { int byteNumber = 4 - iBytesRemaining; uint val = aByte.LShift(byteNumber * 8); iAddress |= val; if (--iBytesRemaining == 0) { // Save for tracing purposes SymAddress originalAddress = new SymAddress(base.StateData.CurrentAddress.Address); TArmInstructionSet originalInstructionSet = base.StateData.CurrentInstructionSet; // Set new branch address TArmInstructionSet newInstructionSet = iInformationByte.InstructionSet; uint address = iAddress; if ((address & 0x1) == 0x1) { // We branched to THUMB, hence change of instruction set... address &= 0xFFFFFFFE; newInstructionSet = TArmInstructionSet.ETHUMB; } // Store address etc - always 32 bit full address during I-SYNC base.StateData.CurrentInstructionSet = newInstructionSet; base.StateData.SetKnownAddressBits(address, 32, TETMBranchType.EBranchExplicit); // And output debug trace... Trace(originalAddress, originalInstructionSet, base.StateData.CurrentAddress, newInstructionSet); // We're done iState = TState.EStateIdle; } }
private void OnContextByte(SymByte aByte) { int byteNumber = iContextIdBytesRequired - iBytesRemaining; uint val = aByte.LShift(byteNumber * 8); iContextId |= val; if (--iBytesRemaining == 0) { base.StateData.SetContextID(iContextId); iState = TState.EStateInformation; } }
public override ETMDecodeState HandleByte(SymByte aByte) { // TODO: test this ETMDecodeState nextState = this; // int byteNumber = iContextIdBytesRequired - iBytesRemaining; uint val = aByte.LShift(byteNumber * 8); iContextId |= val; // if (--iBytesRemaining == 0) { // Got everything base.StateData.SetContextID(iContextId); nextState = new ETMDecodeStateSynchronized(base.StateData); } // return(nextState); }