Debugger StepInto auto-generated code and JMC issue
<p>I'm making a managed .NET debugger using MDBG sample.</p>

<p>Currently I'm struggling with StepInto behavior, while StepOut and StepOver seems to work. </p>

<p>To achieve <code>Just-My-Code</code> stepping I'm calling <code>SetJMCStatus</code> on modules load. That works fine and allow me to debug just my code.</p>

<p>But since I'm setting entire module as JMC, some auto-generated code comes into play and ruin stepping-into. An example of such code could be auto-property.</p>

<p>Since debugger is executing Il instructions, with step-into I'm getting inside auto-generated <code>get_propertyName</code> and <code>set_propertyName</code> method, which are marked as my code, because they are part of my module.</p>

<p>To distinguish such auto-generated code from my code I can use presence of debugging symbols, that are missing in case of auto-generated code. And then I could simply mark method as not my code to skip it during stepping.</p>

<p><strong>The problem is I don't know which methods are auto-generated before I'm getting inside during stepping.</strong> When I stepped inside a method that has no debugging symbols I can mark it as not my code, but it's too late - debugger stopped where it supposed not to stop.</p>

<p>Theoretically I could iterate over my module methods using IMetadataImport and set their JMCStatus when debugger starts, but it seems quite expensive:</p>

<pre><code> foreach (var methodToken in mdbgModule.Importer.EnumerateAllMethodTokens()) {
                var func = mdbgModule.GetFunction(methodToken);
                    if (func.SymMethod == null)
                        func.CorFunction.JMCStatus = false;
            }
</code></pre>

<p>If only I would know what function is going to be executed next, then I would be able to set it's status and prevent stepping inside auto-generated code for the first time.</p>

<p>I'm sticking with MDBG approach for stepping, not changing anything, just calling SetJMCStatus where it's needed, so I'm not sure if it makes sense to provide any code... If so, I'll edit the question, just add a comment!</p>

<p>Any suggestion on topic is greatly appreciated!</p>

<p>Regards,</p>