private void ProcessFormat2Conditions(ETMPcktPHeaderFormat2 aHeader) { string atom1TypeName = TraceAtomTypeName(aHeader.Atom1Type); string atom2TypeName = TraceAtomTypeName(aHeader.Atom2Type); base.Trace("{0} - 1 x {1}, 1 x {2}", base.MakeTracePacketPrefix("P-HEADER(2)"), atom1TypeName, atom2TypeName); // First instruction { uint address1 = base.StateData.CurrentAddress; ETMInstruction inst1 = base.StateData.FetchInstruction(address1); TraceAtom(aHeader.Atom1Type, inst1); if (aHeader.Atom1Type == ETMPcktPHeaderBase.TAtomType.EAtomE_Passed) { bool branched = CheckForBranch(inst1); if (!branched) { base.StateData.IncrementPC(); } } else { base.StateData.IncrementPC(); } } // Second instruction { uint address2 = base.StateData.CurrentAddress; ETMInstruction inst2 = base.StateData.FetchInstruction(address2); TraceAtom(aHeader.Atom2Type, inst2); if (aHeader.Atom2Type == ETMPcktPHeaderBase.TAtomType.EAtomE_Passed) { bool branched = CheckForBranch(inst2); if (!branched) { base.StateData.IncrementPC(); } } else { base.StateData.IncrementPC(); } } // Spacer - to make the verbose output easier to read... base.Trace(string.Empty); }
public override ETMDecodeState HandleByte(SymByte aByte) { ETMDecodeState nextState = new ETMDecodeStateSynchronized(base.StateData); // ETMPcktBase packet = Packets.Factory.ETMPacketFactory.Create(aByte); if (packet is ETMPcktPHeaderFormat1) { ETMPcktPHeaderFormat1 pHeader1 = (ETMPcktPHeaderFormat1)packet; ProcessFormat1Conditions(pHeader1); } else if (packet is ETMPcktPHeaderFormat2) { ETMPcktPHeaderFormat2 pHeader2 = (ETMPcktPHeaderFormat2)packet; ProcessFormat2Conditions(pHeader2); } else { throw new ETMException("ERROR: P-HEADER is not supported"); } // return(nextState); }