Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 18 additions & 0 deletions src/coreclr/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7407,6 +7407,24 @@ HRESULT DacDbiInterfaceImpl::GetReJitInfo(VMPTR_MethodDesc vmMethod, CORDB_ADDRE
return S_OK;
}

HRESULT DacDbiInterfaceImpl::AreOptimizationsDisabled(VMPTR_Module vmModule, mdMethodDef methodTk, OUT BOOL* pOptimizationsDisabled)
{
DD_ENTER_MAY_THROW;
PTR_Module pModule = vmModule.GetDacPtr();
if (pModule == NULL || pOptimizationsDisabled == NULL || TypeFromToken(methodTk) != mdtMethodDef)
{
return E_INVALIDARG;
}
{
CodeVersionManager::LockHolder codeVersioningLockHolder;
Comment thread
mikelle-rogers marked this conversation as resolved.
Outdated
CodeVersionManager * pCodeVersionManager = pModule->GetCodeVersionManager();
ILCodeVersion activeILVersion = pCodeVersionManager->GetActiveILCodeVersion(pModule, methodTk);
*pOptimizationsDisabled = activeILVersion.IsDeoptimized();
}
Comment thread
mikelle-rogers marked this conversation as resolved.

return S_OK;
}

HRESULT DacDbiInterfaceImpl::GetNativeCodeVersionNode(VMPTR_MethodDesc vmMethod, CORDB_ADDRESS codeStartAddress, OUT VMPTR_NativeCodeVersionNode* pVmNativeCodeVersionNode)
{
DD_ENTER_MAY_THROW;
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/debug/daccess/dacdbiimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class DacDbiInterfaceImpl :
HRESULT GetReJitInfo(VMPTR_Module vmModule, mdMethodDef methodTk, OUT VMPTR_ReJitInfo* pReJitInfo);
HRESULT GetActiveRejitILCodeVersionNode(VMPTR_Module vmModule, mdMethodDef methodTk, OUT VMPTR_ILCodeVersionNode* pVmILCodeVersionNode);
HRESULT GetReJitInfo(VMPTR_MethodDesc vmMethod, CORDB_ADDRESS codeStartAddress, OUT VMPTR_ReJitInfo* pReJitInfo);
HRESULT AreOptimizationsDisabled(VMPTR_Module vmModule, mdMethodDef methodTk, OUT BOOL* pOptimizationsDisabled);
HRESULT GetNativeCodeVersionNode(VMPTR_MethodDesc vmMethod, CORDB_ADDRESS codeStartAddress, OUT VMPTR_NativeCodeVersionNode* pVmNativeCodeVersionNode);
HRESULT GetSharedReJitInfo(VMPTR_ReJitInfo vmReJitInfo, VMPTR_SharedReJitInfo* pSharedReJitInfo);
HRESULT GetILCodeVersionNode(VMPTR_NativeCodeVersionNode vmNativeCodeVersionNode, VMPTR_ILCodeVersionNode* pVmILCodeVersionNode);
Expand Down
27 changes: 6 additions & 21 deletions src/coreclr/debug/di/rsfunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,27 +673,12 @@ HRESULT CordbFunction::AreOptimizationsDisabled(BOOL *pOptimizationsDisabled)
{
return E_INVALIDARG;
}

CordbProcess * pProcess = GetProcess();
RSLockHolder lockHolder(pProcess->GetProcessLock());

DebuggerIPCEvent event;
CordbAppDomain * pAppDomain = GetAppDomain();
_ASSERTE (pAppDomain != NULL);

pProcess->InitIPCEvent(&event, DB_IPCE_IS_OPTS_DISABLED, true, pAppDomain->GetADToken());
event.DisableOptData.funcMetadataToken = m_MDToken;
event.DisableOptData.pModule = m_pModule->GetRuntimeModule();

lockHolder.Release();
hr = pProcess->m_cordb->SendIPCEvent(pProcess, &event, sizeof(DebuggerIPCEvent));
lockHolder.Acquire();

_ASSERTE(event.type == DB_IPCE_IS_OPTS_DISABLED_RESULT);

*pOptimizationsDisabled = event.IsOptsDisabledData.value;

return event.hr;;
EX_TRY
{
hr = GetProcess()->GetDAC()->AreOptimizationsDisabled(GetModule()->m_vmModule, m_MDToken, pOptimizationsDisabled);
Comment thread
mikelle-rogers marked this conversation as resolved.
Outdated
}
EX_CATCH_HRESULT(hr);
return hr;
}

