Ejemplo n.º 1
0
        private void SetActualBP()
        {
            switch (bpType)
            {
            case BreakpointType.Read:
                gecko.BreakpointR(bpAddress, bpExact);
                break;

            case BreakpointType.Write:
                gecko.BreakpointW(bpAddress, bpExact);
                break;

            case BreakpointType.ReadWrite:
                gecko.BreakpointRW(bpAddress, bpExact);
                break;

            case BreakpointType.Execute:
                gecko.BreakpointX(bpAddress);
                break;

            default:
                gecko.Step();
                break;
            }
            BPSet = true;
            gecko.Resume();
            //if (!wait)
            //    return true;
            listSet = false;
        }
Ejemplo n.º 2
0
        public bool Compare(Stream regStream, BreakpointType bpType, UInt32 bpAddress, USBGecko gecko)
        {
            if (regStream.Length != 0x120)
            {
                return(false);
            }

            int spos = PRegister * 4;

            UInt32 val = 0;

            if (spos == 0x120) //Value of address is supposed to be checked
            {
                switch (bpType)
                {
                case BreakpointType.Read:
                    val = gecko.peek(bpAddress);
                    break;

                case BreakpointType.ReadWrite:
                case BreakpointType.Write:
                    gecko.Step();
                    val = gecko.peek(bpAddress);
                    break;

                default:
                    return(true);
                }
            }
            else
            {
                regStream.Seek(spos, SeekOrigin.Begin);
                val = GlobalFunctions.ReadStream(regStream);
            }

            switch (PCondition)
            {
            case BreakpointComparison.Equal:
                return(val == PValue);

            case BreakpointComparison.NotEqual:
                return(val != PValue);

            case BreakpointComparison.Greater:
                return(val > PValue);

            case BreakpointComparison.GreaterEqual:
                return(val >= PValue);

            case BreakpointComparison.Lower:
                return(val < PValue);

            case BreakpointComparison.LowerEqual:
                return(val <= PValue);
            }

            return(true);
        }
Ejemplo n.º 3
0
        public bool Compare(Stream regStream, BreakpointType bpType, UInt32 bpAddress, USBGecko gecko)
        {
            if (regStream.Length != 0x120)
                return false;
            
            int spos = PRegister * 4;

            UInt32 val = 0;
            if (spos == 0x120) //Value of address is supposed to be checked
            {
                switch (bpType)
                {                    
                    case BreakpointType.Read:
                        val = gecko.peek(bpAddress);
                        break;
                    case BreakpointType.ReadWrite:
                    case BreakpointType.Write:
                        gecko.Step();
                        val = gecko.peek(bpAddress);
                        break;
                    default:
                        return true;
                }
            }
            else
            {
                regStream.Seek(spos, SeekOrigin.Begin);
                val = GlobalFunctions.ReadStream(regStream);
            }

            switch (PCondition)
            {
                case BreakpointComparison.Equal:
                    return (val == PValue);
                case BreakpointComparison.NotEqual:
                    return (val != PValue);
                case BreakpointComparison.Greater:
                    return (val > PValue);
                case BreakpointComparison.GreaterEqual:
                    return (val >= PValue);
                case BreakpointComparison.Lower:
                    return (val < PValue);
                case BreakpointComparison.LowerEqual:
                    return (val <= PValue);
            }

            return true;
        }