diff options
Diffstat (limited to 'src/Ryujinx.Memory')
| -rw-r--r-- | src/Ryujinx.Memory/Range/MemoryRange.cs | 14 | ||||
| -rw-r--r-- | src/Ryujinx.Memory/Range/MultiRange.cs | 9 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/Ryujinx.Memory/Range/MemoryRange.cs b/src/Ryujinx.Memory/Range/MemoryRange.cs index 7465fbcb..c7ee6db2 100644 --- a/src/Ryujinx.Memory/Range/MemoryRange.cs +++ b/src/Ryujinx.Memory/Range/MemoryRange.cs @@ -57,5 +57,19 @@ return thisAddress < otherEndAddress && otherAddress < thisEndAddress; } + + /// <summary> + /// Returns a string summary of the memory range. + /// </summary> + /// <returns>A string summary of the memory range</returns> + public override string ToString() + { + if (Address == ulong.MaxValue) + { + return $"[Unmapped 0x{Size:X}]"; + } + + return $"[0x{Address:X}, 0x{EndAddress:X})"; + } } } diff --git a/src/Ryujinx.Memory/Range/MultiRange.cs b/src/Ryujinx.Memory/Range/MultiRange.cs index 9dbd76ec..42ef24be 100644 --- a/src/Ryujinx.Memory/Range/MultiRange.cs +++ b/src/Ryujinx.Memory/Range/MultiRange.cs @@ -319,5 +319,14 @@ namespace Ryujinx.Memory.Range return hash.ToHashCode(); } + + /// <summary> + /// Returns a string summary of the ranges contained in the MultiRange. + /// </summary> + /// <returns>A string summary of the ranges contained within</returns> + public override string ToString() + { + return HasSingleRange ? _singleRange.ToString() : string.Join(", ", _ranges); + } } } |
