Skip to content

Commit

Permalink
Only use cDAC on platforms where we implement functionality to get an…
Browse files Browse the repository at this point in the history
… export symbol
  • Loading branch information
elinor-fung committed Apr 19, 2024
1 parent 85ffbda commit c215266
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/coreclr/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <dactablerva.h>
#else
extern "C" bool TryGetSymbol(ICorDebugDataTarget* dataTarget, uint64_t baseAddress, const char* symbolName, uint64_t* symbolAddress);
// cDAC depends on symbol lookup to find the contract descriptor
#define CAN_USE_CDAC
#endif

#include "dwbucketmanager.hpp"
Expand Down Expand Up @@ -5493,6 +5495,8 @@ ClrDataAccess::Initialize(void)
IfFailRet(GetDacGlobalValues());
IfFailRet(DacGetHostVtPtrs());

// TODO: [cdac] TryGetSymbol is only implemented for Linux, OSX, and Windows.
#ifdef CAN_USE_CDAC
CLRConfigNoCache enable = CLRConfigNoCache::Get("ENABLE_CDAC");
if (enable.IsSet())
{
Expand All @@ -5513,6 +5517,7 @@ ClrDataAccess::Initialize(void)
}
}
}
#endif

//
// DAC is now setup and ready to use
Expand Down Expand Up @@ -6945,7 +6950,7 @@ GetDacTableAddress(ICorDebugDataTarget* dataTarget, ULONG64 baseAddress, PULONG6
return E_INVALIDARG;
}
#endif
// On MacOS, FreeBSD or NetBSD use the RVA include file
// On FreeBSD, NetBSD, or SunOS use the RVA include file
*dacTableAddress = baseAddress + DAC_TABLE_RVA;
#else
// Otherwise, try to get the dac table address via the export symbol
Expand Down

0 comments on commit c215266

Please sign in to comment.