Example #1
0
 public AddBreakpointDialog(BreakpointOperation op, uint address, uint mask, MemoryCallbackType type) : this(op)
 {
     AddressMaskBox.SetHexProperties(0xFFFFFFFF);
     Address     = address;
     AddressMask = mask;
     BreakType   = type;
 }
        public void AddBreakpoint(uint address, uint mask, MemoryCallbackType type)
        {
            _breakpoints.Add(Core, MemoryDomains.SystemBus.Name, address, mask, type);

            BreakpointView.ItemCount = _breakpoints.Count;
            UpdateBreakpointRemoveButton();
            UpdateStatsLabel();
        }
        public void AddBreakpoint(uint address, MemoryCallbackType type)
        {
            Breakpoints.Add(Core, address, type);

            BreakpointView.ItemCount = Breakpoints.Count;
            UpdateBreakpointRemoveButton();
            UpdateStatsLabel();
        }
Example #4
0
        public void AddBreakpoint(uint address, MemoryCallbackType type)
        {
            Breakpoints.Add(Core, address, type);

            BreakpointView.ItemCount = Breakpoints.Count;
            UpdateBreakpointRemoveButton();
            UpdateStatsLabel();
        }
Example #5
0
 public MemoryCallback(string scope, MemoryCallbackType type, string name, MemoryCallbackDelegate callback, uint?address, uint?mask)
 {
     Type        = type;
     Name        = name;
     Callback    = callback;
     Address     = address;
     AddressMask = mask ?? 0xFFFFFFFF;
     Scope       = scope;
 }
Example #6
0
        public Breakpoint(IDebuggable core, Action callBack, uint address, MemoryCallbackType type, bool enabled = true)
        {
            _core    = core;
            Type     = type;
            Callback = callBack;
            Address  = address;
            Name     = "Pause";

            Active = enabled;
        }
Example #7
0
        public Breakpoint(string name, bool readOnly, IDebuggable core, Action callBack, uint address, MemoryCallbackType type, bool enabled = true)
        {
            _core    = core;
            Type     = type;
            Callback = callBack;
            Address  = address;
            Name     = name;

            Active   = enabled;
            ReadOnly = readOnly;
        }
Example #8
0
        public MemoryCallback(MemoryCallbackType type, string name, Action callback, uint? address)
        {
            if (type == MemoryCallbackType.Execute && !address.HasValue)
            {
                throw new InvalidOperationException("When assigning an execute callback, an address must be specified");
            }

            Type = type;
            Name = name;
            Callback = callback;
            Address = address;
        }
Example #9
0
        public Breakpoint(IDebuggable core, string scope, MemoryCallbackDelegate callBack, uint address, uint mask, MemoryCallbackType type, bool enabled = true)
        {
            Scope       = scope;
            _core       = core;
            Type        = type;
            Callback    = callBack;
            Address     = address;
            AddressMask = mask;
            Name        = "Pause";

            Active = enabled;
        }
Example #10
0
        public Breakpoint(bool readOnly, IDebuggable core, Action callBack, uint address, uint mask, MemoryCallbackType type, bool enabled = true)
        {
            _core       = core;
            Type        = type;
            Callback    = callBack;
            Address     = address;
            AddressMask = mask;
            Name        = "Pause";

            Active   = enabled;
            ReadOnly = readOnly;
        }
Example #11
0
        public MemoryCallback(MemoryCallbackType type, string name, Action callback, uint?address)
        {
            if (type == MemoryCallbackType.Execute && !address.HasValue)
            {
                throw new InvalidOperationException("When assigning an execute callback, an address must be specified");
            }

            Type     = type;
            Name     = name;
            Callback = callback;
            Address  = address;
        }
Example #12
0
        private string SetMemoryEvent(MemoryCallbackType type, string callback, uint address, uint bytes, string name, uint?checkAddress = null, uint checkValue = 0, string domain = "System Bus")
        {
            domain = NormalizeDomain(domain);
            try
            {
                if (DebuggableCore?.MemoryCallbacksAvailable() == true &&
                    (type != MemoryCallbackType.Execute || DebuggableCore.MemoryCallbacks.ExecuteCallbacksAvailable))
                {
                    name = name ?? callback;

                    uint mask = 0;
                    for (var i = 0; i < bytes; i++)
                    {
                        mask |= (uint)(0xFF << (i * 8));
                    }

                    if (!HasDomain(domain))
                    {
                        throw new ApiError($"{Emulator.Attributes().CoreName} does not support memory callbacks on the domain {domain}");
                    }
                    HttpClient client = new HttpClient();
                    DebuggableCore.MemoryCallbacks.Add(new MemoryCallback(
                                                           domain,
                                                           type,
                                                           name,
                                                           (uint address, uint value, uint flags) =>
                    {
                        if (checkAddress != null && ReadUnsignedByte((int)checkAddress, domain) == checkValue)
                        {
                            try
                            {
                                client.GetAsync(callback).Result.ToString();
                            }
                            catch { }
                        }
                    },
                                                           address,
                                                           mask
                                                           ));
                    return(name);
                }
                // fall through
            }
            catch (NotImplementedException) { }
            if (type == MemoryCallbackType.Execute)
            {
                throw new ApiError($"{Emulator.Attributes().CoreName} does not support memory execute callbacks.");
            }
            throw new ApiError($"{Emulator.Attributes().CoreName} does not support memory callbacks.");
        }
