From c0e9c2df3e836dd0ba288f55da6d365158727971 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Tue, 4 Sep 2018 11:43:50 -0700 Subject: [PATCH] JIT: add option to dump jit-generated debug info (dotnet/coreclr#19808) 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. Commit migrated from https://github.com/dotnet/coreclr/commit/958040ed3f8c7efb3f78f301d3cb76271e941c2e --- src/coreclr/src/jit/compiler.cpp | 12 ++++++++++++ src/coreclr/src/jit/compiler.h | 1 + src/coreclr/src/jit/ee_il_dll.cpp | 4 ++-- src/coreclr/src/jit/jitconfigvalues.h | 2 ++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index b89bda3..2dd6881 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -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; + } } } diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h index d46e571..f2ca61c 100644 --- a/src/coreclr/src/jit/compiler.h +++ b/src/coreclr/src/jit/compiler.h @@ -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 diff --git a/src/coreclr/src/jit/ee_il_dll.cpp b/src/coreclr/src/jit/ee_il_dll.cpp index 85f9606..c7f0658 100644 --- a/src/coreclr/src/jit/ee_il_dll.cpp +++ b/src/coreclr/src/jit/ee_il_dll.cpp @@ -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(); } diff --git a/src/coreclr/src/jit/jitconfigvalues.h b/src/coreclr/src/jit/jitconfigvalues.h index 49b8c7a..8b931e7 100644 --- a/src/coreclr/src/jit/jitconfigvalues.h +++ b/src/coreclr/src/jit/jitconfigvalues.h @@ -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 -- 2.7.4