Skip to content
Draft
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
49 changes: 0 additions & 49 deletions src/coreclr/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5099,55 +5099,6 @@ ClrDataAccess::Initialize(void)
HRESULT hr;
CLRDATA_ADDRESS base = { 0 };

//
// We do not currently support cross-platform
// debugging. Verify that cross-platform is not
// being attempted.
//

// Determine our platform based on the pre-processor macros set when we were built

#ifdef TARGET_UNIX
#if defined(TARGET_X86)
CorDebugPlatform hostPlatform = CORDB_PLATFORM_POSIX_X86;
#elif defined(TARGET_AMD64)
CorDebugPlatform hostPlatform = CORDB_PLATFORM_POSIX_AMD64;
#elif defined(TARGET_ARM)
CorDebugPlatform hostPlatform = CORDB_PLATFORM_POSIX_ARM;
#elif defined(TARGET_ARM64)
CorDebugPlatform hostPlatform = CORDB_PLATFORM_POSIX_ARM64;
#elif defined(TARGET_LOONGARCH64)
CorDebugPlatform hostPlatform = CORDB_PLATFORM_POSIX_LOONGARCH64;
#elif defined(TARGET_RISCV64)
CorDebugPlatform hostPlatform = CORDB_PLATFORM_POSIX_RISCV64;
#else
#error Unknown Processor.
#endif
#else
#if defined(TARGET_X86)
CorDebugPlatform hostPlatform = CORDB_PLATFORM_WINDOWS_X86;
#elif defined(TARGET_AMD64)
CorDebugPlatform hostPlatform = CORDB_PLATFORM_WINDOWS_AMD64;
#elif defined(TARGET_ARM)
CorDebugPlatform hostPlatform = CORDB_PLATFORM_WINDOWS_ARM;
#elif defined(TARGET_ARM64)
CorDebugPlatform hostPlatform = CORDB_PLATFORM_WINDOWS_ARM64;
#else
#error Unknown Processor.
#endif
#endif

CorDebugPlatform targetPlatform;
IfFailRet(m_pTarget->GetPlatform(&targetPlatform));

if (targetPlatform != hostPlatform)
{
// DAC fatal error: Platform mismatch - the platform reported by the data target
// is not what this version of mscordacwks.dll was built for.
return CORDBG_E_INCOMPATIBLE_PLATFORMS;
}

//
// Get the current DLL base for mscorwks globals.
// In case of multiple-CLRs, there may be multiple dlls named "mscorwks".
// code:OpenVirtualProcess can take the base address (clrInstanceId) to select exactly
Expand Down
42 changes: 42 additions & 0 deletions src/coreclr/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7793,6 +7793,48 @@ HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetGenericArgTokenIndex(VMPTR_Met
return S_OK;
}

HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetTargetInfo(OUT TargetInfo * pTargetInfo)
{
DD_ENTER_MAY_THROW;

if (pTargetInfo == NULL)
return E_INVALIDARG;

#if defined(TARGET_X86)
pTargetInfo->arch = kArchX86;
#elif defined(TARGET_AMD64)
pTargetInfo->arch = kArchAMD64;
#elif defined(TARGET_ARM)
pTargetInfo->arch = kArchArm;
#elif defined(TARGET_ARM64)
pTargetInfo->arch = kArchArm64;
#elif defined(TARGET_LOONGARCH64)
pTargetInfo->arch = kArchLoongArch64;
#elif defined(TARGET_RISCV64)
pTargetInfo->arch = kArchRiscV64;
#elif defined(TARGET_WASM)
pTargetInfo->arch = kArchWasm;
#else
pTargetInfo->arch = kArchUnknown;
#endif

#if defined(TARGET_UNIX)
pTargetInfo->os = kOSUnix;
#elif defined(TARGET_WINDOWS)
pTargetInfo->os = kOSWindows;
#else
pTargetInfo->os = kOSUnknown;
#endif

#if defined(TARGET_64BIT)
pTargetInfo->pointerSize = 8;
#else
pTargetInfo->pointerSize = 4;
#endif

return S_OK;
}

DacRefWalker::DacRefWalker(ClrDataAccess *dac, BOOL walkStacks, UINT32 handleMask, BOOL resolvePointers)
: mDac(dac), mWalkStacks(walkStacks), mHandleMask(handleMask), mStackWalker(NULL),
mResolvePointers(resolvePointers), mHandleWalker(NULL)
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 @@ -154,6 +154,7 @@ class DacDbiInterfaceImpl :
HRESULT STDMETHODCALLTYPE EnumerateAsyncLocals(VMPTR_MethodDesc vmMethod, CORDB_ADDRESS codeAddr, UINT32 state, FP_ASYNC_LOCAL_CALLBACK fpCallback, CALLBACK_DATA pUserData);
HRESULT STDMETHODCALLTYPE GetGenericArgTokenIndex(VMPTR_MethodDesc vmMethod, OUT UINT32* pIndex);

HRESULT STDMETHODCALLTYPE GetTargetInfo(OUT TargetInfo * pTargetInfo);
HRESULT STDMETHODCALLTYPE GetReadWriteMetadataSize(VMPTR_Module vmModule, OUT ULONG32 * pSize);
HRESULT STDMETHODCALLTYPE FillReadWriteMetadata(VMPTR_Module vmModule, BYTE * pBuffer, ULONG32 cbBuffer);

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/di/cordb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "dbgtransportmanager.h"
#endif // FEATURE_DBGIPC_TRANSPORT_DI

#if defined(TARGET_UNIX) || defined(__ANDROID__)
#if defined(HOST_UNIX) || defined(__ANDROID__)
// Local (in-process) debugging is not supported for UNIX and Android.
#define SUPPORT_LOCAL_DEBUGGING 0
#else
Expand Down
Loading
Loading