Skip to content

Commit c7dea1c

Browse files
authored
Delete DacVirtualUnwind (#116286)
1 parent 56c80cd commit c7dea1c

File tree

4 files changed

+2
-100
lines changed

4 files changed

+2
-100
lines changed

src/coreclr/debug/daccess/dacfn.cpp

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -204,87 +204,6 @@ DacWriteAll(TADDR addr, PVOID buffer, ULONG32 size, bool throwEx)
204204
return S_OK;
205205
}
206206

207-
#ifdef TARGET_UNIX
208-
209-
static BOOL DacReadAllAdapter(PVOID address, PVOID buffer, SIZE_T size)
210-
{
211-
DAC_INSTANCE* inst = g_dacImpl->m_instances.Find((TADDR)address);
212-
if (inst == nullptr || inst->size < size)
213-
{
214-
inst = g_dacImpl->m_instances.Alloc((TADDR)address, (ULONG32)size, DAC_PAL);
215-
if (inst == nullptr)
216-
{
217-
return FALSE;
218-
}
219-
inst->noReport = 0;
220-
HRESULT hr = DacReadAll((TADDR)address, inst + 1, (ULONG32)size, false);
221-
if (FAILED(hr))
222-
{
223-
g_dacImpl->m_instances.ReturnAlloc(inst);
224-
return FALSE;
225-
}
226-
if (!g_dacImpl->m_instances.Add(inst))
227-
{
228-
g_dacImpl->m_instances.ReturnAlloc(inst);
229-
return FALSE;
230-
}
231-
}
232-
memcpy(buffer, inst + 1, size);
233-
return TRUE;
234-
}
235-
236-
#ifdef HOST_WINDOWS
237-
// For the cross OS dac, we don't have the full pal layer
238-
// Use these minimal prototypes instead of the full pal header
239-
typedef BOOL(*UnwindReadMemoryCallback)(PVOID address, PVOID buffer, SIZE_T size);
240-
241-
extern
242-
BOOL
243-
PAL_VirtualUnwindOutOfProc(PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_POINTERS contextPointers, PULONG64 functionStart, SIZE_T baseAddress, UnwindReadMemoryCallback readMemoryCallback);
244-
#endif
245-
246-
HRESULT
247-
DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_POINTERS contextPointers)
248-
{
249-
if (!g_dacImpl)
250-
{
251-
DacError(E_UNEXPECTED);
252-
UNREACHABLE();
253-
}
254-
255-
// The DAC code doesn't use these context pointers but zero them out to be safe.
256-
if (contextPointers != NULL)
257-
{
258-
memset(contextPointers, 0, sizeof(T_KNONVOLATILE_CONTEXT_POINTERS));
259-
}
260-
261-
HRESULT hr = E_NOINTERFACE;
262-
263-
#ifdef FEATURE_DATATARGET4
264-
ReleaseHolder<ICorDebugDataTarget4> dt;
265-
hr = g_dacImpl->m_pTarget->QueryInterface(IID_ICorDebugDataTarget4, (void **)&dt);
266-
if (SUCCEEDED(hr))
267-
{
268-
hr = dt->VirtualUnwind(threadId, sizeof(CONTEXT), (BYTE*)context);
269-
}
270-
#endif
271-
272-
if (hr == E_NOINTERFACE || hr == E_NOTIMPL)
273-
{
274-
hr = S_OK;
275-
276-
SIZE_T baseAddress = DacGlobalBase();
277-
if (baseAddress == 0 || !PAL_VirtualUnwindOutOfProc(context, contextPointers, nullptr, baseAddress, DacReadAllAdapter))
278-
{
279-
hr = E_FAIL;
280-
}
281-
}
282-
283-
return hr;
284-
}
285-
286-
#endif // TARGET_UNIX
287-
288207
// DacAllocVirtual - Allocate memory from the target process
289208
// Note: this is only available to clients supporting the legacy
290209
// ICLRDataTarget2 interface. It's currently used by SOS for notification tables.

src/coreclr/inc/daccess.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -829,11 +829,6 @@ struct _UNWIND_INFO * DacGetUnwindInfo(TADDR taUnwindInfo);
829829
BOOL DacUnwindStackFrame(T_CONTEXT * pContext, T_KNONVOLATILE_CONTEXT_POINTERS* pContextPointers);
830830
#endif // FEATURE_EH_FUNCLETS
831831

832-
#if defined(TARGET_UNIX)
833-
// call back through data target to unwind out-of-process
834-
HRESULT DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_POINTERS contextPointers);
835-
#endif // TARGET_UNIX
836-
837832
#ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
838833
class SString;
839834
void DacMdCacheAddEEName(TADDR taEE, const SString& ssEEName);

src/coreclr/vm/frames.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,16 +1738,6 @@ BOOL TransitionFrame::Protects_Impl(OBJECTREF * ppORef)
17381738
}
17391739
#endif //defined (_DEBUG) && !defined (DACCESS_COMPILE)
17401740

1741-
//+----------------------------------------------------------------------------
1742-
//
1743-
// Method: TPMethodFrame::GcScanRoots public
1744-
//
1745-
// Synopsis: GC protects arguments on the stack
1746-
//
1747-
1748-
//
1749-
//+----------------------------------------------------------------------------
1750-
17511741
#ifdef FEATURE_COMINTEROP
17521742

17531743
#ifdef TARGET_X86

src/coreclr/vm/frames.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@
7474
// | | call count threshold is reached
7575
// | |
7676
// | +-ExternalMethodFrame - represents a call from an ExternalMethodThunk
77-
// | |
78-
// | +-TPMethodFrame - for calls on transparent proxy
7977
// |
8078
#ifdef FEATURE_COMINTEROP
8179
// +-UnmanagedToManagedFrame - this frame represents a transition from
@@ -1228,7 +1226,7 @@ class FramedMethodFrame : public TransitionFrame
12281226
{
12291227
#ifdef TARGET_AMD64
12301228
// Floating point spill area is between return value and transition block for frames that need it
1231-
// (code:TPMethodFrame and code:CLRToCOMMethodFrame)
1229+
// (see code:CLRToCOMMethodFrame)
12321230
return -(4 * 0x10 /* floating point args */ + 0x8 /* alignment pad */ + TransitionBlock::GetNegSpaceSize()) + (iArg * 0x10);
12331231
#endif
12341232
}
@@ -1254,7 +1252,7 @@ class FramedMethodFrame : public TransitionFrame
12541252
TADDR p = GetTransitionBlock() - TransitionBlock::GetNegSpaceSize();
12551253
#endif
12561254
// Return value is right before the transition block (or floating point spill area on AMD64) for frames that need it
1257-
// (code:TPMethodFrame and code:CLRToCOMMethodFrame)
1255+
// (see code:CLRToCOMMethodFrame)
12581256
#ifdef ENREGISTERED_RETURNTYPE_MAXSIZE
12591257
p -= ENREGISTERED_RETURNTYPE_MAXSIZE;
12601258
#else

0 commit comments

Comments
 (0)