Exemplo n.º 1
0
        private AddBreakpointDialog CreateAddBreakpointDialog(BreakpointOperation op, MemoryCallbackType?type = null, uint?address = null, uint?mask = null)
        {
            var operation = (AddBreakpointDialog.BreakpointOperation)op;

            var b = new AddBreakpointDialog(operation)
            {
                MaxAddressSize = MemoryDomains.SystemBus.Size - 1
            };

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

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

            if (mask != null)
            {
                b.AddressMask = (uint)mask;
            }

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

            return(b);
        }
        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);
        }
Exemplo n.º 3
0
 public AddBreakpointDialog(BreakpointOperation op)
 {
     InitializeComponent();
     Operation = op;
     AddressMaskBox.SetHexProperties(0xFFFFFFFF);
     AddressMask = 0xFFFFFFFF;
 }
Exemplo n.º 4
0
 public AddBreakpointDialog(BreakpointOperation op, uint address, uint mask, MemoryCallbackType type) : this(op)
 {
     AddressMaskBox.SetHexProperties(0xFFFFFFFF);
     Address     = address;
     AddressMask = mask;
     BreakType   = type;
 }
Exemplo n.º 5
0
 public AddBreakpointDialog(BreakpointOperation op, uint address, MemoryCallbackType type) : this(op)
 {
     Address   = address;
     BreakType = type;
 }
Exemplo n.º 6
0
 public AddBreakpointDialog(BreakpointOperation op)
 {
     InitializeComponent();
     Operation = op;
 }
Exemplo n.º 7
0
        private void ProcessBreakpointChange(DocumentLine line, BreakpointOperation ops)
        {
            // please notify ATF team before defining  FullISyntaxEditorControl
            if (line == null || StringUtil.IsNullOrEmptyOrWhitespace(line.Text))
                return;

            // get or create breakpoint layer.
            var layer = Document.SpanIndicatorLayers[SpanIndicatorLayer.BreakpointKey];
            if (layer == null)
            {
                layer = new SpanIndicatorLayer(SpanIndicatorLayer.BreakpointKey, SpanIndicatorLayer.BreakpointDisplayPriority);
                Document.SpanIndicatorLayers.Add(layer);
            }
            
            // find breakpoint indicator for the current line.
            BreakpointIndicator breakpointIndicator = null;
            foreach (SpanIndicator si in line.SpanIndicators)
            {
                breakpointIndicator = si as BreakpointIndicator;
                if (breakpointIndicator != null)
                    break;
            }

            var breakpointExist = breakpointIndicator != null;
            var addbreakpoint = ((ops == BreakpointOperation.Set || ops == BreakpointOperation.Toggle) && !breakpointExist);

            // do nothing 
            if (addbreakpoint == breakpointExist)
                return;
                       
            var e = new BreakpointEventArgs(addbreakpoint, line.Index + 1, line.Text);            
            if (BreakpointChanging != null)
                BreakpointChanging(this, e);

            // cancel the operation
            if (e.Cancel)
                return;

            if (addbreakpoint)
            {
                breakpointIndicator = new BreakpointIndicator();
                layer.Add(breakpointIndicator, line.TextRange);
            }
            else // remove breakpoint
            {
                layer.Remove(breakpointIndicator);                
            }
        }
Exemplo n.º 8
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;
		}
Exemplo n.º 9
0
		public AddBreakpointDialog(BreakpointOperation op, uint address, MemoryCallbackType type):this(op)
		{
			Address = address;
			BreakType = type;
		}
Exemplo n.º 10
0
		public AddBreakpointDialog(BreakpointOperation op)
		{
			InitializeComponent();
			Operation = op;
		}