Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions src/coreclr/debug/runtimeinfo/datadescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,7 @@ CDAC_GLOBAL(MethodDescAlignment, uint64, MethodDesc::ALIGNMENT)
CDAC_GLOBAL(ObjectHeaderSize, uint64, OBJHEADER_SIZE)
CDAC_GLOBAL(SyncBlockValueToObjectOffset, uint16, OBJHEADER_SIZE - cdac_data<ObjHeader>::SyncBlockValue)
CDAC_GLOBAL(StubCodeBlockLast, uint8, STUB_CODE_BLOCK_LAST)
CDAC_GLOBAL(TlsOutOfIndexes, uint32, TLS_OUT_OF_INDEXES)
CDAC_GLOBAL_POINTER(ArrayBoundsZero, cdac_data<ArrayBase>::ArrayBoundsZero)
CDAC_GLOBAL_POINTER(ExceptionMethodTable, &::g_pExceptionClass)
CDAC_GLOBAL_POINTER(FreeObjectMethodTable, &::g_pFreeObjectMethodTable)
Expand All @@ -968,6 +969,7 @@ CDAC_GLOBAL_POINTER(StringMethodTable, &::g_pStringClass)
CDAC_GLOBAL_POINTER(SyncTableEntries, &::g_pSyncTable)
CDAC_GLOBAL_POINTER(MiniMetaDataBuffAddress, &::g_MiniMetaDataBuffAddress)
CDAC_GLOBAL_POINTER(MiniMetaDataBuffMaxSize, &::g_MiniMetaDataBuffMaxSize)
CDAC_GLOBAL_POINTER(TlsIndex, &::g_TlsIndex)
#ifdef STRESS_LOG
CDAC_GLOBAL(StressLogEnabled, uint8, 1)
CDAC_GLOBAL_POINTER(StressLog, &g_pStressLog)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static class Globals

public const string MiniMetaDataBuffAddress = nameof(MiniMetaDataBuffAddress);
public const string MiniMetaDataBuffMaxSize = nameof(MiniMetaDataBuffMaxSize);
public const string TlsIndex = nameof(TlsIndex);

public const string StressLogEnabled = nameof(StressLogEnabled);
public const string StressLogHasModuleTable = nameof(StressLogHasModuleTable);
Expand All @@ -51,6 +52,7 @@ public static class Globals

public const string ExecutionManagerCodeRangeMapAddress = nameof(ExecutionManagerCodeRangeMapAddress);
public const string StubCodeBlockLast = nameof(StubCodeBlockLast);
public const string TlsOutOfIndexes = nameof(TlsOutOfIndexes);
public const string PlatformMetadata = nameof(PlatformMetadata);
public const string ProfilerControlBlock = nameof(ProfilerControlBlock);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1644,8 +1644,43 @@ int ISOSDacInterface.GetThreadStoreData(DacpThreadStoreData* data)
}

int ISOSDacInterface.GetTLSIndex(uint* pIndex)
=> _legacyImpl is not null ? _legacyImpl.GetTLSIndex(pIndex) : HResults.E_NOTIMPL;
{
if (pIndex == null)
return HResults.E_INVALIDARG;

int hr = HResults.S_OK;
try
{
uint TlsOutOfIndexes = _target.ReadGlobal<uint>(Constants.Globals.TlsOutOfIndexes);
uint TlsIndex = _target.Read<uint>(_target.ReadGlobalPointer(Constants.Globals.TlsIndex));
if (TlsIndex == TlsOutOfIndexes)
{
*pIndex = 0;
hr = HResults.S_FALSE;
}
else
{
*pIndex = TlsIndex;
}
}
catch (System.Exception ex)
{
hr = ex.HResult;
}
#if DEBUG
if (_legacyImpl is not null)
{
uint indexLocal;
int hrLocal = _legacyImpl.GetTLSIndex(&indexLocal);
Debug.Assert(hrLocal == hr, $"cDAC: {hr:x}, DAC: {hrLocal:x}");
if (hr == HResults.S_OK || hr == HResults.S_FALSE)
{
Debug.Assert(*pIndex == indexLocal);
}
}
#endif
return hr;
}
int ISOSDacInterface.GetUsefulGlobals(DacpUsefulGlobalsData* data)
{
if (data == null)
Expand Down
Loading