internal void OnBranch(uint aAddress, TArmInstructionSet aInstructionSet, TArmExceptionType aExceptionType, TETMBranchType aBranchType) { if (Branch != null) { ETMBranch branch = new ETMBranch(new SymAddress(aAddress), iBranchCounter, aBranchType, aInstructionSet, aExceptionType); // Try to find a symbol SymbolCollection col = null; Symbol sym = LookUpSymbol(aAddress, out col); // if (sym != null) { branch.Symbol = sym; } else if (col != null) { branch.SymbolText = string.Format("Unknown Symbol from \'{0}\'", col.FileName.FileNameInHost); } // Cascade event Branch(branch); } ++iBranchCounter; }
internal void OnExceptionModeChange(TArmExceptionType aNewException) { if (Exception != null) { Exception(aNewException); } }
public ETMBranch(SymAddress aAddress, int aNumber, TETMBranchType aType, TArmInstructionSet aInstructionSet, TArmExceptionType aExceptionType) { iAddress = aAddress; iNumber = aNumber; iType = aType; iInstructionSet = aInstructionSet; iExceptionType = aExceptionType; }
public override void DecodeException(SymByte aByte) { // In a continuation exception byte, bit 7 is always supposed // to be clear, irrespective of whether original or alternative // compression schemes are in use. System.Diagnostics.Debug.Assert(aByte[7] == false); // Instruction cancellation base.IsLastInstructionCancelled = aByte[5]; // Security base.SecurityMode = TArmSecurityMode.ESecure; if (aByte[0]) { base.SecurityMode = TArmSecurityMode.ENotSecure; } // Exception type TArmExceptionType exceptionType = TArmExceptionType.EUnknown; aByte = (byte)(((byte)(aByte & 0x1E)) >> 1); switch (aByte) { case 0: exceptionType = TArmExceptionType.ENone; break; case 1: exceptionType = TArmExceptionType.EHaltingDebug; break; case 2: exceptionType = TArmExceptionType.ESecureMonitorCall; break; default: case 3: throw new ETMException("ERROR - reserved exception code during continuation byte"); case 4: exceptionType = TArmExceptionType.EAsyncDataAbort; break; case 5: exceptionType = TArmExceptionType.EJazelle; break; case 6: case 7: throw new ETMException("ERROR - reserved exception code during continuation byte"); case 8: exceptionType = TArmExceptionType.EProcessorReset; break; case 9: exceptionType = TArmExceptionType.EUndefinedInstruction; break; case 10: exceptionType = TArmExceptionType.ESVC; break; case 11: exceptionType = TArmExceptionType.EPrefetchAbortOrSWBreakpoint; break; case 12: exceptionType = TArmExceptionType.ESyncDataAbortOrSWWatchpoint; break; case 13: exceptionType = TArmExceptionType.EGeneric; break; case 14: exceptionType = TArmExceptionType.EIRQ; break; case 15: exceptionType = TArmExceptionType.EFIQ; break; } base.ExceptionType = exceptionType; }
public static string ToString(TArmExceptionType aException) { string mode = "???"; // switch (aException) { default: case TArmExceptionType.EUnknown: break; case TArmExceptionType.ENone: mode = "Normal"; break; case TArmExceptionType.EHaltingDebug: mode = "Halting Debug"; break; case TArmExceptionType.ESecureMonitorCall: mode = "Secure Monitor Call"; break; case TArmExceptionType.EAsyncDataAbort: mode = "Data Abort"; break; case TArmExceptionType.EJazelle: mode = "Jazelle"; break; case TArmExceptionType.EProcessorReset: mode = "Reset"; break; case TArmExceptionType.EUndefinedInstruction: mode = "Undefined Instruction"; break; case TArmExceptionType.ESVC: mode = "SVC"; break; case TArmExceptionType.EPrefetchAbortOrSWBreakpoint: mode = "Prefetch Abort / SW Breakpoint"; break; case TArmExceptionType.ESyncDataAbortOrSWWatchpoint: mode = "Data Abort / SW Watchbpoint"; break; case TArmExceptionType.EGeneric: mode = "Generic"; break; case TArmExceptionType.EIRQ: mode = "IRQ"; break; case TArmExceptionType.EFIQ: mode = "FIQ"; break; } // return(mode); }