Example #13
0
        public MemoryCallback(string scope, MemoryCallbackType type, string name, MemoryCallbackDelegate callback, uint?address, uint?mask)
        {
            if (type == MemoryCallbackType.Execute && !address.HasValue)
            {
                throw new InvalidOperationException("When assigning an execute callback, an address must be specified");
            }

            Type        = type;
            Name        = name;
            Callback    = callback;
            Address     = address;
            AddressMask = mask ?? 0xFFFFFFFF;
            Scope       = scope;
        }
Example #14
0
        private string SetMemoryEvent(MemoryCallbackType type, string callback, uint address, uint bytes, string name, int checkAddr = -1, uint checkValue = 0)
        {
            try
            {
                if (
                    DebuggableCore != null &&
                    DebuggableCore.MemoryCallbacksAvailable() &&
                    (type != MemoryCallbackType.Execute || DebuggableCore.MemoryCallbacks.ExecuteCallbacksAvailable)
                    )
                {
                    name = name ?? callback;
                    uint mask = 0;
                    for (var i = 0; i < bytes; i++)
                    {
                        mask |= (uint)(0xFF << (i * 8));
                    }

                    HttpClient client = new HttpClient();
                    DebuggableCore.MemoryCallbacks.Add(new MemoryCallback(type, name, () =>
                    {
                        if (checkAddr < 0 || ReadUnsignedByte(checkAddr) == checkValue)
                        {
                            try
                            {
                                client.GetAsync(callback).Result.ToString();
                            }
                            catch { }
                        }
                    }, address, mask));
                    return(name);
                }
            }
            catch (NotImplementedException) { }
            if (type == MemoryCallbackType.Execute)
            {
                throw new ApiError($"{Emulator.Attributes().CoreName} does not support memory execute callbacks.");
            }
            throw new ApiError($"{Emulator.Attributes().CoreName} does not support memory callbacks.");
        }
Example #15
0
 public AddBreakpointDialog(BreakpointOperation op, uint address, MemoryCallbackType type) : this(op)
 {
     Address   = address;
     BreakType = type;
 }
 public void AddBreakpoint(uint address, uint mask, MemoryCallbackType type)
 {
     this.BreakPointControl1.AddBreakpoint(address, mask, type);
 }
Example #17
0
		public AddBreakpointDialog(BreakpointOperation op, uint address, MemoryCallbackType type):this(op)
		{
			Address = address;
			BreakType = type;
		}
Example #18
0
        public Breakpoint(bool readOnly, IDebuggable core, Action callBack, uint address, MemoryCallbackType type, bool enabled = true)
        {
            _core = core;

            Callback = callBack;
            Address  = address;
            Active   = enabled;
            Name     = "Pause";
            ReadOnly = readOnly;

            if (enabled)
            {
                AddCallback();
            }
        }
Example #19
0
 public void Add(IDebuggable core, uint address, MemoryCallbackType type)
 {
     Add(new Breakpoint(core, Callback, address, type));
 }
Example #20
0
		private AddBreakpointDialog CreateAddBreakpointDialog(BreakpointOperation op, MemoryCallbackType? type = null, uint? address = null)
		{
			var operation = (AddBreakpointDialog.BreakpointOperation)op;

			var b = new AddBreakpointDialog(operation)
			{
				// TODO: don't use Global.Emulator! Pass in an IMemoryDomains implementation from the parent tool
				MaxAddressSize = Global.Emulator.AsMemoryDomains().SystemBus.Size - 1
			};

			if (type != null)
			{
				b.BreakType = (MemoryCallbackType)type;
			}

			if (address != null)
			{
				b.Address = (uint)address;
			}

			if (!MCS.ExecuteCallbacksAvailable)
			{
				b.DisableExecuteOption();
			}

			return b;
		}
Example #21
0
		public void AddBreakpoint(uint address, MemoryCallbackType type)
		{
			this.BreakPointControl1.AddBreakpoint(address, type);
		}
Example #22
0
 private Func <IEnumerable <string>, string, string> WrapConditionalMemoryEvent(MemoryCallbackType type, Func <MemoryCallbackType, string, uint, uint, string, uint?, uint, string, string> innerCall)
 => (IEnumerable <string> args, string domain)
 => innerCall(type, string.Join("/", args.Skip(4)), (uint)GetAddr(args, CurrentDomain.Name), (uint)GetLength(args), domain, (uint)GetAddr(args, CurrentDomain.Name, 2), (uint)GetValue(args, 3), null);
Example #23
0
 // MemoryEvents
 private Func <IEnumerable <string>, string, string> WrapMemoryEvent(MemoryCallbackType type, Func <MemoryCallbackType, string, uint, uint, string, int, uint, string> innerCall)
 => (IEnumerable <string> args, string domain)
 => innerCall(type, string.Join("/", args.Skip(2)), (uint)GetAddr(args, CurrentDomain.Name), (uint)GetLength(args), domain, -1, 0);
Example #24
0
 public void Add(IDebuggable core, string scope, uint address, uint mask, MemoryCallbackType type)
 {
     Add(new Breakpoint(core, scope, Callback, address, mask, type));
 }