Exemplo n.º 1
0
        internal ETMInstruction FetchInstruction(uint aAddress)
        {
            ETMInstruction ret = new ETMInstruction(aAddress);
            //
            bool gotCode = false;

            if (this.LastBranch.IsKnown && Engine.DebugEngineView != null)
            {
                DbgViewCode codeView = Engine.DebugEngineView.Code;

                // In the case where we've been asked to fetch the code from the exception
                // vector, then bypass the rom/rofs code entirely.
                bool isExceptionVector = Config.IsExceptionVector(aAddress);
                if (isExceptionVector)
                {
                    System.Diagnostics.Debug.Assert(this.CurrentInstructionSet == TArmInstructionSet.EARM);
                    TArmExceptionVector vector = Config.MapToExceptionVector(aAddress);
                    uint rawInstruction        = Config.GetExceptionVector(vector);
                    ret.Instruction = codeView.ConvertToInstruction(aAddress, TArmInstructionSet.EARM, rawInstruction);
                }
                else
                {
                    IArmInstruction[] instructions = null;
                    gotCode = codeView.GetInstructions(aAddress, CurrentInstructionSet, 1, out instructions);
                    //
                    if (gotCode)
                    {
                        System.Diagnostics.Debug.Assert(instructions != null && instructions.Length == 1);
                        ret.Instruction = instructions[0];
                    }
                }
            }
            //
            return(ret);
        }
Exemplo n.º 2
0
 public ArmCodeHelper(DbgViewCode aDebugViewCode, ITracer aTracer)
 {
     iCodeView = aDebugViewCode;
     iTracer   = aTracer;
 }