From: Andrew Au Date: Sun, 26 May 2019 23:30:39 +0000 (-0700) Subject: Fixing the epilog size decoding X-Git-Tag: submit/tizen/20210909.063632~11030^2~1391 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57470b7f4876fd7b63eae94fce57b3f692a881c7;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fixing the epilog size decoding Commit migrated from https://github.com/dotnet/coreclr/commit/c690daea096f44d6563de58cd4b5d50cce83d9bf --- diff --git a/src/coreclr/src/tools/r2rdump/Amd64/GcInfo.cs b/src/coreclr/src/tools/r2rdump/Amd64/GcInfo.cs index 7ab9394..0727c98 100644 --- a/src/coreclr/src/tools/r2rdump/Amd64/GcInfo.cs +++ b/src/coreclr/src/tools/r2rdump/Amd64/GcInfo.cs @@ -119,7 +119,7 @@ namespace R2RDump.Amd64 if (_hasGSCookie) { uint normPrologSize = NativeReader.DecodeVarLengthUnsigned(image, _gcInfoTypes.NORM_PROLOG_SIZE_ENCBASE, ref bitOffset) + 1; - uint normEpilogSize = NativeReader.DecodeVarLengthUnsigned(image, _gcInfoTypes.NORM_PROLOG_SIZE_ENCBASE, ref bitOffset); + uint normEpilogSize = NativeReader.DecodeVarLengthUnsigned(image, _gcInfoTypes.NORM_EPILOG_SIZE_ENCBASE, ref bitOffset); ValidRangeStart = normPrologSize; ValidRangeEnd = (uint)CodeLength - normEpilogSize; diff --git a/src/coreclr/src/tools/r2rdump/GCInfoTypes.cs b/src/coreclr/src/tools/r2rdump/GCInfoTypes.cs index 10bad28..f3bf54f 100644 --- a/src/coreclr/src/tools/r2rdump/GCInfoTypes.cs +++ b/src/coreclr/src/tools/r2rdump/GCInfoTypes.cs @@ -79,6 +79,7 @@ namespace R2RDump internal int SIZE_OF_RETURN_KIND_FAT { get; } = 2; internal int CODE_LENGTH_ENCBASE { get; } = 8; internal int NORM_PROLOG_SIZE_ENCBASE { get; } = 5; + internal int NORM_EPILOG_SIZE_ENCBASE { get; } = 3; internal int SECURITY_OBJECT_STACK_SLOT_ENCBASE { get; } = 6; internal int GS_COOKIE_STACK_SLOT_ENCBASE { get; } = 6; internal int PSP_SYM_STACK_SLOT_ENCBASE { get; } = 6; diff --git a/src/coreclr/src/tools/r2rdump/R2RReader.cs b/src/coreclr/src/tools/r2rdump/R2RReader.cs index edfbec0..6f61241 100644 --- a/src/coreclr/src/tools/r2rdump/R2RReader.cs +++ b/src/coreclr/src/tools/r2rdump/R2RReader.cs @@ -553,19 +553,7 @@ namespace R2RDump unwindInfo = new Amd64.UnwindInfo(Image, unwindOffset); if (isEntryPoint[runtimeFunctionId]) { - try - { - gcInfo = new Amd64.GcInfo(Image, unwindOffset + unwindInfo.Size, Machine, R2RHeader.MajorVersion); - } - catch (OverflowException) - { - Console.WriteLine($"Warning: Could not parse GC Info for method: {method.SignatureString}"); - } - catch (IndexOutOfRangeException) - { - Console.WriteLine($"Warning: Could not parse GC Info for method: {method.SignatureString}"); - } - + gcInfo = new Amd64.GcInfo(Image, unwindOffset + unwindInfo.Size, Machine, R2RHeader.MajorVersion); } } else if (Machine == Machine.I386)