Improve thunk call disassembly in R2RDump (#2297)
authorTomáš Rylek <trylek@microsoft.com>
Thu, 30 Jan 2020 10:27:34 +0000 (11:27 +0100)
committerGitHub <noreply@github.com>
Thu, 30 Jan 2020 10:27:34 +0000 (11:27 +0100)
commitb4e711cf89f7d6eacc5136850e7d3f5383cb9382
tree49c79ce51867ef5dcb6275ecb9631fc23d098f9c
parentb27a4b3566deb235c2746e3145dd0438ee38773f
Improve thunk call disassembly in R2RDump (#2297)

* Improve thunk call disassembly in R2RDump

This change improves the disassembly of thunk-based calls to R2R
helpers used by Crossgen1 and considered for Crossgen2 to improve
disassembly quality and facilitate easier comparison of Crossgen1
vs. Crossgen2 codegen.

I have also added new options for hiding the instruction offsets
in the disassembly and for omitting functions with identical
disassembly in the common functions diff output. For SPC this
reduced the size of the dump in <code>--naked --hide-offsets
--diff-hide-same-disasm</code> mode by about one half.

In view of the fact that Andrew wasn't too happy about my change
to stop logging to the console I further simplified the related
code by basically reverting that aspect of my change in a more
radical manner.

I have also moved the call to CoreDisTools.ClearOutputBuffer
into CoreDisTools.GetInstruction so that we don't need to call it
manually in the higher-level code.

Thanks

Tomas

* JanV's PR feedback: use spaces, not tabs, in R2RDump output
15 files changed:
src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcInfo.cs
src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/GcSlotTable.cs
src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Amd64/UnwindInfo.cs
src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm/UnwindInfo.cs
src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/Arm64/UnwindInfo.cs
src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcInfo.cs
src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/GcSlotTable.cs
src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs
src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/UnwindInfo.cs
src/coreclr/src/tools/r2rdump/CommandLineOptions.cs
src/coreclr/src/tools/r2rdump/CoreDisTools.cs
src/coreclr/src/tools/r2rdump/Extensions.cs
src/coreclr/src/tools/r2rdump/R2RDiff.cs
src/coreclr/src/tools/r2rdump/R2RDump.cs
src/coreclr/src/tools/r2rdump/TextDumper.cs