summaryrefslogtreecommitdiff
path: root/src/debug/daccess/dacdbiimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug/daccess/dacdbiimpl.cpp')
-rw-r--r--src/debug/daccess/dacdbiimpl.cpp113
1 files changed, 23 insertions, 90 deletions
diff --git a/src/debug/daccess/dacdbiimpl.cpp b/src/debug/daccess/dacdbiimpl.cpp
index ae266e8a6f..605d5c7cee 100644
--- a/src/debug/daccess/dacdbiimpl.cpp
+++ b/src/debug/daccess/dacdbiimpl.cpp
@@ -25,15 +25,14 @@
#include "stackwalk.h"
#include "dacdbiimpl.h"
-#ifndef FEATURE_CORECLR
-#include "assemblyusagelogmanager.h"
-#endif
#ifdef FEATURE_COMINTEROP
#include "runtimecallablewrapper.h"
#include "comcallablewrapper.h"
#endif // FEATURE_COMINTEROP
+#include "request_common.h"
+
//-----------------------------------------------------------------------------
// Have standard enter and leave macros at the DacDbi boundary to enforce
// standard behavior.
@@ -3249,12 +3248,6 @@ CORDB_ADDRESS DacDbiInterfaceImpl::GetThreadOrContextStaticAddress(VMPTR_FieldDe
{
fieldAddress = pRuntimeThread->GetStaticFieldAddrNoCreate(pFieldDesc, NULL);
}
-#ifdef FEATURE_REMOTING
- else if (pFieldDesc->IsContextStatic())
- {
- fieldAddress = PTR_TO_TADDR(pRuntimeThread->GetContext()->GetStaticFieldAddrNoCreate(pFieldDesc));
- }
-#endif
else
{
// In case we have more special cases added later, this will allow us to notice the need to
@@ -3473,12 +3466,7 @@ void DacDbiInterfaceImpl::GetStackFramesFromException(VMPTR_Object vmObject, Dac
currentFrame.vmDomainFile.SetHostPtr(pDomainFile);
currentFrame.ip = currentElement.ip;
currentFrame.methodDef = currentElement.pFunc->GetMemberDef();
-#if defined(FEATURE_EXCEPTIONDISPATCHINFO)
currentFrame.isLastForeignExceptionFrame = currentElement.fIsLastFrameFromForeignStackTrace;
-#else
- // for CLRs lacking exception dispatch info just set it to 0
- currentFrame.isLastForeignExceptionFrame = 0;
-#endif
}
}
}
@@ -4541,29 +4529,6 @@ void DacDbiInterfaceImpl::MarkDebuggerAttached(BOOL fAttached)
}
-#ifdef FEATURE_INCLUDE_ALL_INTERFACES
-// Enumerate all the Connections in the process.
-void DacDbiInterfaceImpl::EnumerateConnections(FP_CONNECTION_CALLBACK fpCallback, void * pUserData)
-{
- DD_ENTER_MAY_THROW;
-
- ConnectionNameHashEntry * pConnection;
-
- HASHFIND hashfind;
-
- pConnection = CCLRDebugManager::FindFirst(&hashfind);
- while (pConnection)
- {
- DWORD id = pConnection->m_dwConnectionId;
- LPCWSTR pName = pConnection->m_pwzName;
-
- fpCallback(id, pName, pUserData);
-
- // now get the next connection record
- pConnection = CCLRDebugManager::FindNext(&hashfind);
- }
-}
-#endif
// Enumerate all threads in the process.
@@ -4783,14 +4748,7 @@ DWORD DacDbiInterfaceImpl::GetUniqueThreadID(VMPTR_Thread vmThread)
Thread * pThread = vmThread.GetDacPtr();
_ASSERTE(pThread != NULL);
- if (CLRTaskHosted())
- {
- return pThread->GetThreadId();
- }
- else
- {
- return pThread->GetOSThreadId();
- }
+ return pThread->GetOSThreadId();
}
// Return the object handle to the managed Exception object of the current exception
@@ -5494,15 +5452,8 @@ CorDebugUserState DacDbiInterfaceImpl::GetPartialUserState(VMPTR_Thread vmThread
result |= USER_WAIT_SLEEP_JOIN;
}
- // Don't report a SuspendRequested if the thread has actually Suspended.
- if ((ts & Thread::TS_UserSuspendPending) && (ts & Thread::TS_SyncSuspended))
- {
- result |= USER_SUSPENDED;
- }
- else if (ts & Thread::TS_UserSuspendPending)
- {
- result |= USER_SUSPEND_REQUESTED;
- }
+ // CoreCLR does not support user-requested thread suspension
+ _ASSERTE(!(ts & Thread::TS_UserSuspendPending));
if (pThread->IsThreadPoolThread())
{
@@ -5684,28 +5635,7 @@ VMPTR_Object DacDbiInterfaceImpl::GetObject(CORDB_ADDRESS ptr)
HRESULT DacDbiInterfaceImpl::EnableNGENPolicy(CorDebugNGENPolicy ePolicy)
{
-#ifndef FEATURE_CORECLR
- DD_ENTER_MAY_THROW;
-
- // translate from our publicly exposed enum to the appropriate internal value
- AssemblyUsageLogManager::ASSEMBLY_USAGE_LOG_FLAGS asmFlag = AssemblyUsageLogManager::ASSEMBLY_USAGE_LOG_FLAGS_NONE;
-
- switch (ePolicy)
- {
- case DISABLE_LOCAL_NIC:
- asmFlag = AssemblyUsageLogManager::ASSEMBLY_USAGE_LOG_FLAGS_APPLOCALNGENDISABLED;
- break;
- default:
- return E_INVALIDARG;
- }
-
- // we should have made some selection
- _ASSERTE(asmFlag != AssemblyUsageLogManager::ASSEMBLY_USAGE_LOG_FLAGS_NONE);
-
- return AssemblyUsageLogManager::SetUsageLogFlag(asmFlag, TRUE);
-#else
return E_NOTIMPL;
-#endif // FEATURE_CORECLR
}
HRESULT DacDbiInterfaceImpl::SetNGENCompilerFlags(DWORD dwFlags)
@@ -5788,9 +5718,9 @@ BOOL DacDbiInterfaceImpl::IsVmObjectHandleValid(VMPTR_OBJECTHANDLE vmHandle)
// SEH exceptions will be caught
EX_TRY
{
- OBJECTREF objRef = ObjectFromHandle((OBJECTHANDLE)vmHandle.GetDacPtr());
+ OBJECTREF objRef = HndFetchHandle((OBJECTHANDLE)vmHandle.GetDacPtr());
- // NULL is certinally valid...
+ // NULL is certainly valid...
if (objRef != NULL)
{
if (objRef->ValidateObjectWithPossibleAV())
@@ -6636,7 +6566,6 @@ HRESULT DacHeapWalker::ListNearObjects(CORDB_ADDRESS obj, CORDB_ADDRESS *pPrev,
return hr;
}
-#include "gceewks.cpp"
HRESULT DacHeapWalker::InitHeapDataWks(HeapData *&pHeaps, size_t &pCount)
{
// Scrape basic heap details
@@ -6645,16 +6574,20 @@ HRESULT DacHeapWalker::InitHeapDataWks(HeapData *&pHeaps, size_t &pCount)
if (pHeaps == NULL)
return E_OUTOFMEMORY;
- pHeaps[0].YoungestGenPtr = (CORDB_ADDRESS)WKS::generation_table[0].allocation_context.alloc_ptr;
- pHeaps[0].YoungestGenLimit = (CORDB_ADDRESS)WKS::generation_table[0].allocation_context.alloc_limit;
+ dac_generation gen0 = *GenerationTableIndex(g_gcDacGlobals->generation_table, 0);
+ dac_generation gen1 = *GenerationTableIndex(g_gcDacGlobals->generation_table, 1);
+ dac_generation gen2 = *GenerationTableIndex(g_gcDacGlobals->generation_table, 2);
+ dac_generation loh = *GenerationTableIndex(g_gcDacGlobals->generation_table, 3);
+ pHeaps[0].YoungestGenPtr = (CORDB_ADDRESS)gen0.allocation_context.alloc_ptr;
+ pHeaps[0].YoungestGenLimit = (CORDB_ADDRESS)gen0.allocation_context.alloc_limit;
- pHeaps[0].Gen0Start = (CORDB_ADDRESS)WKS::generation_table[0].allocation_start;
- pHeaps[0].Gen0End = (CORDB_ADDRESS)WKS::gc_heap::alloc_allocated.GetAddr();
- pHeaps[0].Gen1Start = (CORDB_ADDRESS)WKS::generation_table[1].allocation_start;
+ pHeaps[0].Gen0Start = (CORDB_ADDRESS)gen0.allocation_start;
+ pHeaps[0].Gen0End = (CORDB_ADDRESS)*g_gcDacGlobals->alloc_allocated;
+ pHeaps[0].Gen1Start = (CORDB_ADDRESS)gen1.allocation_start;
// Segments
- int count = GetSegmentCount(WKS::generation_table[NUMBERGENERATIONS-1].start_segment);
- count += GetSegmentCount(WKS::generation_table[NUMBERGENERATIONS-2].start_segment);
+ int count = GetSegmentCount(loh.start_segment);
+ count += GetSegmentCount(gen2.start_segment);
pHeaps[0].SegmentCount = count;
pHeaps[0].Segments = new (nothrow) SegmentData[count];
@@ -6662,14 +6595,14 @@ HRESULT DacHeapWalker::InitHeapDataWks(HeapData *&pHeaps, size_t &pCount)
return E_OUTOFMEMORY;
// Small object heap segments
- WKS::heap_segment *seg = WKS::generation_table[NUMBERGENERATIONS-2].start_segment;
+ DPTR(dac_heap_segment) seg = gen2.start_segment;
int i = 0;
for (; seg && (i < count); ++i)
{
pHeaps[0].Segments[i].Start = (CORDB_ADDRESS)seg->mem;
- if (seg == WKS::gc_heap::ephemeral_heap_segment)
+ if (seg.GetAddr() == (TADDR)*g_gcDacGlobals->ephemeral_heap_segment)
{
- pHeaps[0].Segments[i].End = (CORDB_ADDRESS)WKS::gc_heap::alloc_allocated.GetAddr();
+ pHeaps[0].Segments[i].End = (CORDB_ADDRESS)*g_gcDacGlobals->alloc_allocated;
pHeaps[0].Segments[i].Generation = 1;
pHeaps[0].EphemeralSegment = i;
}
@@ -6683,7 +6616,7 @@ HRESULT DacHeapWalker::InitHeapDataWks(HeapData *&pHeaps, size_t &pCount)
}
// Large object heap segments
- seg = WKS::generation_table[NUMBERGENERATIONS-1].start_segment;
+ seg = loh.start_segment;
for (; seg && (i < count); ++i)
{
pHeaps[0].Segments[i].Generation = 3;
@@ -7185,7 +7118,7 @@ void DacDbiInterfaceImpl::GetGCHeapInformation(COR_HEAPINFO * pHeapInfo)
DD_ENTER_MAY_THROW;
size_t heapCount = 0;
- pHeapInfo->areGCStructuresValid = GCScan::GetGcRuntimeStructuresValid();
+ pHeapInfo->areGCStructuresValid = *g_gcDacGlobals->gc_structures_invalid_cnt == 0;
#ifdef FEATURE_SVR_GC
if (GCHeapUtilities::IsServerHeap())