From: Amy Yu Date: Thu, 7 Jun 2018 01:00:58 +0000 (-0700) Subject: Output formatting changes for unwindInfo and section contents X-Git-Tag: submit/tizen/20210909.063632~11030^2~4562^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb45102311377f2dd63537e2c6711a1c56dda6f2;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Output formatting changes for unwindInfo and section contents Commit migrated from https://github.com/dotnet/coreclr/commit/957c4db6eb24cdbe87fcd02a658ab99b50f8d304 --- diff --git a/src/coreclr/src/tools/r2rdump/R2RDump.cs b/src/coreclr/src/tools/r2rdump/R2RDump.cs index 2e2c27c..fce9fbd 100644 --- a/src/coreclr/src/tools/r2rdump/R2RDump.cs +++ b/src/coreclr/src/tools/r2rdump/R2RDump.cs @@ -54,7 +54,7 @@ namespace R2RDump syntax.DefineOption("types", ref _types, "Dump available types"); syntax.DefineOption("unwind", ref _unwind, "Dump unwindInfo"); syntax.DefineOption("gc", ref _gc, "Dump gcInfo and slot table"); - syntax.DefineOption("v|verbose", ref verbose, "Dump raw bytes, disassembly, unwindInfo and gcInfo"); + syntax.DefineOption("v|verbose", ref verbose, "Dump raw bytes, disassembly, unwindInfo, gcInfo and section contents"); syntax.DefineOption("diff", ref _diff, "Compare two R2R images (not yet implemented)"); }); @@ -64,6 +64,7 @@ namespace R2RDump _disasm = true; _unwind = true; _gc = true; + _types = true; } return argSyntax; @@ -147,6 +148,11 @@ namespace R2RDump { DumpBytes(r2r, section.RelativeVirtualAddress, (uint)section.Size); } + if (_types) + { + _writer.WriteLine(); + DumpAvailableTypes(r2r); + } } /// @@ -236,7 +242,6 @@ namespace R2RDump private void DumpAvailableTypes(R2RReader r2r) { - WriteDivider("Available Types"); foreach (string name in r2r.AvailableTypes) { _writer.WriteLine(name); @@ -353,6 +358,10 @@ namespace R2RDump { DumpHeader(r2r, false); } + if (_types) + { + DumpSection(r2r, r2r.R2RHeader.Sections[R2RSection.SectionType.READYTORUN_SECTION_AVAILABLE_TYPES]); + } QuerySection(r2r, _sections); QueryRuntimeFunction(r2r, _runtimeFunctions); @@ -360,11 +369,6 @@ namespace R2RDump QueryMethod(r2r, "R2R Methods by Keyword", _keywords, false); } - if (_types) - { - DumpAvailableTypes(r2r); - } - _writer.WriteLine("============================================================="); _writer.WriteLine(); } diff --git a/src/coreclr/src/tools/r2rdump/UnwindInfo.cs b/src/coreclr/src/tools/r2rdump/UnwindInfo.cs index da12f4f..c7f60a5 100644 --- a/src/coreclr/src/tools/r2rdump/UnwindInfo.cs +++ b/src/coreclr/src/tools/r2rdump/UnwindInfo.cs @@ -35,18 +35,16 @@ namespace R2RDump { StringBuilder sb = new StringBuilder(); - sb.AppendLine($"\t\t{{"); - sb.AppendLine($"\t\t\tCodeOffset: {CodeOffset}"); - sb.AppendLine($"\t\t\tUnwindOp: {UnwindOp}"); - sb.AppendLine($"\t\t\tOpInfo: {OpInfo}"); - sb.AppendLine($"\t\t}}"); - sb.AppendLine($"\t\t{{"); - sb.AppendLine($"\t\t\tOffsetLow: {OffsetLow}"); - sb.AppendLine($"\t\t\tUnwindOp: {UnwindOp}"); - sb.AppendLine($"\t\t\tOffsetHigh: {OffsetHigh}"); - sb.AppendLine($"\t\t}}"); + sb.AppendLine($"\t\tCodeOffset: {CodeOffset}"); + sb.AppendLine($"\t\tUnwindOp: {UnwindOp}"); + sb.AppendLine($"\t\tOpInfo: {OpInfo}"); + sb.AppendLine(); + sb.AppendLine($"\t\tOffsetLow: {OffsetLow}"); + sb.AppendLine($"\t\tUnwindOp: {UnwindOp}"); + sb.AppendLine($"\t\tOffsetHigh: {OffsetHigh}"); + sb.AppendLine(); sb.AppendLine($"\t\tFrameOffset: {FrameOffset}"); - sb.AppendLine($"\t\t------------------"); + sb.AppendLine($"\t\t--------------------"); return sb.ToString(); }