When running in the DAC, ReJitManager::IsReJITEnabled checks the configuration environment variable in the environment of the debugger process, not in the target process:
|
inline BOOL ReJitManager::IsReJITEnabled() |
|
{ |
|
LIMITED_METHOD_CONTRACT; |
|
|
|
static bool profilerStartupRejit = CORProfilerEnableRejit() != FALSE; |
|
static ConfigDWORD rejitOnAttachEnabled; |
|
|
|
return profilerStartupRejit || (rejitOnAttachEnabled.val(CLRConfig::EXTERNAL_ProfAPI_RejitOnAttach) != 0); |
|
} |
The CLRConfig::GetConfigString (called by ConfigDWORD::val) checks the environment of the current process (the one in which the DAC is loaded), not the target runtime.
Whenever this is fixed please remember to fix the cDAC implementation as well as the DAC.