Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete DomainAssembly #108618

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 73 additions & 74 deletions src/coreclr/debug/daccess/dacdbiimpl.cpp

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions src/coreclr/debug/daccess/dacdbiimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ 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);

// Helper function for SetCompilerFlags to set EnC status
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);

Expand Down Expand Up @@ -133,7 +133,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);



Expand Down Expand Up @@ -219,7 +219,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);
Expand All @@ -230,7 +230,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);

Expand Down Expand Up @@ -261,7 +261,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<FieldData> * pFieldList,
Expand Down Expand Up @@ -337,7 +337,7 @@ class DacDbiInterfaceImpl :
CorElementType simpleType,
mdTypeDef * pMetadataToken,
VMPTR_Module * pVmModule,
VMPTR_DomainAssembly * pVmDomainAssembly);
VMPTR_Assembly * pVmAssembly);

BOOL IsExceptionObject(VMPTR_Object vmObject);

Expand All @@ -353,7 +353,7 @@ class DacDbiInterfaceImpl :
HRESULT GetDelegateFunctionData(
DelegateType delegateType,
VMPTR_Object delegateObject,
OUT VMPTR_DomainAssembly *ppFunctionDomainAssembly,
OUT VMPTR_Assembly *ppFunctionAssembly,
OUT mdMethodDef *pMethodDef);

HRESULT GetDelegateTargetObject(
Expand Down Expand Up @@ -702,10 +702,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,
Expand All @@ -732,9 +732,9 @@ class DacDbiInterfaceImpl :
void GetModuleData(VMPTR_Module vmModule, ModuleInfo * pData);

// Gets properties for a domain assembly
am11 marked this conversation as resolved.
Show resolved Hide resolved
void GetDomainAssemblyData(VMPTR_DomainAssembly vmDomainAssembly, DomainAssemblyInfo * pData);
void GetRootAssemblyData(VMPTR_Assembly vmAssembly, AssemblyInfo * pData);

void GetModuleForDomainAssembly(VMPTR_DomainAssembly vmDomainAssembly, OUT VMPTR_Module * pModule);
void GetModuleForRootAssembly(VMPTR_Assembly vmAssembly, OUT VMPTR_Module * pModule);

am11 marked this conversation as resolved.
Show resolved Hide resolved
// Yields true if the address is a CLR stub.
BOOL IsTransitionStub(CORDB_ADDRESS address);
Expand All @@ -754,7 +754,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
);
Expand Down Expand Up @@ -830,8 +830,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 root Assembly), resolve the assembly.
VMPTR_Assembly ResolveAssembly(VMPTR_Assembly vmScope, mdToken tkAssemblyRef);


// Hijack the thread
Expand Down
16 changes: 8 additions & 8 deletions src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,22 +575,22 @@ 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)
{
FuncEvalFrame * pFEF = dac_cast<PTR_FuncEvalFrame>(pFrame);
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->GetRootAssembly() : 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);
}

Expand Down Expand Up @@ -767,11 +767,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

Expand Down Expand Up @@ -848,7 +848,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
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/di/breakpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()->GetRuntimeRootAssembly();
pEvent->BreakpointData.encVersion = m_code->GetVersion();

BOOL codeIsIL = m_code->IsIL();
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/debug/di/divalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void**>(&currentStackFrame.pModule));
_ASSERTE(SUCCEEDED(hr));
Expand Down Expand Up @@ -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<CordbModule> funcModule(GetProcess()->LookupOrCreateModule(functionDomainAssembly));
RSSmartPtr<CordbModule> funcModule(GetProcess()->LookupOrCreateModule(functionAssembly));
func.Assign(funcModule->LookupOrCreateFunction(functionMethodDef, nativeCodeForDelFunc.encVersion));
}

Expand Down
Loading