I want to debug the implementation of the [MethodImpl(MethodImplOptions.InternalCall)]BCL method , which is supposedly implemented in C ++. (In this particular case, I look at System.String.nativeCompareOrdinal.) This is mainly because I'm new and want to know how it is implemented.
However, the Visual Studio debugger refuses to enter this method. I can set a breakpoint on this call:
"Hello".Equals("hello", StringComparison.OrdinalIgnoreCase);
then go to Debug> Windows> Disassembly, go to the Equals call and bring up the callx86 instruction . But when I try to use "Step Into" on this call(which, as I know from Reflector, is a call to nativeCompareOrdinal), it does not go to the first instruction inside nativeCompareOrdinal as I want - instead, it goes and goes directly to the next x86 instruction in equals.
I am creating x86, as mixed mode debugging is not supported for x64 applications. I unchecked "Only my code" in "Tools"> "Options"> "Debug", and I have the option "Enable unmanaged code debugging", noted in the project properties> Debug tab, but it still works on call. I also tried to start the process and then connect the debugger and explicitly bind both managed and my own debuggers, but it still won’t go into this InternalCall method.
How can I get the Visual Studio debugger to switch to an unmanaged method?
source
share