From: Andrew Au Date: Thu, 12 Nov 2020 01:39:29 +0000 (-0800) Subject: A couple of R2RDump fixes (#44558) X-Git-Tag: submit/tizen/20210909.063632~4664 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b3b1b5fb517b60b8f41c6e97d9b338988542483;p=platform%2Fupstream%2Fdotnet%2Fruntime.git A couple of R2RDump fixes (#44558) --- diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs index 6c6b2f0..938103f 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs @@ -1669,6 +1669,14 @@ namespace ILCompiler.Reflection.ReadyToRun builder.Append("NEW_MULTI_DIM_ARR__NON_VAR_ARG"); break; + case ReadyToRunHelper.MonitorEnter: + builder.Append("MONITOR_ENTER"); + break; + + case ReadyToRunHelper.MonitorExit: + builder.Append("MONITOR_EXIT"); + break; + // Helpers used with generic handle lookup cases case ReadyToRunHelper.NewObject: builder.Append("NEW_OBJECT"); @@ -1879,9 +1887,7 @@ namespace ILCompiler.Reflection.ReadyToRun break; default: - // TODO: Something is wrong with helper signature parsing - builder.Append(string.Format("Unknown helper: {0:X2}", helperType)); - break; + throw new BadImageFormatException(); } } diff --git a/src/coreclr/src/tools/r2rdump/TextDumper.cs b/src/coreclr/src/tools/r2rdump/TextDumper.cs index 682abd7..ea60e1d 100644 --- a/src/coreclr/src/tools/r2rdump/TextDumper.cs +++ b/src/coreclr/src/tools/r2rdump/TextDumper.cs @@ -226,9 +226,8 @@ namespace R2RDump } _writer.WriteLine(); } - BaseGcInfo gcInfo = (_options.HideTransitions ? null : rtf.Method?.GcInfo); - if (gcInfo != null && gcInfo.Transitions.TryGetValue(codeOffset, out List transitionsForOffset)) + if (gcInfo != null && gcInfo.Transitions != null && gcInfo.Transitions.TryGetValue(codeOffset, out List transitionsForOffset)) { string[] formattedTransitions = new string[transitionsForOffset.Count]; for (int transitionIndex = 0; transitionIndex < formattedTransitions.Length; transitionIndex++)