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
81 changes: 0 additions & 81 deletions src/coreclr/debug/daccess/dacfn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,87 +204,6 @@ DacWriteAll(TADDR addr, PVOID buffer, ULONG32 size, bool throwEx)
return S_OK;
}

#ifdef TARGET_UNIX

static BOOL DacReadAllAdapter(PVOID address, PVOID buffer, SIZE_T size)
{
DAC_INSTANCE* inst = g_dacImpl->m_instances.Find((TADDR)address);
if (inst == nullptr || inst->size < size)
{
inst = g_dacImpl->m_instances.Alloc((TADDR)address, (ULONG32)size, DAC_PAL);
if (inst == nullptr)
{
return FALSE;
}
inst->noReport = 0;
HRESULT hr = DacReadAll((TADDR)address, inst + 1, (ULONG32)size, false);
if (FAILED(hr))
{
g_dacImpl->m_instances.ReturnAlloc(inst);
return FALSE;
}
if (!g_dacImpl->m_instances.Add(inst))
{
g_dacImpl->m_instances.ReturnAlloc(inst);
return FALSE;
}
}
memcpy(buffer, inst + 1, size);
return TRUE;
}

#ifdef HOST_WINDOWS
// For the cross OS dac, we don't have the full pal layer
// Use these minimal prototypes instead of the full pal header
typedef BOOL(*UnwindReadMemoryCallback)(PVOID address, PVOID buffer, SIZE_T size);

extern
BOOL
PAL_VirtualUnwindOutOfProc(PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_POINTERS contextPointers, PULONG64 functionStart, SIZE_T baseAddress, UnwindReadMemoryCallback readMemoryCallback);
#endif

HRESULT
DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_POINTERS contextPointers)
{
if (!g_dacImpl)
{
DacError(E_UNEXPECTED);
UNREACHABLE();
}

// The DAC code doesn't use these context pointers but zero them out to be safe.
if (contextPointers != NULL)
{
memset(contextPointers, 0, sizeof(T_KNONVOLATILE_CONTEXT_POINTERS));
}

HRESULT hr = E_NOINTERFACE;

#ifdef FEATURE_DATATARGET4
ReleaseHolder<ICorDebugDataTarget4> dt;
hr = g_dacImpl->m_pTarget->QueryInterface(IID_ICorDebugDataTarget4, (void **)&dt);
if (SUCCEEDED(hr))
{
hr = dt->VirtualUnwind(threadId, sizeof(CONTEXT), (BYTE*)context);
}
#endif

if (hr == E_NOINTERFACE || hr == E_NOTIMPL)
{
hr = S_OK;

SIZE_T baseAddress = DacGlobalBase();
if (baseAddress == 0 || !PAL_VirtualUnwindOutOfProc(context, contextPointers, nullptr, baseAddress, DacReadAllAdapter))
{
hr = E_FAIL;
}
}

return hr;
}

#endif // TARGET_UNIX

// DacAllocVirtual - Allocate memory from the target process
// Note: this is only available to clients supporting the legacy
// ICLRDataTarget2 interface. It's currently used by SOS for notification tables.
Expand Down
5 changes: 0 additions & 5 deletions src/coreclr/inc/daccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -829,11 +829,6 @@ struct _UNWIND_INFO * DacGetUnwindInfo(TADDR taUnwindInfo);
BOOL DacUnwindStackFrame(T_CONTEXT * pContext, T_KNONVOLATILE_CONTEXT_POINTERS* pContextPointers);
#endif // FEATURE_EH_FUNCLETS

#if defined(TARGET_UNIX)
// call back through data target to unwind out-of-process
HRESULT DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_POINTERS contextPointers);
#endif // TARGET_UNIX

#ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
class SString;
void DacMdCacheAddEEName(TADDR taEE, const SString& ssEEName);
Expand Down
10 changes: 0 additions & 10 deletions src/coreclr/vm/frames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1738,16 +1738,6 @@ BOOL TransitionFrame::Protects_Impl(OBJECTREF * ppORef)
}
#endif //defined (_DEBUG) && !defined (DACCESS_COMPILE)

//+----------------------------------------------------------------------------
//
// Method: TPMethodFrame::GcScanRoots public
//
// Synopsis: GC protects arguments on the stack
//

//
//+----------------------------------------------------------------------------

#ifdef FEATURE_COMINTEROP

#ifdef TARGET_X86
Expand Down
6 changes: 2 additions & 4 deletions src/coreclr/vm/frames.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@
// | | call count threshold is reached
// | |
// | +-ExternalMethodFrame - represents a call from an ExternalMethodThunk
// | |
// | +-TPMethodFrame - for calls on transparent proxy
// |
#ifdef FEATURE_COMINTEROP
// +-UnmanagedToManagedFrame - this frame represents a transition from
Expand Down Expand Up @@ -1228,7 +1226,7 @@ class FramedMethodFrame : public TransitionFrame
{
#ifdef TARGET_AMD64
// Floating point spill area is between return value and transition block for frames that need it
// (code:TPMethodFrame and code:CLRToCOMMethodFrame)
// (see code:CLRToCOMMethodFrame)
return -(4 * 0x10 /* floating point args */ + 0x8 /* alignment pad */ + TransitionBlock::GetNegSpaceSize()) + (iArg * 0x10);
#endif
}
Expand All @@ -1254,7 +1252,7 @@ class FramedMethodFrame : public TransitionFrame
TADDR p = GetTransitionBlock() - TransitionBlock::GetNegSpaceSize();
#endif
// Return value is right before the transition block (or floating point spill area on AMD64) for frames that need it
// (code:TPMethodFrame and code:CLRToCOMMethodFrame)
// (see code:CLRToCOMMethodFrame)
#ifdef ENREGISTERED_RETURNTYPE_MAXSIZE
p -= ENREGISTERED_RETURNTYPE_MAXSIZE;
#else
Expand Down