@@ -173,9 +173,9 @@ HRESULT EditAndContinueModule::ApplyEditAndContinue(
173
173
// Ensure the metadata is RW.
174
174
EX_TRY
175
175
{
176
- // ConvertMetadataToRWForEnC should only ever be called on EnC capable files.
176
+ // ConvertMDInternalToReadWrite should only ever be called on EnC capable files.
177
177
_ASSERTE (IsEditAndContinueCapable ()); // this also checks that the file is EnC capable
178
- GetFile ()->ConvertMetadataToRWForEnC ();
178
+ GetFile ()->ConvertMDInternalToReadWrite ();
179
179
}
180
180
EX_CATCH_HRESULT (hr);
181
181
@@ -310,10 +310,13 @@ HRESULT EditAndContinueModule::UpdateMethod(MethodDesc *pMethod)
310
310
CONTRACTL_END;
311
311
312
312
// Notify the debugger of the update
313
- HRESULT hr = g_pDebugInterface->UpdateFunction (pMethod, m_applyChangesCount);
314
- if (FAILED (hr))
313
+ if (CORDebuggerAttached ())
315
314
{
316
- return hr;
315
+ HRESULT hr = g_pDebugInterface->UpdateFunction (pMethod, m_applyChangesCount);
316
+ if (FAILED (hr))
317
+ {
318
+ return hr;
319
+ }
317
320
}
318
321
319
322
// Notify the JIT that we've got new IL for this method
@@ -375,7 +378,10 @@ HRESULT EditAndContinueModule::AddMethod(mdMethodDef token)
375
378
// Class isn't loaded yet, don't have to modify any existing EE data structures beyond the metadata.
376
379
// Just notify debugger and return.
377
380
LOG ((LF_ENC, LL_INFO100, " EnCModule::AM class %p not loaded, our work is done\n " , parentTypeDef));
378
- hr = g_pDebugInterface->UpdateNotYetLoadedFunction (token, this , m_applyChangesCount);
381
+ if (CORDebuggerAttached ())
382
+ {
383
+ hr = g_pDebugInterface->UpdateNotYetLoadedFunction (token, this , m_applyChangesCount);
384
+ }
379
385
return hr;
380
386
}
381
387
@@ -391,12 +397,15 @@ HRESULT EditAndContinueModule::AddMethod(mdMethodDef token)
391
397
return hr;
392
398
}
393
399
394
- // Tell the debugger about the new method so it get's the version number properly
395
- hr = g_pDebugInterface->AddFunction (pMethod, m_applyChangesCount);
396
- if (FAILED (hr))
400
+ // Tell the debugger about the new method so it gets the version number properly
401
+ if (CORDebuggerAttached ())
397
402
{
398
- _ASSERTE (!" Failed to add function" );
399
- LOG ((LF_ENC, LL_INFO100000, " **Error** EACM::AF: Failed to add method %p to debugger with hr 0x%x\n " , token));
403
+ hr = g_pDebugInterface->AddFunction (pMethod, m_applyChangesCount);
404
+ if (FAILED (hr))
405
+ {
406
+ _ASSERTE (!" Failed to add function" );
407
+ LOG ((LF_ENC, LL_INFO100000, " **Error** EACM::AF: Failed to add method %p to debugger with hr 0x%x\n " , token));
408
+ }
400
409
}
401
410
402
411
return hr;
@@ -463,10 +472,13 @@ HRESULT EditAndContinueModule::AddField(mdFieldDef token)
463
472
}
464
473
465
474
// Tell the debugger about the new field
466
- hr = g_pDebugInterface->AddField (pField, m_applyChangesCount);
467
- if (FAILED (hr))
475
+ if (CORDebuggerAttached ())
468
476
{
469
- LOG ((LF_ENC, LL_INFO100000, " **Error** EACM::AF: Failed to add field %p to debugger with hr 0x%x\n " , token));
477
+ hr = g_pDebugInterface->AddField (pField, m_applyChangesCount);
478
+ if (FAILED (hr))
479
+ {
480
+ LOG ((LF_ENC, LL_INFO100000, " **Error** EACM::AF: Failed to add field %p to debugger with hr 0x%x\n " , token));
481
+ }
470
482
}
471
483
472
484
#ifdef _DEBUG
0 commit comments