public IEnumerable <KeyValuePair <string, ulong> > FetchValues(ulong sp, IGlobalExpressionEvaluator evaluator) { var bytes = evaluator.ReadMemoryBlock($"0x{sp:x8}", _Position) ?? new byte[0]; List <KeyValuePair <string, ulong> > result = new List <KeyValuePair <string, ulong> >(); foreach (var rec in _AllRegisters) { if (rec.EndOffset > bytes.Length) { continue; //Unavailable } switch (rec.Size) { case 4: result.Add(new KeyValuePair <string, ulong>(rec.Name, BitConverter.ToUInt32(bytes, rec.Offset))); break; case 8: result.Add(new KeyValuePair <string, ulong>(rec.Name, BitConverter.ToUInt64(bytes, rec.Offset))); break; } } result.Add(new KeyValuePair <string, ulong>("sp", sp + (ulong)_Position)); return(result); }
public IEnumerable <KeyValuePair <string, ulong> > GetSaved64BitRegisters() { StackLayoutBuilder builder = new StackLayoutBuilder(8); var tmpBlock = _Evaluator.ReadMemoryBlock($"0x{_SavedSP:x8}", 16); builder.Skip(16); if (BitConverter.ToUInt64(tmpBlock, 0) != 0) { builder.AddZigZagRegisterSequence("q", 31, 0); } builder.AddSingleRegister("pc"); builder.Skip(); builder.AddZigZagRegisterSequence("x", 31, 0); builder.VerifyPosition(0x120); return(builder.FetchValues(_SavedSP, _Evaluator)); }
public IEnumerable <KeyValuePair <string, ulong> > Load(IGlobalExpressionEvaluator evaluator, ulong address) { int blockSize = _MaxOffset - _MinOffset + WordSize; var data = evaluator.ReadMemoryBlock($"0x{address + (uint)_MinOffset:x8}", blockSize); List <KeyValuePair <string, ulong> > result = new List <KeyValuePair <string, ulong> >(); foreach (var kv in _Offsets) { int offset = kv.Value - _MinOffset; if (data != null && data.Length >= (offset + WordSize)) { result.Add(new KeyValuePair <string, ulong>(kv.Key, BitConverter.ToUInt32(data, offset))); } else { //We could not fetch the data block, or it was incomplete } } return(result); }