JIT: add option to dump jit-generated debug info (#19808)
authorAndy Ayers <andya@microsoft.com>
Tue, 4 Sep 2018 18:43:50 +0000 (11:43 -0700)
committerGitHub <noreply@github.com>
Tue, 4 Sep 2018 18:43:50 +0000 (11:43 -0700)
Add dump option for debug info (like the ones we have for gc info,
eh, unwind, etc) so we can more readily verify jit changes that are
might impact debug info generation.

src/jit/compiler.cpp
src/jit/compiler.h
src/jit/ee_il_dll.cpp
src/jit/jitconfigvalues.h

index b89bda30337142bb509ee5fcf63a9b4c7a0e34a9..2dd6881b220b5d8bfd32071434f163d92cac424f 100644 (file)
@@ -3264,6 +3264,7 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
     opts.disDiffable     = false;
     opts.dspCode         = false;
     opts.dspEHTable      = false;
+    opts.dspDebugInfo    = false;
     opts.dspGCtbls       = false;
     opts.disAsm2         = false;
     opts.dspUnwind       = false;
@@ -3312,6 +3313,11 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
             {
                 opts.dspEHTable = true;
             }
+
+            if (JitConfig.NgenDebugDump().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args))
+            {
+                opts.dspDebugInfo = true;
+            }
         }
         else
         {
@@ -3373,6 +3379,12 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
                 {
                     opts.dspEHTable = true;
                 }
+
+                if (JitConfig.JitDebugDump().contains(info.compMethodName, info.compClassName,
+                                                      &info.compMethodInfo->args))
+                {
+                    opts.dspDebugInfo = true;
+                }
             }
         }
 
index d46e571edbd9d0139c2843c0ef3982807a3a06ac..f2ca61cd0aa169eefa4c29dbbc208c2344f2cec3 100644 (file)
@@ -8165,6 +8165,7 @@ public:
         bool compProcedureSplittingEH; // Separate cold code from hot code for functions with EH
         bool dspCode;                  // Display native code generated
         bool dspEHTable;               // Display the EH table reported to the VM
+        bool dspDebugInfo;             // Display the Debug info reported to the VM
         bool dspInstrs;                // Display the IL instructions intermixed with the native code output
         bool dspEmit;                  // Display emitter output
         bool dspLines;                 // Display source-code lines intermixed with native code output
index 85f9606d5e67b020b049aafe2ae5798d5792fcd0..c7f06589de4a1ac4ad2d7b05fd118d7148ec4b90 100644 (file)
@@ -657,7 +657,7 @@ void Compiler::eeSetLVdone()
     assert(opts.compScopeInfo);
 
 #ifdef DEBUG
-    if (verbose)
+    if (verbose || opts.dspDebugInfo)
     {
         eeDispVars(info.compMethodHnd, eeVarsCount, (ICorDebugInfo::NativeVarInfo*)eeVars);
     }
@@ -943,7 +943,7 @@ void Compiler::eeSetLIdone()
     assert(opts.compDbgInfo);
 
 #if defined(DEBUG)
-    if (verbose)
+    if (verbose || opts.dspDebugInfo)
     {
         eeDispLineInfos();
     }
index 49b8c7a8ea35580279b246a7ba00a763cd467b1a..8b931e754ee0a5967b3280aaf533c0866d22ac14 100644 (file)
@@ -151,6 +151,7 @@ CONFIG_METHODSET(JitEHDump, W("JitEHDump"))                  // Dump the EH tabl
 CONFIG_METHODSET(JitExclude, W("JitExclude"))
 CONFIG_METHODSET(JitForceProcedureSplitting, W("JitForceProcedureSplitting"))
 CONFIG_METHODSET(JitGCDump, W("JitGCDump"))
+CONFIG_METHODSET(JitDebugDump, W("JitDebugDump"))
 CONFIG_METHODSET(JitHalt, W("JitHalt")) // Emits break instruction into jitted code
 CONFIG_METHODSET(JitImportBreak, W("JitImportBreak"))
 CONFIG_METHODSET(JitInclude, W("JitInclude"))
@@ -171,6 +172,7 @@ CONFIG_METHODSET(NgenDump, W("NgenDump"))     // Same as JitDump, but for ngen
 CONFIG_METHODSET(NgenDumpIR, W("NgenDumpIR")) // Same as JitDumpIR, but for ngen
 CONFIG_METHODSET(NgenEHDump, W("NgenEHDump")) // Dump the EH table for the method, as reported to the VM
 CONFIG_METHODSET(NgenGCDump, W("NgenGCDump"))
+CONFIG_METHODSET(NgenDebugDump, W("NgenDebugDump"))
 CONFIG_METHODSET(NgenUnwindDump, W("NgenUnwindDump")) // Dump the unwind codes for the method
 ///
 /// JIT