I've run into problems with Rotor's profiling interface while trying some simple things, initially just replacing body of a tiny method with an exact copy. I base my code on the sample profiler. I try the same thing with the CLR and things work fine there. Here are the problems:
- Some event mask combinations cause problem in Rotor (with just the straight sample profiler, none of my changes yet) + DN_PROFILER_MASK=0x20 causes a System.StackOverflowException somewhere in closing down the EE + DN_PROFILER_MASK=0x4f/0x8f cause an assertion failure at line 401 in binder.cpp while the EE is trying to run some class finalisation + 0x40 and 0x80 work ok, I haven't tried others - With my changes to replace the body of a tiny method with an exact copy as so: In JITComplicationStarted, if it's ok to block the EE, GetILFunctionBody If it's tiny GetILFunctionBodyAllocator Allocate buffer with given size Copy body to new buffer SetILFunctionBody Done. + This change works fine for the CLR + In Rotor, the new body is never picked up while the new RVA is properly set for both the metadata and the in memory MethodDesc*. Tracing it in the debugger, I found that the new RVA, being after the module, is out of range when checked against the values in the file headers. This result in Module::GetILCode(rva) returning the base of the file. Part of stack trace: sscoree.dll!Cor_RtlImageRvaToSection32(...) Line 78 sscoree.dll!Cor_RtlImageRvaToSection(...) Line 110 sscoree.dll!Cor_RtlImageRvaToOffset(...) Line 203 sscoree.dll!PEFile::RVAToPointer(...) Line 110 sscoree.dll!Module::ResolveILRVA(...) Line 540 sscoree.dll!Module::GetILCode(...) Line 1760 The module (after replacing a method's body) is not 'InMemory', I haven't come across the path where the module is an InMemoryModule yet. Can anyone tell what I'm doing wrong and/or what else is wrong? Thanks, Nam