I've got the following simple code:
class Program
{
static void Main(string[] args)
{
var t = Type.GetType("System.Reflection.Assembly");
Console.WriteLine(t.FullName);
}
}
I'm attempting to debug into the Type.GetType()
method, but the debugger skips over the method even when using "Step Into". I've got debugging enabled for the .NET Framework classes, and debugging into other framework methods works fine. Why doesn't the debugger allow me to step into this particular method?
Because Type.GetType() is inlined to this:
[MethodImpl(MethodImplOptions.InternalCall), SecuritySafeCritical]
public extern Type GetType();
In other words, the method is implemented in C++ inside the CLR. The InternalCall attribute value is the key. Source code for the CLR is not available from the Reference Source. You could use the SSCLI20 source code for reference, it is a pretty good match for CLR source but you can't trust it to be completely accurate, it is no longer maintained. The clr/src/vm/ecall.cpp source code file contains the mappings from InternalCall names to C++ function names.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With