Use Registers for FrameRegister
authorAmy Yu <amycmyu@gmail.com>
Wed, 13 Jun 2018 18:53:08 +0000 (11:53 -0700)
committerAmy Yu <amycmyu@gmail.com>
Tue, 19 Jun 2018 23:38:28 +0000 (16:38 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/20ca285a04c4c19f27040faa843eed10c79e217a

src/coreclr/src/tools/r2rdump/UnwindInfo.cs

index 1f4eb52..0a74247 100644 (file)
@@ -57,7 +57,7 @@ namespace R2RDump
         public byte Flags { get; } //5 bits
         public byte SizeOfProlog { get; }
         public byte CountOfUnwindCodes { get; }
-        public byte FrameRegister { get; } //4 bits
+        public Registers FrameRegister { get; } //4 bits
         public byte FrameOffset { get; } //4 bits
         public UnwindCode[] UnwindCode { get; }
         public uint PersonalityRoutineRVA { get; }
@@ -71,7 +71,7 @@ namespace R2RDump
             SizeOfProlog = NativeReader.ReadByte(image, ref offset);
             CountOfUnwindCodes = NativeReader.ReadByte(image, ref offset);
             byte frameRegisterAndOffset = NativeReader.ReadByte(image, ref offset);
-            FrameRegister = (byte)(frameRegisterAndOffset & 15);
+            FrameRegister = (Registers)(frameRegisterAndOffset & 15);
             FrameOffset = (byte)(frameRegisterAndOffset >> 4);
 
             UnwindCode = new UnwindCode[CountOfUnwindCodes];
@@ -102,7 +102,7 @@ namespace R2RDump
             for (int i = 0; i < CountOfUnwindCodes; i++)
             {
                 sb.Append(GetUnwindCode(ref i));
-                sb.AppendLine($"{tab}{tab}------------------");
+                sb.AppendLine($"\t\t------------------");
             }
             sb.AppendLine($"\tPersonalityRoutineRVA: 0x{PersonalityRoutineRVA:X8}");
             sb.AppendLine($"\tSize: {Size} bytes");