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
13 changes: 12 additions & 1 deletion src/coreclr/vm/datadescriptor/datadescriptor.inc
Original file line number Diff line number Diff line change
Expand Up @@ -951,9 +951,20 @@ CDAC_TYPES_END()

CDAC_GLOBALS_BEGIN()

#if defined(TARGET_UNIX)
#if defined(TARGET_BROWSER)
#ifdef browser
#error Handle 'browser' define
#endif // browser
CDAC_GLOBAL_STRING(OperatingSystem, browser)
#elif defined(TARGET_UNIX)
#ifdef unix
#error Handle 'unix' define
#endif // unix
CDAC_GLOBAL_STRING(OperatingSystem, unix)
#elif defined(TARGET_WINDOWS)
#ifdef windows
#error Handle 'windows' define
#endif // windows
CDAC_GLOBAL_STRING(OperatingSystem, windows)
#else
#error TARGET_{OS} define is not recognized by the cDAC. Update this switch and the enum values in IRuntimeInfo.cs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public enum RuntimeInfoOperatingSystem : uint
Unknown = 0,
Windows,
Unix,
Browser,
}

public interface IRuntimeInfo : IContract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal class AMD64Unwinder(Target target)
private readonly Target _target = target;
private readonly IExecutionManager _eman = target.Contracts.ExecutionManager;

private readonly bool _unix = target.Contracts.RuntimeInfo.GetTargetOperatingSystem() == RuntimeInfoOperatingSystem.Unix;
private readonly bool _unix = target.Contracts.RuntimeInfo.GetTargetOperatingSystem() != RuntimeInfoOperatingSystem.Windows;

public bool Unwind(ref AMD64Context context)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class X86Unwinder(Target target)
private readonly Target _target = target;
private readonly uint _pointerSize = (uint)target.PointerSize;
private readonly bool _updateAllRegs = true;
private readonly bool _unixX86ABI = target.Contracts.RuntimeInfo.GetTargetOperatingSystem() == RuntimeInfoOperatingSystem.Unix;
private readonly bool _unixX86ABI = target.Contracts.RuntimeInfo.GetTargetOperatingSystem() != RuntimeInfoOperatingSystem.Windows;

private static readonly RegMask[] registerOrder =
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,10 @@ int ISOSDacInterface.GetClrWatsonBuckets(ClrDataAddress thread, void* pGenericMo
byte[] buckets = Array.Empty<byte>();
try
{
if (_target.Contracts.RuntimeInfo.GetTargetOperatingSystem() == RuntimeInfoOperatingSystem.Unix)
if (_target.Contracts.RuntimeInfo.GetTargetOperatingSystem() != RuntimeInfoOperatingSystem.Windows)
throw Marshal.GetExceptionForHR(HResults.E_FAIL)!;
else if (thread == 0 || pGenericModeBlock == null)

if (thread == 0 || pGenericModeBlock == null)
throw new ArgumentException();

buckets = threadContract.GetWatsonBuckets(thread.ToTargetPointer(_target));
Expand Down