// determine whether we have a native-only implementation
Expand Down
46 changes: 23 additions & 23 deletions src/coreclr/debug/ee/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10468,33 +10468,33 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent)
}
break;

case DB_IPCE_IS_OPTS_DISABLED:
Comment thread
mikelle-rogers marked this conversation as resolved.
{
Module *pModule = pEvent->DisableOptData.pModule.GetRawPtr();
mdToken methodDef = pEvent->DisableOptData.funcMetadataToken;
_ASSERTE(TypeFromToken(methodDef) == mdtMethodDef);

HRESULT hr = E_INVALIDARG;
BOOL deoptimized = FALSE;
EX_TRY
{
hr = IsMethodDeoptimized(pModule, methodDef, &deoptimized);
}
EX_CATCH_HRESULT(hr);
// case DB_IPCE_IS_OPTS_DISABLED:
Comment thread
mikelle-rogers marked this conversation as resolved.
Outdated
// {
// Module *pModule = pEvent->DisableOptData.pModule.GetRawPtr();
// mdToken methodDef = pEvent->DisableOptData.funcMetadataToken;
// _ASSERTE(TypeFromToken(methodDef) == mdtMethodDef);

// HRESULT hr = E_INVALIDARG;
// BOOL deoptimized = FALSE;
// EX_TRY
// {
// hr = IsMethodDeoptimized(pModule, methodDef, &deoptimized);
// }
// EX_CATCH_HRESULT(hr);

DebuggerIPCEvent * pIPCResult = m_pRCThread->GetIPCEventReceiveBuffer();
// DebuggerIPCEvent * pIPCResult = m_pRCThread->GetIPCEventReceiveBuffer();

InitIPCEvent(pIPCResult,
DB_IPCE_IS_OPTS_DISABLED_RESULT,
g_pEEInterface->GetThread(),
pEvent->vmAppDomain);
// InitIPCEvent(pIPCResult,
// DB_IPCE_IS_OPTS_DISABLED_RESULT,
// g_pEEInterface->GetThread(),
// pEvent->vmAppDomain);

pIPCResult->IsOptsDisabledData.value = deoptimized;
pIPCResult->hr = hr;
// pIPCResult->IsOptsDisabledData.value = deoptimized;
// pIPCResult->hr = hr;

m_pRCThread->SendIPCReply();
}
break;
// m_pRCThread->SendIPCReply();
// }
// break;

case DB_IPCE_BREAKPOINT_ADD:
{
Expand Down
17 changes: 17 additions & 0 deletions src/coreclr/debug/inc/dacdbiinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -2605,6 +2605,23 @@ class IDacDbiInterface
// error HRESULTs such as CORDBG_READ_VIRTUAL_FAILURE are possible
//
virtual
HRESULT AreOptimizationsDisabled(VMPTR_Module vmModule, mdMethodDef methodTk, OUT BOOL* pOptimizationsDisabled) = 0;

Comment thread
mikelle-rogers marked this conversation as resolved.
Outdated
// Retrieves a bool indicating whether or not a method's optimizations have been disabled
// defined in Debugger::IsMethodDeoptimized
//
//
//
// Arguments:
// 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
// error HRESULTs are possible
//
virtual
HRESULT GetDefinesBitField(ULONG32 *pDefines) = 0;

// Retrieves a version number indicating the shape of the data structures used in the Metadata implementation
Expand Down