diff options
author | Amy Yu <amycmyu@gmail.com> | 2018-08-08 16:52:53 -0700 |
---|---|---|
committer | Amy <amycmyu@gmail.com> | 2018-08-15 15:24:43 -0700 |
commit | 26286b460e53d03ec8b74b85f09c0754bb10605f (patch) | |
tree | 95aa16a249dbfe6834f6bac0245f182ab8aa9c1d /src/tools/r2rdump/R2RDump.cs | |
parent | 024f809869d156f73ea6d7527d9664ce90b5505e (diff) | |
download | coreclr-26286b460e53d03ec8b74b85f09c0754bb10605f.tar.gz coreclr-26286b460e53d03ec8b74b85f09c0754bb10605f.tar.bz2 coreclr-26286b460e53d03ec8b74b85f09c0754bb10605f.zip |
R2RDump - GcInfo for x86
x86 GcInfo headers
x86 GcSlotTable
x86 GcTransitions
Update expected xml for R2RDumpTests
Add license headers
Allow multiple GcTransitions with same codeOffset
Add index property in GcSlot, make GcSlot a class instead of struct, add missing spaces, update tests
Remove placeholder functions for parsing partially interruptible pointer tables
Implement partially interruptible GcInfo
Example GcInfo output:
CodeLength: 22 bytes
InfoHdr:
PrologSize: 7
EpilogSize: 4
EpilogCount: 1
EpilogAtEnd: yes
Callee-saved regs = EBP
EbpFrame: yes
Fully Interruptible: yes
DoubleAlign: no
Arguments Size: 0 DWORDs
Stack Frame Size: 1 DWORDs
UntrackedCnt: 1
VarPtrTableSize: 0
GenericsContext: 0
GenericsContextIsMethodDesc: 0
ReturnKind: RT_Scalar
RevPInvokeOffset: 0
Epilogs: 18
GcSlots:
-------------------------
[EBP-4]
Flags: GC_SLOT_UNTRACKED
LowBits:
-------------------------
28fc: 55 push ebp
28fd: 8b ec mov ebp, esp
28ff: 50 push eax
2900: 89 4d fc mov dword ptr [ebp - 4], ecx
2903: 8b 4d fc mov ecx, dword ptr [ebp - 4]
2906: ff 15 10 10 01 10 call dword ptr [268505104]
reg ECX becoming live
290c: 90 nop
reg ECX becoming dead
290d: 90 nop
290e: 8b e5 mov esp, ebp
2910: 5d pop ebp
2911: c3 ret
Diffstat (limited to 'src/tools/r2rdump/R2RDump.cs')
-rw-r--r-- | src/tools/r2rdump/R2RDump.cs | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/tools/r2rdump/R2RDump.cs b/src/tools/r2rdump/R2RDump.cs index 9341c44164..8034956078 100644 --- a/src/tools/r2rdump/R2RDump.cs +++ b/src/tools/r2rdump/R2RDump.cs @@ -15,6 +15,8 @@ namespace R2RDump public abstract class Dumper { internal R2RReader _r2r; + internal TextWriter _writer; + internal bool _raw; internal bool _header; internal bool _disasm; @@ -22,9 +24,15 @@ namespace R2RDump internal bool _unwind; internal bool _gc; internal bool _sectionContents; - internal TextWriter _writer; + /// <summary> + /// Run right before printing output + /// </summary> abstract internal void Begin(); + + /// <summary> + /// Run right after printing output + /// </summary> abstract internal void End(); abstract internal void WriteDivider(string title); abstract internal void WriteSubDivider(); @@ -42,6 +50,7 @@ namespace R2RDump class R2RDump { + // Options set by user specifying what to dump private bool _help; private IReadOnlyList<string> _inputFilenames = Array.Empty<string>(); private string _outputFilename = null; @@ -66,6 +75,9 @@ namespace R2RDump { } + /// <summary> + /// Parse commandline options + /// </summary> private ArgumentSyntax ParseCommandLine(string[] args) { bool verbose = false; @@ -132,13 +144,17 @@ namespace R2RDump return int.TryParse(arg, out n); } + /// <summary> + /// Outputs a warning message + /// </summary> + /// <param name="warning">The warning message to output</param> public static void WriteWarning(string warning) { Console.WriteLine($"Warning: {warning}"); } // <summary> - /// For each query in the list of queries, search for all methods matching the query by name, signature or id + /// For each query in the list of queries, dump all methods matching the query by name, signature or id /// </summary> /// <param name="r2r">Contains all the extracted info about the ReadyToRun image</param> /// <param name="title">The title to print, "R2R Methods by Query" or "R2R Methods by Keyword"</param> @@ -162,7 +178,7 @@ namespace R2RDump } // <summary> - /// For each query in the list of queries, search for all sections by the name or value of the ReadyToRunSectionType enum + /// For each query in the list of queries, dump all sections by the name or value of the ReadyToRunSectionType enum /// </summary> /// <param name="r2r">Contains all the extracted info about the ReadyToRun image</param> /// <param name="queries">The names/values to search for</param> @@ -184,7 +200,7 @@ namespace R2RDump } // <summary> - /// For each query in the list of queries, search for a runtime function by id. + /// For each query in the list of queries, dump a runtime function by id. /// The method containing the runtime function gets outputted, along with the single runtime function that was searched /// </summary> /// <param name="r2r">Contains all the extracted info about the ReadyToRun image</param> @@ -218,7 +234,7 @@ namespace R2RDump _dumper.Begin(); - if (_queries.Count == 0 && _keywords.Count == 0 && _runtimeFunctions.Count == 0 && _sections.Count == 0) //dump all sections and methods + if (_queries.Count == 0 && _keywords.Count == 0 && _runtimeFunctions.Count == 0 && _sections.Count == 0) //dump all sections and methods if no queries specified { _dumper.WriteDivider("R2R Header"); _dumper.DumpHeader(true); @@ -228,7 +244,7 @@ namespace R2RDump _dumper.DumpAllMethods(); } } - else //dump queried sections/methods/runtimeFunctions + else //dump queried sections, methods and runtimeFunctions { if (_header) { @@ -245,7 +261,7 @@ namespace R2RDump } /// <summary> - /// Returns true if the name/signature/id of <param>method</param> matches <param>query</param> + /// Returns true if the name, signature or id of <param>method</param> matches <param>query</param> /// </summary> /// <param name="exact">Specifies exact or partial match</param> /// <remarks>Case-insensitive and ignores whitespace</remarks> |