From 8b3b1b5fb517b60b8f41c6e97d9b338988542483 Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Wed, 11 Nov 2020 17:39:29 -0800 Subject: [PATCH] A couple of R2RDump fixes (#44558) --- .../ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs | 12 +++++++++--- src/coreclr/src/tools/r2rdump/TextDumper.cs | 3 +-- 2 files changed, 10 insertions(+), 5 deletions(-) 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++) -- 2.7.4