Skip to content

Commit

Permalink
Merge pull request #3088 from cshung/public/update-ready-to-run
Browse files Browse the repository at this point in the history
Update ready to run
  • Loading branch information
christophwille authored Sep 23, 2023
2 parents 6d8647b + f4af00a commit be9fabb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<ItemGroup>
<PackageReference Include="Iced" Version="1.18.0" />
<PackageReference Include="ILCompiler.Reflection.ReadyToRun.Experimental" Version="8.0.0-preview.5.23260.1" />
<PackageReference Include="ILCompiler.Reflection.ReadyToRun.Experimental" Version="8.0.0-rc.2.23471.30" />
<!-- ILCompiler.Reflection.ReadyToRun has dependencies on System.Reflection.Metadata and
System.Runtime.CompilerServices.Unsafe. Because the AddIn compiles into ILSpy's output
directory, we're at risk of overwriting our dependencies with different versions.
Expand Down
14 changes: 10 additions & 4 deletions ILSpy.ReadyToRun/ReadyToRunDisassembler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ public void Disassemble(PEFile currentFile, int bitness, ulong address, bool sho
ulong baseInstrIP = instructions[0].IP;

var boundsMap = new Dictionary<uint, uint>();
foreach (var bound in runtimeFunction.DebugInfo.BoundsList)
if (runtimeFunction.DebugInfo != null)
{
// ignoring the return value assuming the same key is always mapped to the same value in runtimeFunction.DebugInfo.BoundsList
boundsMap.TryAdd(bound.NativeOffset, bound.ILOffset);
foreach (var bound in runtimeFunction.DebugInfo.BoundsList)
{
// ignoring the return value assuming the same key is always mapped to the same value in runtimeFunction.DebugInfo.BoundsList
boundsMap.TryAdd(bound.NativeOffset, bound.ILOffset);
}
}

foreach (var instr in instructions)
Expand All @@ -141,7 +144,10 @@ public void Disassemble(PEFile currentFile, int bitness, ulong address, bool sho
}
}
}
DecorateGCInfo(instr, baseInstrIP, readyToRunMethod.GcInfo);
if (ReadyToRunOptions.GetIsShowGCInfo(null))
{
DecorateGCInfo(instr, baseInstrIP, readyToRunMethod.GcInfo);
}
formatter.Format(instr, tempOutput);
output.Write(instr.IP.ToString("X16"));
output.Write(" ");
Expand Down

0 comments on commit be9fabb

Please sign in to comment.