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
22 changes: 22 additions & 0 deletions docs/design/datacontracts/debug_interface_globals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Debug Interface Globals

The following document lists the global variables that are used directly in the debug interface managed code (SOSDacImpl.cs, etc.)

Global variables used
| Global Name | Type | Purpose |
| --- | --- | --- |
| StringMethodTable | TargetPointer | Identify where the string MethodTable exists |
| ObjectMethodTable | TargetPointer | Identify where the object MethodTable exists |
| SystemDomain | TargetPointer | Identify where the SystemDomain exists |
| DirectorySeparator | TargetPointer | Identify where the directory separator exists |
| FeatureCOMInterop | TargetPointer | Identify where the flag for FeatureCOMInterop exists |
| StressLog | TargetPointer | Identify where the StressLog exists |
| AppDomain | TargetPointer | Identify where the AppDomain exists |
| ObjectArrayMethodTable | TargetPointer | Identify where the ObjectArrayMethodTable exists |
| ExceptionMethodTable | TargetPointer | Identify where the ExceptionMethodTable exists |
| FreeObjectMethodTable | TargetPointer | Identify where the FreeObjectMethodTable exists |
| SOSBreakingChangeVersion | TargetPointer | Identify where the SOSBreakingChangeVersion exists |
| DacNotificationFlags | TargetPointer | Identify where the DacNotificationFlags exists |
| MaxClrNotificationArgs | uint32 | Identify the maximum number of CLR notification arguments |
| ClrNotificationArguments | TargetPointer | Identify where the ClrNotificationArguments exists |
| DefaultADID | uint | Identify the default AppDomain ID |
1 change: 1 addition & 0 deletions src/coreclr/debug/runtimeinfo/datadescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,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(DacNotificationFlags, &::g_dacNotificationFlags)
CDAC_GLOBAL_POINTER(OffsetOfCurrentThreadInfo, &::g_offsetOfCurrentThreadInfo)
#ifdef TARGET_WINDOWS
CDAC_GLOBAL_POINTER(TlsIndexBase, &::_tls_index)
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 DacNotificationFlags = nameof(DacNotificationFlags);
public const string OffsetOfCurrentThreadInfo = nameof(OffsetOfCurrentThreadInfo);
public const string TlsIndexBase = nameof(TlsIndexBase);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.Marshalling;
using System.Diagnostics;

namespace Microsoft.Diagnostics.DataContractReader.Legacy;

Expand Down Expand Up @@ -210,8 +211,27 @@ int IXCLRDataProcess.SetCodeNotifications(
=> _legacyProcess is not null ? _legacyProcess.SetCodeNotifications(numTokens, mods, singleMod, tokens, flags, singleFlags) : HResults.E_NOTIMPL;

int IXCLRDataProcess.GetOtherNotificationFlags(uint* flags)
=> _legacyProcess is not null ? _legacyProcess.GetOtherNotificationFlags(flags) : HResults.E_NOTIMPL;

{
int hr = HResults.S_OK;
try
{
*flags = _target.Read<uint>(_target.ReadGlobalPointer(Constants.Globals.DacNotificationFlags));
}
catch (System.Exception ex)
{
hr = ex.HResult;
}
#if DEBUG
if (_legacyProcess is not null)
{
uint flagsLocal;
int hrLocal = _legacyProcess.GetOtherNotificationFlags(&flagsLocal);
Debug.Assert(hrLocal == hr, $"cDAC: {hr:x}, DAC: {hrLocal:x}");
Debug.Assert(*flags == flagsLocal);
}
#endif
return hr;
}
int IXCLRDataProcess.SetOtherNotificationFlags(uint flags)
=> _legacyProcess is not null ? _legacyProcess.SetOtherNotificationFlags(flags) : HResults.E_NOTIMPL;

Expand Down
Loading