Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 17 additions & 23 deletions src/coreclr/debug/di/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5061,6 +5061,23 @@ void CordbProcess::RawDispatchEvent(

case DB_IPCE_LOAD_MODULE:
{
LOG((LF_CORDB, LL_INFO100,
"RCET::HRCE: load module (includes assembly loading) on thread %#x Asm:0x%08x AD:0x%08x \n",
dwVolatileThreadId,
VmPtrToCookie(pEvent->LoadModuleData.vmDomainAssembly),
VmPtrToCookie(pEvent->vmAppDomain)));

_ASSERTE (pAppDomain != NULL);

// Determine if this Assembly is cached.
CordbAssembly * pAssembly = pAppDomain->LookupOrCreateAssembly(pEvent->LoadModuleData.vmDomainAssembly);
_ASSERTE(pAssembly != NULL); // throws on error

// If created, or have, an Assembly, notify callback.
{
PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent);
hr = pCallback1->LoadAssembly(pAppDomain, pAssembly);
}
_ASSERTE (pAppDomain != NULL);
CordbModule * pModule = pAppDomain->LookupOrCreateModule(pEvent->LoadModuleData.vmDomainAssembly);

Expand Down Expand Up @@ -5375,29 +5392,6 @@ void CordbProcess::RawDispatchEvent(

break;

case DB_IPCE_LOAD_ASSEMBLY:
{
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->vmAppDomain)));

_ASSERTE (pAppDomain != NULL);

// Determine if this Assembly is cached.
CordbAssembly * pAssembly = pAppDomain->LookupOrCreateAssembly(pEvent->AssemblyData.vmDomainAssembly);
_ASSERTE(pAssembly != NULL); // throws on error

// If created, or have, an Assembly, notify callback.
{
PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent);
hr = pCallback1->LoadAssembly(pAppDomain, pAssembly);
}
}

break;

case DB_IPCE_UNLOAD_ASSEMBLY:
{
LOG((LF_CORDB, LL_INFO100, "RCET::DRCE: unload assembly on thread %#x Asm:0x%x AD:0x%x\n",
Expand Down
56 changes: 0 additions & 56 deletions src/coreclr/debug/ee/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9250,62 +9250,6 @@ void Debugger::SendCreateAppDomainEvent(AppDomain * pRuntimeAppDomain)

}


//
// LoadAssembly is called when a new Assembly gets loaded.
//
void Debugger::LoadAssembly(DomainAssembly * pDomainAssembly)
{
CONTRACTL
{
MAY_DO_HELPER_THREAD_DUTY_THROWS_CONTRACT;
MAY_DO_HELPER_THREAD_DUTY_GC_TRIGGERS_CONTRACT;
}
CONTRACTL_END;

if (CORDBUnrecoverableError(this))
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() ));

if (!CORDebuggerAttached())
{
return;
}

Thread *pThread = g_pEEInterface->GetThread();
SENDIPCEVENT_BEGIN(this, pThread)


if (CORDebuggerAttached())
{
// Send a load assembly event to the Right Side.
DebuggerIPCEvent* ipce = m_pRCThread->GetIPCEventSendBuffer();
InitIPCEvent(ipce,
DB_IPCE_LOAD_ASSEMBLY,
pThread);

ipce->AssemblyData.vmDomainAssembly.SetRawPtr(pDomainAssembly);

m_pRCThread->SendIPCEvent();
}
else
{
LOG((LF_CORDB,LL_INFO1000, "D::LA: Skipping SendIPCEvent because RS detached."));
}

// Stop all Runtime threads
if (CORDebuggerAttached())
{
TrapAllRuntimeThreads();
}

SENDIPCEVENT_END;
}



//
// UnloadAssembly is called when a Runtime thread unloads an assembly.
//
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/debug/ee/debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -2623,9 +2623,6 @@ class Debugger : public DebugInterface

void SendCreateAppDomainEvent(AppDomain * pAppDomain);

// Notify the debugger that an assembly has been loaded
void LoadAssembly(DomainAssembly * pDomainAssembly);

// Notify the debugger that an assembly has been unloaded
void UnloadAssembly(DomainAssembly * pDomainAssembly);

Expand Down
1 change: 0 additions & 1 deletion src/coreclr/vm/appdomain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ class LoadLevelLimiter final

enum
{
ATTACH_ASSEMBLY_LOAD = 0x1,
ATTACH_MODULE_LOAD = 0x2,
ATTACH_CLASS_LOAD = 0x4,

Expand Down
13 changes: 2 additions & 11 deletions src/coreclr/vm/assembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2365,7 +2365,7 @@ void Assembly::DeliverSyncEvents()
SetShouldNotifyDebugger();

// Still work to do even if no debugger is attached.
NotifyDebuggerLoad(ATTACH_ASSEMBLY_LOAD, FALSE);
NotifyDebuggerLoad(ATTACH_MODULE_LOAD, FALSE);

}
#endif // DEBUGGING_SUPPORTED
Expand Down Expand Up @@ -2488,16 +2488,7 @@ BOOL Assembly::NotifyDebuggerLoad(int flags, BOOL attaching)
}

// There is still work we need to do even when no debugger is attached.
if (flags & ATTACH_ASSEMBLY_LOAD)
{
if (ShouldNotifyDebugger())
{
g_pDebugInterface->LoadAssembly(GetDomainAssembly());
}
result = TRUE;
}

if(this->ShouldNotifyDebugger())
if(this->ShouldNotifyDebugger() && !(flags & ATTACH_MODULE_LOAD))
{
result = result ||
this->GetModule()->NotifyDebuggerLoad(GetDomainAssembly(), flags, attaching);
Expand Down
8 changes: 0 additions & 8 deletions src/coreclr/vm/dbginterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,6 @@ class DebugInterface

virtual HRESULT UpdateAppDomainEntryInIPC (AppDomain *pAppDomain) = 0;

// Called when an assembly is being loaded into an AppDomain.
// This includes when a domain neutral assembly is loaded into a new AppDomain.
// 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


// Called for all assemblies in an AppDomain when the AppDomain is unloaded.
// This includes domain neutral assemblies that are also loaded into other domains.
// This is called only when a debugger is attached, and will occur after all UnloadClass
Expand Down
Loading