public void ReadMemory(ulong address, uint size, OnMemoryRead onMemoryRead) { var command = new ReadMemory(address, size, OnMemoryRead); OnMemoryReadMap.Add(command, onMemoryRead); GDBClient.SendCommand(command); }
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(); }
public void ReadMemory(ulong address, uint size, OnMemoryRead onMemoryRead) { ThreadPool.QueueUserWorkItem(state => { ReadMemoryInternal(address, size, onMemoryRead); }); }
public Request(ulong address, uint size, OnMemoryRead onMemoryRead) { Address = address; Size = size; OnMemoryRead = onMemoryRead; }
protected void NotifyMemoryRead(BusData address, BusData data) { OnMemoryRead?.Invoke(this, new MemoryNotificationEventArgs <AddressT, DataT>((AddressT)address, (DataT)data)); }