diff --git a/src/coreclr/debug/daccess/daccess.cpp b/src/coreclr/debug/daccess/daccess.cpp index 466041074a1eda..fe3794225b4f7c 100644 --- a/src/coreclr/debug/daccess/daccess.cpp +++ b/src/coreclr/debug/daccess/daccess.cpp @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: daccess.cpp -// - // // ClrDataAccess implementation. -// //***************************************************************************** #include "stdafx.h" diff --git a/src/coreclr/debug/daccess/dacdbiimpl.cpp b/src/coreclr/debug/daccess/dacdbiimpl.cpp index 4788dd322d2e1e..0d40f4c1a62b43 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.cpp +++ b/src/coreclr/debug/daccess/dacdbiimpl.cpp @@ -1,15 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: DacDbiImpl.cpp -// - // // Implement DAC/DBI interface -// //***************************************************************************** - #include "stdafx.h" #include "dacdbiinterface.h" @@ -658,21 +655,21 @@ void DacDbiInterfaceImpl::GetAppDomainFullName( // Get the values of the JIT Optimization and EnC flags. void DacDbiInterfaceImpl::GetCompilerFlags ( - VMPTR_DomainAssembly vmDomainAssembly, + VMPTR_Assembly vmAssembly, BOOL *pfAllowJITOpts, BOOL *pfEnableEnC) { DD_ENTER_MAY_THROW; - DomainAssembly * pDomainAssembly = vmDomainAssembly.GetDacPtr(); + Assembly * pAssembly = vmAssembly.GetDacPtr(); - if (pDomainAssembly == NULL) + if (pAssembly == NULL) { ThrowHR(E_FAIL); } // Get the underlying module - none of this is AppDomain specific - Module * pModule = pDomainAssembly->GetAssembly()->GetModule(); + Module * pModule = pAssembly->GetModule(); DWORD dwBits = pModule->GetDebuggerInfoBits(); *pfAllowJITOpts = !CORDisableJITOptimizations(dwBits); *pfEnableEnC = pModule->IsEditAndContinueEnabled(); @@ -713,15 +710,15 @@ bool DacDbiInterfaceImpl::CanSetEnCBits(Module * pModule) } // DacDbiInterfaceImpl::SetEnCBits // Set the values of the JIT optimization and EnC flags. -HRESULT DacDbiInterfaceImpl::SetCompilerFlags(VMPTR_DomainAssembly vmDomainAssembly, +HRESULT DacDbiInterfaceImpl::SetCompilerFlags(VMPTR_Assembly vmAssembly, BOOL fAllowJitOpts, BOOL fEnableEnC) { DD_ENTER_MAY_THROW; DWORD dwBits = 0; - DomainAssembly * pDomainAssembly = vmDomainAssembly.GetDacPtr(); - Module * pModule = pDomainAssembly->GetAssembly()->GetModule(); + Assembly * pAssembly = vmAssembly.GetDacPtr(); + Module * pModule = pAssembly->GetModule(); HRESULT hr = S_OK; @@ -821,7 +818,7 @@ SIZE_T DacDbiInterfaceImpl::GetArgCount(MethodDesc * pMD) return 0; } - MetaSig msig(pCallSig, cbCallSigSize, pMD->GetAssembly()->GetModule(), NULL, MetaSig::sigMember); + MetaSig msig(pCallSig, cbCallSigSize, pMD->GetModule(), NULL, MetaSig::sigMember); // Get the arg count. UINT32 NumArguments = msig.NumFixedArgs(); @@ -1019,7 +1016,7 @@ void DacDbiInterfaceImpl::GetSequencePoints(MethodDesc * pMethodDesc, #endif // if there is a profiler load-time mapping and not a rejit mapping, apply that instead InstrumentedILOffsetMapping loadTimeMapping = - pMethodDesc->GetAssembly()->GetModule()->GetInstrumentedILOffsetMapping(pMethodDesc->GetMemberDef()); + pMethodDesc->GetModule()->GetInstrumentedILOffsetMapping(pMethodDesc->GetMemberDef()); ComposeMapping(&loadTimeMapping, mapCopy, &entryCount); #ifdef FEATURE_REJIT } @@ -1083,15 +1080,15 @@ ULONG DacDbiInterfaceImpl::TranslateInstrumentedILOffsetToOriginal(ULONG // a module and a token. The info will come from a MethodDesc, if // one exists or from metadata. // -void DacDbiInterfaceImpl::GetILCodeAndSig(VMPTR_DomainAssembly vmDomainAssembly, +void DacDbiInterfaceImpl::GetILCodeAndSig(VMPTR_Assembly vmAssembly, mdToken functionToken, TargetBuffer * pCodeInfo, mdToken * pLocalSigToken) { DD_ENTER_MAY_THROW; - DomainAssembly * pDomainAssembly = vmDomainAssembly.GetDacPtr(); - Module * pModule = pDomainAssembly->GetAssembly()->GetModule(); + Assembly * pAssembly = vmAssembly.GetDacPtr(); + Module * pModule = pAssembly->GetModule(); RVA methodRVA = 0; DWORD implFlags; @@ -1318,7 +1315,7 @@ void DacDbiInterfaceImpl::GetMethodRegionInfo(MethodDesc * pMethodDe // isn't currently available. In this case, all values in pCodeInfo will be // cleared. -void DacDbiInterfaceImpl::GetNativeCodeInfo(VMPTR_DomainAssembly vmDomainAssembly, +void DacDbiInterfaceImpl::GetNativeCodeInfo(VMPTR_Assembly vmAssembly, mdToken functionToken, NativeCodeFunctionData * pCodeInfo) { @@ -1329,8 +1326,8 @@ void DacDbiInterfaceImpl::GetNativeCodeInfo(VMPTR_DomainAssembly vmDomai // pre-initialize: pCodeInfo->Clear(); - DomainAssembly * pDomainAssembly = vmDomainAssembly.GetDacPtr(); - Module * pModule = pDomainAssembly->GetAssembly()->GetModule(); + Assembly * pAssembly = vmAssembly.GetDacPtr(); + Module * pModule = pAssembly->GetModule(); MethodDesc* pMethodDesc = FindLoadedMethodRefOrDef(pModule, functionToken); pCodeInfo->vmNativeCodeMethodDescToken.SetHostPtr(pMethodDesc); @@ -1739,7 +1736,7 @@ void DacDbiInterfaceImpl::GetClassInfo(VMPTR_AppDomain vmAppDomain, } // DacDbiInterfaceImpl::GetClassInfo // DacDbi API: Get field information and object size for an instantiated generic type -void DacDbiInterfaceImpl::GetInstantiationFieldInfo (VMPTR_DomainAssembly vmDomainAssembly, +void DacDbiInterfaceImpl::GetInstantiationFieldInfo (VMPTR_Assembly vmAssembly, VMPTR_TypeHandle vmThExact, VMPTR_TypeHandle vmThApprox, DacDbiArrayList * pFieldList, @@ -2479,11 +2476,11 @@ void DacDbiInterfaceImpl::GetClassTypeInfo(TypeHandle typeH pTypeInfo->ClassTypeData.vmModule.SetDacTargetPtr(PTR_HOST_TO_TADDR(pModule)); if (pAppDomain) { - pTypeInfo->ClassTypeData.vmDomainAssembly.SetDacTargetPtr(PTR_HOST_TO_TADDR(pModule->GetDomainAssembly())); + pTypeInfo->ClassTypeData.vmAssembly.SetDacTargetPtr(PTR_HOST_TO_TADDR(pModule->GetAssembly())); } else { - pTypeInfo->ClassTypeData.vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + pTypeInfo->ClassTypeData.vmAssembly = VMPTR_Assembly::NullPtr(); } } // DacDbiInterfaceImpl::GetClassTypeInfo @@ -2543,7 +2540,7 @@ void DacDbiInterfaceImpl::TypeHandleToBasicTypeInfo(TypeHandle case ELEMENT_TYPE_BYREF: pTypeInfo->vmTypeHandle.SetDacTargetPtr(typeHandle.AsTAddr()); pTypeInfo->metadataToken = mdTokenNil; - pTypeInfo->vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + pTypeInfo->vmAssembly = VMPTR_Assembly::NullPtr(); break; case ELEMENT_TYPE_CLASS: @@ -2566,11 +2563,11 @@ void DacDbiInterfaceImpl::TypeHandleToBasicTypeInfo(TypeHandle pTypeInfo->vmModule.SetDacTargetPtr(PTR_HOST_TO_TADDR(pModule)); if (pAppDomain) { - pTypeInfo->vmDomainAssembly.SetDacTargetPtr(PTR_HOST_TO_TADDR(pModule->GetDomainAssembly())); + pTypeInfo->vmAssembly.SetDacTargetPtr(PTR_HOST_TO_TADDR(pModule->GetAssembly())); } else { - pTypeInfo->vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + pTypeInfo->vmAssembly = VMPTR_Assembly::NullPtr(); } break; } @@ -2578,7 +2575,7 @@ void DacDbiInterfaceImpl::TypeHandleToBasicTypeInfo(TypeHandle default: pTypeInfo->vmTypeHandle = VMPTR_TypeHandle::NullPtr(); pTypeInfo->metadataToken = mdTokenNil; - pTypeInfo->vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + pTypeInfo->vmAssembly = VMPTR_Assembly::NullPtr(); break; } return; @@ -2865,8 +2862,8 @@ TypeHandle DacDbiInterfaceImpl::GetClassOrValueTypeHandle(DebuggerIPCE_BasicType // otherwise, have the loader look it up using the metadata token and domain file else { - DomainAssembly * pDomainAssembly = pData->vmDomainAssembly.GetDacPtr(); - Module * pModule = pDomainAssembly->GetAssembly()->GetModule(); + Assembly * pAssembly = pData->vmAssembly.GetDacPtr(); + Module * pModule = pAssembly->GetModule(); typeHandle = ClassLoader::LookupTypeDefOrRefInModule(pModule, pData->metadataToken); if (typeHandle.IsNull()) @@ -3266,7 +3263,7 @@ void DacDbiInterfaceImpl::GetSimpleType(VMPTR_AppDomain vmAppDomain, CorElementType simpleType, mdTypeDef *pMetadataToken, VMPTR_Module *pVmModule, - VMPTR_DomainAssembly *pVmDomainAssembly) + VMPTR_Assembly *pVmAssembly) { DD_ENTER_MAY_THROW; @@ -3274,8 +3271,8 @@ void DacDbiInterfaceImpl::GetSimpleType(VMPTR_AppDomain vmAppDomain, // if we fail to get either a valid type handle or module, we will want to send back // a NULL domain file too, so we'll to preinitialize this here. - _ASSERTE(pVmDomainAssembly != NULL); - *pVmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + _ASSERTE(pVmAssembly != NULL); + *pVmAssembly = VMPTR_Assembly::NullPtr(); // FindLoadedElementType will return NULL if the type hasn't been loaded yet. TypeHandle typeHandle = FindLoadedElementType(simpleType); @@ -3296,8 +3293,8 @@ void DacDbiInterfaceImpl::GetSimpleType(VMPTR_AppDomain vmAppDomain, if (pAppDomain) { - pVmDomainAssembly->SetHostPtr(pModule->GetDomainAssembly()); - if (pVmDomainAssembly->IsNull()) + pVmAssembly->SetHostPtr(pModule->GetAssembly()); + if (pVmAssembly->IsNull()) ThrowHR(CORDBG_E_TARGET_INCONSISTENT); } } @@ -3457,7 +3454,7 @@ HRESULT DacDbiInterfaceImpl::GetDelegateType(VMPTR_Object delegateObject, Delega HRESULT DacDbiInterfaceImpl::GetDelegateFunctionData( DelegateType delegateType, VMPTR_Object delegateObject, - OUT VMPTR_DomainAssembly *ppFunctionDomainAssembly, + OUT VMPTR_Assembly *ppFunctionAssembly, OUT mdMethodDef *pMethodDef) { DD_ENTER_MAY_THROW; @@ -3488,7 +3485,7 @@ HRESULT DacDbiInterfaceImpl::GetDelegateFunctionData( if (hr != S_OK) return hr; - ppFunctionDomainAssembly->SetDacTargetPtr(dac_cast(pMD.GetDacPtr()->GetModule()->GetDomainAssembly())); + ppFunctionAssembly->SetDacTargetPtr(dac_cast(pMD.GetDacPtr()->GetModule()->GetAssembly())); *pMethodDef = pMD.GetDacPtr()->GetMemberDef(); return hr; @@ -3694,11 +3691,11 @@ void DacDbiInterfaceImpl::GetStackFramesFromException(VMPTR_Object vmObject, Dac _ASSERTE(pDomain != NULL); Module* pModule = currentElement.pFunc->GetModule(); - DomainAssembly* pDomainAssembly = pModule->GetDomainAssembly(); - _ASSERTE(pDomainAssembly != NULL); + Assembly* pAssembly = pModule->GetAssembly(); + _ASSERTE(pAssembly != NULL); currentFrame.vmAppDomain.SetHostPtr(pDomain); - currentFrame.vmDomainAssembly.SetHostPtr(pDomainAssembly); + currentFrame.vmAssembly.SetHostPtr(pAssembly); currentFrame.ip = currentElement.ip; currentFrame.methodDef = currentElement.pFunc->GetMemberDef(); currentFrame.isLastForeignExceptionFrame = (currentElement.flags & STEF_LAST_FRAME_FROM_FOREIGN_STACK_TRACE) != 0; @@ -3841,8 +3838,8 @@ FieldDesc * DacDbiInterfaceImpl::GetEnCFieldDesc(const EnCHangingFieldInfo * pEn { FieldDesc * pFD = NULL; - DomainAssembly * pDomainAssembly = pEnCFieldInfo->GetObjectTypeData().vmDomainAssembly.GetDacPtr(); - Module * pModule = pDomainAssembly->GetAssembly()->GetModule(); + Assembly * pAssembly = pEnCFieldInfo->GetObjectTypeData().vmAssembly.GetDacPtr(); + Module * pModule = pAssembly->GetModule(); // get the type handle for the object TypeHandle typeHandle = ClassLoader::LookupTypeDefOrRefInModule(pModule, @@ -3880,8 +3877,8 @@ PTR_CBYTE DacDbiInterfaceImpl::GetPtrToEnCField(FieldDesc * pFD, const EnCHangin #else PTR_EditAndContinueModule pEnCModule; - DomainAssembly * pDomainAssembly = pEnCFieldInfo->GetObjectTypeData().vmDomainAssembly.GetDacPtr(); - Module * pModule = pDomainAssembly->GetAssembly()->GetModule(); + Assembly * pAssembly = pEnCFieldInfo->GetObjectTypeData().vmAssembly.GetDacPtr(); + Module * pModule = pAssembly->GetModule(); // make sure we actually have an EditAndContinueModule _ASSERTE(pModule->IsEditAndContinueCapable()); @@ -3999,20 +3996,18 @@ void DacDbiInterfaceImpl::GetEnCHangingFieldInfo(const EnCHangingFieldInfo * pEn } // DacDbiInterfaceImpl::GetEnCHangingFieldInfo //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void DacDbiInterfaceImpl::GetAssemblyFromDomainAssembly(VMPTR_DomainAssembly vmDomainAssembly, VMPTR_Assembly *vmAssembly) +void DacDbiInterfaceImpl::GetAssemblyFromRootAssembly(VMPTR_Assembly vmRuntimeAssembly, VMPTR_Assembly *vmAssembly) { DD_ENTER_MAY_THROW; _ASSERTE(vmAssembly != NULL); - DomainAssembly * pDomainAssembly = vmDomainAssembly.GetDacPtr(); - vmAssembly->SetHostPtr(pDomainAssembly->GetAssembly()); + Assembly * pAssembly = vmRuntimeAssembly.GetDacPtr(); + vmAssembly->SetHostPtr(pAssembly); } // Determines whether the runtime security system has assigned full-trust to this assembly. -BOOL DacDbiInterfaceImpl::IsAssemblyFullyTrusted(VMPTR_DomainAssembly vmDomainAssembly) +BOOL DacDbiInterfaceImpl::IsAssemblyFullyTrusted(VMPTR_Assembly vmAssembly) { DD_ENTER_MAY_THROW; @@ -4052,8 +4047,8 @@ void DacDbiInterfaceImpl::ResolveTypeReference(const TypeRefData * pTypeRefInfo, TypeRefData * pTargetRefInfo) { DD_ENTER_MAY_THROW; - DomainAssembly * pDomainAssembly = pTypeRefInfo->vmDomainAssembly.GetDacPtr(); - Module * pReferencingModule = pDomainAssembly->GetAssembly()->GetModule(); + Assembly * pAssembly = pTypeRefInfo->vmAssembly.GetDacPtr(); + Module * pReferencingModule = pAssembly->GetModule(); BOOL fSuccess = FALSE; // Resolve the type ref @@ -4079,7 +4074,7 @@ void DacDbiInterfaceImpl::ResolveTypeReference(const TypeRefData * pTypeRefInfo, _ASSERTE(pTargetModule != NULL); _ASSERTE( TypeFromToken(targetTypeDef) == mdtTypeDef ); - pTargetRefInfo->vmDomainAssembly.SetDacTargetPtr(PTR_HOST_TO_TADDR(pTargetModule->GetDomainAssembly())); + pTargetRefInfo->vmAssembly.SetDacTargetPtr(PTR_HOST_TO_TADDR(pTargetModule->GetAssembly())); pTargetRefInfo->typeToken = targetTypeDef; } else @@ -4310,19 +4305,19 @@ void DacDbiInterfaceImpl::GetSymbolsBuffer(VMPTR_Module vmModule, TargetBuffer * -void DacDbiInterfaceImpl::GetModuleForDomainAssembly(VMPTR_DomainAssembly vmDomainAssembly, OUT VMPTR_Module * pModule) +void DacDbiInterfaceImpl::GetModuleForRuntimeAssembly(VMPTR_Assembly vmAssembly, OUT VMPTR_Module * pModule) { DD_ENTER_MAY_THROW; _ASSERTE(pModule != NULL); - DomainAssembly * pDomainAssembly = vmDomainAssembly.GetDacPtr(); - pModule->SetHostPtr(pDomainAssembly->GetAssembly()->GetModule()); + Assembly * pAssembly = vmAssembly.GetDacPtr(); + pModule->SetHostPtr(pAssembly->GetModule()); } -// Implement IDacDbiInterface::GetDomainAssemblyData -void DacDbiInterfaceImpl::GetDomainAssemblyData(VMPTR_DomainAssembly vmDomainAssembly, DomainAssemblyInfo * pData) +// Implement IDacDbiInterface::GetRuntimeAssemblyData +void DacDbiInterfaceImpl::GetRuntimeAssemblyData(VMPTR_Assembly vmAssembly, AssemblyInfo * pData) { DD_ENTER_MAY_THROW; @@ -4330,10 +4325,10 @@ void DacDbiInterfaceImpl::GetDomainAssemblyData(VMPTR_DomainAssembly vmDomainAss ZeroMemory(pData, sizeof(*pData)); - DomainAssembly * pDomainAssembly = vmDomainAssembly.GetDacPtr(); + Assembly * pAssembly = vmAssembly.GetDacPtr(); // @dbgtodo - is this efficient DAC usage (perhaps a dac-cop rule)? Are we round-tripping the pointer? - pData->vmDomainAssembly.SetHostPtr(pDomainAssembly); + pData->vmAssembly.SetHostPtr(pAssembly); pData->vmAppDomain.SetHostPtr(AppDomain::GetCurrentDomain()); } @@ -4425,17 +4420,17 @@ void DacDbiInterfaceImpl::EnumerateAssembliesInAppDomain( while (iterator.Next(pAssembly.This())) { - VMPTR_DomainAssembly vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); - vmDomainAssembly.SetHostPtr(pAssembly->GetDomainAssembly()); + VMPTR_Assembly vmAssembly = VMPTR_Assembly::NullPtr(); + vmAssembly.SetHostPtr(pAssembly); - fpCallback(vmDomainAssembly, pUserData); + fpCallback(vmAssembly, pUserData); } } // Implementation of IDacDbiInterface::EnumerateModulesInAssembly, // Enumerate all the modules (non-resource) in an assembly. void DacDbiInterfaceImpl::EnumerateModulesInAssembly( - VMPTR_DomainAssembly vmAssembly, + VMPTR_Assembly vmAssembly, FP_MODULE_ENUMERATION_CALLBACK fpCallback, void * pUserData) { @@ -4443,43 +4438,42 @@ void DacDbiInterfaceImpl::EnumerateModulesInAssembly( _ASSERTE(fpCallback != NULL); - DomainAssembly * pDomainAssembly = vmAssembly.GetDacPtr(); + Assembly * pAssembly = vmAssembly.GetDacPtr(); // Debugger isn't notified of Resource / Inspection-only modules. - if (pDomainAssembly->GetAssembly()->GetModule()->IsVisibleToDebugger()) + if (pAssembly->GetModule()->IsVisibleToDebugger()) { - // If domain assembly isn't yet loaded, just return - if (!pDomainAssembly->GetAssembly()->IsLoaded()) + // If the assembly isn't yet loaded, just return + if (!pAssembly->IsLoaded()) return; - VMPTR_DomainAssembly vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); - vmDomainAssembly.SetHostPtr(pDomainAssembly); + VMPTR_Assembly vmAssembly = VMPTR_Assembly::NullPtr(); + vmAssembly.SetHostPtr(pAssembly); - fpCallback(vmDomainAssembly, pUserData); + fpCallback(vmAssembly, pUserData); } } // Implementation of IDacDbiInterface::ResolveAssembly // Returns NULL if not found. -VMPTR_DomainAssembly DacDbiInterfaceImpl::ResolveAssembly( - VMPTR_DomainAssembly vmScope, +VMPTR_Assembly DacDbiInterfaceImpl::ResolveAssembly( + VMPTR_Assembly vmScope, mdToken tkAssemblyRef) { DD_ENTER_MAY_THROW; - DomainAssembly * pDomainAssembly = vmScope.GetDacPtr(); - Module * pModule = pDomainAssembly->GetAssembly()->GetModule(); + Assembly * pRuntimeAssembly = vmScope.GetDacPtr(); + Module * pModule = pRuntimeAssembly->GetModule(); - VMPTR_DomainAssembly vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + VMPTR_Assembly vmAssembly = VMPTR_Assembly::NullPtr(); Assembly * pAssembly = pModule->LookupAssemblyRef(tkAssemblyRef); if (pAssembly != NULL) { - DomainAssembly * pDomainAssembly = pAssembly->GetDomainAssembly(); - vmDomainAssembly.SetHostPtr(pDomainAssembly); + vmAssembly.SetHostPtr(pAssembly); } - return vmDomainAssembly; + return vmAssembly; } // When stopped at an event, request a synchronization. @@ -6017,7 +6011,7 @@ void DacDbiInterfaceImpl::GetTypedByRefInfo(CORDB_ADDRESS pTypedByRe "ref=0x%08x, cls=0x%08x, mod=0x%p\n", pObjectData->objRef, pObjectData->typedByrefType.metadataToken, - pObjectData->typedByrefType.vmDomainAssembly.GetDacPtr())); + pObjectData->typedByrefType.vmAssembly.GetDacPtr())); } // DacDbiInterfaceImpl::GetTypedByRefInfo // Get the string data associated withn obj and put it into the pointers @@ -6985,7 +6979,7 @@ bool DacDbiInterfaceImpl::IsValidObject(CORDB_ADDRESS addr) } bool DacDbiInterfaceImpl::GetAppDomainForObject(CORDB_ADDRESS addr, OUT VMPTR_AppDomain * pAppDomain, - OUT VMPTR_Module *pModule, OUT VMPTR_DomainAssembly *pDomainAssembly) + OUT VMPTR_Module *pModule, OUT VMPTR_Assembly *pAssembly) { DD_ENTER_MAY_THROW; @@ -7000,7 +6994,7 @@ bool DacDbiInterfaceImpl::GetAppDomainForObject(CORDB_ADDRESS addr, OUT VMPTR_Ap pAppDomain->SetDacTargetPtr(PTR_HOST_TO_TADDR(AppDomain::GetCurrentDomain())); pModule->SetDacTargetPtr(PTR_HOST_TO_TADDR(module)); - pDomainAssembly->SetDacTargetPtr(PTR_HOST_TO_TADDR(module->GetDomainAssembly())); + pAssembly->SetDacTargetPtr(PTR_HOST_TO_TADDR(module->GetAssembly())); return true; } diff --git a/src/coreclr/debug/daccess/dacdbiimpl.h b/src/coreclr/debug/daccess/dacdbiimpl.h index a4ef89438ad066..18567b3dc0ac84 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.h +++ b/src/coreclr/debug/daccess/dacdbiimpl.h @@ -1,9 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // DacDbiImpl.h -// - // // Implement the interface between the DAC and DBI. //***************************************************************************** @@ -96,7 +95,7 @@ class DacDbiInterfaceImpl : IStringHolder * pStrName); // Get the values of the JIT Optimization and EnC flags. - void GetCompilerFlags (VMPTR_DomainAssembly vmDomainAssembly, + void GetCompilerFlags (VMPTR_Assembly vmAssembly, BOOL * pfAllowJITOpts, BOOL * pfEnableEnC); @@ -104,7 +103,7 @@ class DacDbiInterfaceImpl : bool CanSetEnCBits(Module * pModule); // Set the values of the JIT optimization and EnC flags. - HRESULT SetCompilerFlags(VMPTR_DomainAssembly vmDomainAssembly, + HRESULT SetCompilerFlags(VMPTR_Assembly vmAssembly, BOOL fAllowJitOpts, BOOL fEnableEnC); @@ -133,7 +132,7 @@ class DacDbiInterfaceImpl : bool IsValidObject(CORDB_ADDRESS obj); - bool GetAppDomainForObject(CORDB_ADDRESS obj, OUT VMPTR_AppDomain * pApp, OUT VMPTR_Module *pModule, OUT VMPTR_DomainAssembly *mod); + bool GetAppDomainForObject(CORDB_ADDRESS obj, OUT VMPTR_AppDomain * pApp, OUT VMPTR_Module *pModule, OUT VMPTR_Assembly *mod); @@ -219,7 +218,7 @@ class DacDbiInterfaceImpl : // a module and a token. The info will come from a MethodDesc, if // one exists or from metadata. // - void GetILCodeAndSig(VMPTR_DomainAssembly vmDomainAssembly, + void GetILCodeAndSig(VMPTR_Assembly vmAssembly, mdToken functionToken, TargetBuffer * pCodeInfo, mdToken * pLocalSigToken); @@ -230,7 +229,7 @@ class DacDbiInterfaceImpl : // whether it's an instantiated generic // its EnC version number // hot and cold region information. - void GetNativeCodeInfo(VMPTR_DomainAssembly vmDomainAssembly, + void GetNativeCodeInfo(VMPTR_Assembly vmAssembly, mdToken functionToken, NativeCodeFunctionData * pCodeInfo); @@ -261,7 +260,7 @@ class DacDbiInterfaceImpl : ClassInfo * pData); // get field information and object size for an instantiated generic type - void GetInstantiationFieldInfo (VMPTR_DomainAssembly vmDomainAssembly, + void GetInstantiationFieldInfo (VMPTR_Assembly vmAssembly, VMPTR_TypeHandle vmThExact, VMPTR_TypeHandle vmThApprox, DacDbiArrayList * pFieldList, @@ -337,7 +336,7 @@ class DacDbiInterfaceImpl : CorElementType simpleType, mdTypeDef * pMetadataToken, VMPTR_Module * pVmModule, - VMPTR_DomainAssembly * pVmDomainAssembly); + VMPTR_Assembly * pVmAssembly); BOOL IsExceptionObject(VMPTR_Object vmObject); @@ -353,7 +352,7 @@ class DacDbiInterfaceImpl : HRESULT GetDelegateFunctionData( DelegateType delegateType, VMPTR_Object delegateObject, - OUT VMPTR_DomainAssembly *ppFunctionDomainAssembly, + OUT VMPTR_Assembly *ppFunctionAssembly, OUT mdMethodDef *pMethodDef); HRESULT GetDelegateTargetObject( @@ -702,10 +701,10 @@ class DacDbiInterfaceImpl : BOOL GetAssemblyPath(VMPTR_Assembly vmAssembly, IStringHolder * pStrFilename); - void GetAssemblyFromDomainAssembly(VMPTR_DomainAssembly vmDomainAssembly, VMPTR_Assembly *vmAssembly); + void GetAssemblyFromRootAssembly(VMPTR_Assembly vmRootAssembly, VMPTR_Assembly *vmAssembly); // Determines whether the runtime security system has assigned full-trust to this assembly. - BOOL IsAssemblyFullyTrusted(VMPTR_DomainAssembly vmDomainAssembly); + BOOL IsAssemblyFullyTrusted(VMPTR_Assembly vmAssembly); // get a type def resolved across modules void ResolveTypeReference(const TypeRefData * pTypeRefInfo, @@ -731,10 +730,10 @@ class DacDbiInterfaceImpl : // Gets properties for a module void GetModuleData(VMPTR_Module vmModule, ModuleInfo * pData); - // Gets properties for a domain assembly - void GetDomainAssemblyData(VMPTR_DomainAssembly vmDomainAssembly, DomainAssemblyInfo * pData); + // Gets properties for an assembly + void GetRuntimeAssemblyData(VMPTR_Assembly vmAssembly, AssemblyInfo * pData); - void GetModuleForDomainAssembly(VMPTR_DomainAssembly vmDomainAssembly, OUT VMPTR_Module * pModule); + void GetModuleForRuntimeAssembly(VMPTR_Assembly vmAssembly, OUT VMPTR_Module * pModule); // Yields true if the address is a CLR stub. BOOL IsTransitionStub(CORDB_ADDRESS address); @@ -754,7 +753,7 @@ class DacDbiInterfaceImpl : // Enumerate the moduels in the given assembly. void EnumerateModulesInAssembly( - VMPTR_DomainAssembly vmAssembly, + VMPTR_Assembly vmAssembly, FP_MODULE_ENUMERATION_CALLBACK fpCallback, void * pUserData ); @@ -830,8 +829,8 @@ class DacDbiInterfaceImpl : // Return the current appdomain the specified thread is in. VMPTR_AppDomain GetCurrentAppDomain(VMPTR_Thread vmThread); - // Given an assembly ref token and metadata scope (via the DomainAssembly), resolve the assembly. - VMPTR_DomainAssembly ResolveAssembly(VMPTR_DomainAssembly vmScope, mdToken tkAssemblyRef); + // Given an assembly ref token and metadata scope (via the runtime assembly), resolve the assembly. + VMPTR_Assembly ResolveAssembly(VMPTR_Assembly vmScope, mdToken tkAssemblyRef); // Hijack the thread diff --git a/src/coreclr/debug/daccess/dacdbiimpl.inl b/src/coreclr/debug/daccess/dacdbiimpl.inl index e8f664ef68b262..d60db5c26e4b17 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.inl +++ b/src/coreclr/debug/daccess/dacdbiimpl.inl @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // DacDbiImpl.inl -// - // // Inline functions for DacDbiImpl.h -// //***************************************************************************** #ifndef _DACDBI_IMPL_INL_ diff --git a/src/coreclr/debug/daccess/dacdbiimpllocks.cpp b/src/coreclr/debug/daccess/dacdbiimpllocks.cpp index 6c0d5a7e70e875..fea87304edb0f4 100644 --- a/src/coreclr/debug/daccess/dacdbiimpllocks.cpp +++ b/src/coreclr/debug/daccess/dacdbiimpllocks.cpp @@ -1,13 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: DacDbiImplLocks.cpp -// - // // Implement DAC/DBI interface for testing our ability to detect when the LS // holds a lock that we encounter while executing in the DAC. -// //***************************************************************************** #include "stdafx.h" diff --git a/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp b/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp index 3f60dec6a9b1ad..a10a83c5eb56a2 100644 --- a/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp +++ b/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// -// DacDbiImplStackWalk.cpp -// +//***************************************************************************** +// File: DacDbiImplStackWalk.cpp // // This file contains the implementation of the stackwalking-related functions on the DacDbiInterface. -// // ====================================================================================== #include "stdafx.h" @@ -575,7 +573,7 @@ void DacDbiInterfaceImpl::EnumerateInternalFrames(VMPTR_Thread #endif // FEATURE_COMINTEROP Module * pModule = (pMD ? pMD->GetModule() : NULL); - DomainAssembly * pDomainAssembly = (pModule ? pModule->GetDomainAssembly() : NULL); + Assembly * pAssembly = (pModule ? pModule->GetAssembly() : NULL); if (frameData.stubFrame.frameType == STUBFRAME_FUNC_EVAL) { @@ -583,14 +581,14 @@ void DacDbiInterfaceImpl::EnumerateInternalFrames(VMPTR_Thread DebuggerEval * pDE = pFEF->GetDebuggerEval(); frameData.stubFrame.funcMetadataToken = pDE->m_methodToken; - frameData.stubFrame.vmDomainAssembly.SetHostPtr( - pDE->m_debuggerModule ? pDE->m_debuggerModule->GetDomainAssembly() : NULL); + frameData.stubFrame.vmAssembly.SetHostPtr( + pDE->m_debuggerModule ? pDE->m_debuggerModule->GetAssembly() : NULL); frameData.stubFrame.vmMethodDesc = VMPTR_MethodDesc::NullPtr(); } else { frameData.stubFrame.funcMetadataToken = (pMD == NULL ? mdTokenNil : pMD->GetMemberDef()); - frameData.stubFrame.vmDomainAssembly.SetHostPtr(pDomainAssembly); + frameData.stubFrame.vmAssembly.SetHostPtr(pAssembly); frameData.stubFrame.vmMethodDesc.SetHostPtr(pMD); } @@ -767,11 +765,11 @@ void DacDbiInterfaceImpl::InitFrameData(StackFrameIterator * pIter, // Although MiniDumpNormal tries to dump all AppDomains, it's possible // target corruption will keep one from being present. This should mean // we'll just fail later, but struggle on for now. - DomainAssembly *pDomainAssembly = NULL; + Assembly *pAssembly = NULL; EX_TRY_ALLOW_DATATARGET_MISSING_MEMORY { - pDomainAssembly = (pModule ? pModule->GetDomainAssembly() : NULL); - _ASSERTE(pDomainAssembly != NULL); + pAssembly = (pModule ? pModule->GetAssembly() : NULL); + _ASSERTE(pAssembly != NULL); } EX_END_CATCH_ALLOW_DATATARGET_MISSING_MEMORY @@ -848,7 +846,7 @@ void DacDbiInterfaceImpl::InitFrameData(StackFrameIterator * pIter, // pFuncData->funcMetadataToken = pMD->GetMemberDef(); - pFuncData->vmDomainAssembly.SetHostPtr(pDomainAssembly); + pFuncData->vmAssembly.SetHostPtr(pAssembly); // PERF: this is expensive to get so I stopped fetching it eagerly // It is only needed if we haven't already got a cached copy diff --git a/src/coreclr/debug/daccess/dacfn.cpp b/src/coreclr/debug/daccess/dacfn.cpp index 8077463c8e2347..462dc1e1626020 100644 --- a/src/coreclr/debug/daccess/dacfn.cpp +++ b/src/coreclr/debug/daccess/dacfn.cpp @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: dacfn.cpp -// - // // Dac function implementations. -// //***************************************************************************** #include "stdafx.h" diff --git a/src/coreclr/debug/daccess/dacimpl.h b/src/coreclr/debug/daccess/dacimpl.h index 2d3123a575870d..0388cffd647b5b 100644 --- a/src/coreclr/debug/daccess/dacimpl.h +++ b/src/coreclr/debug/daccess/dacimpl.h @@ -1,15 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: dacimpl.h -// - // // Central header file for external data access implementation. -// //***************************************************************************** - #ifndef __DACIMPL_H__ #define __DACIMPL_H__ diff --git a/src/coreclr/debug/daccess/datatargetadapter.cpp b/src/coreclr/debug/daccess/datatargetadapter.cpp index 347656d514d119..be0f48837c3594 100644 --- a/src/coreclr/debug/daccess/datatargetadapter.cpp +++ b/src/coreclr/debug/daccess/datatargetadapter.cpp @@ -1,9 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // DataTargetAdapter.cpp -// - // // implementation of compatibility adapter for ICLRDataTarget //***************************************************************************** diff --git a/src/coreclr/debug/daccess/datatargetadapter.h b/src/coreclr/debug/daccess/datatargetadapter.h index 8b5c038fafb107..dae960931d19a4 100644 --- a/src/coreclr/debug/daccess/datatargetadapter.h +++ b/src/coreclr/debug/daccess/datatargetadapter.h @@ -1,9 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // DataTargetAdapter.h -// - // // header for compatibility adapter for ICLRDataTarget //***************************************************************************** diff --git a/src/coreclr/debug/daccess/enummem.cpp b/src/coreclr/debug/daccess/enummem.cpp index 7840bb29070cd0..76605299d89fb9 100644 --- a/src/coreclr/debug/daccess/enummem.cpp +++ b/src/coreclr/debug/daccess/enummem.cpp @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: enummem.cpp -// - // // ICLRDataEnumMemoryRegions implementation. -// //***************************************************************************** #include "stdafx.h" diff --git a/src/coreclr/debug/daccess/fntableaccess.cpp b/src/coreclr/debug/daccess/fntableaccess.cpp index 0489bdfb6ca110..da7e02e29bf5be 100644 --- a/src/coreclr/debug/daccess/fntableaccess.cpp +++ b/src/coreclr/debug/daccess/fntableaccess.cpp @@ -1,8 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// =========================================================================== -// +// =========================================================================== // File: DebugSupport.cpp // // Support routines for debugging the CLR @@ -13,12 +12,8 @@ #ifndef TARGET_UNIX #ifndef TARGET_X86 -// -// // @TODO: This is old code that should be easy to implement on top of the existing DAC support. // This code was originally written prior to DAC. -// -// #include #include diff --git a/src/coreclr/debug/daccess/fntableaccess.h b/src/coreclr/debug/daccess/fntableaccess.h index c4a72a6d93dedb..0d86b1e244db50 100644 --- a/src/coreclr/debug/daccess/fntableaccess.h +++ b/src/coreclr/debug/daccess/fntableaccess.h @@ -1,8 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// - #ifdef _MSC_VER #pragma once #endif diff --git a/src/coreclr/debug/daccess/gcinterface.dac.h b/src/coreclr/debug/daccess/gcinterface.dac.h index ae0dbfd3632e2c..a3a2c9925a34c9 100644 --- a/src/coreclr/debug/daccess/gcinterface.dac.h +++ b/src/coreclr/debug/daccess/gcinterface.dac.h @@ -1,5 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + #ifndef __DACCESS_GCINTERFACE_DAC_H__ #define __DACCESS_GCINTERFACE_DAC_H__ diff --git a/src/coreclr/debug/daccess/inspect.cpp b/src/coreclr/debug/daccess/inspect.cpp index 99667d95918977..d634461bf9c56c 100644 --- a/src/coreclr/debug/daccess/inspect.cpp +++ b/src/coreclr/debug/daccess/inspect.cpp @@ -1,17 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: inspect.cpp -// - // // ClrData object inspection. -// //***************************************************************************** #include "stdafx.h" - HRESULT InitFieldIter(DeepFieldDescIterator* fieldIter, TypeHandle typeHandle, diff --git a/src/coreclr/debug/daccess/nidump.cpp b/src/coreclr/debug/daccess/nidump.cpp index f130c0d3a0654f..dac3cb800760ec 100644 --- a/src/coreclr/debug/daccess/nidump.cpp +++ b/src/coreclr/debug/daccess/nidump.cpp @@ -1,8 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - -// /*vim: set foldmethod=marker: */ #include diff --git a/src/coreclr/debug/daccess/reimpl.cpp b/src/coreclr/debug/daccess/reimpl.cpp index 1935eacce97258..e5a5982fd42b34 100644 --- a/src/coreclr/debug/daccess/reimpl.cpp +++ b/src/coreclr/debug/daccess/reimpl.cpp @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: reimpl.cpp -// - // // Data-access-specific reimplementations of standard code. -// //***************************************************************************** #include "stdafx.h" diff --git a/src/coreclr/debug/daccess/request.cpp b/src/coreclr/debug/daccess/request.cpp index 252d68a71cf6ae..2f06cd8cd943c8 100644 --- a/src/coreclr/debug/daccess/request.cpp +++ b/src/coreclr/debug/daccess/request.cpp @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: request.cpp -// - // // CorDataAccess::Request implementation. -// //***************************************************************************** #include "stdafx.h" diff --git a/src/coreclr/debug/daccess/request_svr.cpp b/src/coreclr/debug/daccess/request_svr.cpp index d1dd6f046e8370..0178dddfd60a03 100644 --- a/src/coreclr/debug/daccess/request_svr.cpp +++ b/src/coreclr/debug/daccess/request_svr.cpp @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -//***************************************************************************** -// +//***************************************************************************** // File: request.cpp // // CorDataAccess::Request implementation. -// //***************************************************************************** #include "stdafx.h" diff --git a/src/coreclr/debug/daccess/stack.cpp b/src/coreclr/debug/daccess/stack.cpp index a0dc074ae1f67a..62edf353956380 100644 --- a/src/coreclr/debug/daccess/stack.cpp +++ b/src/coreclr/debug/daccess/stack.cpp @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: stack.cpp -// - // // CLRData stack walking. -// //***************************************************************************** #include "stdafx.h" diff --git a/src/coreclr/debug/daccess/stdafx.h b/src/coreclr/debug/daccess/stdafx.h index bb7b7b2365de59..ced20a9d243f74 100644 --- a/src/coreclr/debug/daccess/stdafx.h +++ b/src/coreclr/debug/daccess/stdafx.h @@ -1,9 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: stdafx.h -// - // //***************************************************************************** /* XXX Fri 10/14/2005 diff --git a/src/coreclr/debug/daccess/task.cpp b/src/coreclr/debug/daccess/task.cpp index 65f14dedd18920..d206d91d796b26 100644 --- a/src/coreclr/debug/daccess/task.cpp +++ b/src/coreclr/debug/daccess/task.cpp @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: task.cpp -// - // // ClrDataTask. -// //***************************************************************************** #include "stdafx.h" diff --git a/src/coreclr/debug/di/breakpoint.cpp b/src/coreclr/debug/di/breakpoint.cpp index 568d7fc9fc66ad..068bd111f9bce4 100644 --- a/src/coreclr/debug/di/breakpoint.cpp +++ b/src/coreclr/debug/di/breakpoint.cpp @@ -201,7 +201,7 @@ HRESULT CordbFunctionBreakpoint::Activate(BOOL fActivate) pProcess->InitIPCEvent(pEvent, DB_IPCE_BREAKPOINT_ADD, true, pAppDomain->GetADToken()); pEvent->BreakpointData.funcMetadataToken = m_code->GetMetadataToken(); - pEvent->BreakpointData.vmDomainAssembly = m_code->GetModule()->GetRuntimeDomainAssembly(); + pEvent->BreakpointData.vmAssembly = m_code->GetModule()->GetRuntimeAssembly(); pEvent->BreakpointData.encVersion = m_code->GetVersion(); BOOL codeIsIL = m_code->IsIL(); diff --git a/src/coreclr/debug/di/divalue.cpp b/src/coreclr/debug/di/divalue.cpp index 53ba0f6e9d9885..8869c52349bc36 100644 --- a/src/coreclr/debug/di/divalue.cpp +++ b/src/coreclr/debug/di/divalue.cpp @@ -2468,7 +2468,7 @@ HRESULT CordbObjectValue::EnumerateExceptionCallStack(ICorDebugExceptionObjectCa CorDebugExceptionObjectStackFrame& currentStackFrame = pStackFrames[index]; CordbAppDomain* pAppDomain = GetProcess()->LookupOrCreateAppDomain(currentDacFrame.vmAppDomain); - CordbModule* pModule = pAppDomain->LookupOrCreateModule(currentDacFrame.vmDomainAssembly); + CordbModule* pModule = pAppDomain->LookupOrCreateModule(currentDacFrame.vmAssembly); hr = pModule->QueryInterface(IID_ICorDebugModule, reinterpret_cast(¤tStackFrame.pModule)); _ASSERTE(SUCCEEDED(hr)); @@ -2695,18 +2695,18 @@ HRESULT CordbObjectValue::GetFunctionHelper(ICorDebugFunction **ppFunction) { RSLockHolder lockHolder(GetProcess()->GetProcessLock()); - VMPTR_DomainAssembly functionDomainAssembly; + VMPTR_Assembly functionAssembly; mdMethodDef functionMethodDef = 0; - hr = pDAC->GetDelegateFunctionData(delType, pDelegateObj, &functionDomainAssembly, &functionMethodDef); + hr = pDAC->GetDelegateFunctionData(delType, pDelegateObj, &functionAssembly, &functionMethodDef); if (hr != S_OK) return hr; // TODO: How to ensure results are sanitized? // Also, this is expensive. Do we really care that much about this? NativeCodeFunctionData nativeCodeForDelFunc; - pDAC->GetNativeCodeInfo(functionDomainAssembly, functionMethodDef, &nativeCodeForDelFunc); + pDAC->GetNativeCodeInfo(functionAssembly, functionMethodDef, &nativeCodeForDelFunc); - RSSmartPtr funcModule(GetProcess()->LookupOrCreateModule(functionDomainAssembly)); + RSSmartPtr funcModule(GetProcess()->LookupOrCreateModule(functionAssembly)); func.Assign(funcModule->LookupOrCreateFunction(functionMethodDef, nativeCodeForDelFunc.encVersion)); } diff --git a/src/coreclr/debug/di/module.cpp b/src/coreclr/debug/di/module.cpp index f33929d2b043cb..c1bc98e0a54fed 100644 --- a/src/coreclr/debug/di/module.cpp +++ b/src/coreclr/debug/di/module.cpp @@ -48,17 +48,17 @@ STDAPI ReOpenMetaDataWithMemoryEx( // // Arguments: // pProcess - process that this module lives in -// vmDomainAssembly - CLR cookie for module. +// vmAssembly - CLR cookie for module. CordbModule::CordbModule( CordbProcess * pProcess, VMPTR_Module vmModule, - VMPTR_DomainAssembly vmDomainAssembly) -: CordbBase(pProcess, vmDomainAssembly.IsNull() ? VmPtrToCookie(vmModule) : VmPtrToCookie(vmDomainAssembly), enumCordbModule), + VMPTR_Assembly vmAssembly) +: CordbBase(pProcess, vmAssembly.IsNull() ? VmPtrToCookie(vmModule) : VmPtrToCookie(vmAssembly), enumCordbModule), m_pAssembly(0), m_pAppDomain(0), m_classes(11), m_functions(101), - m_vmDomainAssembly(vmDomainAssembly), + m_vmAssembly(vmAssembly), m_vmModule(vmModule), m_EnCCount(0), m_fForceMetaDataSerialize(FALSE), @@ -84,14 +84,14 @@ CordbModule::CordbModule( m_fInMemory = modInfo.fInMemory; m_vmPEFile = modInfo.vmPEAssembly; - if (!vmDomainAssembly.IsNull()) + if (!vmAssembly.IsNull()) { - DomainAssemblyInfo dfInfo; + AssemblyInfo dfInfo; - pProcess->GetDAC()->GetDomainAssemblyData(vmDomainAssembly, &dfInfo); // throws + pProcess->GetDAC()->GetRuntimeAssemblyData(vmAssembly, &dfInfo); // throws m_pAppDomain = pProcess->LookupOrCreateAppDomain(dfInfo.vmAppDomain); - m_pAssembly = m_pAppDomain->LookupOrCreateAssembly(dfInfo.vmDomainAssembly); + m_pAssembly = m_pAppDomain->LookupOrCreateRuntimeAssembly(dfInfo.vmAssembly); } else { @@ -115,21 +115,21 @@ CordbModule::CordbModule( // Callback helper for code:CordbModule::DbgAssertModuleDeleted // // Arguments -// vmDomainAssembly - domain file in the enumeration +// vmAssembly - domain file in the enumeration // pUserData - pointer to the CordbModule that we just got an exit event for. // -void DbgAssertModuleDeletedCallback(VMPTR_DomainAssembly vmDomainAssembly, void * pUserData) +void DbgAssertModuleDeletedCallback(VMPTR_Assembly vmAssembly, void * pUserData) { CordbModule * pThis = reinterpret_cast(pUserData); INTERNAL_DAC_CALLBACK(pThis->GetProcess()); - if (!pThis->m_vmDomainAssembly.IsNull()) + if (!pThis->m_vmAssembly.IsNull()) { - VMPTR_DomainAssembly vmDomainAssemblyDeleted = pThis->m_vmDomainAssembly; + VMPTR_Assembly vmAssemblyDeleted = pThis->m_vmAssembly; - CONSISTENCY_CHECK_MSGF((vmDomainAssemblyDeleted != vmDomainAssembly), - ("A Module Unload event was sent for a module, but it still shows up in the enumeration.\n vmDomainAssemblyDeleted=%p\n", - VmPtrToCookie(vmDomainAssemblyDeleted))); + CONSISTENCY_CHECK_MSGF((vmAssemblyDeleted != vmAssembly), + ("A Module Unload event was sent for a module, but it still shows up in the enumeration.\n vmAssemblyDeleted=%p\n", + VmPtrToCookie(vmAssemblyDeleted))); } } @@ -144,7 +144,7 @@ void DbgAssertModuleDeletedCallback(VMPTR_DomainAssembly vmDomainAssembly, void void CordbModule::DbgAssertModuleDeleted() { GetProcess()->GetDAC()->EnumerateModulesInAssembly( - m_pAssembly->GetDomainAssemblyPtr(), + m_pAssembly->GetAssemblyPtr(), DbgAssertModuleDeletedCallback, this); } @@ -1499,7 +1499,7 @@ HRESULT CordbModule::EnableClassLoadCallbacks(BOOL bClassLoadCallbacks) if (m_fDynamic && !bClassLoadCallbacks) return E_INVALIDARG; - if (m_vmDomainAssembly.IsNull()) + if (m_vmAssembly.IsNull()) return E_UNEXPECTED; // Send a Set Class Load Flag event to the left side. There is no need to wait for a response, and this can be @@ -1511,7 +1511,7 @@ HRESULT CordbModule::EnableClassLoadCallbacks(BOOL bClassLoadCallbacks) DB_IPCE_SET_CLASS_LOAD_FLAG, false, (GetAppDomain()->GetADToken())); - event.SetClassLoad.vmDomainAssembly = this->m_vmDomainAssembly; + event.SetClassLoad.vmAssembly = this->m_vmAssembly; event.SetClassLoad.flag = (bClassLoadCallbacks == TRUE); HRESULT hr = pProcess->m_cordb->SendIPCEvent(pProcess, &event, @@ -2041,7 +2041,7 @@ HRESULT CordbModule::ResolveTypeRef(mdTypeRef token, CordbClass **ppClass) return E_INVALIDARG; } - if (m_vmDomainAssembly.IsNull() || m_pAppDomain == NULL) + if (m_vmAssembly.IsNull() || m_pAppDomain == NULL) { return E_UNEXPECTED; } @@ -2050,7 +2050,7 @@ HRESULT CordbModule::ResolveTypeRef(mdTypeRef token, CordbClass **ppClass) *ppClass = NULL; EX_TRY { - TypeRefData inData = {m_vmDomainAssembly, token}; + TypeRefData inData = {m_vmAssembly, token}; TypeRefData outData; { @@ -2058,7 +2058,7 @@ HRESULT CordbModule::ResolveTypeRef(mdTypeRef token, CordbClass **ppClass) pProcess->GetDAC()->ResolveTypeReference(&inData, &outData); } - CordbModule * pModule = m_pAppDomain->LookupOrCreateModule(outData.vmDomainAssembly); + CordbModule * pModule = m_pAppDomain->LookupOrCreateModule(outData.vmAssembly); IfFailThrow(pModule->LookupClassByToken(outData.typeToken, ppClass)); } EX_CATCH_HRESULT(hr); @@ -2271,7 +2271,7 @@ HRESULT CordbModule::ApplyChangesInternal(ULONG cbMetaData, FAIL_IF_NEUTERED(this); INTERNAL_SYNC_API_ENTRY(this->GetProcess()); // - if (m_vmDomainAssembly.IsNull()) + if (m_vmAssembly.IsNull()) return E_UNEXPECTED; #ifdef FEATURE_REMAP_FUNCTION @@ -2288,7 +2288,7 @@ HRESULT CordbModule::ApplyChangesInternal(ULONG cbMetaData, DebuggerIPCEvent event; GetProcess()->InitIPCEvent(&event, DB_IPCE_APPLY_CHANGES, false, VMPTR_AppDomain::NullPtr()); - event.ApplyChanges.vmDomainAssembly = this->m_vmDomainAssembly; + event.ApplyChanges.vmAssembly = this->m_vmAssembly; // Have the left-side create a buffer for us to store the delta into ULONG cbSize = cbMetaData+cbIL; @@ -2354,7 +2354,7 @@ HRESULT CordbModule::ApplyChangesInternal(ULONG cbMetaData, CordbModule* pModule = NULL; - pModule = pAppDomain->LookupOrCreateModule(retEvent->EnCUpdate.vmDomainAssembly); // throws + pModule = pAppDomain->LookupOrCreateModule(retEvent->EnCUpdate.vmAssembly); // throws _ASSERTE(pModule != NULL); // update to the newest version @@ -2412,7 +2412,7 @@ HRESULT CordbModule::SetJMCStatus( FAIL_IF_NEUTERED(this); ATT_REQUIRE_STOPPED_MAY_FAIL(GetProcess()); - if (m_vmDomainAssembly.IsNull()) + if (m_vmAssembly.IsNull()) return E_UNEXPECTED; // @todo -allow the other parameters. These are functions that have default status @@ -2431,7 +2431,7 @@ HRESULT CordbModule::SetJMCStatus( // Tell the LS that this module is/is not user code DebuggerIPCEvent event; pProcess->InitIPCEvent(&event, DB_IPCE_SET_MODULE_JMC_STATUS, true, this->GetAppDomain()->GetADToken()); - event.SetJMCFunctionStatus.vmDomainAssembly = m_vmDomainAssembly; + event.SetJMCFunctionStatus.vmAssembly = m_vmAssembly; event.SetJMCFunctionStatus.dwStatus = fIsUserCode; @@ -2520,17 +2520,17 @@ CordbAssembly * CordbModule::ResolveAssemblyInternal(mdToken tkAssemblyRef) CordbAssembly * pAssembly = NULL; - if (!m_vmDomainAssembly.IsNull()) + if (!m_vmAssembly.IsNull()) { // Get DAC to do the real work to resolve the assembly - VMPTR_DomainAssembly vmDomainAssembly = GetProcess()->GetDAC()->ResolveAssembly(m_vmDomainAssembly, tkAssemblyRef); + VMPTR_Assembly vmAssembly = GetProcess()->GetDAC()->ResolveAssembly(m_vmAssembly, tkAssemblyRef); // now find the ICorDebugAssembly corresponding to it - if (!vmDomainAssembly.IsNull() && m_pAppDomain != NULL) + if (!vmAssembly.IsNull() && m_pAppDomain != NULL) { RSLockHolder lockHolder(GetProcess()->GetProcessLock()); // Don't throw here because if the lookup fails, we want to throw CORDBG_E_CANNOT_RESOLVE_ASSEMBLY. - pAssembly = m_pAppDomain->LookupOrCreateAssembly(vmDomainAssembly); + pAssembly = m_pAppDomain->LookupOrCreateAssembly(vmAssembly); } } @@ -2694,7 +2694,7 @@ HRESULT CordbModule::SetJITCompilerFlags(DWORD dwFlags) if (SUCCEEDED(hr)) { // DD interface will check if it's a valid time to change the flags. - hr = pProcess->GetDAC()->SetCompilerFlags(GetRuntimeDomainAssembly(), fAllowJitOpts, fEnableEnC); + hr = pProcess->GetDAC()->SetCompilerFlags(GetRuntimeAssembly(), fAllowJitOpts, fEnableEnC); } } } @@ -2730,7 +2730,7 @@ HRESULT CordbModule::GetJITCompilerFlags(DWORD *pdwFlags ) BOOL fEnableEnC; pProcess->GetDAC()->GetCompilerFlags ( - GetRuntimeDomainAssembly(), + GetRuntimeAssembly(), &fAllowJitOpts, &fEnableEnC); diff --git a/src/coreclr/debug/di/process.cpp b/src/coreclr/debug/di/process.cpp index fffd6df484825f..4590ce654f9c9d 100644 --- a/src/coreclr/debug/di/process.cpp +++ b/src/coreclr/debug/di/process.cpp @@ -2572,10 +2572,10 @@ HRESULT CordbProcess::GetTypeForObject(CORDB_ADDRESS addr, CordbAppDomain* pAppD { VMPTR_AppDomain appDomain; VMPTR_Module mod; - VMPTR_DomainAssembly domainAssembly; + VMPTR_Assembly assembly; HRESULT hr = E_FAIL; - if (GetDAC()->GetAppDomainForObject(addr, &appDomain, &mod, &domainAssembly)) + if (GetDAC()->GetAppDomainForObject(addr, &appDomain, &mod, &assembly)) { if (pAppDomainOverride) { @@ -4304,15 +4304,15 @@ class ShimAssemblyCallbackData // Callback invoked from DAC enumeration. // // arguments: - // vmDomainAssembly - VMPTR for assembly + // vmAssembly - VMPTR for assembly // pData - a 'this' pointer // - static void Callback(VMPTR_DomainAssembly vmDomainAssembly, void * pData) + static void Callback(VMPTR_Assembly vmAssembly, void * pData) { ShimAssemblyCallbackData * pThis = static_cast (pData); INTERNAL_DAC_CALLBACK(pThis->m_pProcess); - CordbAssembly * pAssembly = pThis->m_pAppDomain->LookupOrCreateAssembly(vmDomainAssembly); + CordbAssembly * pAssembly = pThis->m_pAppDomain->LookupOrCreateAssembly(vmAssembly); pThis->SetAndMoveNext(pAssembly); } @@ -4439,15 +4439,15 @@ class ShimModuleCallbackData // Callback invoked from DAC enumeration. // // arguments: - // vmDomainAssembly - VMPTR for Module + // vmAssembly - VMPTR for Module // pData - a 'this' pointer // - static void Callback(VMPTR_DomainAssembly vmDomainAssembly, void * pData) + static void Callback(VMPTR_Assembly vmAssembly, void * pData) { ShimModuleCallbackData * pThis = static_cast (pData); INTERNAL_DAC_CALLBACK(pThis->m_pProcess); - CordbModule * pModule = pThis->m_pAssembly->GetAppDomain()->LookupOrCreateModule(vmDomainAssembly); + CordbModule * pModule = pThis->m_pAssembly->GetAppDomain()->LookupOrCreateModule(vmAssembly); pThis->SetAndMoveNext(pModule); } @@ -4537,7 +4537,7 @@ void CordbProcess::GetModulesInLoadOrder( // Enumerate through and fill out pModules table. GetDAC()->EnumerateModulesInAssembly( - pAssemblyInternal->GetDomainAssemblyPtr(), + pAssemblyInternal->GetAssemblyPtr(), ShimModuleCallbackData::Callback, &data); // user data @@ -5073,7 +5073,7 @@ void CordbProcess::RawDispatchEvent( case DB_IPCE_METADATA_UPDATE: { - CordbModule * pModule = pAppDomain->LookupOrCreateModule(pEvent->MetadataUpdateData.vmDomainAssembly); + CordbModule * pModule = pAppDomain->LookupOrCreateModule(pEvent->MetadataUpdateData.vmAssembly); pModule->RefreshMetaData(); } break; @@ -5081,7 +5081,7 @@ void CordbProcess::RawDispatchEvent( case DB_IPCE_LOAD_MODULE: { _ASSERTE (pAppDomain != NULL); - CordbModule * pModule = pAppDomain->LookupOrCreateModule(pEvent->LoadModuleData.vmDomainAssembly); + CordbModule * pModule = pAppDomain->LookupOrCreateModule(pEvent->LoadModuleData.vmAssembly); { pModule->SetLoadEventContinueMarker(); @@ -5133,12 +5133,12 @@ void CordbProcess::RawDispatchEvent( { STRESS_LOG3(LF_CORDB, LL_INFO100, "RCET::HRCE: unload module on thread %#x Mod:0x%x AD:0x%08x\n", dwVolatileThreadId, - VmPtrToCookie(pEvent->UnloadModuleData.vmDomainAssembly), + VmPtrToCookie(pEvent->UnloadModuleData.vmAssembly), VmPtrToCookie(pEvent->vmAppDomain)); PREFIX_ASSUME (pAppDomain != NULL); - CordbModule *module = pAppDomain->LookupOrCreateModule(pEvent->UnloadModuleData.vmDomainAssembly); + CordbModule *module = pAppDomain->LookupOrCreateModule(pEvent->UnloadModuleData.vmAssembly); if (module == NULL) { @@ -5159,7 +5159,7 @@ void CordbProcess::RawDispatchEvent( pCallback1->UnloadModule(pAppDomain, module); } - pAppDomain->m_modules.RemoveBase(VmPtrToCookie(pEvent->UnloadModuleData.vmDomainAssembly)); + pAppDomain->m_modules.RemoveBase(VmPtrToCookie(pEvent->UnloadModuleData.vmAssembly)); } break; @@ -5171,13 +5171,13 @@ void CordbProcess::RawDispatchEvent( "RCET::HRCE: load class on thread %#x Tok:0x%08x Mod:0x%08x Asm:0x%08x AD:0x%08x\n", dwVolatileThreadId, pEvent->LoadClass.classMetadataToken, - VmPtrToCookie(pEvent->LoadClass.vmDomainAssembly), + VmPtrToCookie(pEvent->LoadClass.vmAssembly), LsPtrToCookie(pEvent->LoadClass.classDebuggerAssemblyToken), VmPtrToCookie(pEvent->vmAppDomain))); _ASSERTE (pAppDomain != NULL); - CordbModule* pModule = pAppDomain->LookupOrCreateModule(pEvent->LoadClass.vmDomainAssembly); + CordbModule* pModule = pAppDomain->LookupOrCreateModule(pEvent->LoadClass.vmAssembly); if (pModule == NULL) { LOG((LF_CORDB, LL_INFO100, "Load Class on not-loaded Module - continue()ing!" )); @@ -5229,13 +5229,13 @@ void CordbProcess::RawDispatchEvent( "RCET::HRCE: unload class on thread %#x Tok:0x%08x Mod:0x%08x AD:0x%08x\n", dwVolatileThreadId, pEvent->UnloadClass.classMetadataToken, - VmPtrToCookie(pEvent->UnloadClass.vmDomainAssembly), + VmPtrToCookie(pEvent->UnloadClass.vmAssembly), VmPtrToCookie(pEvent->vmAppDomain))); // get the appdomain object _ASSERTE (pAppDomain != NULL); - CordbModule *pModule = pAppDomain->LookupOrCreateModule(pEvent->UnloadClass.vmDomainAssembly); + CordbModule *pModule = pAppDomain->LookupOrCreateModule(pEvent->UnloadClass.vmAssembly); if (pModule == NULL) { LOG((LF_CORDB, LL_INFO100, "Unload Class on not-loaded Module - continue()ing!" )); @@ -5312,7 +5312,7 @@ void CordbProcess::RawDispatchEvent( // determine first whether custom notifications for this type are enabled -- if not // we just return without doing anything. CordbClass * pNotificationClass = LookupClass(pAppDomain, - pEvent->CustomNotification.vmDomainAssembly, + pEvent->CustomNotification.vmAssembly, pEvent->CustomNotification.classToken); // if the class is NULL, that means the debugger never enabled notifications for it. Otherwise, @@ -5412,13 +5412,13 @@ void CordbProcess::RawDispatchEvent( LOG((LF_CORDB, LL_INFO100, "RCET::HRCE: load assembly on thread %#x Asm:0x%08x AD:0x%08x \n", dwVolatileThreadId, - VmPtrToCookie(pEvent->AssemblyData.vmDomainAssembly), + VmPtrToCookie(pEvent->AssemblyData.vmAssembly), VmPtrToCookie(pEvent->vmAppDomain))); _ASSERTE (pAppDomain != NULL); // Determine if this Assembly is cached. - CordbAssembly * pAssembly = pAppDomain->LookupOrCreateAssembly(pEvent->AssemblyData.vmDomainAssembly); + CordbAssembly * pAssembly = pAppDomain->LookupOrCreateAssembly(pEvent->AssemblyData.vmAssembly); _ASSERTE(pAssembly != NULL); // throws on error // If created, or have, an Assembly, notify callback. @@ -5434,12 +5434,12 @@ void CordbProcess::RawDispatchEvent( { LOG((LF_CORDB, LL_INFO100, "RCET::DRCE: unload assembly on thread %#x Asm:0x%x AD:0x%x\n", dwVolatileThreadId, - VmPtrToCookie(pEvent->AssemblyData.vmDomainAssembly), + VmPtrToCookie(pEvent->AssemblyData.vmAssembly), VmPtrToCookie(pEvent->vmAppDomain))); _ASSERTE (pAppDomain != NULL); - CordbAssembly * pAssembly = pAppDomain->LookupOrCreateAssembly(pEvent->AssemblyData.vmDomainAssembly); + CordbAssembly * pAssembly = pAppDomain->LookupOrCreateAssembly(pEvent->AssemblyData.vmAssembly); if (pAssembly == NULL) { @@ -5457,7 +5457,7 @@ void CordbProcess::RawDispatchEvent( hr = pCallback1->UnloadAssembly(pAppDomain, pAssembly); } - pAppDomain->RemoveAssemblyFromCache(pEvent->AssemblyData.vmDomainAssembly); + pAppDomain->RemoveAssemblyFromCache(pEvent->AssemblyData.vmAssembly); } break; @@ -5588,7 +5588,7 @@ void CordbProcess::RawDispatchEvent( _ASSERTE (pAppDomain != NULL); // Find the Right Side module for this module. - CordbModule * pModule = pAppDomain->LookupOrCreateModule(pEvent->UpdateModuleSymsData.vmDomainAssembly); + CordbModule * pModule = pAppDomain->LookupOrCreateModule(pEvent->UpdateModuleSymsData.vmAssembly); _ASSERTE(pModule != NULL); // This is a legacy event notification for updated PDBs. @@ -5662,7 +5662,7 @@ void CordbProcess::RawDispatchEvent( _ASSERTE(NULL != pAppDomain); - CordbModule * pModule = pAppDomain->LookupOrCreateModule(pEvent->EnCRemap.vmDomainAssembly); + CordbModule * pModule = pAppDomain->LookupOrCreateModule(pEvent->EnCRemap.vmAssembly); PREFIX_ASSUME(pModule != NULL); CordbFunction * pCurFunction = NULL; @@ -5718,7 +5718,7 @@ void CordbProcess::RawDispatchEvent( _ASSERTE(NULL != pAppDomain); - CordbModule* pModule = pAppDomain->LookupOrCreateModule(pEvent->EnCRemap.vmDomainAssembly); + CordbModule* pModule = pAppDomain->LookupOrCreateModule(pEvent->EnCRemap.vmAssembly); PREFIX_ASSUME(pModule != NULL); // Find the function we're remapping to, which must be the latest version @@ -11163,11 +11163,11 @@ void CordbProcess::HandleSetThreadContextNeeded(DWORD dwThreadId) // 3. read the thread context, and from that read the pointer to the left-side context and the size of the context // 4. then we can perform the actual SetThreadContext operation // 5. lastly, we must resume the thread - // For the first step of obtaining the thread handle, + // For the first step of obtaining the thread handle, // we have previously attempted to use ::OpenThread to get a handle to the thread. // However, there are situations where OpenThread can fail with an Access Denied error. - // From https://github.com/dotnet/runtime/issues/107263, the control-c handler in - // Windows causes the process to have higher privileges. + // From https://github.com/dotnet/runtime/issues/107263, the control-c handler in + // Windows causes the process to have higher privileges. // We are now using the following approach to access the thread handle, which is the same // approach used by CordbThread::RefreshHandle: // 1. Get the thread handle from the DAC @@ -11210,8 +11210,8 @@ void CordbProcess::HandleSetThreadContextNeeded(DWORD dwThreadId) DT_CONTEXT context = { 0 }; context.ContextFlags = CONTEXT_FULL; - // we originally used GetDataTarget()->GetThreadContext, but - // the implementation uses ShimLocalDataTarget::GetThreadContext which + // we originally used GetDataTarget()->GetThreadContext, but + // the implementation uses ShimLocalDataTarget::GetThreadContext which // depends on OpenThread which might fail with an Access Denied error (see note above) BOOL success = ::GetThreadContext(hThread, (CONTEXT*)(&context)); if (!success) @@ -11224,7 +11224,7 @@ void CordbProcess::HandleSetThreadContextNeeded(DWORD dwThreadId) TADDR lsContextAddr = (TADDR)context.Rcx; DWORD contextSize = (DWORD)context.Rdx; - // Read the expected Rip and Rsp from the thread context. This is used to + // Read the expected Rip and Rsp from the thread context. This is used to // validate the context read from the left-side. TADDR expectedRip = (TADDR)context.R8; TADDR expectedRsp = (TADDR)context.R9; @@ -15193,16 +15193,16 @@ void CordbProcess::UpdateThreadsForAdUnload(CordbAppDomain * pAppDomain) // CordbProcess::LookupClass // Looks up a previously constructed CordbClass instance without creating. May return NULL if the // CordbClass instance doesn't exist. -// Argument: (in) vmDomainAssembly - pointer to the domain assembly for the module +// Argument: (in) vmAssembly - pointer to the domain assembly for the module // (in) mdTypeDef - metadata token for the class // Return value: pointer to a previously created CordbClass instance or NULL in none exists -CordbClass * CordbProcess::LookupClass(ICorDebugAppDomain * pAppDomain, VMPTR_DomainAssembly vmDomainAssembly, mdTypeDef classToken) +CordbClass * CordbProcess::LookupClass(ICorDebugAppDomain * pAppDomain, VMPTR_Assembly vmAssembly, mdTypeDef classToken) { _ASSERTE(ThreadHoldsProcessLock()); if (pAppDomain != NULL) { - CordbModule * pModule = ((CordbAppDomain *)pAppDomain)->m_modules.GetBase(VmPtrToCookie(vmDomainAssembly)); + CordbModule * pModule = ((CordbAppDomain *)pAppDomain)->m_modules.GetBase(VmPtrToCookie(vmAssembly)); if (pModule != NULL) { return pModule->LookupClass(classToken); @@ -15215,7 +15215,7 @@ CordbClass * CordbProcess::LookupClass(ICorDebugAppDomain * pAppDomain, VMPTR_Do // Look for a specific module in the process. // // Arguments: -// vmDomainAssembly - non-null module to lookup +// vmAssembly - non-null module to lookup // // Returns: // a CordbModule object for the given cookie. Object may be from the cache, or created @@ -15223,23 +15223,23 @@ CordbClass * CordbProcess::LookupClass(ICorDebugAppDomain * pAppDomain, VMPTR_Do // Never returns null. Throws on error. // // Notes: -// A VMPTR_DomainAssembly has appdomain affinity, but is ultimately scoped to a process. -// So if we get a raw VMPTR_DomainAssembly (eg, from the stackwalker or from some other +// A VMPTR_Assembly has appdomain affinity, but is ultimately scoped to a process. +// So if we get a raw VMPTR_Assembly (eg, from the stackwalker or from some other // lookup function), then we need to do a process wide lookup since we don't know which // appdomain it's in. If you know the appdomain, you can use code:CordbAppDomain::LookupOrCreateModule. // -CordbModule * CordbProcess::LookupOrCreateModule(VMPTR_DomainAssembly vmDomainAssembly) +CordbModule * CordbProcess::LookupOrCreateModule(VMPTR_Assembly vmAssembly) { INTERNAL_API_ENTRY(this); RSLockHolder lockHolder(GetProcess()->GetProcessLock()); - _ASSERTE(!vmDomainAssembly.IsNull()); + _ASSERTE(!vmAssembly.IsNull()); - DomainAssemblyInfo data; - GetDAC()->GetDomainAssemblyData(vmDomainAssembly, &data); // throws + AssemblyInfo data; + GetDAC()->GetRuntimeAssemblyData(vmAssembly, &data); // throws CordbAppDomain * pAppDomain = LookupOrCreateAppDomain(data.vmAppDomain); - return pAppDomain->LookupOrCreateModule(vmDomainAssembly); + return pAppDomain->LookupOrCreateModule(vmAssembly); } //--------------------------------------------------------------------------------------- diff --git a/src/coreclr/debug/di/rsappdomain.cpp b/src/coreclr/debug/di/rsappdomain.cpp index c385f0da353ad0..4e24dc48cf7d91 100644 --- a/src/coreclr/debug/di/rsappdomain.cpp +++ b/src/coreclr/debug/di/rsappdomain.cpp @@ -1,11 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: RsAppDomain.cpp -// - // //***************************************************************************** + #include "stdafx.h" #include "primitives.h" #include "safewrap.h" @@ -20,7 +20,6 @@ #include "../../dlls/mscorrc/resource.h" #include - /* ------------------------------------------------------------------------- * * AppDomain class methods * ------------------------------------------------------------------------- */ @@ -362,7 +361,7 @@ HRESULT CordbAppDomain::GetProcess(ICorDebugProcess **ppProcess) // Callback for assembly enumeration. // // Arguments: -// vmDomainAssembly - new assembly to add +// vmAssembly - new assembly to add // pThis - user data for CordbAppDomain to add assembly too // // @@ -373,13 +372,13 @@ HRESULT CordbAppDomain::GetProcess(ICorDebugProcess **ppProcess) // // static -void CordbAppDomain::AssemblyEnumerationCallback(VMPTR_DomainAssembly vmDomainAssembly, void * pThis) +void CordbAppDomain::AssemblyEnumerationCallback(VMPTR_Assembly vmAssembly, void * pThis) { CordbAppDomain * pAppDomain = static_cast (pThis); INTERNAL_DAC_CALLBACK(pAppDomain->GetProcess()); // This lookup will cause the cache to be populated if we haven't seen this assembly before. - pAppDomain->LookupOrCreateAssembly(vmDomainAssembly); + pAppDomain->LookupOrCreateAssembly(vmAssembly); } @@ -388,7 +387,7 @@ void CordbAppDomain::AssemblyEnumerationCallback(VMPTR_DomainAssembly vmDomainAs // Cache a new assembly // // Arguments: -// vmDomainAssembly - new assembly to add to cache +// vmAssembly - new assembly to add to cache // // Return Value: // Pointer to Assembly in cache. @@ -400,14 +399,14 @@ void CordbAppDomain::AssemblyEnumerationCallback(VMPTR_DomainAssembly vmDomainAs // // Notes: // -CordbAssembly * CordbAppDomain::CacheAssembly(VMPTR_DomainAssembly vmDomainAssembly) +CordbAssembly * CordbAppDomain::CacheRuntimeAssembly(VMPTR_Assembly vmRuntimeAssembly) { INTERNAL_API_ENTRY(GetProcess()); VMPTR_Assembly vmAssembly; - GetProcess()->GetDAC()->GetAssemblyFromDomainAssembly(vmDomainAssembly, &vmAssembly); + GetProcess()->GetDAC()->GetAssemblyFromRootAssembly(vmRuntimeAssembly, &vmAssembly); - RSInitHolder pAssembly(new CordbAssembly(this, vmAssembly, vmDomainAssembly)); + RSInitHolder pAssembly(new CordbAssembly(this, vmAssembly, vmAssembly)); return pAssembly.TransferOwnershipToHash(&m_assemblies); } @@ -416,7 +415,7 @@ CordbAssembly * CordbAppDomain::CacheAssembly(VMPTR_Assembly vmAssembly) { INTERNAL_API_ENTRY(GetProcess()); - RSInitHolder pAssembly(new CordbAssembly(this, vmAssembly, VMPTR_DomainAssembly())); + RSInitHolder pAssembly(new CordbAssembly(this, vmAssembly, VMPTR_Assembly())); return pAssembly.TransferOwnershipToHash(&m_assemblies); } @@ -776,41 +775,39 @@ HRESULT CordbAppDomain::GetID (ULONG32 *pId) // Remove an assembly from the ICorDebug cache. // // Arguments: -// vmDomainAssembly - token to remove. +// vmAssembly - token to remove. // // Notes: // This is the opposite of code:CordbAppDomain::LookupOrCreateAssembly. // This only need to be called at assembly unload events. -void CordbAppDomain::RemoveAssemblyFromCache(VMPTR_DomainAssembly vmDomainAssembly) +void CordbAppDomain::RemoveAssemblyFromCache(VMPTR_Assembly vmAssembly) { // This will handle if the assembly is not in the hash. // This could happen if we attach right before an assembly-unload event. - m_assemblies.RemoveBase(VmPtrToCookie(vmDomainAssembly)); + m_assemblies.RemoveBase(VmPtrToCookie(vmAssembly)); } //--------------------------------------------------------------------------------------- -// Lookup (or create) the CordbAssembly for the given VMPTR_DomainAssembly +// Lookup (or create) the CordbAssembly for the given VMPTR_Assembly // // Arguments: -// vmDomainAssembly - CLR token for the Assembly. +// vmAssembly - CLR token for the Assembly. // // Returns: // a CordbAssembly object for the given CLR assembly. This may be from the cache, // or newly created if not yet in the cache. // Never returns NULL. Throws on error (eg, oom). // -CordbAssembly * CordbAppDomain::LookupOrCreateAssembly(VMPTR_DomainAssembly vmDomainAssembly) +CordbAssembly * CordbAppDomain::LookupOrCreateRuntimeAssembly(VMPTR_Assembly vmAssembly) { - CordbAssembly * pAssembly = m_assemblies.GetBase(VmPtrToCookie(vmDomainAssembly)); + CordbAssembly * pAssembly = m_assemblies.GetBase(VmPtrToCookie(vmAssembly)); if (pAssembly != NULL) { return pAssembly; } - return CacheAssembly(vmDomainAssembly); + return CacheRuntimeAssembly(vmAssembly); } - -// CordbAssembly * CordbAppDomain::LookupOrCreateAssembly(VMPTR_Assembly vmAssembly) { CordbAssembly * pAssembly = m_assemblies.GetBase(VmPtrToCookie(vmAssembly)); @@ -821,12 +818,11 @@ CordbAssembly * CordbAppDomain::LookupOrCreateAssembly(VMPTR_Assembly vmAssembly return CacheAssembly(vmAssembly); } - //--------------------------------------------------------------------------------------- // Lookup or create a module within the appdomain // // Arguments: -// vmDomainAssembly - non-null module to lookup +// vmAssembly - non-null module to lookup // // Returns: // a CordbModule object for the given cookie. Object may be from the cache, or created @@ -836,26 +832,26 @@ CordbAssembly * CordbAppDomain::LookupOrCreateAssembly(VMPTR_Assembly vmAssembly // Notes: // If you don't know which appdomain the module is in, use code:CordbProcess::LookupOrCreateModule. // -CordbModule* CordbAppDomain::LookupOrCreateModule(VMPTR_Module vmModule, VMPTR_DomainAssembly vmDomainAssembly) +CordbModule* CordbAppDomain::LookupOrCreateModule(VMPTR_Module vmModule, VMPTR_Assembly vmAssembly) { INTERNAL_API_ENTRY(this); CordbModule * pModule; RSLockHolder lockHolder(GetProcess()->GetProcessLock()); // @dbgtodo locking: push this up. - _ASSERTE(!vmDomainAssembly.IsNull() || !vmModule.IsNull()); + _ASSERTE(!vmAssembly.IsNull() || !vmModule.IsNull()); // check to see if the module is present in this app domain - pModule = m_modules.GetBase(vmDomainAssembly.IsNull() ? VmPtrToCookie(vmModule) : VmPtrToCookie(vmDomainAssembly)); + pModule = m_modules.GetBase(vmAssembly.IsNull() ? VmPtrToCookie(vmModule) : VmPtrToCookie(vmAssembly)); if (pModule != NULL) { return pModule; } if (vmModule.IsNull()) - GetProcess()->GetDAC()->GetModuleForDomainAssembly(vmDomainAssembly, &vmModule); + GetProcess()->GetDAC()->GetModuleForRuntimeAssembly(vmAssembly, &vmModule); - RSInitHolder pModuleInit(new CordbModule(GetProcess(), vmModule, vmDomainAssembly)); + RSInitHolder pModuleInit(new CordbModule(GetProcess(), vmModule, vmAssembly)); pModule = pModuleInit.TransferOwnershipToHash(&m_modules); // The appdomains should match. @@ -865,12 +861,12 @@ CordbModule* CordbAppDomain::LookupOrCreateModule(VMPTR_Module vmModule, VMPTR_D } -CordbModule* CordbAppDomain::LookupOrCreateModule(VMPTR_DomainAssembly vmDomainAssembly) +CordbModule* CordbAppDomain::LookupOrCreateModule(VMPTR_Assembly vmAssembly) { INTERNAL_API_ENTRY(this); - _ASSERTE(!vmDomainAssembly.IsNull()); - return LookupOrCreateModule(VMPTR_Module::NullPtr(), vmDomainAssembly); + _ASSERTE(!vmAssembly.IsNull()); + return LookupOrCreateModule(VMPTR_Module::NullPtr(), vmAssembly); } @@ -887,7 +883,7 @@ CordbModule* CordbAppDomain::LookupOrCreateModule(VMPTR_DomainAssembly vmDomainA // invokes this callback. // static -void CordbAppDomain::ModuleEnumerationCallback(VMPTR_DomainAssembly vmModule, void * pUserData) +void CordbAppDomain::ModuleEnumerationCallback(VMPTR_Assembly vmModule, void * pUserData) { CONTRACTL { @@ -934,7 +930,7 @@ void CordbAppDomain::PrepopulateModules() // DD-primitive that invokes a callback. GetProcess()->GetDAC()->EnumerateModulesInAssembly( - pAssembly->GetDomainAssemblyPtr(), + pAssembly->GetAssemblyPtr(), CordbAppDomain::ModuleEnumerationCallback, this); // user data diff --git a/src/coreclr/debug/di/rsassembly.cpp b/src/coreclr/debug/di/rsassembly.cpp index cddba652770f94..7205989a45452f 100644 --- a/src/coreclr/debug/di/rsassembly.cpp +++ b/src/coreclr/debug/di/rsassembly.cpp @@ -26,13 +26,13 @@ * ------------------------------------------------------------------------- */ CordbAssembly::CordbAssembly(CordbAppDomain * pAppDomain, VMPTR_Assembly vmAssembly, - VMPTR_DomainAssembly vmDomainAssembly) + VMPTR_Assembly vmRuntimeAssembly) : CordbBase(pAppDomain->GetProcess(), - vmDomainAssembly.IsNull() ? VmPtrToCookie(vmAssembly) : VmPtrToCookie(vmDomainAssembly), + vmRuntimeAssembly.IsNull() ? VmPtrToCookie(vmAssembly) : VmPtrToCookie(vmRuntimeAssembly), enumCordbAssembly), m_vmAssembly(vmAssembly), - m_vmDomainAssembly(vmDomainAssembly), + m_vmRuntimeAssembly(vmRuntimeAssembly), m_pAppDomain(pAppDomain) { _ASSERTE(!vmAssembly.IsNull()); @@ -80,19 +80,19 @@ void CordbAssembly::Neuter() // Callback helper for code:CordbAssembly::DbgAssertAssemblyDeleted // // Arguments -// vmDomainAssembly - domain file in the enumeration +// vmAssembly - root file in the enumeration // pUserData - pointer to the CordbAssembly that we just got an exit event for. // // static -void CordbAssembly::DbgAssertAssemblyDeletedCallback(VMPTR_DomainAssembly vmDomainAssembly, void * pUserData) +void CordbAssembly::DbgAssertAssemblyDeletedCallback(VMPTR_Assembly vmAssembly, void * pUserData) { CordbAssembly * pThis = reinterpret_cast(pUserData); INTERNAL_DAC_CALLBACK(pThis->GetProcess()); - VMPTR_DomainAssembly vmAssemblyDeleted = pThis->m_vmDomainAssembly; + VMPTR_Assembly vmAssemblyDeleted = pThis->m_vmRuntimeAssembly; - CONSISTENCY_CHECK_MSGF((vmAssemblyDeleted != vmDomainAssembly), + CONSISTENCY_CHECK_MSGF((vmAssemblyDeleted != vmAssembly), ("An Assembly Unload event was sent, but the assembly still shows up in the enumeration.\n vmAssemblyDeleted=%p\n", VmPtrToCookie(vmAssemblyDeleted))); } @@ -286,7 +286,7 @@ HRESULT CordbAssembly::IsFullyTrusted( BOOL *pbFullyTrusted ) ATT_REQUIRE_STOPPED_MAY_FAIL(GetProcess()); VALIDATE_POINTER_TO_OBJECT(pbFullyTrusted, BOOL*); - if (m_vmDomainAssembly.IsNull()) + if (m_vmRuntimeAssembly.IsNull()) return E_UNEXPECTED; // Check for cached result @@ -303,7 +303,7 @@ HRESULT CordbAssembly::IsFullyTrusted( BOOL *pbFullyTrusted ) CordbProcess * pProcess = m_pAppDomain->GetProcess(); IDacDbiInterface * pDac = pProcess->GetDAC(); - BOOL fIsFullTrust = pDac->IsAssemblyFullyTrusted(m_vmDomainAssembly); + BOOL fIsFullTrust = pDac->IsAssemblyFullyTrusted(m_vmRuntimeAssembly); // Once the trust level of an assembly is known, it cannot change. m_foptIsFullTrust = fIsFullTrust; diff --git a/src/coreclr/debug/di/rsclass.cpp b/src/coreclr/debug/di/rsclass.cpp index d60d1777de0b58..e2b43004d14dcf 100644 --- a/src/coreclr/debug/di/rsclass.cpp +++ b/src/coreclr/debug/di/rsclass.cpp @@ -781,11 +781,11 @@ void CordbClass::Init(ClassLoadLevel desiredLoadLevel) if(desiredLoadLevel == FullInfo) { VMPTR_AppDomain vmAppDomain = VMPTR_AppDomain::NullPtr(); - VMPTR_DomainAssembly vmDomainAssembly = m_pModule->GetRuntimeDomainAssembly(); - if (!vmDomainAssembly.IsNull()) + VMPTR_Assembly vmAssembly = m_pModule->GetRuntimeAssembly(); + if (!vmAssembly.IsNull()) { - DomainAssemblyInfo info; - pDac->GetDomainAssemblyData(vmDomainAssembly, &info); + AssemblyInfo info; + pDac->GetRuntimeAssemblyData(vmAssembly, &info); vmAppDomain = info.vmAppDomain; } pDac->GetClassInfo(vmAppDomain, vmTypeHandle, &m_classInfo); @@ -941,7 +941,7 @@ void CordbClass::InitEnCFieldInfo(EnCHangingFieldInfo * pEncField, fieldToken, ELEMENT_TYPE_MAX, classToken, - m_pModule->GetRuntimeDomainAssembly()); + m_pModule->GetRuntimeAssembly()); } else { @@ -966,7 +966,7 @@ void CordbClass::InitEnCFieldInfo(EnCHangingFieldInfo * pEncField, // This is used only for log messages, and could // be removed. classToken, // metadata token for the class - m_pModule->GetRuntimeDomainAssembly()); // Domain file for the class + m_pModule->GetRuntimeAssembly()); // Root file for the class } } // CordbClass::InitFieldData diff --git a/src/coreclr/debug/di/rsfunction.cpp b/src/coreclr/debug/di/rsfunction.cpp index d9d30eddb072c1..0b6c0f5ab4807f 100644 --- a/src/coreclr/debug/di/rsfunction.cpp +++ b/src/coreclr/debug/di/rsfunction.cpp @@ -780,7 +780,7 @@ HRESULT CordbFunction::GetILCodeAndSigToken() // and we also fallback on creating an empty ILCode object. // See issue DD 273199 for cases where IL and NGEN metadata mismatch (different RVAs). ALLOW_DATATARGET_MISSING_OR_INCONSISTENT_MEMORY( - pProcess->GetDAC()->GetILCodeAndSig(m_pModule->GetRuntimeDomainAssembly(), + pProcess->GetDAC()->GetILCodeAndSig(m_pModule->GetRuntimeAssembly(), m_MDToken, &codeInfo, &localVarSigToken); @@ -857,7 +857,7 @@ HRESULT CordbFunction::InitParentClassOfFunction() } mdTypeDef classMetadataToken; - VMPTR_DomainAssembly vmDomainAssembly = m_pModule->GetRuntimeDomainAssembly(); + VMPTR_Assembly vmAssembly = m_pModule->GetRuntimeAssembly(); classMetadataToken = InitParentClassOfFunctionHelper(m_MDToken); @@ -870,7 +870,7 @@ HRESULT CordbFunction::InitParentClassOfFunction() CordbAssembly *pAssembly = m_pModule->GetCordbAssembly(); PREFIX_ASSUME(pAssembly != NULL); - CordbModule* pClassModule = pAssembly->GetAppDomain()->LookupOrCreateModule(vmDomainAssembly); + CordbModule* pClassModule = pAssembly->GetAppDomain()->LookupOrCreateModule(vmAssembly); PREFIX_ASSUME(pClassModule != NULL); CordbClass *pClass; @@ -925,7 +925,7 @@ HRESULT CordbFunction::InitNativeCodeInfo() // All we actually need is the start address and method desc which are cheap to get relative // to some of the other members. So far this doesn't appear to be a perf hotspot, but if it // shows up in some scenario it wouldn't be too hard to improve it - pProcess->GetDAC()->GetNativeCodeInfo(m_pModule->GetRuntimeDomainAssembly(), m_MDToken, &codeInfo); + pProcess->GetDAC()->GetNativeCodeInfo(m_pModule->GetRuntimeAssembly(), m_MDToken, &codeInfo); } // populate the m_nativeCode pointer with the code info we found @@ -979,7 +979,7 @@ HRESULT CordbFunction::SetJMCStatus(BOOL fIsUserCode) DebuggerIPCEvent event; pProcess->InitIPCEvent(&event, DB_IPCE_SET_METHOD_JMC_STATUS, true, m_pModule->GetAppDomain()->GetADToken()); - event.SetJMCFunctionStatus.vmDomainAssembly = m_pModule->GetRuntimeDomainAssembly(); + event.SetJMCFunctionStatus.vmAssembly = m_pModule->GetRuntimeAssembly(); event.SetJMCFunctionStatus.funcMetadataToken = m_MDToken; event.SetJMCFunctionStatus.dwStatus = fIsUserCode; @@ -1031,7 +1031,7 @@ HRESULT CordbFunction::GetJMCStatus(BOOL * pfIsUserCode) // Ask the left-side if a method is user code or not. DebuggerIPCEvent event; pProcess->InitIPCEvent(&event, DB_IPCE_GET_METHOD_JMC_STATUS, true, m_pModule->GetAppDomain()->GetADToken()); - event.SetJMCFunctionStatus.vmDomainAssembly = m_pModule->GetRuntimeDomainAssembly(); + event.SetJMCFunctionStatus.vmAssembly = m_pModule->GetRuntimeAssembly(); event.SetJMCFunctionStatus.funcMetadataToken = m_MDToken; diff --git a/src/coreclr/debug/di/rspriv.h b/src/coreclr/debug/di/rspriv.h index 4f5acbbdc1c0b6..5b9a3ddeabb611 100644 --- a/src/coreclr/debug/di/rspriv.h +++ b/src/coreclr/debug/di/rspriv.h @@ -1,9 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // rspriv. -// - // // Common include file for right-side of debugger. //***************************************************************************** @@ -2499,13 +2498,13 @@ class CordbAppDomain : public CordbBase, CordbModule * GetModuleFromMetaDataInterface(IUnknown *pIMetaData); // Lookup a module from the cache. Create and to the cache if needed. - CordbModule * LookupOrCreateModule(VMPTR_Module vmModuleToken, VMPTR_DomainAssembly vmDomainAssemblyToken); + CordbModule * LookupOrCreateModule(VMPTR_Module vmModuleToken, VMPTR_Assembly vmAssemblyToken); // Lookup a module from the cache. Create and to the cache if needed. - CordbModule * LookupOrCreateModule(VMPTR_DomainAssembly vmDomainAssemblyToken); + CordbModule * LookupOrCreateModule(VMPTR_Assembly vmAssemblyToken); // Callback from DAC for module enumeration - static void ModuleEnumerationCallback(VMPTR_DomainAssembly vmModule, void * pUserData); + static void ModuleEnumerationCallback(VMPTR_Assembly vmModule, void * pUserData); // Use DAC to add any modules for this assembly. void PrepopulateModules(); @@ -2515,9 +2514,9 @@ class CordbAppDomain : public CordbBase, public: ULONG m_AppDomainId; - CordbAssembly * LookupOrCreateAssembly(VMPTR_DomainAssembly vmDomainAssembly); + CordbAssembly * LookupOrCreateRuntimeAssembly(VMPTR_Assembly vmAssembly); CordbAssembly * LookupOrCreateAssembly(VMPTR_Assembly vmAssembly); - void RemoveAssemblyFromCache(VMPTR_DomainAssembly vmDomainAssembly); + void RemoveAssemblyFromCache(VMPTR_Assembly vmAssembly); CordbSafeHashTable m_breakpoints; @@ -2530,25 +2529,25 @@ class CordbAppDomain : public CordbBase, // them as special cases. CordbSafeHashTable m_sharedtypes; - CordbAssembly * CacheAssembly(VMPTR_DomainAssembly vmDomainAssembly); + CordbAssembly * CacheRuntimeAssembly(VMPTR_Assembly vmAssembly); CordbAssembly * CacheAssembly(VMPTR_Assembly vmAssembly); // Cache of modules in this appdomain. In the VM, modules live in an assembly. // This cache lives on the appdomain because we generally want to do appdomain (or process) // wide lookup. - // This is indexed by VMPTR_DomainAssembly, which has appdomain affinity. + // This is indexed by VMPTR_Assembly, which has appdomain affinity. // This is populated by code:CordbAppDomain::LookupOrCreateModule (which may be invoked // anytime the RS gets hold of a VMPTR), and are removed at the unload event. CordbSafeHashTable m_modules; private: // Cache of assemblies in this appdomain. - // This is indexed by VMPTR_DomainAssembly, which has appdomain affinity. + // This is indexed by VMPTR_Assembly, which has appdomain affinity. // This is populated by code:CordbAppDomain::LookupOrCreateAssembly (which may be invoked // anytime the RS gets hold of a VMPTR), and are removed at the unload event. CordbSafeHashTable m_assemblies; - static void AssemblyEnumerationCallback(VMPTR_DomainAssembly vmDomainAssembly, void * pThis); + static void AssemblyEnumerationCallback(VMPTR_Assembly vmAssembly, void * pThis); void PrepopulateAssembliesOrThrow(); // Use DAC to refresh our name @@ -2587,7 +2586,7 @@ class CordbAssembly : public CordbBase, public ICorDebugAssembly, ICorDebugAssem public: CordbAssembly(CordbAppDomain * pAppDomain, VMPTR_Assembly vmAssembly, - VMPTR_DomainAssembly vmDomainAssembly); + VMPTR_Assembly vmRuntimeAssembly); virtual ~CordbAssembly(); virtual void Neuter(); @@ -2659,15 +2658,15 @@ class CordbAssembly : public CordbBase, public ICorDebugAssembly, ICorDebugAssem #ifdef _DEBUG void DbgAssertAssemblyDeleted(); - static void DbgAssertAssemblyDeletedCallback(VMPTR_DomainAssembly vmDomainAssembly, void * pUserData); + static void DbgAssertAssemblyDeletedCallback(VMPTR_Assembly vmAssembly, void * pUserData); #endif // _DEBUG CordbAppDomain * GetAppDomain() { return m_pAppDomain; } - VMPTR_DomainAssembly GetDomainAssemblyPtr() { return m_vmDomainAssembly; } + VMPTR_Assembly GetAssemblyPtr() { return m_vmRuntimeAssembly; } private: VMPTR_Assembly m_vmAssembly; - VMPTR_DomainAssembly m_vmDomainAssembly; + VMPTR_Assembly m_vmRuntimeAssembly; CordbAppDomain * m_pAppDomain; StringCopyHolder m_strAssemblyFileName; @@ -3456,9 +3455,9 @@ class CordbProcess : // Looks up a previously constructed CordbClass instance without creating. May return NULL if the // CordbClass instance doesn't exist. - CordbClass * LookupClass(ICorDebugAppDomain * pAppDomain, VMPTR_DomainAssembly vmDomainAssembly, mdTypeDef classToken); + CordbClass * LookupClass(ICorDebugAppDomain * pAppDomain, VMPTR_Assembly vmAssembly, mdTypeDef classToken); - CordbModule * LookupOrCreateModule(VMPTR_DomainAssembly vmDomainAssembly); + CordbModule * LookupOrCreateModule(VMPTR_Assembly vmAssembly); #ifdef FEATURE_INTEROP_DEBUGGING CordbUnmanagedThread *GetUnmanagedThread(DWORD dwThreadId) @@ -4145,7 +4144,7 @@ class CordbModule : public CordbBase, public: CordbModule(CordbProcess * process, VMPTR_Module vmModule, - VMPTR_DomainAssembly vmDomainAssembly); + VMPTR_Assembly vmAssembly); virtual ~CordbModule(); virtual void Neuter(); @@ -4352,9 +4351,9 @@ class CordbModule : public CordbBase, const WCHAR * GetNGenImagePath(); - const VMPTR_DomainAssembly GetRuntimeDomainAssembly () + const VMPTR_Assembly GetRuntimeAssembly () { - return m_vmDomainAssembly; + return m_vmAssembly; } const VMPTR_Module GetRuntimeModule() @@ -4389,7 +4388,7 @@ class CordbModule : public CordbBase, // The real handle into the VM for a module. This is appdomain aware. // This is the primary VM counterpart for the CordbModule. - VMPTR_DomainAssembly m_vmDomainAssembly; + VMPTR_Assembly m_vmAssembly; VMPTR_Module m_vmModule; @@ -4804,7 +4803,7 @@ class CordbType : public CordbBase, public ICorDebugType, public ICorDebugType2 void DestNaryType(Instantiation *pInst); CorElementType GetElementType() { return m_elementType; } - VMPTR_DomainAssembly GetDomainAssembly(); + VMPTR_Assembly GetAssembly(); VMPTR_Module GetModule(); // If this is a ptr type, get the CordbType that it points to. diff --git a/src/coreclr/debug/di/rsstackwalk.cpp b/src/coreclr/debug/di/rsstackwalk.cpp index f2bf3777bb6bb3..0b48e18aef98ea 100644 --- a/src/coreclr/debug/di/rsstackwalk.cpp +++ b/src/coreclr/debug/di/rsstackwalk.cpp @@ -639,7 +639,7 @@ HRESULT CordbStackWalk::GetFrameWorker(ICorDebugFrame ** ppFrame) _ASSERTE(pCurrentAppDomain != NULL); // Lookup the module - CordbModule* pModule = pCurrentAppDomain->LookupOrCreateModule(pFuncData->vmDomainAssembly); + CordbModule* pModule = pCurrentAppDomain->LookupOrCreateModule(pFuncData->vmAssembly); PREFIX_ASSUME(pModule != NULL); // Create or look up a CordbNativeCode. There is one for each jitted instance of a method, diff --git a/src/coreclr/debug/di/rsthread.cpp b/src/coreclr/debug/di/rsthread.cpp index 619b37c87ef8b8..d4360d15d78030 100644 --- a/src/coreclr/debug/di/rsthread.cpp +++ b/src/coreclr/debug/di/rsthread.cpp @@ -1633,8 +1633,8 @@ HRESULT CordbThread::SetIP(bool fCanSetIPOnly, ATT_REQUIRE_STOPPED_MAY_FAIL(GetProcess()); - VMPTR_DomainAssembly vmDomainAssembly = pNativeCode->GetModule()->m_vmDomainAssembly; - _ASSERTE(!vmDomainAssembly.IsNull()); + VMPTR_Assembly vmAssembly = pNativeCode->GetModule()->m_vmAssembly; + _ASSERTE(!vmAssembly.IsNull()); // If this thread is stopped due to an exception, never allow SetIP if (HasException()) @@ -1646,7 +1646,7 @@ HRESULT CordbThread::SetIP(bool fCanSetIPOnly, GetProcess()->InitIPCEvent(&event, DB_IPCE_SET_IP, true, GetAppDomain()->GetADToken()); event.SetIP.fCanSetIPOnly = fCanSetIPOnly; event.SetIP.vmThreadToken = m_vmThreadToken; - event.SetIP.vmDomainAssembly = vmDomainAssembly; + event.SetIP.vmAssembly = vmAssembly; event.SetIP.mdMethod = pNativeCode->GetMetadataToken(); event.SetIP.vmMethodDesc = pNativeCode->GetVMNativeCodeMethodDescToken(); event.SetIP.startAddress = pNativeCode->GetAddress(); @@ -1658,7 +1658,7 @@ HRESULT CordbThread::SetIP(bool fCanSetIPOnly, "mod:0x%x MethodDef:0x%x offset:0x%x il?:0x%x\n", GetCurrentThreadId(), VmPtrToCookie(m_vmThreadToken), - VmPtrToCookie(vmDomainAssembly), + VmPtrToCookie(vmAssembly), pNativeCode->GetMetadataToken(), offset, fIsIL)); @@ -5217,7 +5217,7 @@ CordbInternalFrame::CordbInternalFrame(CordbThread * pThread, // Find the module of the function. Note that this module isn't necessarily in the same domain as our frame. // FuncEval frames can point to methods they are going to invoke in another domain. CordbModule * pModule = NULL; - pModule = GetProcess()->LookupOrCreateModule(pData->stubFrame.vmDomainAssembly); + pModule = GetProcess()->LookupOrCreateModule(pData->stubFrame.vmAssembly); _ASSERTE(pModule != NULL); // @@ -9888,7 +9888,7 @@ HRESULT CordbEval::CallParameterizedFunction(ICorDebugFunction *pFunction, event.FuncEval.vmThreadToken = m_thread->m_vmThreadToken; event.FuncEval.funcEvalType = m_evalType; event.FuncEval.funcMetadataToken = m_function->GetMetadataToken(); - event.FuncEval.vmDomainAssembly = m_function->GetModule()->GetRuntimeDomainAssembly(); + event.FuncEval.vmAssembly = m_function->GetModule()->GetRuntimeAssembly(); event.FuncEval.funcEvalKey = hFuncEval.Ptr(); event.FuncEval.argCount = nArgs; event.FuncEval.genericArgsCount = nTypeArgs; @@ -10071,7 +10071,7 @@ HRESULT CordbEval::NewParameterizedObject(ICorDebugFunction * pConstructor, event.FuncEval.vmThreadToken = m_thread->m_vmThreadToken; event.FuncEval.funcEvalType = m_evalType; event.FuncEval.funcMetadataToken = m_function->GetMetadataToken(); - event.FuncEval.vmDomainAssembly = m_function->GetModule()->GetRuntimeDomainAssembly(); + event.FuncEval.vmAssembly = m_function->GetModule()->GetRuntimeAssembly(); event.FuncEval.funcEvalKey = hFuncEval.Ptr(); event.FuncEval.argCount = nArgs; event.FuncEval.genericArgsCount = nTypeArgs; @@ -10172,7 +10172,7 @@ HRESULT CordbEval::NewParameterizedObjectNoConstructor(ICorDebugClass * pClass, event.FuncEval.funcEvalType = m_evalType; event.FuncEval.funcMetadataToken = mdMethodDefNil; event.FuncEval.funcClassMetadataToken = (mdTypeDef)m_class->m_id; - event.FuncEval.vmDomainAssembly = m_class->GetModule()->GetRuntimeDomainAssembly(); + event.FuncEval.vmAssembly = m_class->GetModule()->GetRuntimeAssembly(); event.FuncEval.funcEvalKey = hFuncEval.Ptr(); event.FuncEval.argCount = 0; event.FuncEval.genericArgsCount = nTypeArgs; @@ -10267,7 +10267,7 @@ HRESULT CordbEval::NewStringWithLength(LPCWSTR wszString, UINT iLength) // Note: no function or module here... event.FuncEval.funcMetadataToken = mdMethodDefNil; event.FuncEval.funcClassMetadataToken = mdTypeDefNil; - event.FuncEval.vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + event.FuncEval.vmAssembly = VMPTR_Assembly::NullPtr(); event.FuncEval.argCount = 0; event.FuncEval.genericArgsCount = 0; event.FuncEval.genericArgsNodeCount = 0; @@ -10384,7 +10384,7 @@ HRESULT CordbEval::NewParameterizedArray(ICorDebugType * pElementType, // Note: no function or module here... event.FuncEval.funcMetadataToken = mdMethodDefNil; event.FuncEval.funcClassMetadataToken = mdTypeDefNil; - event.FuncEval.vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + event.FuncEval.vmAssembly = VMPTR_Assembly::NullPtr(); event.FuncEval.argCount = 0; event.FuncEval.genericArgsCount = 1; diff --git a/src/coreclr/debug/di/rstype.cpp b/src/coreclr/debug/di/rstype.cpp index ae686064e96cb1..e1b822a8e0fd57 100644 --- a/src/coreclr/debug/di/rstype.cpp +++ b/src/coreclr/debug/di/rstype.cpp @@ -1,19 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // File: rstype.cpp -// - // // Define implementation of ICorDebugType //***************************************************************************** - #include "stdafx.h" #include "winbase.h" #include "corpriv.h" - //----------------------------------------------------------------------------- // Public method to get the static field from a type. // @@ -1191,7 +1188,7 @@ HRESULT CordbType::TypeDataToType(CordbAppDomain *pAppDomain, DebuggerIPCE_Basic DebuggerIPCE_ExpandedTypeData e; e.elementType = et; e.ClassTypeData.metadataToken = data->metadataToken; - e.ClassTypeData.vmDomainAssembly = data->vmDomainAssembly; + e.ClassTypeData.vmAssembly = data->vmAssembly; e.ClassTypeData.vmModule = data->vmModule; e.ClassTypeData.typeHandle = data->vmTypeHandle; return CordbType::TypeDataToType(pAppDomain, &e, pRes); @@ -1254,7 +1251,7 @@ HRESULT CordbType::TypeDataToType(CordbAppDomain *pAppDomain, DebuggerIPCE_Expan CordbModule * pClassModule = NULL; EX_TRY { - pClassModule = pAppDomain->LookupOrCreateModule(data->ClassTypeData.vmModule, data->ClassTypeData.vmDomainAssembly); + pClassModule = pAppDomain->LookupOrCreateModule(data->ClassTypeData.vmModule, data->ClassTypeData.vmAssembly); } EX_CATCH_HRESULT(hr); if( pClassModule == NULL ) @@ -1611,7 +1608,7 @@ HRESULT CordbType::InitStringOrObjectClass(BOOL fForceInit) // CordbProcess *pProcess = GetProcess(); mdTypeDef metadataToken; - VMPTR_DomainAssembly vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + VMPTR_Assembly vmAssembly = VMPTR_Assembly::NullPtr(); VMPTR_Module vmModule = VMPTR_Module::NullPtr(); { @@ -1620,13 +1617,13 @@ HRESULT CordbType::InitStringOrObjectClass(BOOL fForceInit) m_elementType, &metadataToken, &vmModule, - &vmDomainAssembly); + &vmAssembly); } // // Step 2) Lookup CordbClass based off token + Module. // - CordbModule * pTypeModule = m_appdomain->LookupOrCreateModule(vmModule, vmDomainAssembly); + CordbModule * pTypeModule = m_appdomain->LookupOrCreateModule(vmModule, vmAssembly); _ASSERTE(pTypeModule != NULL); IfFailThrow(pTypeModule->LookupOrCreateClass(metadataToken, &m_pClass)); @@ -1704,7 +1701,7 @@ HRESULT CordbType::InitInstantiationFieldInfo(BOOL fForceInit) // this may be called multiple times. Each call will discard previous values in m_fieldList and reinitialize // the list with updated information RSLockHolder lockHolder(pProcess->GetProcessLock()); - pProcess->GetDAC()->GetInstantiationFieldInfo(m_pClass->GetModule()->GetRuntimeDomainAssembly(), + pProcess->GetDAC()->GetInstantiationFieldInfo(m_pClass->GetModule()->GetRuntimeAssembly(), m_typeHandleExact, typeHandleApprox, &m_fieldList, @@ -1876,23 +1873,23 @@ CordbType::GetUnboxedObjectSize(ULONG32 *pObjectSize) } } -VMPTR_DomainAssembly CordbType::GetDomainAssembly() +VMPTR_Assembly CordbType::GetAssembly() { if (m_pClass != NULL) { CordbModule * pModule = m_pClass->GetModule(); if (pModule) { - return pModule->m_vmDomainAssembly; + return pModule->m_vmAssembly; } else { - return VMPTR_DomainAssembly::NullPtr(); + return VMPTR_Assembly::NullPtr(); } } else { - return VMPTR_DomainAssembly::NullPtr(); + return VMPTR_Assembly::NullPtr(); } } @@ -1937,7 +1934,7 @@ HRESULT CordbType::TypeToBasicTypeData(DebuggerIPCE_BasicTypeData *data) case ELEMENT_TYPE_PTR: data->elementType = m_elementType; data->metadataToken = mdTokenNil; - data->vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + data->vmAssembly = VMPTR_Assembly::NullPtr(); data->vmTypeHandle = m_typeHandleExact; if (data->vmTypeHandle.IsNull()) { @@ -1950,7 +1947,7 @@ HRESULT CordbType::TypeToBasicTypeData(DebuggerIPCE_BasicTypeData *data) _ASSERTE(m_pClass != NULL); data->elementType = m_pClass->IsValueClassNoInit() ? ELEMENT_TYPE_VALUETYPE : ELEMENT_TYPE_CLASS; data->metadataToken = m_pClass->MDToken(); - data->vmDomainAssembly = GetDomainAssembly(); + data->vmAssembly = GetAssembly(); data->vmTypeHandle = m_typeHandleExact; if (m_pClass->HasTypeParams() && data->vmTypeHandle.IsNull()) { @@ -1961,7 +1958,7 @@ HRESULT CordbType::TypeToBasicTypeData(DebuggerIPCE_BasicTypeData *data) // This includes all the "primitive" types, in which CorElementType is a sufficient description. data->elementType = m_elementType; data->metadataToken = mdTokenNil; - data->vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + data->vmAssembly = VMPTR_Assembly::NullPtr(); data->vmTypeHandle = VMPTR_TypeHandle::NullPtr(); break; } @@ -2001,7 +1998,7 @@ void CordbType::TypeToExpandedTypeData(DebuggerIPCE_ExpandedTypeData *data) { data->elementType = m_pClass->IsValueClassNoInit() ? ELEMENT_TYPE_VALUETYPE : ELEMENT_TYPE_CLASS; data->ClassTypeData.metadataToken = m_pClass->GetToken(); - data->ClassTypeData.vmDomainAssembly = GetDomainAssembly(); + data->ClassTypeData.vmAssembly = GetAssembly(); data->ClassTypeData.vmModule = GetModule(); data->ClassTypeData.typeHandle = VMPTR_TypeHandle::NullPtr(); @@ -2339,14 +2336,14 @@ HRESULT CordbType::GetTypeID(COR_TYPEID *pId) { mdTypeDef mdToken; VMPTR_Module vmModule = VMPTR_Module::NullPtr(); - VMPTR_DomainAssembly vmDomainAssembly = VMPTR_DomainAssembly::NullPtr(); + VMPTR_Assembly vmAssembly = VMPTR_Assembly::NullPtr(); // get module and token of the simple type GetProcess()->GetDAC()->GetSimpleType(GetAppDomain()->GetADToken(), et, &mdToken, &vmModule, - &vmDomainAssembly); + &vmAssembly); vmTypeHandle = GetProcess()->GetDAC()->GetTypeHandle(vmModule, mdToken); } diff --git a/src/coreclr/debug/ee/debugger.cpp b/src/coreclr/debug/ee/debugger.cpp index 695f48752c16c3..d0e462afac4efb 100644 --- a/src/coreclr/debug/ee/debugger.cpp +++ b/src/coreclr/debug/ee/debugger.cpp @@ -1351,7 +1351,7 @@ DebuggerEval::DebuggerEval(CONTEXT * pContext, DebuggerIPCE_FuncEvalInfo * pEval // could get unloaded between now and when the funceval actually starts. So we stash an // AppDomain ID which is safe to use after the AD is unloaded. It's only safe to // use the DebuggerModule* after we've verified the ADID is still valid (i.e. by entering that domain). - m_debuggerModule = g_pDebugger->LookupOrCreateModule(pEvalInfo->vmDomainAssembly); + m_debuggerModule = g_pDebugger->LookupOrCreateModule(pEvalInfo->vmAssembly); m_funcEvalKey = pEvalInfo->funcEvalKey; m_argCount = pEvalInfo->argCount; m_targetCodeAddr = (TADDR)NULL; @@ -5119,10 +5119,10 @@ void Debugger::SendSyncCompleteIPCEvent(bool isEESuspendedForGC) } // -// Lookup or create a DebuggerModule for the given pDomainAssembly. +// Lookup or create a DebuggerModule for the given pAssembly. // // Arguments: -// pDomainAssembly - non-null domain file. +// pAssembly - non-null root file. // // Returns: // DebuggerModule instance for the given domain file. May be lazily created. @@ -5131,36 +5131,36 @@ void Debugger::SendSyncCompleteIPCEvent(bool isEESuspendedForGC) // @dbgtodo JMC - this should go away when we get rid of DebuggerModule. // -DebuggerModule * Debugger::LookupOrCreateModule(DomainAssembly * pDomainAssembly) +DebuggerModule * Debugger::LookupOrCreateModule(Assembly * pAssembly) { - _ASSERTE(pDomainAssembly != NULL); - LOG((LF_CORDB, LL_INFO1000, "D::LOCM df=%p\n", pDomainAssembly)); - DebuggerModule * pDModule = LookupOrCreateModule(pDomainAssembly->GetAssembly()->GetModule()); - LOG((LF_CORDB, LL_INFO1000, "D::LOCM m=%p ad=%p -> dm=%p\n", pDomainAssembly->GetAssembly()->GetModule(), AppDomain::GetCurrentDomain(), pDModule)); + _ASSERTE(pAssembly != NULL); + LOG((LF_CORDB, LL_INFO1000, "D::LOCM df=%p\n", pAssembly)); + DebuggerModule * pDModule = LookupOrCreateModule(pAssembly->GetModule()); + LOG((LF_CORDB, LL_INFO1000, "D::LOCM m=%p ad=%p -> dm=%p\n", pAssembly->GetModule(), AppDomain::GetCurrentDomain(), pDModule)); _ASSERTE(pDModule != NULL); - _ASSERTE(pDModule->GetDomainAssembly() == pDomainAssembly); + _ASSERTE(pDModule->GetAssembly() == pAssembly); return pDModule; } -// Overloaded Wrapper around for VMPTR_DomainAssembly-->DomainAssembly* +// Overloaded Wrapper around for VMPTR_Assembly-->Assembly* // // Arguments: -// vmDomainAssembly - VMPTR cookie for a domain file. This can be NullPtr(). +// vmAssembly - VMPTR cookie for a domain file. This can be NullPtr(). // // Returns: // Debugger Module instance for the given domain file. May be lazily created. // // Notes: // VMPTR comes from IPC events -DebuggerModule * Debugger::LookupOrCreateModule(VMPTR_DomainAssembly vmDomainAssembly) +DebuggerModule * Debugger::LookupOrCreateModule(VMPTR_Assembly vmAssembly) { - DomainAssembly * pDomainAssembly = vmDomainAssembly.GetRawPtr(); - if (pDomainAssembly == NULL) + Assembly * pAssembly = vmAssembly.GetRawPtr(); + if (pAssembly == NULL) { return NULL; } - return LookupOrCreateModule(pDomainAssembly); + return LookupOrCreateModule(pAssembly); } // Lookup or create a DebuggerModule for the given (Module, AppDomain) pair. @@ -5203,28 +5203,28 @@ DebuggerModule* Debugger::LookupOrCreateModule(Module* pModule) HRESULT hr = S_OK; EX_TRY { - DomainAssembly * pDomainAssembly = pModule->GetDomainAssembly(); - SIMPLIFYING_ASSUMPTION(pDomainAssembly != NULL); - dmod = AddDebuggerModule(pDomainAssembly); // throws + Assembly * pAssembly = pModule->GetAssembly(); + SIMPLIFYING_ASSUMPTION(pAssembly != NULL); + dmod = AddDebuggerModule(pAssembly); // throws } EX_CATCH_HRESULT(hr); SIMPLIFYING_ASSUMPTION(dmod != NULL); // may not be true in OOM cases; but LS doesn't handle OOM. } LOG((LF_CORDB, LL_INFO1000, "D::LOCM m=%p -> dm=%p(Mod=%p, DomFile=%p)\n", - pModule, dmod, dmod->GetRuntimeModule(), dmod->GetDomainAssembly())); + pModule, dmod, dmod->GetRuntimeModule(), dmod->GetAssembly())); return dmod; } // Create a new DebuggerModule object // // Arguments: -// pDomainAssembly- runtime domain file to create debugger module object around +// pAssembly- runtime domain file to create debugger module object around // // Returns: // New instnace of a DebuggerModule. Throws on failure. // -DebuggerModule* Debugger::AddDebuggerModule(DomainAssembly * pDomainAssembly) +DebuggerModule* Debugger::AddDebuggerModule(Assembly * pAssembly) { CONTRACTL { @@ -5233,15 +5233,15 @@ DebuggerModule* Debugger::AddDebuggerModule(DomainAssembly * pDomainAssembly) } CONTRACTL_END; - LOG((LF_CORDB, LL_INFO1000, "D::ADM df=0x%x\n", pDomainAssembly)); + LOG((LF_CORDB, LL_INFO1000, "D::ADM df=0x%x\n", pAssembly)); DebuggerDataLockHolder chInfo(this); - Module * pRuntimeModule = pDomainAssembly->GetAssembly()->GetModule(); + Module * pRuntimeModule = pAssembly->GetModule(); HRESULT hr = CheckInitModuleTable(); IfFailThrow(hr); - DebuggerModule* pModule = new (interopsafe) DebuggerModule(pRuntimeModule, pDomainAssembly); + DebuggerModule* pModule = new (interopsafe) DebuggerModule(pRuntimeModule, pAssembly); _ASSERTE(pModule != NULL); // throws on oom TRACE_ALLOC(pModule); @@ -5250,7 +5250,7 @@ DebuggerModule* Debugger::AddDebuggerModule(DomainAssembly * pDomainAssembly) // @dbgtodo inspection/exceptions - this may leak module in OOM case. LS is not OOM resilient; and we // expect to get rid of DebuggerModule anyways. - LOG((LF_CORDB, LL_INFO1000, "D::ADM df=0x%x -> dm=0x%x\n", pDomainAssembly, pModule)); + LOG((LF_CORDB, LL_INFO1000, "D::ADM df=0x%x -> dm=0x%x\n", pAssembly, pModule)); return pModule; } @@ -6149,7 +6149,7 @@ void Debugger::LockAndSendEnCRemapEvent(DebuggerJitInfo * dji, SIZE_T currentIP, Module *pRuntimeModule = pMD->GetModule(); DebuggerModule * pDModule = LookupOrCreateModule(pRuntimeModule); - ipce->EnCRemap.vmDomainAssembly.SetRawPtr((pDModule ? pDModule->GetDomainAssembly() : NULL)); + ipce->EnCRemap.vmAssembly.SetRawPtr((pDModule ? pDModule->GetAssembly() : NULL)); LOG((LF_CORDB, LL_INFO10000, "D::LASEnCRE: %s::%s dmod:%p\n", pMD->m_pszDebugClassName, pMD->m_pszDebugMethodName, pDModule)); @@ -6194,7 +6194,7 @@ void Debugger::LockAndSendEnCRemapCompleteEvent(MethodDesc *pMD) Module *pRuntimeModule = pMD->GetModule(); DebuggerModule * pDModule = LookupOrCreateModule(pRuntimeModule); - ipce->EnCRemapComplete.vmDomainAssembly.SetRawPtr((pDModule ? pDModule->GetDomainAssembly() : NULL)); + ipce->EnCRemapComplete.vmAssembly.SetRawPtr((pDModule ? pDModule->GetAssembly() : NULL)); LOG((LF_CORDB, LL_INFO10000, "D::LASEnCRE: %s::%s dmod:%p, methodDef:0x%08x \n", pMD->m_pszDebugClassName, pMD->m_pszDebugMethodName, @@ -6257,7 +6257,7 @@ void Debugger::SendEnCUpdateEvent(DebuggerIPCEventType eventType, _ASSERTE(pModule); DebuggerModule * pDModule = LookupOrCreateModule(pModule); - event->EnCUpdate.vmDomainAssembly.SetRawPtr((pDModule ? pDModule->GetDomainAssembly() : NULL)); + event->EnCUpdate.vmAssembly.SetRawPtr((pDModule ? pDModule->GetAssembly() : NULL)); m_pRCThread->SendIPCEvent(); @@ -8032,7 +8032,7 @@ BOOL Debugger::ShouldSendCatchHandlerFound(Thread* pThread) } } -BOOL Debugger::ShouldSendCustomNotification(DomainAssembly *pAssembly, mdTypeDef typeDef) +BOOL Debugger::ShouldSendCustomNotification(Assembly *pAssembly, mdTypeDef typeDef) { CONTRACTL { @@ -8042,7 +8042,7 @@ BOOL Debugger::ShouldSendCustomNotification(DomainAssembly *pAssembly, mdTypeDef } CONTRACTL_END; - Module *pModule = pAssembly->GetAssembly()->GetModule(); + Module *pModule = pAssembly->GetModule(); TypeInModule tim(pModule, typeDef); return !(m_pCustomNotificationTable->Lookup(tim).IsNull()); } @@ -9259,7 +9259,7 @@ void Debugger::SendCreateAppDomainEvent(AppDomain * pRuntimeAppDomain) // // LoadAssembly is called when a new Assembly gets loaded. // -void Debugger::LoadAssembly(DomainAssembly * pDomainAssembly) +void Debugger::LoadAssembly(Assembly * pAssembly) { CONTRACTL { @@ -9272,7 +9272,7 @@ void Debugger::LoadAssembly(DomainAssembly * pDomainAssembly) return; LOG((LF_CORDB, LL_INFO100, "D::LA: Load Assembly Asy:0x%p AD:0x%p which:%s\n", - pDomainAssembly, AppDomain::GetCurrentDomain(), pDomainAssembly->GetAssembly()->GetDebugName() )); + pAssembly, AppDomain::GetCurrentDomain(), pAssembly->GetDebugName() )); if (!CORDebuggerAttached()) { @@ -9292,7 +9292,7 @@ void Debugger::LoadAssembly(DomainAssembly * pDomainAssembly) pThread, AppDomain::GetCurrentDomain()); - ipce->AssemblyData.vmDomainAssembly.SetRawPtr(pDomainAssembly); + ipce->AssemblyData.vmAssembly.SetRawPtr(pAssembly); m_pRCThread->SendIPCEvent(); } @@ -9315,7 +9315,7 @@ void Debugger::LoadAssembly(DomainAssembly * pDomainAssembly) // // UnloadAssembly is called when a Runtime thread unloads an assembly. // -void Debugger::UnloadAssembly(DomainAssembly * pDomainAssembly) +void Debugger::UnloadAssembly(Assembly * pAssembly) { CONTRACTL { @@ -9328,7 +9328,7 @@ void Debugger::UnloadAssembly(DomainAssembly * pDomainAssembly) return; LOG((LF_CORDB, LL_INFO100, "D::UA: Unload Assembly Asy:0x%p AD:0x%p which:%s\n", - pDomainAssembly, AppDomain::GetCurrentDomain(), pDomainAssembly->GetAssembly()->GetDebugName() )); + pAssembly, AppDomain::GetCurrentDomain(), pAssembly->GetDebugName() )); Thread *thread = g_pEEInterface->GetThread(); // Note that the debugger lock is reentrant, so we may or may not hold it already. @@ -9341,7 +9341,7 @@ void Debugger::UnloadAssembly(DomainAssembly * pDomainAssembly) DB_IPCE_UNLOAD_ASSEMBLY, thread, AppDomain::GetCurrentDomain()); - ipce->AssemblyData.vmDomainAssembly.SetRawPtr(pDomainAssembly); + ipce->AssemblyData.vmAssembly.SetRawPtr(pAssembly); SendSimpleIPCEventAndBlock(); @@ -9358,7 +9358,7 @@ void Debugger::LoadModule(Module* pRuntimeModule, LPCWSTR pszModuleName, // module file name. DWORD dwModuleName, // length of pszModuleName in chars, not including null. Assembly *pAssembly, - DomainAssembly * pDomainAssembly, + Assembly * pRuntimeAssembly, BOOL fAttaching) { @@ -9389,7 +9389,7 @@ void Debugger::LoadModule(Module* pRuntimeModule, // The RS has logic to ignore duplicate ModuleLoad events. We have to send what could possibly be a dup, though, // due to some really nasty issues with getting proper assembly and module load events from the loader when dealing // with shared assemblies. - module = LookupOrCreateModule(pDomainAssembly); + module = LookupOrCreateModule(pRuntimeAssembly); _ASSERTE(module != NULL); @@ -9399,17 +9399,17 @@ void Debugger::LoadModule(Module* pRuntimeModule, module->SetCanChangeJitFlags(true); - // @dbgtodo inspection - Check whether the DomainAssembly we get is consistent with the Module and AppDomain we get. + // @dbgtodo inspection - Check whether the Assembly we get is consistent with the Module and AppDomain we get. // We should simply things when we actually get rid of DebuggerModule, possibly by just passing the - // DomainAssembly around. - _ASSERTE(module->GetDomainAssembly() == pDomainAssembly); - _ASSERTE(module->GetRuntimeModule() == pDomainAssembly->GetAssembly()->GetModule()); + // assembly around. + _ASSERTE(module->GetAssembly() == pRuntimeAssembly); + _ASSERTE(module->GetRuntimeModule() == pRuntimeAssembly->GetModule()); // Send a load module event to the Right Side. ipce = m_pRCThread->GetIPCEventSendBuffer(); InitIPCEvent(ipce,DB_IPCE_LOAD_MODULE, pThread, AppDomain::GetCurrentDomain()); - ipce->LoadModuleData.vmDomainAssembly.SetRawPtr(pDomainAssembly); + ipce->LoadModuleData.vmAssembly.SetRawPtr(pRuntimeAssembly); m_pRCThread->SendIPCEvent(); @@ -9476,7 +9476,7 @@ void Debugger::SendRawUpdateModuleSymsEvent(Module *pRuntimeModule) g_pEEInterface->GetThread(), AppDomain::GetCurrentDomain()); - ipce->UpdateModuleSymsData.vmDomainAssembly.SetRawPtr((module ? module->GetDomainAssembly() : NULL)); + ipce->UpdateModuleSymsData.vmAssembly.SetRawPtr((module ? module->GetAssembly() : NULL)); m_pRCThread->SendIPCEvent(); } @@ -9570,13 +9570,13 @@ void Debugger::UnloadModule(Module* pRuntimeModule) STRESS_LOG6(LF_CORDB, LL_INFO10000, "D::UM: Unloading RTMod:%#08x (DomFile: %#08x, IsISStream:%#08x); DMod:%#08x(RTMod:%#08x DomFile: %#08x)\n", - pRuntimeModule, pRuntimeModule->GetDomainAssembly(), false, - module, module->GetRuntimeModule(), module->GetDomainAssembly()); + pRuntimeModule, pRuntimeModule->GetAssembly(), false, + module, module->GetRuntimeModule(), module->GetAssembly()); // Send the unload module event to the Right Side. DebuggerIPCEvent* ipce = m_pRCThread->GetIPCEventSendBuffer(); InitIPCEvent(ipce, DB_IPCE_UNLOAD_MODULE, thread, AppDomain::GetCurrentDomain()); - ipce->UnloadModuleData.vmDomainAssembly.SetRawPtr((module ? module->GetDomainAssembly() : NULL)); + ipce->UnloadModuleData.vmAssembly.SetRawPtr((module ? module->GetAssembly() : NULL)); ipce->UnloadModuleData.debuggerAssemblyToken.Set(pRuntimeModule->GetClassLoader()->GetAssembly()); m_pRCThread->SendIPCEvent(); @@ -9747,7 +9747,7 @@ void Debugger::SendClassLoadUnloadEvent (mdTypeDef classMetadataToken, InitIPCEvent(pEvent, DB_IPCE_LOAD_CLASS, g_pEEInterface->GetThread(), AppDomain::GetCurrentDomain()); pEvent->LoadClass.classMetadataToken = classMetadataToken; - pEvent->LoadClass.vmDomainAssembly.SetRawPtr((pClassDebuggerModule ? pClassDebuggerModule->GetDomainAssembly() : NULL)); + pEvent->LoadClass.vmAssembly.SetRawPtr((pClassDebuggerModule ? pClassDebuggerModule->GetAssembly() : NULL)); pEvent->LoadClass.classDebuggerAssemblyToken.Set(pAssembly); @@ -9759,7 +9759,7 @@ void Debugger::SendClassLoadUnloadEvent (mdTypeDef classMetadataToken, InitIPCEvent(pEvent, DB_IPCE_UNLOAD_CLASS, g_pEEInterface->GetThread(), AppDomain::GetCurrentDomain()); pEvent->UnloadClass.classMetadataToken = classMetadataToken; - pEvent->UnloadClass.vmDomainAssembly.SetRawPtr((pClassDebuggerModule ? pClassDebuggerModule->GetDomainAssembly() : NULL)); + pEvent->UnloadClass.vmAssembly.SetRawPtr((pClassDebuggerModule ? pClassDebuggerModule->GetAssembly() : NULL)); pEvent->UnloadClass.classDebuggerAssemblyToken.Set(pAssembly); } @@ -9810,10 +9810,10 @@ BOOL Debugger::SendSystemClassLoadUnloadEvent(mdTypeDef classMetadataToken, // Only notify for app domains where the module has been fully loaded already // We used to make a different check here domain->ContainsAssembly() but that - // triggers too early in the loading process. FindDomainAssembly will not become + // triggers too early in the loading process. FindAssembly will not become // non-NULL until the module is fully loaded into the domain which is what we // want. - if (classModule->GetDomainAssembly() != NULL ) + if (classModule->GetAssembly() != NULL ) { // Find the Left Side module that this class belongs in. DebuggerModule* pModule = LookupOrCreateModule(classModule); @@ -10446,7 +10446,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) _ASSERTE(hr == S_OK); DebuggerBreakpoint * pDebuggerBP = NULL; - DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->BreakpointData.vmDomainAssembly); + DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->BreakpointData.vmAssembly); Module * pModule = pDebuggerModule->GetRuntimeModule(); DebuggerMethodInfo * pDMI = GetOrCreateMethodInfo(pModule, pEvent->BreakpointData.funcMetadataToken); MethodDesc * pMethodDesc = pEvent->BreakpointData.nativeCodeMethodDescToken.UnWrap(); @@ -10764,7 +10764,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) { LOG((LF_ENC, LL_INFO100, "D::HIPCE: DB_IPCE_APPLY_CHANGES 1\n")); - DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->ApplyChanges.vmDomainAssembly); + DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->ApplyChanges.vmAssembly); // // @todo handle error. // @@ -10781,7 +10781,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) case DB_IPCE_SET_CLASS_LOAD_FLAG: { - DebuggerModule *pDebuggerModule = LookupOrCreateModule(pEvent->SetClassLoad.vmDomainAssembly); + DebuggerModule *pDebuggerModule = LookupOrCreateModule(pEvent->SetClassLoad.vmAssembly); _ASSERTE(pDebuggerModule != NULL); @@ -10831,7 +10831,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) // unexpected in an OOM situation. Quickly just sanity check them. // Thread * pThread = pEvent->SetIP.vmThreadToken.GetRawPtr(); - Module * pModule = pEvent->SetIP.vmDomainAssembly.GetRawPtr()->GetAssembly()->GetModule(); + Module * pModule = pEvent->SetIP.vmAssembly.GetRawPtr()->GetModule(); // Get the DJI for this function DebuggerMethodInfo * pDMI = GetOrCreateMethodInfo(pModule, pEvent->SetIP.mdMethod); @@ -11163,7 +11163,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) case DB_IPCE_SET_METHOD_JMC_STATUS: { // Get the info out of the event - DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->SetJMCFunctionStatus.vmDomainAssembly); + DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->SetJMCFunctionStatus.vmAssembly); Module * pModule = pDebuggerModule->GetRuntimeModule(); bool fStatus = (pEvent->SetJMCFunctionStatus.dwStatus != 0); @@ -11211,7 +11211,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) case DB_IPCE_GET_METHOD_JMC_STATUS: { // Get the method - DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->SetJMCFunctionStatus.vmDomainAssembly); + DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->SetJMCFunctionStatus.vmAssembly); Module * pModule = pDebuggerModule->GetRuntimeModule(); @@ -11245,7 +11245,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) case DB_IPCE_SET_MODULE_JMC_STATUS: { // Get data out of event - DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->SetJMCFunctionStatus.vmDomainAssembly); + DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->SetJMCFunctionStatus.vmAssembly); bool fStatus = (pEvent->SetJMCFunctionStatus.dwStatus != 0); @@ -11746,7 +11746,7 @@ void Debugger::TypeHandleToBasicTypeInfo(AppDomain *pAppDomain, TypeHandle th, D case ELEMENT_TYPE_BYREF: res->vmTypeHandle = WrapTypeHandle(th); res->metadataToken = mdTokenNil; - res->vmDomainAssembly.SetRawPtr(NULL); + res->vmAssembly.SetRawPtr(NULL); break; case ELEMENT_TYPE_CLASS: @@ -11756,14 +11756,14 @@ void Debugger::TypeHandleToBasicTypeInfo(AppDomain *pAppDomain, TypeHandle th, D // only set if instantiated res->metadataToken = th.GetCl(); DebuggerModule * pDModule = LookupOrCreateModule(th.GetModule()); - res->vmDomainAssembly.SetRawPtr((pDModule ? pDModule->GetDomainAssembly() : NULL)); + res->vmAssembly.SetRawPtr((pDModule ? pDModule->GetAssembly() : NULL)); break; } default: res->vmTypeHandle = VMPTR_TypeHandle::NullPtr(); res->metadataToken = mdTokenNil; - res->vmDomainAssembly.SetRawPtr(NULL); + res->vmAssembly.SetRawPtr(NULL); break; } return; @@ -11835,8 +11835,8 @@ void Debugger::TypeHandleToExpandedTypeInfo(AreValueTypesBoxed boxed, res->ClassTypeData.typeHandle = th.HasInstantiation() ? WrapTypeHandle(th) : VMPTR_TypeHandle::NullPtr(); // only set if instantiated res->ClassTypeData.metadataToken = th.GetCl(); DebuggerModule * pModule = LookupOrCreateModule(th.GetModule()); - res->ClassTypeData.vmDomainAssembly.SetRawPtr((pModule ? pModule->GetDomainAssembly() : NULL)); - _ASSERTE(!res->ClassTypeData.vmDomainAssembly.IsNull()); + res->ClassTypeData.vmAssembly.SetRawPtr((pModule ? pModule->GetAssembly() : NULL)); + _ASSERTE(!res->ClassTypeData.vmAssembly.IsNull()); break; } @@ -11896,7 +11896,7 @@ HRESULT Debugger::BasicTypeInfoToTypeHandle(DebuggerIPCE_BasicTypeData *data, Ty } else { - DebuggerModule *pDebuggerModule = g_pDebugger->LookupOrCreateModule(data->vmDomainAssembly); + DebuggerModule *pDebuggerModule = g_pDebugger->LookupOrCreateModule(data->vmAssembly); th = g_pEEInterface->FindLoadedClass(pDebuggerModule->GetRuntimeModule(), data->metadataToken); if (th.IsNull()) @@ -11998,7 +11998,7 @@ TypeHandle Debugger::TypeDataWalk::ReadTypeHandle() case ELEMENT_TYPE_CLASS: case ELEMENT_TYPE_VALUETYPE: { - DebuggerModule *pDebuggerModule = g_pDebugger->LookupOrCreateModule(data->data.ClassTypeData.vmDomainAssembly); + DebuggerModule *pDebuggerModule = g_pDebugger->LookupOrCreateModule(data->data.ClassTypeData.vmAssembly); th = ReadInstantiation(pDebuggerModule->GetRuntimeModule(), data->data.ClassTypeData.metadataToken, data->numTypeArgs); break; } @@ -14536,7 +14536,7 @@ void Debugger::SendLogSwitchSetting(int iLevel, // pDomain - domain file for the domain in which the notification occurred // classToken - metadata token for the type of the notification object void Debugger::SendCustomDebuggerNotification(Thread * pThread, - DomainAssembly * pDomain, + Assembly * pAssembly, mdTypeDef classToken) { CONTRACTL @@ -14559,7 +14559,7 @@ void Debugger::SendCustomDebuggerNotification(Thread * pThread, Thread *curThread = g_pEEInterface->GetThread(); SENDIPCEVENT_BEGIN(this, curThread); - if (CORDebuggerAttached() && ShouldSendCustomNotification(pDomain, classToken)) + if (CORDebuggerAttached() && ShouldSendCustomNotification(pAssembly, classToken)) { DebuggerIPCEvent* ipce = m_pRCThread->GetIPCEventSendBuffer(); InitIPCEvent(ipce, @@ -14567,10 +14567,10 @@ void Debugger::SendCustomDebuggerNotification(Thread * pThread, curThread, AppDomain::GetCurrentDomain()); - VMPTR_DomainAssembly vmDomainAssembly = VMPTR_DomainAssembly::MakePtr(pDomain); + VMPTR_Assembly vmAssembly = VMPTR_Assembly::MakePtr(pAssembly); ipce->CustomNotification.classToken = classToken; - ipce->CustomNotification.vmDomainAssembly = vmDomainAssembly; + ipce->CustomNotification.vmAssembly = vmAssembly; m_pRCThread->SendIPCEvent(); @@ -14586,7 +14586,6 @@ void Debugger::SendCustomDebuggerNotification(Thread * pThread, SENDIPCEVENT_END; } - //----------------------------------------------------------------------------- // // Add the AppDomain to the list stored in the IPC block. It adds the id and diff --git a/src/coreclr/debug/ee/debugger.h b/src/coreclr/debug/ee/debugger.h index d9513cac8f5abc..8ff7543b99a723 100644 --- a/src/coreclr/debug/ee/debugger.h +++ b/src/coreclr/debug/ee/debugger.h @@ -451,7 +451,7 @@ typedef DPTR(class DebuggerModule) PTR_DebuggerModule; class DebuggerModule { public: - DebuggerModule(Module * pRuntimeModule, DomainAssembly * pDomainAssembly); + DebuggerModule(Module * pRuntimeModule, Assembly * pAssembly); // Do we have any optimized code in the module? // JMC-probes aren't emitted in optimized code, @@ -467,10 +467,10 @@ class DebuggerModule Module * GetRuntimeModule(); - DomainAssembly * GetDomainAssembly() + Assembly * GetAssembly() { LIMITED_METHOD_DAC_CONTRACT; - return m_pRuntimeDomainAssembly; + return m_pAssembly; } void SetCanChangeJitFlags(bool fCanChangeJitFlags); @@ -479,7 +479,7 @@ class DebuggerModule BOOL m_enableClassLoadCallbacks; PTR_Module m_pRuntimeModule; - PTR_DomainAssembly m_pRuntimeDomainAssembly; + PTR_Assembly m_pAssembly; bool m_fHasOptimizedCode; @@ -1983,9 +1983,9 @@ class Debugger : public DebugInterface LPCWSTR pszModuleName, DWORD dwModuleName, Assembly *pAssembly, - DomainAssembly * pDomainAssembly, + Assembly * pRuntimeAssembly, BOOL fAttaching); - DebuggerModule * AddDebuggerModule(DomainAssembly * pDomainAssembly); + DebuggerModule * AddDebuggerModule(Assembly * pAssembly); void UnloadModule(Module* pRuntimeModule); void DestructModule(Module *pModule); @@ -2012,7 +2012,7 @@ class Debugger : public DebugInterface BOOL ShouldSendCatchHandlerFound(Thread* pThread); - BOOL ShouldSendCustomNotification(DomainAssembly *pAssembly, mdTypeDef typeDef); + BOOL ShouldSendCustomNotification(Assembly *pAssembly, mdTypeDef typeDef); void SendCatchHandlerFound(Thread *pThread, FramePointer fp, @@ -2156,8 +2156,8 @@ class Debugger : public DebugInterface bool HandleIPCEvent(DebuggerIPCEvent* event); - DebuggerModule * LookupOrCreateModule(VMPTR_DomainAssembly vmDomainAssembly); - DebuggerModule * LookupOrCreateModule(DomainAssembly * pDomainAssembly); + DebuggerModule * LookupOrCreateModule(VMPTR_Assembly vmAssembly); + DebuggerModule * LookupOrCreateModule(Assembly * pAssembly); DebuggerModule * LookupOrCreateModule(Module * pModule); HRESULT GetAndSendInterceptCommand(DebuggerIPCEvent *event); @@ -2530,7 +2530,7 @@ class Debugger : public DebugInterface } // send a custom debugger notification to the RS - void SendCustomDebuggerNotification(Thread * pThread, DomainAssembly * pDomain, mdTypeDef classToken); + void SendCustomDebuggerNotification(Thread * pThread, Assembly * pAssembly, mdTypeDef classToken); // Send an MDA notification. This ultimately translates to an ICorDebugMDA object on the Right-Side. void SendMDANotification( @@ -2629,10 +2629,10 @@ class Debugger : public DebugInterface void SendCreateAppDomainEvent(AppDomain * pAppDomain); // Notify the debugger that an assembly has been loaded - void LoadAssembly(DomainAssembly * pDomainAssembly); + void LoadAssembly(Assembly * pAssembly); // Notify the debugger that an assembly has been unloaded - void UnloadAssembly(DomainAssembly * pDomainAssembly); + void UnloadAssembly(Assembly * pAssembly); HRESULT FuncEvalSetup(DebuggerIPCE_FuncEvalInfo *pEvalInfo, BYTE **argDataArea, DebuggerEval **debuggerEvalKey); HRESULT FuncEvalAbort(DebuggerEval *debuggerEvalKey); diff --git a/src/coreclr/debug/ee/debugger.inl b/src/coreclr/debug/ee/debugger.inl index 7d1ad99c518704..88132636343ecc 100644 --- a/src/coreclr/debug/ee/debugger.inl +++ b/src/coreclr/debug/ee/debugger.inl @@ -52,13 +52,13 @@ inline DebuggerModuleTable * Debugger::GetModuleTable() // @dbgtodo inspection - get rid of this entire class as we move things out-of-proc. //----------------------------------------------------------------------------- inline DebuggerModule::DebuggerModule(Module * pRuntimeModule, - DomainAssembly * pDomainAssembly) : + Assembly * pAssembly) : m_enableClassLoadCallbacks(FALSE), m_pRuntimeModule(pRuntimeModule), - m_pRuntimeDomainAssembly(pDomainAssembly) + m_pAssembly(pAssembly) { LOG((LF_CORDB,LL_INFO10000, "DM::DM this:0x%x Module:0x%x DF:0x%x\n", - this, pRuntimeModule, pDomainAssembly)); + this, pRuntimeModule, pAssembly)); // Do we have any optimized code? DWORD dwDebugBits = pRuntimeModule->GetDebuggerInfoBits(); diff --git a/src/coreclr/debug/ee/debuggermodule.cpp b/src/coreclr/debug/ee/debuggermodule.cpp index 688174b806f6fe..11b4cc59c70b9e 100644 --- a/src/coreclr/debug/ee/debuggermodule.cpp +++ b/src/coreclr/debug/ee/debuggermodule.cpp @@ -141,7 +141,7 @@ void DebuggerModuleTable::RemoveModule(Module* pModule) if (pRuntimeModule == pModule) { LOG((LF_CORDB, LL_INFO1000, "DMT::RM Removing DebuggerMod:0x%x - Module:0x%x DF:0x%x\n", - pDM, pModule, pDM->GetDomainAssembly())); + pDM, pModule, pDM->GetAssembly())); TRACE_FREE(pDM); DeleteInteropSafe(pDM); Delete(HASH(pRuntimeModule), (HASHENTRY *) pDME); diff --git a/src/coreclr/debug/inc/dacdbiinterface.h b/src/coreclr/debug/inc/dacdbiinterface.h index 5b809d9795f0d1..dba2f119119a42 100644 --- a/src/coreclr/debug/inc/dacdbiinterface.h +++ b/src/coreclr/debug/inc/dacdbiinterface.h @@ -310,13 +310,13 @@ class IDacDbiInterface VMPTR_OBJECTHANDLE GetAppDomainObject(VMPTR_AppDomain vmAppDomain) = 0; virtual - void GetAssemblyFromDomainAssembly(VMPTR_DomainAssembly vmDomainAssembly, OUT VMPTR_Assembly * vmAssembly) = 0; + void GetAssemblyFromRootAssembly(VMPTR_Assembly vmRootAssembly, OUT VMPTR_Assembly * vmAssembly) = 0; // // Determines whether the runtime security system has assigned full-trust to this assembly. // // Arguments: - // vmDomainAssembly - VM pointer to the assembly in question. + // vmAssembly - VM pointer to the assembly in question. // // Return Value: // Returns trust status for the assembly. @@ -327,7 +327,7 @@ class IDacDbiInterface // an assembly loaded without full-trust should have no way of causing this API to return true. // virtual - BOOL IsAssemblyFullyTrusted(VMPTR_DomainAssembly vmDomainAssembly) = 0; + BOOL IsAssemblyFullyTrusted(VMPTR_Assembly vmAssembly) = 0; // @@ -588,27 +588,27 @@ class IDacDbiInterface // pData - required out parameter which will be filled out with module properties // // Notes: - // See definition of DomainAssemblyInfo for more details about what properties + // See definition of AssemblyInfo for more details about what properties // this gives back. virtual void GetModuleData(VMPTR_Module vmModule, OUT ModuleInfo * pData) = 0; // - // Get properties for a DomainAssembly + // Get properties for an assembly // // Arguments: - // vmDomainAssembly - vm handle to a DomainAssembly + // vmAssembly - vm handle to an assembly // pData - required out parameter which will be filled out with module properties // // Notes: - // See definition of DomainAssemblyInfo for more details about what properties + // See definition of AssemblyInfo for more details about what properties // this gives back. virtual - void GetDomainAssemblyData(VMPTR_DomainAssembly vmDomainAssembly, OUT DomainAssemblyInfo * pData) = 0; + void GetRuntimeAssemblyData(VMPTR_Assembly vmAssembly, OUT AssemblyInfo * pData) = 0; virtual - void GetModuleForDomainAssembly(VMPTR_DomainAssembly vmDomainAssembly, OUT VMPTR_Module * pModule) = 0; + void GetModuleForRuntimeAssembly(VMPTR_Assembly vmAssembly, OUT VMPTR_Module * pModule) = 0; //......................................................................... // These methods were the methods that DBI was calling from IXClrData in V2. @@ -672,7 +672,7 @@ class IDacDbiInterface // Get the values of the JIT Optimization and EnC flags. // // Arguments: - // vmDomainAssembly - (input) VM DomainAssembly (module) for which we are retrieving flags + // vmAssembly - (input) VM Assembly (module) for which we are retrieving flags // pfAllowJITOpts - (mandatory output) true iff this is not compiled for debug, // i.e., without optimization // pfEnableEnc - (mandatory output) true iff this module has EnC enabled @@ -687,7 +687,7 @@ class IDacDbiInterface virtual void GetCompilerFlags( - VMPTR_DomainAssembly vmDomainAssembly, + VMPTR_Assembly vmAssembly, OUT BOOL * pfAllowJITOpts, OUT BOOL * pfEnableEnC) = 0; @@ -695,7 +695,7 @@ class IDacDbiInterface // Set the values of the JIT optimization and EnC flags. // // Arguments: - // vmDomainAssembly - (input) VM DomainAssembly (module) for which we are retrieving flags + // vmAssembly - (input) VM Assembly (module) for which we are retrieving flags // pfAllowJITOpts - (input) true iff this should not be compiled for debug, // i.e., without optimization // pfEnableEnc - (input) true iff this module should have EnC enabled. If this is @@ -717,7 +717,7 @@ class IDacDbiInterface //......................................................................... virtual - HRESULT SetCompilerFlags(VMPTR_DomainAssembly vmDomainAssembly, + HRESULT SetCompilerFlags(VMPTR_Assembly vmAssembly, BOOL fAllowJitOpts, BOOL fEnableEnC) = 0; @@ -768,7 +768,7 @@ class IDacDbiInterface // need this information from the runtime. // - typedef void (*FP_ASSEMBLY_ENUMERATION_CALLBACK)(VMPTR_DomainAssembly vmDomainAssembly, CALLBACK_DATA pUserData); + typedef void (*FP_ASSEMBLY_ENUMERATION_CALLBACK)(VMPTR_Assembly vmAssembly, CALLBACK_DATA pUserData); virtual void EnumerateAssembliesInAppDomain(VMPTR_AppDomain vmAppDomain, FP_ASSEMBLY_ENUMERATION_CALLBACK fpCallback, @@ -784,7 +784,7 @@ class IDacDbiInterface // Arguments: // vmModule - new module from the enumeration // pUserData - user data passed to EnumerateModulesInAssembly - typedef void (*FP_MODULE_ENUMERATION_CALLBACK)(VMPTR_DomainAssembly vmModule, CALLBACK_DATA pUserData); + typedef void (*FP_MODULE_ENUMERATION_CALLBACK)(VMPTR_Assembly vmModule, CALLBACK_DATA pUserData); // // Enumerates all the code Modules in an assembly. @@ -803,7 +803,7 @@ class IDacDbiInterface // virtual void EnumerateModulesInAssembly( - VMPTR_DomainAssembly vmAssembly, + VMPTR_Assembly vmAssembly, FP_MODULE_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) = 0; @@ -1277,7 +1277,7 @@ class IDacDbiInterface // The debugger can't duplicate this policy with 100% accuracy, and // so we need DAC to lookup the assembly that was actually loaded. virtual - VMPTR_DomainAssembly ResolveAssembly(VMPTR_DomainAssembly vmScope, mdToken tkAssemblyRef) = 0; + VMPTR_Assembly ResolveAssembly(VMPTR_Assembly vmScope, mdToken tkAssemblyRef) = 0; //----------------------------------------------------------------------------- // Interface for initializing the native/IL sequence points and native var info @@ -1708,13 +1708,13 @@ class IDacDbiInterface // // Arguments: // Input: - // vmDomainAssembly - module containing metadata for the method + // vmAssembly - module containing metadata for the method // functionToken - metadata token for the function // Output (required): // codeInfo - start address and size of the IL // pLocalSigToken - signature token for the method virtual - void GetILCodeAndSig(VMPTR_DomainAssembly vmDomainAssembly, + void GetILCodeAndSig(VMPTR_Assembly vmAssembly, mdToken functionToken, OUT TargetBuffer * pCodeInfo, OUT mdToken * pLocalSigToken) = 0; @@ -1724,7 +1724,7 @@ class IDacDbiInterface // and hot and cold region information. // Arguments: // Input: - // vmDomainAssembly - module containing metadata for the method + // vmAssembly - module containing metadata for the method // functionToken - token for the function for which we need code info // Output (required): // pCodeInfo - data structure describing the native code regions. @@ -1734,7 +1734,7 @@ class IDacDbiInterface // invalid (i.e., pCodeInfo->IsValid is false). virtual - void GetNativeCodeInfo(VMPTR_DomainAssembly vmDomainAssembly, + void GetNativeCodeInfo(VMPTR_Assembly vmAssembly, mdToken functionToken, OUT NativeCodeFunctionData * pCodeInfo) = 0; @@ -1799,7 +1799,7 @@ class IDacDbiInterface // get field information and object size for an instantiated generic // // Arguments: - // input: vmDomainAssembly - module containing metadata for the type + // input: vmAssembly - module containing metadata for the type // thExact - exact type handle for type (may be NULL) // thApprox - approximate type handle for the type // output: @@ -1808,7 +1808,7 @@ class IDacDbiInterface // pObjectSize - size of the instantiated object // virtual - void GetInstantiationFieldInfo (VMPTR_DomainAssembly vmDomainAssembly, + void GetInstantiationFieldInfo (VMPTR_Assembly vmAssembly, VMPTR_TypeHandle vmThExact, VMPTR_TypeHandle vmThApprox, OUT DacDbiArrayList * pFieldList, @@ -1993,12 +1993,12 @@ class IDacDbiInterface // input: vmAppDomain - Appdomain in which simpleType resides // simpleType - CorElementType value corresponding to a simple type // output: pMetadataToken - the metadata token corresponding to simpleType, - // in the scope of vmDomainAssembly. - // vmDomainAssembly - the domainAssembly for simpleType + // in the scope of vmAssembly. + // vmAssembly - the assembly for simpleType // Notes: // This is inspection-only. If the type is not yet loaded, it will throw CORDBG_E_CLASS_NOT_LOADED. // It will not try to load a type. - // If the type has been loaded, vmDomainAssembly will be non-null unless the target is somehow corrupted. + // If the type has been loaded, vmAssembly will be non-null unless the target is somehow corrupted. // In that case, we will throw CORDBG_E_TARGET_INCONSISTENT. virtual @@ -2006,7 +2006,7 @@ class IDacDbiInterface CorElementType simpleType, OUT mdTypeDef * pMetadataToken, OUT VMPTR_Module * pVmModule, - OUT VMPTR_DomainAssembly * pVmDomainAssembly) = 0; + OUT VMPTR_Assembly * pVmAssembly) = 0; // for the specified object returns TRUE if the object derives from System.Exception virtual @@ -2460,7 +2460,7 @@ class IDacDbiInterface virtual bool GetAppDomainForObject(CORDB_ADDRESS obj, OUT VMPTR_AppDomain * pApp, OUT VMPTR_Module * pModule, - OUT VMPTR_DomainAssembly * pDomainAssembly) = 0; + OUT VMPTR_Assembly * pAssembly) = 0; // Reference Walking. @@ -2591,17 +2591,17 @@ class IDacDbiInterface // virtual HRESULT GetSharedReJitInfoData(VMPTR_SharedReJitInfo sharedReJitInfo, DacSharedReJitInfo* pData) = 0; - + // Retrieves a bool indicating whether or not a method's optimizations have been disabled // defined in Debugger::IsMethodDeoptimized - // + // // // // Arguments: // vmModule - The module for the method in question // methodTk - The method token for the method in question // pOptimizationsDisabled - [out] A bool indicating whether or not the optimizations on a function are disabled - // + // // // Returns: // S_OK if no error @@ -2609,7 +2609,7 @@ class IDacDbiInterface // virtual HRESULT AreOptimizationsDisabled(VMPTR_Module vmModule, mdMethodDef methodTk, OUT BOOL* pOptimizationsDisabled) = 0; - + // Retrieves a bit field indicating which defines were in use when clr was built. This only includes // defines that are specified in the Debugger::_Target_Defines enumeration, which is a small subset of // all defines. @@ -2750,7 +2750,7 @@ class IDacDbiInterface HRESULT GetDelegateFunctionData( DelegateType delegateType, VMPTR_Object delegateObject, - OUT VMPTR_DomainAssembly *ppFunctionDomainAssembly, + OUT VMPTR_Assembly *ppFunctionAssembly, OUT mdMethodDef *pMethodDef) = 0; virtual diff --git a/src/coreclr/debug/inc/dacdbistructures.h b/src/coreclr/debug/inc/dacdbistructures.h index e91cd9fb9bb44d..51b01a2d74697e 100644 --- a/src/coreclr/debug/inc/dacdbistructures.h +++ b/src/coreclr/debug/inc/dacdbistructures.h @@ -162,19 +162,19 @@ struct MSLAYOUT TargetBuffer //=================================================================================== // Module properties, retrieved by DAC. -// Describes a VMPTR_DomainAssembly representing a module. +// Describes a VMPTR_Assembly representing a module. // In the VM, a raw Module may be domain neutral and shared by many appdomains. -// Whereas a DomainAssembly is like a { AppDomain, Module} pair. DomainAssembly corresponds +// Whereas a runtime assembly is like a { AppDomain, Module} pair. Runtime assembly corresponds // much more to ICorDebugModule (which also has appdomain affinity). //=================================================================================== -struct MSLAYOUT DomainAssemblyInfo +struct MSLAYOUT AssemblyInfo { - // The appdomain that the DomainAssembly is associated with. - // Although VMPTR_Module may be shared across multiple domains, a DomainAssembly has appdomain affinity. + // The appdomain that the runtime assembly is associated with. + // Although VMPTR_Module may be shared across multiple domains, a runtime assembly has appdomain affinity. VMPTR_AppDomain vmAppDomain; // The assembly this module belongs to. All modules live in an assembly. - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; }; struct MSLAYOUT ModuleInfo @@ -623,7 +623,7 @@ class MSLAYOUT EnCHangingFieldInfo mdFieldDef fieldToken, CorElementType elementType, mdTypeDef metadataToken, - VMPTR_DomainAssembly vmDomainAssembly); + VMPTR_Assembly vmAssembly); DebuggerIPCE_BasicTypeData GetObjectTypeData() const { return m_objectTypeData; }; mdFieldDef GetFieldToken() const { return m_fldToken; }; @@ -659,7 +659,7 @@ enum AreValueTypesBoxed { NoValueTypeBoxing, OnlyPrimitivesUnboxed, AllBoxed }; typedef struct MSLAYOUT { // domain file for the type - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; // metadata token for the type. This may be a typeRef (for requests) or a typeDef (for responses). mdToken typeToken; } TypeRefData; @@ -745,7 +745,7 @@ struct MSLAYOUT DacGcReference struct MSLAYOUT DacExceptionCallStackData { VMPTR_AppDomain vmAppDomain; - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; CORDB_ADDRESS ip; mdMethodDef methodDef; BOOL isLastForeignExceptionFrame; diff --git a/src/coreclr/debug/inc/dacdbistructures.inl b/src/coreclr/debug/inc/dacdbistructures.inl index a408a2c1ffb8db..2029f9f7fc5832 100644 --- a/src/coreclr/debug/inc/dacdbistructures.inl +++ b/src/coreclr/debug/inc/dacdbistructures.inl @@ -710,14 +710,14 @@ void EnCHangingFieldInfo::Init(VMPTR_Object pObject, mdFieldDef fieldToken, CorElementType elementType, mdTypeDef metadataToken, - VMPTR_DomainAssembly vmDomainAssembly) + VMPTR_Assembly vmAssembly) { m_vmObject = pObject; m_offsetToVars = offset; m_fldToken = fieldToken; m_objectTypeData.elementType = elementType; m_objectTypeData.metadataToken = metadataToken; - m_objectTypeData.vmDomainAssembly = vmDomainAssembly; + m_objectTypeData.vmAssembly = vmAssembly; } diff --git a/src/coreclr/debug/inc/dbgipcevents.h b/src/coreclr/debug/inc/dbgipcevents.h index 6c39939f00307e..5364c35d2af9ea 100644 --- a/src/coreclr/debug/inc/dbgipcevents.h +++ b/src/coreclr/debug/inc/dbgipcevents.h @@ -1,9 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + /* ------------------------------------------------------------------------- * * DbgIPCEvents.h -- header file for private Debugger data shared by various -// - + * * debugger components. * ------------------------------------------------------------------------- */ @@ -825,11 +825,10 @@ typedef VMPTR_Base VMPTR_CONTEXT; typedef VMPTR_Base VMPTR_CONTEXT; #endif -// DomainAssembly is a base-class for a CLR module, with app-domain affinity. -// For domain-neutral modules (like CoreLib), there is a DomainAssembly instance +// Assembly is a base-class for a CLR module, with app-domain affinity. +// For domain-neutral modules (like CoreLib), there is a Assembly instance // for each appdomain the module lives in. // This is the canonical handle ICorDebug uses to a CLR module. -DEFINE_VMPTR(class DomainAssembly, PTR_DomainAssembly, VMPTR_DomainAssembly); DEFINE_VMPTR(class Module, PTR_Module, VMPTR_Module); DEFINE_VMPTR(class Assembly, PTR_Assembly, VMPTR_Assembly); @@ -1329,7 +1328,7 @@ inline bool IsEqualOrCloserToRoot(FramePointer fp1, FramePointer fp2) struct MSLAYOUT DebuggerIPCE_FuncData { mdMethodDef funcMetadataToken; - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; mdTypeDef classMetadataToken; @@ -1469,7 +1468,7 @@ struct MSLAYOUT DebuggerIPCE_STRData struct MSLAYOUT { mdMethodDef funcMetadataToken; - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; VMPTR_MethodDesc vmMethodDesc; CorDebugInternalFrameType frameType; } stubFrame; @@ -1513,7 +1512,7 @@ struct MSLAYOUT DebuggerIPCE_BasicTypeData CorElementType elementType; mdTypeDef metadataToken; VMPTR_Module vmModule; - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; VMPTR_TypeHandle vmTypeHandle; }; @@ -1549,7 +1548,7 @@ struct MSLAYOUT DebuggerIPCE_ExpandedTypeData { mdTypeDef metadataToken; VMPTR_Module vmModule; - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; VMPTR_TypeHandle typeHandle; // if non-null then further fetches will be needed to get type arguments } ClassTypeData; @@ -1723,7 +1722,7 @@ struct MSLAYOUT DebuggerIPCE_FuncEvalInfo DebuggerIPCE_FuncEvalType funcEvalType; mdMethodDef funcMetadataToken; mdTypeDef funcClassMetadataToken; - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; RSPTR_CORDBEVAL funcEvalKey; bool evalDuringException; @@ -1975,7 +1974,7 @@ struct MSLAYOUT DebuggerIPCEvent { // Module whose metadata is being updated // This tells the RS that the metadata for that module has become invalid. - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; } MetadataUpdateData; @@ -1987,7 +1986,7 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; } AssemblyData; #ifdef TEST_DATA_CONSISTENCY @@ -2018,13 +2017,13 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { // Module that was just loaded. - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; }LoadModuleData; struct MSLAYOUT { - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; LSPTR_ASSEMBLY debuggerAssemblyToken; } UnloadModuleData; @@ -2033,7 +2032,7 @@ struct MSLAYOUT DebuggerIPCEvent // Queury PDB from OOP struct MSLAYOUT { - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; } UpdateModuleSymsData; DebuggerMDANotification MDANotification; @@ -2042,7 +2041,7 @@ struct MSLAYOUT DebuggerIPCEvent { LSPTR_BREAKPOINT breakpointToken; mdMethodDef funcMetadataToken; - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; bool isIL; SIZE_T offset; SIZE_T encVersion; @@ -2142,7 +2141,7 @@ struct MSLAYOUT DebuggerIPCEvent // Apply an EnC edit struct MSLAYOUT { - VMPTR_DomainAssembly vmDomainAssembly; // Module to edit + VMPTR_Assembly vmAssembly; // Module to edit DWORD cbDeltaMetadata; // size of blob pointed to by pDeltaMetadata CORDB_ADDRESS pDeltaMetadata; // pointer to delta metadata in debuggee // it's the RS's responsibility to allocate and free @@ -2159,20 +2158,20 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { mdTypeDef classMetadataToken; - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; LSPTR_ASSEMBLY classDebuggerAssemblyToken; } LoadClass; struct MSLAYOUT { mdTypeDef classMetadataToken; - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; LSPTR_ASSEMBLY classDebuggerAssemblyToken; } UnloadClass; struct MSLAYOUT { - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; bool flag; } SetClassLoad; @@ -2203,7 +2202,7 @@ struct MSLAYOUT DebuggerIPCEvent CORDB_ADDRESS startAddress; bool fCanSetIPOnly; VMPTR_Thread vmThreadToken; - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; mdMethodDef mdMethod; VMPTR_MethodDesc vmMethodDesc; SIZE_T offset; @@ -2232,7 +2231,7 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { // Domain file for the domain in which the notification occurred - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; // metadata token for the type of the CustomNotification object's type mdTypeDef classToken; @@ -2297,7 +2296,7 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; BOOL fAllowJitOpts; BOOL fEnableEnC; } JitDebugInfo; @@ -2305,7 +2304,7 @@ struct MSLAYOUT DebuggerIPCEvent // EnC Remap opportunity struct MSLAYOUT { - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; mdMethodDef funcMetadataToken ; // methodDef of function with remap opportunity SIZE_T currentVersionNumber; // version currently executing SIZE_T resumeVersionNumber; // latest version @@ -2317,7 +2316,7 @@ struct MSLAYOUT DebuggerIPCEvent // EnC Remap has taken place struct MSLAYOUT { - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; mdMethodDef funcMetadataToken; // methodDef of function that was remapped } EnCRemapComplete; @@ -2325,7 +2324,7 @@ struct MSLAYOUT DebuggerIPCEvent // specific edit made by EnC (function add/update or field add). struct MSLAYOUT { - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; mdToken memberMetadataToken; // Either a methodDef token indicating the function that // was updated/added, or a fieldDef token indicating the // field which was added. @@ -2346,7 +2345,7 @@ struct MSLAYOUT DebuggerIPCEvent // @todo - Perhaps we can bundle these up so we can set multiple funcs w/ 1 event? struct MSLAYOUT { - VMPTR_DomainAssembly vmDomainAssembly; + VMPTR_Assembly vmAssembly; mdMethodDef funcMetadataToken; DWORD dwStatus; } SetJMCFunctionStatus; diff --git a/src/coreclr/inc/eventtracebase.h b/src/coreclr/inc/eventtracebase.h index 38868fe528f797..d58d8ef915a476 100644 --- a/src/coreclr/inc/eventtracebase.h +++ b/src/coreclr/inc/eventtracebase.h @@ -1,14 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + // // File: eventtracebase.h // Abstract: This module implements base Event Tracing support (excluding some of the // CLR VM-specific ETW helpers). // -// - -// // // #EventTracing // Windows @@ -761,10 +759,10 @@ namespace ETW typedef enum _EnumerationOptions { None= 0x00000000, - DomainAssemblyModuleLoad= 0x00000001, - DomainAssemblyModuleUnload= 0x00000002, - DomainAssemblyModuleDCStart= 0x00000004, - DomainAssemblyModuleDCEnd= 0x00000008, + AssemblyModuleLoad= 0x00000001, + AssemblyModuleUnload= 0x00000002, + AssemblyModuleDCStart= 0x00000004, + AssemblyModuleDCEnd= 0x00000008, JitMethodLoad= 0x00000010, JitMethodUnload= 0x00000020, JitMethodDCStart= 0x00000040, diff --git a/src/coreclr/vm/CMakeLists.txt b/src/coreclr/vm/CMakeLists.txt index 334faa6f16764d..b936be7e5bcab2 100644 --- a/src/coreclr/vm/CMakeLists.txt +++ b/src/coreclr/vm/CMakeLists.txt @@ -65,7 +65,6 @@ set(VM_SOURCES_DAC_AND_WKS_COMMON debuginfostore.cpp decodemd.cpp disassembler.cpp - domainassembly.cpp dynamicmethod.cpp ecall.cpp eedbginterfaceimpl.cpp @@ -161,7 +160,6 @@ set(VM_HEADERS_DAC_AND_WKS_COMMON debuginfostore.h decodemd.h disassembler.h - domainassembly.h dynamicmethod.h ecall.h eedbginterfaceimpl.h diff --git a/src/coreclr/vm/appdomain.cpp b/src/coreclr/vm/appdomain.cpp index ce933c43739a11..cf5953993034ab 100644 --- a/src/coreclr/vm/appdomain.cpp +++ b/src/coreclr/vm/appdomain.cpp @@ -1761,7 +1761,7 @@ void AppDomain::Stop() #ifndef DACCESS_COMPILE -void AppDomain::AddAssembly(DomainAssembly * assem) +void AppDomain::AddAssembly(Assembly * assem) { CONTRACTL { @@ -1791,7 +1791,7 @@ void AppDomain::AddAssembly(DomainAssembly * assem) } } -void AppDomain::RemoveAssembly(DomainAssembly * pAsm) +void AppDomain::RemoveAssembly(Assembly * pAsm) { CONTRACTL { @@ -2021,7 +2021,7 @@ BOOL FileLoadLock::CompleteLoadLevel(FileLoadLevel level, BOOL success) // Dev11 bug 236344 // In AppDomain::IsLoading, if the lock is taken on m_pList and then FindFileLock returns NULL, - // we depend on the DomainAssembly's load level being up to date. Hence we must update the load + // we depend on the runtime Assembly's load level being up to date. Hence we must update the load // level while the m_pList lock is held. if (success) m_pAssembly->SetLoadLevel(level); @@ -2447,11 +2447,11 @@ Assembly *AppDomain::LoadAssemblyInternal(AssemblySpec* pIdentity, pLoaderAllocator = this->GetLoaderAllocator(); } - // Allocate the DomainAssembly a bit early to avoid GC mode problems. We could potentially avoid + // Allocate the runtime Assembly a bit early to avoid GC mode problems. We could potentially avoid // a rare redundant allocation by moving this closer to FileLoadLock::Create, but it's not worth it. AllocMemTracker amTracker; AllocMemTracker *pamTracker = &amTracker; - NewHolder pDomainAssembly = new DomainAssembly(pPEAssembly, pLoaderAllocator, pamTracker); + NewHolder pAssembly = Assembly::Create(pPEAssembly, pamTracker, pLoaderAllocator); LoadLockHolder lock(this); @@ -2464,19 +2464,19 @@ Assembly *AppDomain::LoadAssemblyInternal(AssemblySpec* pIdentity, result = FindAssembly(pPEAssembly, FindAssemblyOptions_IncludeFailedToLoad); if (result == NULL) { - // We are the first one in - create the DomainAssembly + // We are the first one in - create the runtime Assembly registerNewAssembly = true; - fileLock = FileLoadLock::Create(lock, pPEAssembly, pDomainAssembly->GetAssembly()); - pDomainAssembly.SuppressRelease(); + fileLock = FileLoadLock::Create(lock, pPEAssembly, pAssembly); + pAssembly.SuppressRelease(); pamTracker->SuppressRelease(); // Set the assembly module to be tenured now that we know it won't be deleted - pDomainAssembly->GetAssembly()->SetIsTenured(); - if (pDomainAssembly->GetAssembly()->IsCollectible()) + pAssembly->SetIsTenured(); + if (pAssembly->IsCollectible()) { // We add the assembly to the LoaderAllocator only when we are sure that it can be added // and won't be deleted in case of a concurrent load from the same ALC - ((AssemblyLoaderAllocator *)pLoaderAllocator)->AddDomainAssembly(pDomainAssembly); + ((AssemblyLoaderAllocator *)pLoaderAllocator)->AddAssembly(pAssembly); } } } @@ -2503,7 +2503,7 @@ Assembly *AppDomain::LoadAssemblyInternal(AssemblySpec* pIdentity, if (registerNewAssembly) { - pPEAssembly->GetAssemblyBinder()->AddLoadedAssembly(pDomainAssembly->GetAssembly()); + pPEAssembly->GetAssemblyBinder()->AddLoadedAssembly(pAssembly); } } else @@ -2711,7 +2711,7 @@ CHECK AppDomain::CheckValidModule(Module * pModule) } CONTRACTL_END; - if (pModule->GetDomainAssembly() != NULL) + if (pModule->GetAssembly() != NULL) CHECK_OK; CHECK_OK; @@ -4056,13 +4056,12 @@ AppDomain::AssemblyIterator::Next_Unlocked( while (m_Iterator.Next()) { // Get element from the list/iterator (without adding reference to the assembly) - DomainAssembly * pDomainAssembly = dac_cast(m_Iterator.GetElement()); - if (pDomainAssembly == NULL) + Assembly * pAssembly = dac_cast(m_Iterator.GetElement()); + if (pAssembly == NULL) { continue; } - Assembly* pAssembly = pDomainAssembly->GetAssembly(); if (pAssembly->IsError()) { if (m_assemblyIterationFlags & kIncludeFailedToLoad) @@ -4123,7 +4122,7 @@ AppDomain::AssemblyIterator::Next_Unlocked( // Un-tenured collectible assemblies should not be returned. (This can only happen in a brief // window during collectible assembly creation. No thread should need to have a pointer - // to the just allocated DomainAssembly at this stage.) + // to the just allocated runtime Assembly at this stage.) if (!pAssembly->GetModule()->IsTenured()) { continue; // reject diff --git a/src/coreclr/vm/appdomain.hpp b/src/coreclr/vm/appdomain.hpp index b5938414511b6f..f3a16ff1902130 100644 --- a/src/coreclr/vm/appdomain.hpp +++ b/src/coreclr/vm/appdomain.hpp @@ -21,7 +21,6 @@ #include "arraylist.h" #include "comreflectioncache.hpp" #include "comutilnative.h" -#include "domainassembly.h" #include "fptrstubs.h" #include "gcheaputilities.h" #include "gchandleutilities.h" @@ -40,7 +39,6 @@ class AppDomain; class GlobalStringLiteralMap; class StringLiteralMap; class FrozenObjectHeapManager; -class DomainAssembly; class TypeEquivalenceHashTable; #ifdef FEATURE_COMINTEROP @@ -280,7 +278,7 @@ typedef PEFileListLock::Holder PEFileListLockHolder; // Loading infrastructure: // -// a DomainAssembly is a file being loaded. Files are loaded in layers to enable loading in the +// An assembly is a file being loaded. Files are loaded in layers to enable loading in the // presence of dependency loops. // // FileLoadLevel describes the various levels available. These are implemented slightly @@ -466,7 +464,7 @@ enum AssemblyIterationFlags // (all m_level values) kIncludeAvailableToProfilers = 0x00000020, // include assemblies available to profilers - // See comment at code:DomainAssembly::IsAvailableToProfilers + // See comment at code:Assembly::IsAvailableToProfilers // Execution / introspection flags kIncludeExecution = 0x00000004, // include assemblies that are loaded for execution only @@ -541,16 +539,6 @@ class CollectibleAssemblyHolderBase } private: - LoaderAllocator * GetLoaderAllocator(DomainAssembly * pDomainAssembly) - { - WRAPPER_NO_CONTRACT; - return pDomainAssembly->GetAssembly()->GetLoaderAllocator(); - } - BOOL IsCollectible(DomainAssembly * pDomainAssembly) - { - WRAPPER_NO_CONTRACT; - return pDomainAssembly->GetAssembly()->IsCollectible(); - } LoaderAllocator * GetLoaderAllocator(Assembly * pAssembly) { WRAPPER_NO_CONTRACT; @@ -568,7 +556,7 @@ class CollectibleAssemblyHolderBase // Holder of assembly reference which keeps collectible assembly alive while the holder is valid. // // Collectible assembly can be collected at any point when GC happens. Almost instantly all native data -// structures of the assembly (e.g. code:DomainAssembly, code:Assembly) could be deallocated. +// structures of the assembly (e.g. code:Assembly) could be deallocated. // Therefore any usage of (collectible) assembly data structures from native world, has to prevent the // deallocation by increasing ref-count on the assembly / associated loader allocator. // @@ -815,7 +803,7 @@ class AppDomain final protected: // Multi-thread safe access to the list of assemblies - class DomainAssemblyList + class AssemblyList { private: ArrayList m_array; @@ -882,7 +870,7 @@ class AppDomain final return m_array.GetCount(); } - void Get(AppDomain * pAppDomain, DWORD index, CollectibleAssemblyHolder * pAssemblyHolder) + void Get(AppDomain * pAppDomain, DWORD index, CollectibleAssemblyHolder * pAssemblyHolder) { CONTRACTL { NOTHROW; @@ -895,7 +883,7 @@ class AppDomain final CrstHolder ch(pAppDomain->GetAssemblyListLock()); Get_Unlocked(index, pAssemblyHolder); } - void Get_Unlocked(DWORD index, CollectibleAssemblyHolder * pAssemblyHolder) + void Get_Unlocked(DWORD index, CollectibleAssemblyHolder * pAssemblyHolder) { CONTRACTL { NOTHROW; @@ -904,11 +892,11 @@ class AppDomain final } CONTRACTL_END; _ASSERTE(dbg_m_pAppDomain->GetAssemblyListLock()->OwnedByCurrentThread()); - *pAssemblyHolder = dac_cast(m_array.Get(index)); + *pAssemblyHolder = dac_cast(m_array.Get(index)); } // Doesn't lock the assembly list (caller has to hold the lock already). // Doesn't AddRef the returned assembly (if collectible). - DomainAssembly * Get_UnlockedNoReference(DWORD index) + Assembly * Get_UnlockedNoReference(DWORD index) { CONTRACTL { NOTHROW; @@ -920,11 +908,11 @@ class AppDomain final #ifndef DACCESS_COMPILE _ASSERTE(dbg_m_pAppDomain->GetAssemblyListLock()->OwnedByCurrentThread()); #endif - return dac_cast(m_array.Get(index)); + return dac_cast(m_array.Get(index)); } #ifndef DACCESS_COMPILE - void Set(AppDomain * pAppDomain, DWORD index, DomainAssembly * pAssembly) + void Set(AppDomain * pAppDomain, DWORD index, Assembly * pAssembly) { CONTRACTL { NOTHROW; @@ -937,7 +925,7 @@ class AppDomain final CrstHolder ch(pAppDomain->GetAssemblyListLock()); return Set_Unlocked(index, pAssembly); } - void Set_Unlocked(DWORD index, DomainAssembly * pAssembly) + void Set_Unlocked(DWORD index, Assembly * pAssembly) { CONTRACTL { NOTHROW; @@ -949,7 +937,7 @@ class AppDomain final m_array.Set(index, pAssembly); } - HRESULT Append_Unlocked(DomainAssembly * pAssembly) + HRESULT Append_Unlocked(Assembly * pAssembly) { CONTRACTL { NOTHROW; @@ -975,10 +963,10 @@ class AppDomain final { return m_array.Iterate(); } - }; // class DomainAssemblyList + }; // class AssemblyList // Conceptually a list of code:Assembly structures, protected by lock code:GetAssemblyListLock - DomainAssemblyList m_Assemblies; + AssemblyList m_Assemblies; public: // Note that this lock switches thread into GC_NOTRIGGER region as GC can take it too. @@ -1096,7 +1084,7 @@ class AppDomain final // unless the call is guaranteed to succeed or you don't need the caching // (e.g. if you will FailFast or tear down the AppDomain anyway) // The main point that you should not bypass caching if you might try to load the same file again, - // resulting in multiple DomainAssembly objects that share the same PEAssembly for ngen image + // resulting in multiple Assembly objects that share the same PEAssembly for ngen image //which is violating our internal assumptions Assembly *LoadAssemblyInternal(AssemblySpec* pIdentity, PEAssembly *pPEAssembly, @@ -1134,8 +1122,8 @@ class AppDomain final NATIVE_LIBRARY_HANDLE FindUnmanagedImageInCache(LPCWSTR libraryName); // Adds or removes an assembly to the domain. - void AddAssembly(DomainAssembly * assem); - void RemoveAssembly(DomainAssembly * pAsm); + void AddAssembly(Assembly * assem); + void RemoveAssembly(Assembly * pAsm); BOOL ContainsAssembly(Assembly * assem); diff --git a/src/coreclr/vm/assembly.cpp b/src/coreclr/vm/assembly.cpp index 6309f9bfcb10c6..7c37100bae53d1 100644 --- a/src/coreclr/vm/assembly.cpp +++ b/src/coreclr/vm/assembly.cpp @@ -335,6 +335,8 @@ Assembly * Assembly::Create( } CONTRACTL_END + pPEAssembly->AddRef(); + pPEAssembly->ValidateForExecution(); NewHolder pAssembly (new Assembly(pPEAssembly, pLoaderAllocator)); #ifdef PROFILING_SUPPORTED @@ -366,6 +368,8 @@ Assembly * Assembly::Create( #endif pAssembly.SuppressRelease(); + // Creating the Assembly should have ensured the PEAssembly is loaded + _ASSERT(pAssembly->GetPEAssembly()->IsLoaded()); return pAssembly; } // Assembly::Create @@ -443,7 +447,6 @@ Assembly *Assembly::CreateDynamic(AssemblyBinder* pBinder, NativeAssemblyNamePar AppDomain* pDomain = ::GetAppDomain(); - NewHolder pDomainAssembly; Assembly* pAssem; BOOL createdNewAssemblyLoaderAllocator = FALSE; @@ -487,15 +490,14 @@ Assembly *Assembly::CreateDynamic(AssemblyBinder* pBinder, NativeAssemblyNamePar pLoaderAllocator.SuppressRelease(); } - // Create a domain assembly - pDomainAssembly = new DomainAssembly(pPEAssembly, pLoaderAllocator, pamTracker); - pAssem = pDomainAssembly->GetAssembly(); + // Create an assembly + pAssem = Create(pPEAssembly, pamTracker, pLoaderAllocator); pAssem->m_isDynamic = true; if (pAssem->IsCollectible()) { // We add the assembly to the LoaderAllocator only when we are sure that it can be added // and won't be deleted in case of a concurrent load from the same ALC - ((AssemblyLoaderAllocator *)(LoaderAllocator *)pLoaderAllocator)->AddDomainAssembly(pDomainAssembly); + ((AssemblyLoaderAllocator *)(LoaderAllocator *)pLoaderAllocator)->AddAssembly(pAssem); } } @@ -528,7 +530,6 @@ Assembly *Assembly::CreateDynamic(AssemblyBinder* pBinder, NativeAssemblyNamePar // Cannot fail after this point - pDomainAssembly.SuppressRelease(); pamTracker->SuppressRelease(); // Once we reach this point, the loader allocator lifetime is controlled by the Assembly object. @@ -547,31 +548,8 @@ Assembly *Assembly::CreateDynamic(AssemblyBinder* pBinder, NativeAssemblyNamePar RETURN pRetVal; } // Assembly::CreateDynamic - - -void Assembly::SetDomainAssembly(DomainAssembly *pDomainAssembly) -{ - CONTRACTL - { - PRECONDITION(CheckPointer(pDomainAssembly)); - THROWS; - GC_TRIGGERS; - INJECT_FAULT(COMPlusThrowOM();); - } - CONTRACTL_END; - - GetModule()->SetDomainAssembly(pDomainAssembly); - -} // Assembly::SetDomainAssembly - #endif // #ifndef DACCESS_COMPILE -DomainAssembly *Assembly::GetDomainAssembly() -{ - LIMITED_METHOD_DAC_CONTRACT; - return GetModule()->GetDomainAssembly(); -} - PTR_LoaderHeap Assembly::GetLowFrequencyHeap() { WRAPPER_NO_CONTRACT; @@ -2288,9 +2266,9 @@ void Assembly::Begin() { AppDomain::LoadLockHolder lock(AppDomain::GetCurrentDomain()); - AppDomain::GetCurrentDomain()->AddAssembly(GetDomainAssembly()); + AppDomain::GetCurrentDomain()->AddAssembly(this); } - // Make it possible to find this DomainAssembly object from associated BINDER_SPACE::Assembly. + // Make it possible to find this assembly object from associated BINDER_SPACE::Assembly. RegisterWithHostAssembly(); } @@ -2494,7 +2472,7 @@ BOOL Assembly::NotifyDebuggerLoad(int flags, BOOL attaching) { if (ShouldNotifyDebugger()) { - g_pDebugInterface->LoadAssembly(GetDomainAssembly()); + g_pDebugInterface->LoadAssembly(this); } result = TRUE; } @@ -2502,12 +2480,12 @@ BOOL Assembly::NotifyDebuggerLoad(int flags, BOOL attaching) if(this->ShouldNotifyDebugger()) { result = result || - this->GetModule()->NotifyDebuggerLoad(GetDomainAssembly(), flags, attaching); + this->GetModule()->NotifyDebuggerLoad(this, flags, attaching); } if( ShouldNotifyDebugger()) { - result |= m_pModule->NotifyDebuggerLoad(GetDomainAssembly(), ATTACH_MODULE_LOAD, attaching); + result |= m_pModule->NotifyDebuggerLoad(this, ATTACH_MODULE_LOAD, attaching); SetDebuggerNotified(); } @@ -2525,7 +2503,7 @@ void Assembly::NotifyDebuggerUnload() // a previous load event (such as if debugger attached after the modules was loaded). this->GetModule()->NotifyDebuggerUnload(); - g_pDebugInterface->UnloadAssembly(GetDomainAssembly()); + g_pDebugInterface->UnloadAssembly(this); } FriendAssemblyDescriptor::FriendAssemblyDescriptor() diff --git a/src/coreclr/vm/assembly.hpp b/src/coreclr/vm/assembly.hpp index 8e533370b043e2..0baad75cc74ab9 100644 --- a/src/coreclr/vm/assembly.hpp +++ b/src/coreclr/vm/assembly.hpp @@ -315,12 +315,12 @@ class Assembly m_debuggerFlags = flags; } - DomainAssembly* GetNextAssemblyInSameALC() + Assembly* GetNextAssemblyInSameALC() { return m_NextAssemblyInSameALC; } - void SetNextAssemblyInSameALC(DomainAssembly* assembly) + void SetNextAssemblyInSameALC(Assembly* assembly) { _ASSERTE(m_NextAssemblyInSameALC == NULL); m_NextAssemblyInSameALC = assembly; @@ -374,9 +374,6 @@ class Assembly //**************************************************************************************** - DomainAssembly *GetDomainAssembly(); - void SetDomainAssembly(DomainAssembly *pAssembly); - #if defined(FEATURE_COLLECTIBLE_TYPES) && !defined(DACCESS_COMPILE) OBJECTHANDLE GetLoaderAllocatorObjectHandle() { WRAPPER_NO_CONTRACT; return GetLoaderAllocator()->GetLoaderAllocatorObjectHandle(); } #endif // FEATURE_COLLECTIBLE_TYPES @@ -535,7 +532,7 @@ class Assembly LOADERHANDLE m_hExposedObject; - DomainAssembly* m_NextAssemblyInSameALC; + Assembly* m_NextAssemblyInSameALC; }; #ifndef DACCESS_COMPILE diff --git a/src/coreclr/vm/assemblynative.cpp b/src/coreclr/vm/assemblynative.cpp index 3ca0783d65349c..936f99527a45cd 100644 --- a/src/coreclr/vm/assemblynative.cpp +++ b/src/coreclr/vm/assemblynative.cpp @@ -41,7 +41,6 @@ extern "C" void QCALLTYPE AssemblyNative_InternalLoad(NativeAssemblyNameParts* p BEGIN_QCALL; - DomainAssembly * pParentAssembly = NULL; Assembly * pRefAssembly = NULL; AssemblyBinder *pBinder = NULL; diff --git a/src/coreclr/vm/assemblyspec.hpp b/src/coreclr/vm/assemblyspec.hpp index ac86f220fd5f43..f1921657de7805 100644 --- a/src/coreclr/vm/assemblyspec.hpp +++ b/src/coreclr/vm/assemblyspec.hpp @@ -14,7 +14,6 @@ #include "hash.h" #include "assemblyspecbase.h" -#include "domainassembly.h" #include "holder.h" enum FileLoadLevel diff --git a/src/coreclr/vm/ceeload.cpp b/src/coreclr/vm/ceeload.cpp index f4d075b126e139..2d793966578e5b 100644 --- a/src/coreclr/vm/ceeload.cpp +++ b/src/coreclr/vm/ceeload.cpp @@ -829,13 +829,6 @@ BOOL Module::IsCollectible() return GetAssembly()->IsCollectible(); } -DomainAssembly* Module::GetDomainAssembly() -{ - LIMITED_METHOD_DAC_CONTRACT; - - return m_pDomainAssembly; -} - #ifndef DACCESS_COMPILE #include "staticallocationhelpers.inl" @@ -1141,13 +1134,6 @@ BOOL Module::IsRuntimeMarshallingEnabled() return hr != S_OK; } -void Module::SetDomainAssembly(DomainAssembly *pDomainAssembly) -{ - LIMITED_METHOD_CONTRACT; - - m_pDomainAssembly = pDomainAssembly; -} - //--------------------------------------------------------------------------------------- // // Returns managed representation of the module (Module or ModuleBuilder). @@ -2906,7 +2892,7 @@ void Module::UpdateDynamicMetadataIfNeeded() #endif // DEBUGGING_SUPPORTED -BOOL Module::NotifyDebuggerLoad(DomainAssembly * pDomainAssembly, int flags, BOOL attaching) +BOOL Module::NotifyDebuggerLoad(Assembly * pAssembly, int flags, BOOL attaching) { WRAPPER_NO_CONTRACT; @@ -2917,7 +2903,7 @@ BOOL Module::NotifyDebuggerLoad(DomainAssembly * pDomainAssembly, int flags, BOO // Always capture metadata, even if no debugger is attached. If a debugger later attaches, it will use // this data. { - Module * pModule = pDomainAssembly->GetAssembly()->GetModule(); + Module * pModule = pAssembly->GetModule(); pModule->UpdateDynamicMetadataIfNeeded(); } @@ -2937,7 +2923,7 @@ BOOL Module::NotifyDebuggerLoad(DomainAssembly * pDomainAssembly, int flags, BOO m_pPEAssembly->GetPath(), m_pPEAssembly->GetPath().GetCount(), GetAssembly(), - pDomainAssembly, + pAssembly, attaching); result = TRUE; diff --git a/src/coreclr/vm/ceeload.h b/src/coreclr/vm/ceeload.h index 2d0d266494a174..f8c3af462d92a4 100644 --- a/src/coreclr/vm/ceeload.h +++ b/src/coreclr/vm/ceeload.h @@ -887,10 +887,6 @@ class Module : public ModuleBase MethodTable *GetGlobalMethodTable(); bool NeedsGlobalMethodTable(); - DomainAssembly *GetDomainAssembly(); - - void SetDomainAssembly(DomainAssembly *pDomainAssembly); - OBJECTREF GetExposedObject(); OBJECTREF GetExposedObjectIfExists(); @@ -1333,7 +1329,7 @@ class Module : public ModuleBase public: // Debugger stuff - BOOL NotifyDebuggerLoad(DomainAssembly * pDomainAssembly, int level, BOOL attaching); + BOOL NotifyDebuggerLoad(Assembly * pAssembly, int level, BOOL attaching); void NotifyDebuggerUnload(); void SetDebuggerInfoBits(DebuggerAssemblyControlFlags newBits); @@ -1509,10 +1505,6 @@ class Module : public ModuleBase const ReadyToRun_MethodIsGenericMap *m_pMethodIsGenericMap = &ReadyToRun_MethodIsGenericMap::EmptyInstance; const ReadyToRun_TypeGenericInfoMap *m_pTypeGenericInfoMap = &ReadyToRun_TypeGenericInfoMap::EmptyInstance; -protected: - - PTR_DomainAssembly m_pDomainAssembly; - public: //----------------------------------------------------------------------------------------- // Returns a BOOL to indicate if we have computed whether compiler has instructed us to diff --git a/src/coreclr/vm/comdynamic.cpp b/src/coreclr/vm/comdynamic.cpp index 896ea02264a285..db55b9ba633f5f 100644 --- a/src/coreclr/vm/comdynamic.cpp +++ b/src/coreclr/vm/comdynamic.cpp @@ -891,7 +891,6 @@ void UpdateRuntimeStateForAssemblyCustomAttribute(Module* pModule, mdToken tkCus } Assembly* pAssembly = pModule->GetAssembly(); - DomainAssembly* pDomainAssembly = pAssembly->GetDomainAssembly(); DWORD actualFlags; actualFlags = ((DWORD)pAssembly->GetDebuggerInfoBits() & mask) | flags; diff --git a/src/coreclr/vm/common.h b/src/coreclr/vm/common.h index 19a5384433cf15..3715a43a800437 100644 --- a/src/coreclr/vm/common.h +++ b/src/coreclr/vm/common.h @@ -113,7 +113,6 @@ typedef DPTR(class ComCallMethodDesc) PTR_ComCallMethodDesc; typedef DPTR(class CLRToCOMCallMethodDesc) PTR_CLRToCOMCallMethodDesc; typedef VPTR(class DebugInterface) PTR_DebugInterface; typedef DPTR(class Dictionary) PTR_Dictionary; -typedef DPTR(class DomainAssembly) PTR_DomainAssembly; typedef DPTR(struct FailedAssembly) PTR_FailedAssembly; typedef VPTR(class EditAndContinueModule) PTR_EditAndContinueModule; typedef DPTR(class EEClass) PTR_EEClass; diff --git a/src/coreclr/vm/coreassemblyspec.cpp b/src/coreclr/vm/coreassemblyspec.cpp index 886df7e4afbe5d..ed46fa3d753094 100644 --- a/src/coreclr/vm/coreassemblyspec.cpp +++ b/src/coreclr/vm/coreassemblyspec.cpp @@ -15,7 +15,6 @@ #include "appdomain.inl" #include #include "peimagelayout.inl" -#include "domainassembly.h" #include "holder.h" #include "bundle.h" #include "strongnameinternal.h" diff --git a/src/coreclr/vm/dbginterface.h b/src/coreclr/vm/dbginterface.h index 9a58eea52ad256..f0b7bc76fc11ca 100644 --- a/src/coreclr/vm/dbginterface.h +++ b/src/coreclr/vm/dbginterface.h @@ -67,7 +67,7 @@ class DebugInterface LPCWSTR psModuleName, // module file name DWORD dwModuleName, // number of characters in file name excludign null Assembly * pAssembly, // the assembly the module belongs to - DomainAssembly * pDomainAssembly, + Assembly * pRuntimeAssembly, BOOL fAttaching) = 0; // true if this notification is due to a debugger // being attached to the process @@ -244,7 +244,7 @@ class DebugInterface // send a custom notification from the target to the RS. This will become an ICorDebugThread and // ICorDebugAppDomain on the RS. - virtual void SendCustomDebuggerNotification(Thread * pThread, DomainAssembly * pDomainAssembly, mdTypeDef classToken) = 0; + virtual void SendCustomDebuggerNotification(Thread * pThread, Assembly * pAssembly, mdTypeDef classToken) = 0; // Send an MDA notification. This ultimately translates to an ICorDebugMDA object on the Right-Side. virtual void SendMDANotification( @@ -300,7 +300,7 @@ class DebugInterface // This is called only when a debugger is attached, and will occur after the // related AddAppDomainToIPCBlock call and before any LoadModule or // LoadClass calls for this assembly. - virtual void LoadAssembly(DomainAssembly * pDomainAssembly) = 0; // the assembly being loaded + virtual void LoadAssembly(Assembly * pAssembly) = 0; // the assembly being loaded // Called for all assemblies in an AppDomain when the AppDomain is unloaded. @@ -309,7 +309,7 @@ class DebugInterface // and UnloadModule calls and before any RemoveAppDomainFromIPCBlock calls realted // to this assembly. On CLR shutdown, we are not guaranteed to get UnloadAssembly calls for // all outstanding loaded assemblies. - virtual void UnloadAssembly(DomainAssembly * pDomainAssembly) = 0; + virtual void UnloadAssembly(Assembly * pAssembly) = 0; virtual HRESULT SetILInstrumentedCodeMap(MethodDesc *fd, BOOL fStartJit, diff --git a/src/coreclr/vm/debugdebugger.cpp b/src/coreclr/vm/debugdebugger.cpp index abb873942abaa0..cd5f81bcf57dd8 100644 --- a/src/coreclr/vm/debugdebugger.cpp +++ b/src/coreclr/vm/debugdebugger.cpp @@ -886,11 +886,11 @@ extern "C" void QCALLTYPE DebugDebugger_CustomNotification(QCall::ObjectHandleOn StrongHandleHolder objHandle = pAppDomain->CreateStrongHandle(data.Get()); MethodTable* pMT = data.Get()->GetGCSafeMethodTable(); Module* pModule = pMT->GetModule(); - DomainAssembly* pDomainAssembly = pModule->GetDomainAssembly(); + Assembly* pAssembly = pModule->GetAssembly(); mdTypeDef classToken = pMT->GetCl(); pThread->SetThreadCurrNotification(objHandle); - g_pDebugInterface->SendCustomDebuggerNotification(pThread, pDomainAssembly, classToken); + g_pDebugInterface->SendCustomDebuggerNotification(pThread, pAssembly, classToken); pThread->ClearThreadCurrNotification(); if (pThread->IsAbortRequested()) diff --git a/src/coreclr/vm/domainassembly.cpp b/src/coreclr/vm/domainassembly.cpp deleted file mode 100644 index 653117ba3ecc29..00000000000000 --- a/src/coreclr/vm/domainassembly.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// -------------------------------------------------------------------------------- -// DomainAssembly.cpp -// - -#include "common.h" -#include "invokeutil.h" -#include "eeconfig.h" -#include "dynamicmethod.h" -#include "field.h" -#include "dbginterface.h" -#include "eventtrace.h" - -#include "dllimportcallback.h" -#include "peimagelayout.inl" - -#ifndef DACCESS_COMPILE -DomainAssembly::DomainAssembly(PEAssembly* pPEAssembly, LoaderAllocator* pLoaderAllocator, AllocMemTracker* memTracker) - : m_pAssembly(NULL) -{ - CONTRACTL - { - CONSTRUCTOR_CHECK; - THROWS; // ValidateForExecution - GC_TRIGGERS; // ValidateForExecution - MODE_ANY; - } - CONTRACTL_END; - - pPEAssembly->AddRef(); - pPEAssembly->ValidateForExecution(); - - // Create the Assembly - NewHolder assembly = Assembly::Create(pPEAssembly, memTracker, pLoaderAllocator); - - m_pAssembly = assembly.Extract(); - - m_pAssembly->SetDomainAssembly(this); - - // Creating the Assembly should have ensured the PEAssembly is loaded - _ASSERT(GetPEAssembly()->IsLoaded()); -} - -DomainAssembly::~DomainAssembly() -{ - CONTRACTL - { - DESTRUCTOR_CHECK; - NOTHROW; - GC_TRIGGERS; - MODE_ANY; - } - CONTRACTL_END; - - if (m_pAssembly != NULL) - { - delete m_pAssembly; - } -} -#endif //!DACCESS_COMPILE - - -PEAssembly* DomainAssembly::GetPEAssembly() -{ - return PTR_PEAssembly(m_pAssembly->GetPEAssembly()); -} diff --git a/src/coreclr/vm/domainassembly.h b/src/coreclr/vm/domainassembly.h deleted file mode 100644 index e913657033ba9a..00000000000000 --- a/src/coreclr/vm/domainassembly.h +++ /dev/null @@ -1,50 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// -------------------------------------------------------------------------------- -// DomainAssembly.h -// - -#ifndef _DOMAINASSEMBLY_H_ -#define _DOMAINASSEMBLY_H_ - -// -------------------------------------------------------------------------------- -// DomainAssembly represents an assembly loaded (or being loaded) into an app domain. It -// is guaranteed to be unique per file per app domain. -// -------------------------------------------------------------------------------- - -class DomainAssembly final -{ -public: - - // ------------------------------------------------------------ - // Public API - // ------------------------------------------------------------ - -#ifndef DACCESS_COMPILE - ~DomainAssembly(); - DomainAssembly() {LIMITED_METHOD_CONTRACT;}; -#endif - - PEAssembly* GetPEAssembly(); - - Assembly* GetAssembly() - { - LIMITED_METHOD_DAC_CONTRACT; - - return m_pAssembly; - } - -private: - // ------------------------------------------------------------ - // Loader API - // ------------------------------------------------------------ - - friend class AppDomain; - friend class Assembly; - - DomainAssembly(PEAssembly* pPEAssembly, LoaderAllocator* pLoaderAllocator, AllocMemTracker* memTracker); - - PTR_Assembly m_pAssembly; -}; - -#endif // _DOMAINASSEMBLY_H_ diff --git a/src/coreclr/vm/eventtrace.cpp b/src/coreclr/vm/eventtrace.cpp index 535a44f96dffb7..2acf1abc500634 100644 --- a/src/coreclr/vm/eventtrace.cpp +++ b/src/coreclr/vm/eventtrace.cpp @@ -2011,7 +2011,7 @@ VOID ETW::EnumerationLog::StartRundown() TRACE_LEVEL_INFORMATION, CLR_RUNDOWNLOADER_KEYWORD)) { - enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart; + enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart; } if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, @@ -2070,7 +2070,7 @@ DWORD ETW::EnumerationLog::GetEnumerationOptionsFromRuntimeKeywords() TRACE_LEVEL_INFORMATION, CLR_LOADER_KEYWORD)) { - enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload; + enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload; } if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, @@ -2201,7 +2201,7 @@ VOID ETW::EnumerationLog::EndRundown() TRACE_LEVEL_INFORMATION, CLR_RUNDOWNLOADER_KEYWORD)) { - enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd; + enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd; } if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, @@ -2976,7 +2976,7 @@ VOID ETW::LoaderLog::DomainLoadReal(_In_opt_ LPWSTR wszFriendlyName) TRACE_LEVEL_INFORMATION, CLR_LOADER_KEYWORD)) { - DWORD dwEventOptions = ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad; + DWORD dwEventOptions = ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad; ETW::LoaderLog::SendDomainEvent(dwEventOptions, wszFriendlyName); } } EX_CATCH { } EX_END_CATCH(SwallowAllExceptions); @@ -3860,7 +3860,7 @@ VOID ETW::LoaderLog::ModuleLoad(Module *pModule, LONG liReportedSharedModule) { if(bTraceFlagLoaderSet) - enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad; + enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad; if (bTraceFlagPerfTrackSet) enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::ModuleRangeLoad; if(bTraceFlagNgenMethodSet && bTraceFlagStartRundownSet) @@ -3870,14 +3870,14 @@ VOID ETW::LoaderLog::ModuleLoad(Module *pModule, LONG liReportedSharedModule) ETW::LoaderLog::SendAssemblyEvent(pModule->GetAssembly(), enumerationOptions); if(bTraceFlagLoaderSet || bTraceFlagPerfTrackSet) - ETW::LoaderLog::SendModuleEvent(pModule, ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad | ETW::EnumerationLog::EnumerationStructs::ModuleRangeLoad); + ETW::LoaderLog::SendModuleEvent(pModule, ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad | ETW::EnumerationLog::EnumerationStructs::ModuleRangeLoad); ETW::EnumerationLog::EnumerationHelper(pModule, enumerationOptions); } // we want to report domainmodule events whenever they are loaded in any AppDomain if(bTraceFlagLoaderSet) - ETW::LoaderLog::SendModuleEvent(pModule, ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad, TRUE); + ETW::LoaderLog::SendModuleEvent(pModule, ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad, TRUE); } { @@ -3952,28 +3952,28 @@ VOID ETW::LoaderLog::SendDomainEvent(DWORD dwEventOptions, LPCWSTR wszFriendlyNa /* prepare events args for ETW and ETM */ szDtraceOutput1 = (PCWSTR)lpswzDomainName; - if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad) + if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad) { FireEtwAppDomainLoad_V1(ullDomainId, ulDomainFlags, szDtraceOutput1, DefaultADID, GetClrInstanceId()); } - else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload) + else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload) { FireEtwAppDomainUnload_V1(ullDomainId, ulDomainFlags, szDtraceOutput1, DefaultADID, GetClrInstanceId()); } - else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) + else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) { FireEtwAppDomainDCStart_V1(ullDomainId, ulDomainFlags, szDtraceOutput1, DefaultADID, GetClrInstanceId()); } - else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd) + else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd) { FireEtwAppDomainDCEnd_V1(ullDomainId, ulDomainFlags, szDtraceOutput1, DefaultADID, GetClrInstanceId()); } else { - _ASSERTE((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad) || - (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload) || - (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) || - (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd)); + _ASSERTE((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad) || + (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload) || + (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) || + (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd)); } } @@ -4081,28 +4081,28 @@ VOID ETW::LoaderLog::SendAssemblyEvent(Assembly *pAssembly, DWORD dwEventOptions /* prepare events args for ETW and ETM */ szDtraceOutput1 = (PCWSTR)lpszAssemblyPath; - if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad) + if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad) { FireEtwAssemblyLoad_V1(ullAssemblyId, ullDomainId, ullBindingID, ulAssemblyFlags, szDtraceOutput1, GetClrInstanceId()); } - else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload) + else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload) { FireEtwAssemblyUnload_V1(ullAssemblyId, ullDomainId, ullBindingID, ulAssemblyFlags, szDtraceOutput1, GetClrInstanceId()); } - else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) + else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) { FireEtwAssemblyDCStart_V1(ullAssemblyId, ullDomainId, ullBindingID, ulAssemblyFlags, szDtraceOutput1, GetClrInstanceId()); } - else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd) + else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd) { FireEtwAssemblyDCEnd_V1(ullAssemblyId, ullDomainId, ullBindingID, ulAssemblyFlags, szDtraceOutput1, GetClrInstanceId()); } else { - _ASSERTE((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad) || - (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload) || - (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) || - (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd)); + _ASSERTE((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad) || + (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload) || + (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) || + (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd)); } } @@ -4373,49 +4373,49 @@ VOID ETW::LoaderLog::SendModuleEvent(Module *pModule, DWORD dwEventOptions, BOOL if(bFireDomainModuleEvents) { ULONGLONG ullAppDomainId = (ULONGLONG)AppDomain::GetCurrentDomain(); - if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad) + if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad) { FireEtwDomainModuleLoad_V1(ullModuleId, ullAssemblyId, ullAppDomainId, ulFlags, ulReservedFlags, szDtraceOutput1, szDtraceOutput2, GetClrInstanceId()); } - else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) + else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) { FireEtwDomainModuleDCStart_V1(ullModuleId, ullAssemblyId, ullAppDomainId, ulFlags, ulReservedFlags, szDtraceOutput1, szDtraceOutput2, GetClrInstanceId()); } - else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd) + else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd) { FireEtwDomainModuleDCEnd_V1(ullModuleId, ullAssemblyId, ullAppDomainId, ulFlags, ulReservedFlags, szDtraceOutput1, szDtraceOutput2, GetClrInstanceId()); } else { - _ASSERTE((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad) || - (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) || - (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd)); + _ASSERTE((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad) || + (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) || + (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd)); } } else { - if((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad) || (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::ModuleRangeLoad)) + if((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad) || (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::ModuleRangeLoad)) { FireEtwModuleLoad_V1_or_V2(ullModuleId, ullAssemblyId, ulFlags, ulReservedFlags, szDtraceOutput1, szDtraceOutput2, GetClrInstanceId(), &cvInfoIL.signature, cvInfoIL.age, managedPdbPath, &cvInfoNative.signature, cvInfoNative.age, nativePdbPath); } - else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload) + else if(dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload) { FireEtwModuleUnload_V1_or_V2(ullModuleId, ullAssemblyId, ulFlags, ulReservedFlags, szDtraceOutput1, szDtraceOutput2, GetClrInstanceId(), &cvInfoIL.signature, cvInfoIL.age, managedPdbPath, &cvInfoNative.signature, cvInfoNative.age, nativePdbPath); } - else if((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) || (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::ModuleRangeDCStart)) + else if((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) || (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::ModuleRangeDCStart)) { FireEtwModuleDCStart_V1_or_V2(ullModuleId, ullAssemblyId, ulFlags, ulReservedFlags, szDtraceOutput1, szDtraceOutput2, GetClrInstanceId(), &cvInfoIL.signature, cvInfoIL.age, managedPdbPath, &cvInfoNative.signature, cvInfoNative.age, nativePdbPath); } - else if((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd) || (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::ModuleRangeDCEnd)) + else if((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd) || (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::ModuleRangeDCEnd)) { FireEtwModuleDCEnd_V1_or_V2(ullModuleId, ullAssemblyId, ulFlags, ulReservedFlags, szDtraceOutput1, szDtraceOutput2, GetClrInstanceId(), &cvInfoIL.signature, cvInfoIL.age, managedPdbPath, &cvInfoNative.signature, cvInfoNative.age, nativePdbPath); } else { - _ASSERTE((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleLoad) || - (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload) || - (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) || - (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd) || + _ASSERTE((dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleLoad) || + (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload) || + (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) || + (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd) || (dwEventOptions & ETW::EnumerationLog::EnumerationStructs::ModuleRangeEnabledAny)); } @@ -5360,7 +5360,7 @@ VOID ETW::EnumerationLog::IterateAppDomain(DWORD enumerationOptions) EX_TRY { // DC Start events for Domain - if(enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) + if(enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) { ETW::LoaderLog::SendDomainEvent(enumerationOptions); } @@ -5376,7 +5376,7 @@ VOID ETW::EnumerationLog::IterateAppDomain(DWORD enumerationOptions) CollectibleAssemblyHolder pAssembly; while (assemblyIterator.Next(pAssembly.This())) { - if (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) + if (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) { ETW::EnumerationLog::IterateAssembly(pAssembly, enumerationOptions); } @@ -5384,8 +5384,8 @@ VOID ETW::EnumerationLog::IterateAppDomain(DWORD enumerationOptions) Module * pModule = pAssembly->GetModule(); ETW::EnumerationLog::IterateModule(pModule, enumerationOptions); - if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd) || - (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload)) + if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd) || + (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload)) { ETW::EnumerationLog::IterateAssembly(pAssembly, enumerationOptions); } @@ -5398,8 +5398,8 @@ VOID ETW::EnumerationLog::IterateAppDomain(DWORD enumerationOptions) } // DC End or Unload events for Domain - if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd) || - (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload)) + if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd) || + (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload)) { ETW::LoaderLog::SendDomainEvent(enumerationOptions); } @@ -5432,21 +5432,21 @@ VOID ETW::EnumerationLog::IterateCollectibleLoaderAllocator(AssemblyLoaderAlloca ETW::MethodLog::SendEventsForJitMethods(FALSE /*getCodeVersionIds*/, pLoaderAllocator, enumerationOptions); } - // Iterate on all DomainAssembly loaded from the same AssemblyLoaderAllocator - DomainAssemblyIterator domainAssemblyIt = pLoaderAllocator->Id()->GetDomainAssemblyIterator(); - while (!domainAssemblyIt.end()) + // Iterate on all assemblies loaded from the same AssemblyLoaderAllocator + AssemblyIterator assemblyIt = pLoaderAllocator->Id()->GetAssemblyIterator(); + while (!assemblyIt.end()) { - Assembly *pAssembly = domainAssemblyIt->GetAssembly(); // TODO: handle iterator + Assembly *pAssembly = assemblyIt; // TODO: handle iterator - Module* pModule = domainAssemblyIt->GetAssembly()->GetModule(); + Module* pModule = assemblyIt->GetModule(); ETW::EnumerationLog::IterateModule(pModule, enumerationOptions); - if (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload) + if (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload) { ETW::EnumerationLog::IterateAssembly(pAssembly, enumerationOptions); } - domainAssemblyIt++; + assemblyIt++; } // Load Jit Method events @@ -5472,22 +5472,22 @@ VOID ETW::EnumerationLog::IterateAssembly(Assembly *pAssembly, DWORD enumeration EX_TRY { // DC Start events for Assembly - if(enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) + if(enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) { ETW::LoaderLog::SendAssemblyEvent(pAssembly, enumerationOptions); } // DC Start, DCEnd, events for DomainModule - if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd) || - (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart)) + if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd) || + (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart)) { Module* pModule = pAssembly->GetModule(); ETW::LoaderLog::SendModuleEvent(pModule, enumerationOptions, TRUE); } // DC End or Unload events for Assembly - if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd) || - (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload)) + if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd) || + (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload)) { ETW::LoaderLog::SendAssemblyEvent(pAssembly, enumerationOptions); } @@ -5509,7 +5509,7 @@ VOID ETW::EnumerationLog::IterateModule(Module *pModule, DWORD enumerationOption EX_TRY { // DC Start events for Module - if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart) || + if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCStart) || (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::ModuleRangeDCStart)) { ETW::LoaderLog::SendModuleEvent(pModule, enumerationOptions); @@ -5525,8 +5525,8 @@ VOID ETW::EnumerationLog::IterateModule(Module *pModule, DWORD enumerationOption } // DC End or Unload events for Module - if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd) || - (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload) || + if((enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleDCEnd) || + (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::AssemblyModuleUnload) || (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::ModuleRangeDCEnd)) { ETW::LoaderLog::SendModuleEvent(pModule, enumerationOptions); diff --git a/src/coreclr/vm/eventtrace_bulktype.cpp b/src/coreclr/vm/eventtrace_bulktype.cpp index 1cb9e212ce4f2a..4332ff089d2c0d 100644 --- a/src/coreclr/vm/eventtrace_bulktype.cpp +++ b/src/coreclr/vm/eventtrace_bulktype.cpp @@ -367,17 +367,10 @@ void BulkComLogger::AddCcwHandle(Object **handle) curr->Handles[curr->Count++] = handle; } - - - //--------------------------------------------------------------------------------------- // BulkStaticsLogger: Batches up and logs static variable roots //--------------------------------------------------------------------------------------- - - -#include "domainassembly.h" - BulkStaticsLogger::BulkStaticsLogger(BulkTypeEventLogger *typeLogger) : m_buffer(0), m_used(0), m_count(0), m_domain(0), m_typeLogger(typeLogger) { @@ -525,8 +518,8 @@ void BulkStaticsLogger::LogAllStatics() if (module == NULL) continue; - DomainAssembly *domainAssembly = module->GetDomainAssembly(); - if (domainAssembly == NULL) + Assembly *assembly = module->GetAssembly(); + if (assembly == NULL) continue; // Ensure the module has fully loaded. diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index f13286a675ab78..554a81b103b945 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -13116,7 +13116,7 @@ PCODE UnsafeJitFunction(PrepareCodeConfig* config, QueryPerformanceCounter(&methodJitTimeStop); SString moduleName; - ftn->GetModule()->GetDomainAssembly()->GetPEAssembly()->GetPathOrCodeBase(moduleName); + ftn->GetModule()->GetPEAssembly()->GetPathOrCodeBase(moduleName); SString codeBase; codeBase.AppendPrintf("%s,0x%x,%d,%d\n", diff --git a/src/coreclr/vm/loaderallocator.cpp b/src/coreclr/vm/loaderallocator.cpp index e4463d734e0640..7b2e408ebbc957 100644 --- a/src/coreclr/vm/loaderallocator.cpp +++ b/src/coreclr/vm/loaderallocator.cpp @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - #include "common.h" #include "stringliteralmap.h" #include "virtualcallstub.h" @@ -39,7 +38,7 @@ LoaderAllocator::LoaderAllocator(bool collectible) : m_cReferences = (UINT32)-1; - m_pFirstDomainAssemblyFromSameALCToDelete = NULL; + m_pFirstAssemblyFromSameALCToDelete = NULL; #ifdef FAT_DISPATCH_TOKENS // DispatchTokenFat pointer table for token overflow scenarios. Lazily allocated. @@ -442,7 +441,7 @@ LoaderAllocator * LoaderAllocator::GCLoaderAllocators_RemoveAssemblies(AppDomain pLoaderAllocator->m_pLoaderAllocatorDestroyNext = pFirstDestroyedLoaderAllocator; // We will store a reference to this assembly, and use it later in this function pFirstDestroyedLoaderAllocator = pLoaderAllocator; - _ASSERTE(pLoaderAllocator->m_pFirstDomainAssemblyFromSameALCToDelete != NULL); + _ASSERTE(pLoaderAllocator->m_pFirstAssemblyFromSameALCToDelete != NULL); } } } @@ -459,23 +458,23 @@ LoaderAllocator * LoaderAllocator::GCLoaderAllocators_RemoveAssemblies(AppDomain GetAppDomain()->RemoveTypesFromTypeIDMap(pDomainLoaderAllocatorDestroyIterator); - DomainAssemblyIterator domainAssemblyIt(pDomainLoaderAllocatorDestroyIterator->m_pFirstDomainAssemblyFromSameALCToDelete); + AssemblyIterator assemblyIt(pDomainLoaderAllocatorDestroyIterator->m_pFirstAssemblyFromSameALCToDelete); // Release all assemblies from the same ALC - while (!domainAssemblyIt.end()) + while (!assemblyIt.end()) { - DomainAssembly* domainAssemblyToRemove = domainAssemblyIt; - pAppDomain->RemoveAssembly(domainAssemblyToRemove); + Assembly* assemblyToRemove = assemblyIt; + pAppDomain->RemoveAssembly(assemblyToRemove); - if (!domainAssemblyToRemove->GetAssembly()->IsDynamic()) + if (!assemblyToRemove->IsDynamic()) { - pAppDomain->RemoveFileFromCache(domainAssemblyToRemove->GetPEAssembly()); + pAppDomain->RemoveFileFromCache(assemblyToRemove->GetPEAssembly()); AssemblySpec spec; - spec.InitializeSpec(domainAssemblyToRemove->GetPEAssembly()); - VERIFY(pAppDomain->RemoveAssemblyFromCache(domainAssemblyToRemove->GetAssembly())); + spec.InitializeSpec(assemblyToRemove->GetPEAssembly()); + VERIFY(pAppDomain->RemoveAssemblyFromCache(assemblyToRemove)); } - domainAssemblyIt++; + assemblyIt++; } pDomainLoaderAllocatorDestroyIterator = pDomainLoaderAllocatorDestroyIterator->m_pLoaderAllocatorDestroyNext; @@ -507,9 +506,9 @@ void LoaderAllocator::GCLoaderAllocators(LoaderAllocator* pOriginalLoaderAllocat AppDomain* pAppDomain = AppDomain::GetCurrentDomain(); - // Collect all LoaderAllocators that don't have anymore DomainAssemblies alive + // Collect all LoaderAllocators that don't have anymore assemblies alive // Note: that it may not collect our pOriginalLoaderAllocator in case this - // LoaderAllocator hasn't loaded any DomainAssembly. We handle this case in the next loop. + // LoaderAllocator hasn't loaded any assembly. We handle this case in the next loop. // Note: The removed LoaderAllocators are not reachable outside of this function anymore, because we // removed them from the assembly list pFirstDestroyedLoaderAllocator = GCLoaderAllocators_RemoveAssemblies(pAppDomain); @@ -527,14 +526,14 @@ void LoaderAllocator::GCLoaderAllocators(LoaderAllocator* pOriginalLoaderAllocat // Set the unloaded flag before notifying the debugger pDomainLoaderAllocatorDestroyIterator->SetIsUnloaded(); - DomainAssemblyIterator domainAssemblyIt(pDomainLoaderAllocatorDestroyIterator->m_pFirstDomainAssemblyFromSameALCToDelete); - while (!domainAssemblyIt.end()) + AssemblyIterator assemblyIt(pDomainLoaderAllocatorDestroyIterator->m_pFirstAssemblyFromSameALCToDelete); + while (!assemblyIt.end()) { // Call AssemblyUnloadStarted event - domainAssemblyIt->GetAssembly()->StartUnload(); + assemblyIt->StartUnload(); // Notify the debugger - domainAssemblyIt->GetAssembly()->NotifyDebuggerUnload(); - domainAssemblyIt++; + assemblyIt->NotifyDebuggerUnload(); + assemblyIt++; } if (pDomainLoaderAllocatorDestroyIterator == pOriginalLoaderAllocator) @@ -544,7 +543,7 @@ void LoaderAllocator::GCLoaderAllocators(LoaderAllocator* pOriginalLoaderAllocat pDomainLoaderAllocatorDestroyIterator = pDomainLoaderAllocatorDestroyIterator->m_pLoaderAllocatorDestroyNext; } - // If the original LoaderAllocator was not processed, it is most likely a LoaderAllocator without any loaded DomainAssembly + // If the original LoaderAllocator was not processed, it is most likely a LoaderAllocator without any loaded assembly // But we still want to collect it so we add it to the list of LoaderAllocator to destroy if (!isOriginalLoaderAllocatorFound && !pOriginalLoaderAllocator->IsAlive()) { @@ -552,21 +551,21 @@ void LoaderAllocator::GCLoaderAllocators(LoaderAllocator* pOriginalLoaderAllocat pFirstDestroyedLoaderAllocator = pOriginalLoaderAllocator; } - // Iterate through free list, deleting DomainAssemblies + // Iterate through free list, deleting assemblies pDomainLoaderAllocatorDestroyIterator = pFirstDestroyedLoaderAllocator; while (pDomainLoaderAllocatorDestroyIterator != NULL) { _ASSERTE(!pDomainLoaderAllocatorDestroyIterator->IsAlive()); - DomainAssemblyIterator domainAssemblyIt(pDomainLoaderAllocatorDestroyIterator->m_pFirstDomainAssemblyFromSameALCToDelete); - while (!domainAssemblyIt.end()) + AssemblyIterator assemblyIt(pDomainLoaderAllocatorDestroyIterator->m_pFirstAssemblyFromSameALCToDelete); + while (!assemblyIt.end()) { - delete (DomainAssembly*)domainAssemblyIt; - domainAssemblyIt++; + delete (Assembly*)assemblyIt; + assemblyIt++; } // We really don't have to set it to NULL as the assembly is not reachable anymore, but just in case ... // (Also debugging NULL AVs if someone uses it accidentally is so much easier) - pDomainLoaderAllocatorDestroyIterator->m_pFirstDomainAssemblyFromSameALCToDelete = NULL; + pDomainLoaderAllocatorDestroyIterator->m_pFirstAssemblyFromSameALCToDelete = NULL; pDomainLoaderAllocatorDestroyIterator->ReleaseManagedAssemblyLoadContext(); @@ -574,10 +573,10 @@ void LoaderAllocator::GCLoaderAllocators(LoaderAllocator* pOriginalLoaderAllocat // handles first pDomainLoaderAllocatorDestroyIterator->CleanupDependentHandlesToNativeObjects(); - // The following code was previously happening on delete ~DomainAssembly->Terminate + // The following code was previously happening on delete ~Assembly->Terminate // We are moving this part here in order to make sure that we can unload a LoaderAllocator - // that didn't have a DomainAssembly - // (we have now a LoaderAllocator with 0-n DomainAssembly) + // that didn't have a assembly + // (we have now a LoaderAllocator with 0-n assembly) // This cleanup code starts resembling parts of AppDomain::Terminate too much. // It would be useful to reduce duplication and also establish clear responsibilities @@ -622,7 +621,7 @@ void LoaderAllocator::GCLoaderAllocators(LoaderAllocator* pOriginalLoaderAllocat pDomainLoaderAllocatorDestroyIterator = pLoaderAllocatorDestroyNext; } - // Deleting the DomainAssemblies will have created a list of LoaderAllocator's on the AppDomain + // Deleting the assemblies will have created a list of LoaderAllocator's on the AppDomain // Call this shutdown function to clean those up. pAppDomain->ShutdownFreeLoaderAllocators(); } // LoaderAllocator::GCLoaderAllocators @@ -666,11 +665,10 @@ BOOL LoaderAllocator::Destroy(QCall::LoaderAllocatorHandle pLoaderAllocator) } #endif // FEATURE_COMINTEROP - DomainAssembly* pDomainAssembly = (DomainAssembly*)(pID->GetDomainAssemblyIterator()); - if (pDomainAssembly != NULL) + Assembly* pAssembly = (Assembly*)(pID->GetAssemblyIterator()); + if (pAssembly != NULL) { - Assembly *pAssembly = pDomainAssembly->GetAssembly(); - pLoaderAllocator->m_pFirstDomainAssemblyFromSameALCToDelete = pAssembly->GetDomainAssembly(); + pLoaderAllocator->m_pFirstAssemblyFromSameALCToDelete = pAssembly; } // Iterate through all references to other loader allocators and decrement their reference @@ -1701,16 +1699,16 @@ BOOL AssemblyLoaderAllocator::CanUnload() return TRUE; } -DomainAssemblyIterator::DomainAssemblyIterator(DomainAssembly* pFirstAssembly) +AssemblyIterator::AssemblyIterator(Assembly* pFirstAssembly) { pCurrentAssembly = pFirstAssembly; - pNextAssembly = pCurrentAssembly ? pCurrentAssembly->GetAssembly()->GetNextAssemblyInSameALC() : NULL; + pNextAssembly = pCurrentAssembly ? pCurrentAssembly->GetNextAssemblyInSameALC() : NULL; } -void DomainAssemblyIterator::operator++() +void AssemblyIterator::operator++() { pCurrentAssembly = pNextAssembly; - pNextAssembly = pCurrentAssembly ? pCurrentAssembly->GetAssembly()->GetNextAssemblyInSameALC() : NULL; + pNextAssembly = pCurrentAssembly ? pCurrentAssembly->GetNextAssemblyInSameALC() : NULL; } #ifndef DACCESS_COMPILE diff --git a/src/coreclr/vm/loaderallocator.hpp b/src/coreclr/vm/loaderallocator.hpp index f2a200ef761730..c827caddd73ad6 100644 --- a/src/coreclr/vm/loaderallocator.hpp +++ b/src/coreclr/vm/loaderallocator.hpp @@ -47,7 +47,7 @@ class CodeRangeMapRangeList : public RangeList VPTR_VTABLE_CLASS(CodeRangeMapRangeList, RangeList) #if defined(DACCESS_COMPILE) || !defined(TARGET_WINDOWS) - CodeRangeMapRangeList() : + CodeRangeMapRangeList() : _RangeListRWLock(COOPERATIVE_OR_PREEMPTIVE, LOCK_TYPE_DEFAULT), _rangeListType(STUB_CODE_BLOCK_UNKNOWN), _id(NULL), @@ -55,7 +55,7 @@ class CodeRangeMapRangeList : public RangeList {} #endif - CodeRangeMapRangeList(StubCodeBlockKind rangeListType, bool collectible) : + CodeRangeMapRangeList(StubCodeBlockKind rangeListType, bool collectible) : _RangeListRWLock(COOPERATIVE_OR_PREEMPTIVE, LOCK_TYPE_DEFAULT), _rangeListType(rangeListType), _id(NULL), @@ -84,7 +84,7 @@ class CodeRangeMapRangeList : public RangeList _ASSERTE(id == _id || _id == NULL); _id = id; - // Grow the array first, so that a failure cannot break the + // Grow the array first, so that a failure cannot break the RangeSection::RangeSectionFlags flags = RangeSection::RANGE_SECTION_RANGELIST; if (_collectible) @@ -92,7 +92,7 @@ class CodeRangeMapRangeList : public RangeList _starts.Preallocate(_starts.GetCount() + 1); flags = (RangeSection::RangeSectionFlags)(flags | RangeSection::RANGE_SECTION_COLLECTIBLE); } - + ExecutionManager::AddCodeRange(start, end, ExecutionManager::GetEEJitManager(), flags, this); if (_collectible) @@ -167,7 +167,7 @@ class CodeRangeMapRangeList : public RangeList return FALSE; if ((pRS->_flags & RangeSection::RANGE_SECTION_RANGELIST) == 0) return FALSE; - + return (pRS->_pRangeList == this); } @@ -179,26 +179,26 @@ class CodeRangeMapRangeList : public RangeList bool _collectible; }; -// Iterator over a DomainAssembly in the same ALC -class DomainAssemblyIterator +// Iterator over assemblies in the same ALC +class AssemblyIterator { - DomainAssembly* pCurrentAssembly; - DomainAssembly* pNextAssembly; + Assembly* pCurrentAssembly; + Assembly* pNextAssembly; public: - DomainAssemblyIterator(DomainAssembly* pFirstAssembly); + AssemblyIterator(Assembly* pFirstAssembly); bool end() const { return pCurrentAssembly == NULL; } - operator DomainAssembly*() const + operator Assembly*() const { return pCurrentAssembly; } - DomainAssembly* operator ->() const + Assembly* operator ->() const { return pCurrentAssembly; } @@ -218,7 +218,7 @@ class LoaderAllocatorID LoaderAllocatorType m_type; union { - DomainAssembly* m_pDomainAssembly; + Assembly* m_pAssembly; void* m_pValue; }; @@ -232,8 +232,8 @@ class LoaderAllocatorID }; VOID Init(); LoaderAllocatorType GetType(); - VOID AddDomainAssembly(DomainAssembly* pDomainAssembly); - DomainAssemblyIterator GetDomainAssemblyIterator(); + VOID AddAssembly(Assembly* pAssembly); + AssemblyIterator GetAssemblyIterator(); BOOL Equals(LoaderAllocatorID* pId); COUNT_T Hash(); }; @@ -261,7 +261,7 @@ class SegmentedHandleIndexStack public: ~SegmentedHandleIndexStack(); - + // Push the value to the stack. If the push cannot be done due to OOM, return false; inline bool Push(DWORD value); @@ -403,7 +403,7 @@ class LoaderAllocator Volatile m_cReferences; // This will be set by code:LoaderAllocator::Destroy (from managed scout finalizer) and signalizes that // the assembly was collected - DomainAssembly * m_pFirstDomainAssemblyFromSameALCToDelete; + Assembly * m_pFirstAssemblyFromSameALCToDelete; BOOL CheckAddReference_Unlocked(LoaderAllocator *pOtherLA); @@ -491,7 +491,7 @@ class LoaderAllocator // Detection: // code:IsAlive ... TRUE // code:IsManagedScoutAlive ... TRUE - // code:DomainAssembly::GetExposedAssemblyObject ... non-NULL (may need to allocate GC object) + // code:Assembly::GetExposedAssemblyObject ... non-NULL (may need to allocate GC object) // // code:AddReferenceIfAlive ... TRUE (+ adds reference) // @@ -502,7 +502,7 @@ class LoaderAllocator // Detection: // code:IsAlive ... TRUE // code:IsManagedScoutAlive ... TRUE - // code:DomainAssembly::GetExposedAssemblyObject ... NULL (change from phase #1) + // code:Assembly::GetExposedAssemblyObject ... NULL (change from phase #1) // // code:AddReferenceIfAlive ... TRUE (+ adds reference) // @@ -518,7 +518,7 @@ class LoaderAllocator // Detection: // code:IsAlive ... TRUE // code:IsManagedScoutAlive ... FALSE (change from phase #2) - // code:DomainAssembly::GetExposedAssemblyObject ... NULL + // code:Assembly::GetExposedAssemblyObject ... NULL // // code:AddReferenceIfAlive ... TRUE (+ adds reference) // @@ -544,7 +544,7 @@ class LoaderAllocator // Checks if managed scout is alive - see code:#AssemblyPhases. BOOL IsManagedScoutAlive() { - return (m_pFirstDomainAssemblyFromSameALCToDelete == NULL); + return (m_pFirstAssemblyFromSameALCToDelete == NULL); } // Collect unreferenced assemblies, delete all their remaining resources. @@ -911,10 +911,10 @@ class AssemblyLoaderAllocator : public LoaderAllocator void Init(); virtual BOOL CanUnload(); - void AddDomainAssembly(DomainAssembly *pDomainAssembly) + void AddAssembly(Assembly *pAssembly) { WRAPPER_NO_CONTRACT; - m_Id.AddDomainAssembly(pDomainAssembly); + m_Id.AddAssembly(pAssembly); } ShuffleThunkCache* GetShuffleThunkCache() diff --git a/src/coreclr/vm/loaderallocator.inl b/src/coreclr/vm/loaderallocator.inl index c70fb52396c15e..ffa183e30f9777 100644 --- a/src/coreclr/vm/loaderallocator.inl +++ b/src/coreclr/vm/loaderallocator.inl @@ -44,17 +44,17 @@ inline void LoaderAllocatorID::Init() m_type = LAT_Assembly; }; -inline void LoaderAllocatorID::AddDomainAssembly(DomainAssembly* pAssembly) +inline void LoaderAllocatorID::AddAssembly(Assembly* pAssembly) { LIMITED_METHOD_CONTRACT; _ASSERTE(m_type == LAT_Assembly); // Link domain assembly together - if (m_pDomainAssembly != NULL) + if (m_pAssembly != NULL) { - pAssembly->GetAssembly()->SetNextAssemblyInSameALC(m_pDomainAssembly); + pAssembly->SetNextAssemblyInSameALC(m_pAssembly); } - m_pDomainAssembly = pAssembly; + m_pAssembly = pAssembly; } inline VOID* LoaderAllocatorID::GetValue() @@ -75,11 +75,11 @@ inline LoaderAllocatorType LoaderAllocatorID::GetType() return m_type; } -inline DomainAssemblyIterator LoaderAllocatorID::GetDomainAssemblyIterator() +inline AssemblyIterator LoaderAllocatorID::GetAssemblyIterator() { LIMITED_METHOD_DAC_CONTRACT; _ASSERTE(m_type == LAT_Assembly); - return DomainAssemblyIterator(m_pDomainAssembly); + return AssemblyIterator(m_pAssembly); } inline LoaderAllocatorID* AssemblyLoaderAllocator::Id() diff --git a/src/coreclr/vm/methoditer.h b/src/coreclr/vm/methoditer.h index 90ccc67e96f6c5..40d1f5955c3020 100644 --- a/src/coreclr/vm/methoditer.h +++ b/src/coreclr/vm/methoditer.h @@ -1,18 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - - #ifndef _METHODDESCITER_H_ #define _METHODDESCITER_H_ #include "instmethhash.h" #include "method.hpp" #include "appdomain.hpp" -#include "domainassembly.h" #include "typehash.h" - // Iterate all the currently loaded instantiations of a mdMethodDef // in a given AppDomain. Can be used for both generic + nongeneric methods. // This may give back duplicate entries; and it may give back some extra diff --git a/src/coreclr/vm/object.h b/src/coreclr/vm/object.h index fca89bc39b24a4..b160128c520efe 100644 --- a/src/coreclr/vm/object.h +++ b/src/coreclr/vm/object.h @@ -78,7 +78,6 @@ void ErectWriteBarrierForMT(MethodTable **dst, MethodTable *ref); class MethodTable; class Thread; class Assembly; -class DomainAssembly; class AssemblyNative; class WaitHandleNative; class ArgDestination; diff --git a/src/coreclr/vm/profilingenumerators.cpp b/src/coreclr/vm/profilingenumerators.cpp index f214be043f0bf8..0054647d48522c 100644 --- a/src/coreclr/vm/profilingenumerators.cpp +++ b/src/coreclr/vm/profilingenumerators.cpp @@ -172,7 +172,7 @@ BOOL ProfilerObjectEnum::Init() // Assemblies appear in the debugging API enumerations as soon as they begin to load, // whereas Assemblies (like all other entities) appear in the profiling API enumerations // once their load is complete (i.e., just before AssemblyLoadFinished). Also, -// debuggers enumerate DomainModules and DomainAssemblies, whereas profilers enumerate +// debuggers enumerate DomainModules and Assemblies, whereas profilers enumerate // Modules and Assemblies. // // For information about other synchronization issues with profiler catch-up, see @@ -291,7 +291,7 @@ HRESULT IterateUnsharedModules(AppDomain * pAppDomain, // enumerable. // // Note: To determine what happens in a given load stage of a module or assembly, - // look at the switch statement in code:DomainAssembly::DoIncrementalLoad, and keep in + // look at the switch statement in code:Assembly::DoIncrementalLoad, and keep in // mind that it takes cases on the *next* load stage; in other words, the actions // that appear in a case for a given load stage are actually executed as we attempt // to transition TO that load stage, and thus they actually execute while the module @@ -432,17 +432,15 @@ HRESULT ProfilerModuleEnum::Init() HRESULT hr = S_OK; - // When an assembly is loaded into an AppDomain, a DomainAssembly is - // created (one per pairing of the AppDomain with the assembly). This means - // that we'll create multiple DomainAssemblys for the same module if it is loaded - // domain-neutral (i.e., "shared"). The profiling API callbacks shield the profiler - // from this, and only report a given module the first time it's loaded. So a - // profiler sees only one ModuleLoadFinished for a module loaded domain-neutral, even - // though the module may be used by multiple AppDomains. The module enumerator must - // mirror the behavior of the profiling API callbacks, by avoiding duplicate Modules - // in the module list we return to the profiler. So first add unshared modules (non - // domain-neutral) to the enumerator, and then separately add any shared modules that - // were loaded into at least one AD. + // When an assembly is loaded into the AppDomain (since .NET Core only has one AppDomain), + // an Assembly object is created. For assemblies that are shared across multiple contexts + // (e.g., loaded into multiple AssemblyLoadContexts or marked as domain-neutral in older + // runtimes), the profiling API ensures that the profiler only sees the module once. + // The profiler will only receive a single ModuleLoadFinished callback for a module, even if + // the assembly is used across multiple contexts. The module enumerator must mirror this + // behavior, avoiding duplicate modules in the list returned to the profiler. + // Therefore, we first add non-shared assemblies (those specific to a single ALC) to the enumerator, + // and then separately add any shared modules that are loaded across multiple contexts. // First, iterate through all ADs. For each one, call // AddUnsharedModulesFromAppDomain, which iterates through all UNSHARED modules and diff --git a/src/coreclr/vm/threads.cpp b/src/coreclr/vm/threads.cpp index 60de80e15660cf..9c1720607b3b93 100644 --- a/src/coreclr/vm/threads.cpp +++ b/src/coreclr/vm/threads.cpp @@ -8108,8 +8108,8 @@ Thread::EnumMemoryRegionsWorker(CLRDataEnumMemoryFlags flags) DacEnumCodeForStackwalk(callEnd); // To stackwalk through funceval frames, we need to be sure to preserve the - // DebuggerModule's m_pRuntimeDomainAssembly. This is the only case that doesn't use the current - // vmDomainAssembly in code:DacDbiInterfaceImpl::EnumerateInternalFrames. The following + // DebuggerModule's m_pRuntimeAssembly. This is the only case that doesn't use the current + // vmAssembly in code:DacDbiInterfaceImpl::EnumerateInternalFrames. The following // code mimics that function. // Allow failure, since we want to continue attempting to walk the stack regardless of the outcome. EX_TRY diff --git a/src/coreclr/vm/threads.h b/src/coreclr/vm/threads.h index 8fe3db20ab2d4a..b9b65e857bb1ac 100644 --- a/src/coreclr/vm/threads.h +++ b/src/coreclr/vm/threads.h @@ -132,7 +132,6 @@ class NDirect; class Frame; class ThreadBaseObject; class AppDomainStack; -class DomainAssembly; class DeadlockAwareLock; struct HelperMethodFrameCallerList; class EECodeInfo;