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
376 changes: 203 additions & 173 deletions src/coreclr/debug/daccess/dacdbiimpl.cpp

Large diffs are not rendered by default.

336 changes: 170 additions & 166 deletions src/coreclr/debug/daccess/dacdbiimpl.h

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ T_CONTEXT * GetContextBufferFromHandle(StackWalkHandle pSFIHandle)


// Create and return a stackwalker on the specified thread.
HRESULT DacDbiInterfaceImpl::CreateStackWalk(VMPTR_Thread vmThread, DT_CONTEXT * pInternalContextBuffer, OUT StackWalkHandle * ppSFIHandle)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::CreateStackWalk(VMPTR_Thread vmThread, DT_CONTEXT * pInternalContextBuffer, OUT StackWalkHandle * ppSFIHandle)
{
DD_ENTER_MAY_THROW;

Expand Down Expand Up @@ -144,7 +144,7 @@ HRESULT DacDbiInterfaceImpl::CreateStackWalk(VMPTR_Thread vmThread, DT_CONTEXT *
}

// Delete the stackwalk object allocated by code:AllocateStackwalk
HRESULT DacDbiInterfaceImpl::DeleteStackWalk(StackWalkHandle ppSFIHandle)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::DeleteStackWalk(StackWalkHandle ppSFIHandle)
{
HRESULT hr = S_OK;
EX_TRY
Expand All @@ -156,7 +156,7 @@ HRESULT DacDbiInterfaceImpl::DeleteStackWalk(StackWalkHandle ppSFIHandle)
}

// Get the CONTEXT of the current frame at which the stackwalker is stopped.
HRESULT DacDbiInterfaceImpl::GetStackWalkCurrentContext(StackWalkHandle pSFIHandle, DT_CONTEXT * pContext)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetStackWalkCurrentContext(StackWalkHandle pSFIHandle, DT_CONTEXT * pContext)
{
DD_ENTER_MAY_THROW;

Expand Down Expand Up @@ -189,7 +189,7 @@ void DacDbiInterfaceImpl::GetStackWalkCurrentContext(StackFrameIterator * pIter,


// Set the stackwalker to the specified CONTEXT.
HRESULT DacDbiInterfaceImpl::SetStackWalkCurrentContext(VMPTR_Thread vmThread, StackWalkHandle pSFIHandle, CorDebugSetContextFlag flag, DT_CONTEXT * pContext)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::SetStackWalkCurrentContext(VMPTR_Thread vmThread, StackWalkHandle pSFIHandle, CorDebugSetContextFlag flag, DT_CONTEXT * pContext)
{
DD_ENTER_MAY_THROW;

Expand Down Expand Up @@ -229,7 +229,7 @@ HRESULT DacDbiInterfaceImpl::SetStackWalkCurrentContext(VMPTR_Thread vmThread, S


// Unwind the stackwalker to the next frame.
HRESULT DacDbiInterfaceImpl::UnwindStackWalkFrame(StackWalkHandle pSFIHandle, OUT BOOL * pResult)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::UnwindStackWalkFrame(StackWalkHandle pSFIHandle, OUT BOOL * pResult)
{
DD_ENTER_MAY_THROW;

Expand Down Expand Up @@ -348,7 +348,7 @@ bool g_fSkipStackCheckInit = false;

// Check whether the specified CONTEXT is valid. The only check we perform right now is whether the
// SP in the specified CONTEXT is in the stack range of the thread.
HRESULT DacDbiInterfaceImpl::CheckContext(VMPTR_Thread vmThread,
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::CheckContext(VMPTR_Thread vmThread,
const DT_CONTEXT * pContext)
{
DD_ENTER_MAY_THROW;
Expand Down Expand Up @@ -386,7 +386,7 @@ HRESULT DacDbiInterfaceImpl::CheckContext(VMPTR_Thread vmThread,
}

// Retrieve information about the current frame from the stackwalker.
HRESULT DacDbiInterfaceImpl::GetStackWalkCurrentFrameInfo(StackWalkHandle pSFIHandle, OPTIONAL DebuggerIPCE_STRData * pFrameData, OUT FrameType * pRetVal)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetStackWalkCurrentFrameInfo(StackWalkHandle pSFIHandle, OPTIONAL DebuggerIPCE_STRData * pFrameData, OUT FrameType * pRetVal)
{
DD_ENTER_MAY_THROW;

Expand Down Expand Up @@ -491,7 +491,7 @@ HRESULT DacDbiInterfaceImpl::GetStackWalkCurrentFrameInfo(StackWalkHandle pSFIHa
// Internal frames are interesting if they are not of type STUBFRAME_NONE.
//

HRESULT DacDbiInterfaceImpl::GetCountOfInternalFrames(VMPTR_Thread vmThread, OUT ULONG32 * pRetVal)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetCountOfInternalFrames(VMPTR_Thread vmThread, OUT ULONG32 * pRetVal)
{
DD_ENTER_MAY_THROW;

Expand Down Expand Up @@ -551,7 +551,7 @@ HRESULT DacDbiInterfaceImpl::GetCountOfInternalFrames(VMPTR_Thread vmThread, OUT
// pUserData - user-defined custom data to be passed to the callback
//

HRESULT DacDbiInterfaceImpl::EnumerateInternalFrames(VMPTR_Thread vmThread, FP_INTERNAL_FRAME_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::EnumerateInternalFrames(VMPTR_Thread vmThread, FP_INTERNAL_FRAME_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData)
{
DD_ENTER_MAY_THROW;

Expand Down Expand Up @@ -674,7 +674,7 @@ HRESULT DacDbiInterfaceImpl::EnumerateInternalFrames(VMPTR_Thread vmThread, FP_I

// Given the FramePointer of the parent frame and the FramePointer of the current frame,
// check if the current frame is the parent frame.
HRESULT DacDbiInterfaceImpl::IsMatchingParentFrame(FramePointer fpToCheck, FramePointer fpParent, OUT BOOL * pResult)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::IsMatchingParentFrame(FramePointer fpToCheck, FramePointer fpParent, OUT BOOL * pResult)
{
DD_ENTER_MAY_THROW;

Expand All @@ -695,7 +695,7 @@ HRESULT DacDbiInterfaceImpl::IsMatchingParentFrame(FramePointer fpToCheck, Frame
}

// Return the stack parameter size of the given method.
HRESULT DacDbiInterfaceImpl::GetStackParameterSize(CORDB_ADDRESS controlPC, OUT ULONG32 * pRetVal)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetStackParameterSize(CORDB_ADDRESS controlPC, OUT ULONG32 * pRetVal)
{
DD_ENTER_MAY_THROW;

Expand All @@ -713,7 +713,7 @@ HRESULT DacDbiInterfaceImpl::GetStackParameterSize(CORDB_ADDRESS controlPC, OUT
}

// Return the FramePointer of the current frame at which the stackwalker is stopped.
HRESULT DacDbiInterfaceImpl::GetFramePointer(StackWalkHandle pSFIHandle, OUT FramePointer * pRetVal)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetFramePointer(StackWalkHandle pSFIHandle, OUT FramePointer * pRetVal)
{
DD_ENTER_MAY_THROW;

Expand Down Expand Up @@ -780,7 +780,7 @@ FramePointer DacDbiInterfaceImpl::GetFramePointerWorker(StackFrameIterator * pIt

// Return TRUE if the specified CONTEXT is the CONTEXT of the leaf frame.
// @dbgtodo filter CONTEXT - Currently we check for the filter CONTEXT first.
HRESULT DacDbiInterfaceImpl::IsLeafFrame(VMPTR_Thread vmThread, const DT_CONTEXT * pContext, OUT BOOL * pResult)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::IsLeafFrame(VMPTR_Thread vmThread, const DT_CONTEXT * pContext, OUT BOOL * pResult)
{
DD_ENTER_MAY_THROW;

Expand All @@ -800,7 +800,7 @@ HRESULT DacDbiInterfaceImpl::IsLeafFrame(VMPTR_Thread vmThread, const DT_CONTEXT

// This is a simple helper function to convert a CONTEXT to a DebuggerREGDISPLAY. We need to do this
// inside DDI because the RS has no notion of REGDISPLAY.
HRESULT DacDbiInterfaceImpl::ConvertContextToDebuggerRegDisplay(const DT_CONTEXT * pInContext, DebuggerREGDISPLAY * pOutDRD, BOOL fActive)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::ConvertContextToDebuggerRegDisplay(const DT_CONTEXT * pInContext, DebuggerREGDISPLAY * pOutDRD, BOOL fActive)
{
DD_ENTER_MAY_THROW;

Expand Down Expand Up @@ -1417,7 +1417,7 @@ BOOL DacDbiInterfaceImpl::UnwindRuntimeStackFrame(StackFrameIterator * pIter)
// Return true iff TS_SyncSuspended or TS_Hijacked is set on the specified thread.
//

HRESULT DacDbiInterfaceImpl::IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread, OUT bool * pResult)
HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread, OUT BOOL * pResult)
{
DD_ENTER_MAY_THROW;

Expand All @@ -1429,17 +1429,17 @@ HRESULT DacDbiInterfaceImpl::IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread,
Thread::ThreadState ts = pThread->GetSnapshotState();
if ((ts & Thread::TS_SyncSuspended) != 0)
{
*pResult = true;
*pResult = TRUE;
}
#ifdef FEATURE_HIJACK
else if ((ts & Thread::TS_Hijacked) != 0)
{
*pResult = true;
*pResult = TRUE;
}
#endif
else
{
*pResult = false;
*pResult = FALSE;
}
}
EX_CATCH_HRESULT(hr);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/di/divalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2460,7 +2460,7 @@ HRESULT CordbObjectValue::EnumerateExceptionCallStack(ICorDebugExceptionObjectCa

DacDbiArrayList<DacExceptionCallStackData> dacStackFrames;

IfFailThrow(pDAC->GetStackFramesFromException(vmObj, dacStackFrames));
IfFailThrow(pDAC->GetStackFramesFromException(vmObj, &dacStackFrames));
int stackFramesLength = dacStackFrames.Count();

if (stackFramesLength > 0)
Expand Down
12 changes: 6 additions & 6 deletions src/coreclr/debug/di/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,10 +797,10 @@ HRESULT CordbModule::InitPublicMetaDataFromFile(const WCHAR * pszFullPathName,

_ASSERTE(!m_vmPEFile.IsNull());
// MetaData lookup favors the NGEN image, which is what we want here.
bool _mdFileInfoResult;
BOOL _mdFileInfoResult;
IfFailThrow(this->GetProcess()->GetDAC()->GetMetaDataFileInfoFromPEFile(m_vmPEFile,
dwImageTimeStamp,
dwImageSize,
&dwImageTimeStamp,
&dwImageSize,
&filePath,
&_mdFileInfoResult));
if (!_mdFileInfoResult)
Expand Down Expand Up @@ -1187,10 +1187,10 @@ HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_
StringCopyHolder filePath;

_ASSERTE(!m_vmPEFile.IsNull());
bool _mdFileInfoResult;
BOOL _mdFileInfoResult;
IfFailThrow(this->GetProcess()->GetDAC()->GetMetaDataFileInfoFromPEFile(m_vmPEFile,
dwImageTimeStamp,
dwImageSize,
&dwImageTimeStamp,
&dwImageSize,
&filePath,
&_mdFileInfoResult));
if (_mdFileInfoResult)
Expand Down
26 changes: 17 additions & 9 deletions src/coreclr/debug/di/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ IMDInternalImport * CordbProcess::LookupMetaDataFromDebugger(
IMDInternalImport * pMDII = NULL;

// First, see if the debugger can locate the exact metadata we want.
bool _metaDataFileInfoResult;
IfFailThrow(this->GetDAC()->GetMetaDataFileInfoFromPEFile(vmPEAssembly, dwImageTimeStamp, dwImageSize, &filePath, &_metaDataFileInfoResult));
BOOL _metaDataFileInfoResult;
IfFailThrow(this->GetDAC()->GetMetaDataFileInfoFromPEFile(vmPEAssembly, &dwImageTimeStamp, &dwImageSize, &filePath, &_metaDataFileInfoResult));
if (_metaDataFileInfoResult)
{
_ASSERTE(filePath.IsSet());
Expand Down Expand Up @@ -1626,7 +1626,7 @@ void CordbProcess::FreeDac()

if (m_pDacPrimitives != NULL)
{
m_pDacPrimitives->Destroy();
m_pDacPrimitives->Release();
m_pDacPrimitives = NULL;
}

Expand Down Expand Up @@ -2195,6 +2195,14 @@ HRESULT CordbProcess::QueryInterface(REFIID id, void **pInterface)
{
*pInterface = static_cast<ICorDebugProcess12*>(this);
}
else if (id == IID_IDacDbiAllocator)
{
*pInterface = static_cast<IDacDbiInterface::IAllocator*>(this);
}
else if (id == IID_IDacDbiMetaDataLookup)
{
*pInterface = static_cast<IDacDbiInterface::IMetaDataLookup*>(this);
}
else if (id == IID_IUnknown)
{
*pInterface = static_cast<IUnknown*>(static_cast<ICorDebugProcess*>(this));
Expand Down Expand Up @@ -2250,7 +2258,7 @@ HRESULT CordbProcess::EnumerateHeap(ICorDebugHeapEnum **ppObjects)

EX_TRY
{
bool gcValid;
BOOL gcValid;
IfFailThrow(m_pDacPrimitives->AreGCStructuresValid(&gcValid));
if (gcValid)
{
Expand Down Expand Up @@ -2333,7 +2341,7 @@ HRESULT CordbProcess::GetObjectInternal(CORDB_ADDRESS addr, ICorDebugObjectValue

EX_TRY
{
bool validObj;
BOOL validObj;
IfFailThrow(m_pDacPrimitives->IsValidObject(addr, &validObj));
if (!validObj)
{
Expand Down Expand Up @@ -2601,7 +2609,7 @@ COM_METHOD CordbProcess::GetAsyncStack(CORDB_ADDRESS continuationAddress, ICorDe

EX_TRY
{
bool validObj;
BOOL validObj;
IfFailThrow(m_pDacPrimitives->IsValidObject(continuationAddress, &validObj));
if (!validObj)
{
Expand Down Expand Up @@ -2637,7 +2645,7 @@ HRESULT CordbProcess::GetTypeForObject(CORDB_ADDRESS addr, CordbType **ppType, C
VMPTR_DomainAssembly domainAssembly;

HRESULT hr = E_FAIL;
bool _appDomainResult;
BOOL _appDomainResult;
IfFailThrow(GetDAC()->GetAppDomainForObject(addr, &appDomain, &mod, &domainAssembly, &_appDomainResult));
if (_appDomainResult)
{
Expand Down Expand Up @@ -14579,7 +14587,7 @@ void CordbWin32EventThread::AttachProcess()
EX_TRY
{
// Don't allow attach if any metadata/IL updates have been applied
bool _metadataUpdatesApplied;
BOOL _metadataUpdatesApplied;
IfFailThrow(pProcess->GetDAC()->MetadataUpdatesApplied(&_metadataUpdatesApplied));
if (_metadataUpdatesApplied)
{
Expand Down Expand Up @@ -15754,7 +15762,7 @@ bool CordbProcess::IsThreadSuspendedOrHijacked(ICorDebugThread * pICorDebugThrea
PUBLIC_REENTRANT_API_ENTRY_FOR_SHIM(this);

CordbThread * pCordbThread = static_cast<CordbThread *> (pICorDebugThread);
bool _isSuspendedOrHijacked;
BOOL _isSuspendedOrHijacked;
IfFailThrow(GetDAC()->IsThreadSuspendedOrHijacked(pCordbThread->m_vmThreadToken, &_isSuspendedOrHijacked));
return _isSuspendedOrHijacked;
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/di/rspriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class CordbEval;
class RSLock;
class NeuterList;

class IDacDbiInterface;
struct IDacDbiInterface;

#if defined(FEATURE_DBGIPC_TRANSPORT_DI)
class DbgTransportTarget;
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/di/rsthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,9 +912,9 @@ bool CordbThread::IsThreadWaitingOrSleeping()
//
bool CordbThread::IsThreadDead()
{
bool _isDead;
BOOL _isDead;
IfFailThrow(GetProcess()->GetDAC()->IsThreadMarkedDead(m_vmThreadToken, &_isDead));
return _isDead;
return _isDead != FALSE;
}

// Helper to return CORDBG_E_BAD_THREAD_STATE if IsThreadDead
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/di/rstype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ HRESULT CordbType::InitInstantiationTypeHandle(BOOL fForceInit)
{
// Get the TypeHandle based on the type data
RSLockHolder lockHolder(GetProcess()->GetProcessLock());
hr = pProcess->GetDAC()->GetExactTypeHandle(&typeData, &argInfo, m_typeHandleExact);
hr = pProcess->GetDAC()->GetExactTypeHandle(&typeData, &argInfo, &m_typeHandleExact);
}
}
EX_CATCH_HRESULT(hr);
Expand Down
Loading
Loading