示例#1
0
        public void ReadMemory(ulong address, uint size, OnMemoryRead onMemoryRead)
        {
            var command = new ReadMemory(address, size, OnMemoryRead);

            OnMemoryReadMap.Add(command, onMemoryRead);

            GDBClient.SendCommand(command);
        }
示例#2
0
        public void ReadMemory(ulong address, uint size, OnMemoryRead onMemoryRead)
        {
            var request = new Request(address, size, onMemoryRead);

            var start = Alignment.AlignDown(address, BlockSize);
            var end   = Alignment.AlignUp(address + (ulong)size, BlockSize);

            var queries = new List <ulong>();

            lock (sync)
            {
                requests.Add(request);

                for (var i = start; i < end; i += BlockSize)
                {
                    if (!requested.Contains(i))
                    {
                        requested.Add(i);

                        //Connector.ReadMemory(i, BlockSize, OnMemoryRead);
                        queries.Add(i);
                    }

                    if (!received.Contains(i))
                    {
                        request.Blocks.Add(i);
                    }
                }
            }

            foreach (var q in queries)
            {
                Connector.ReadMemory(q, BlockSize, OnMemoryRead);
            }

            Process();
        }
示例#3
0
 public void ReadMemory(ulong address, uint size, OnMemoryRead onMemoryRead)
 {
     ThreadPool.QueueUserWorkItem(state => { ReadMemoryInternal(address, size, onMemoryRead); });
 }
示例#4
0
 public Request(ulong address, uint size, OnMemoryRead onMemoryRead)
 {
     Address      = address;
     Size         = size;
     OnMemoryRead = onMemoryRead;
 }
示例#5
0
 protected void NotifyMemoryRead(BusData address, BusData data)
 {
     OnMemoryRead?.Invoke(this, new MemoryNotificationEventArgs <AddressT, DataT>((AddressT)address, (DataT)data));
 }