NativeAOT is not debugged with a managed debugger that would be able to understand these. It's also questionable whether a possible future managed debugger would be using this (versus debugging with IL that gets embedded in debugging symbols like .NET Native does).
<IlcArg Include="--feature:System.Linq.Expressions.CanCompileToIL=false" />
<IlcArg Include="--feature:System.Linq.Expressions.CanEmitObjectArrayDelegate=false" />
<IlcArg Include="--feature:System.Linq.Expressions.CanCreateArbitraryDelegates=false" />
+
+ <!-- The managed debugging support in libraries is unused - trim it -->
+ <IlcArg Condition="'$(IlcKeepManagedDebuggerSupport)' != 'true'" Include="--feature:System.Diagnostics.Debugger.IsSupported=false" />
</ItemGroup>
<MakeDir Directories="$(NativeIntermediateOutputPath)" />
Assert.Equal(builder, items);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public static void TestDebuggerAttributes_Null()
{
Type proxyType = DebuggerAttributes.GetProxyType(ImmutableArray.CreateBuilder<string>(4));
Assert.Equal(builder, items);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public static void TestDebuggerAttributes_Null()
{
Type proxyType = DebuggerAttributes.GetProxyType(ImmutableHashSet.Create<string>());
Assert.Equal(dict, items);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public static void TestDebuggerAttributes_Null()
{
Type proxyType = DebuggerAttributes.GetProxyType(ImmutableHashSet.Create<string>());
Assert.Equal(set, items);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public static void TestDebuggerAttributes_Null()
{
Type proxyType = DebuggerAttributes.GetProxyType(ImmutableHashSet.Create<string>());
Assert.Equal(builder, items);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public static void TestDebuggerAttributes_Null()
{
Type proxyType = DebuggerAttributes.GetProxyType(ImmutableList.CreateBuilder<string>());
Assert.Equal(builder, items);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public static void TestDebuggerAttributes_Null()
{
Type proxyType = DebuggerAttributes.GetProxyType(ImmutableSortedSet.CreateBuilder<int>());
Assert.Equal(set, items);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public static void TestDebuggerAttributes_Null()
{
Type proxyType = DebuggerAttributes.GetProxyType(ImmutableSortedSet.Create("1", "2", "3"));
Assert.Equal(stack, items);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public static void TestDebuggerAttributes_Null()
{
Type proxyType = DebuggerAttributes.GetProxyType(ImmutableStack.Create<string>("1", "2", "3"));
AssertExtensions.Throws<ArgumentNullException>("c", () => new ArrayList(null)); // Collection is null
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public static void DebuggerAttribute()
{
DebuggerAttributes.ValidateDebuggerDisplayReferences(new ArrayList());
AssertExtensions.Throws<ArgumentOutOfRangeException>("loadFactor", () => new Hashtable(100, float.NegativeInfinity, null)); // Load factor is infinity
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public void DebuggerAttribute()
{
DebuggerAttributes.ValidateDebuggerDisplayReferences(new Hashtable());
Assert.Equal(testQueue.ToArray(), items);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public static void DebuggerAttribute_NullQueue_ThrowsArgumentNullException()
{
bool threwNull = false;
Assert.Equal("Count = 0", DebuggerAttributes.ValidateDebuggerDisplayReferences(new SortedList()));
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public void DebuggerAttribute_NormalList()
{
var list = new SortedList() { { "a", 1 }, { "b", 2 } };
Assert.Equal(list.Count, items.Length);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public void DebuggerAttribute_SynchronizedList()
{
var list = SortedList.Synchronized(new SortedList() { { "a", 1 }, { "b", 2 } });
Assert.Equal(list.Count, items.Length);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public void DebuggerAttribute_NullSortedList_ThrowsArgumentNullException()
{
bool threwNull = false;
Assert.Equal(stack.ToArray(), items);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public static void DebuggerAttribute_NullStack_ThrowsArgumentNullException()
{
bool threwNull = false;
EnumAttr(PublicEnum.Case1, name = "EnumAttrSimple"),
TypeAttr(typeof(object), name = "TypeAttrSimple")]
[assembly: CompilationRelaxations(8)]
-[assembly: Debuggable((DebuggableAttribute.DebuggingModes)263)]
[assembly: CLSCompliant(false)]
[assembly: TypeForwardedTo(typeof(string))]
[assembly: TypeForwardedTo(typeof(TypeInForwardedAssembly))]
[InlineData(typeof(AssemblyDescriptionAttribute))]
[InlineData(typeof(AssemblyCompanyAttribute))]
[InlineData(typeof(CLSCompliantAttribute))]
- [InlineData(typeof(DebuggableAttribute))]
[InlineData(typeof(Attr))]
public void CustomAttributes(Type type)
{
[InlineData(typeof(AssemblyDescriptionAttribute))]
[InlineData(typeof(AssemblyCompanyAttribute))]
[InlineData(typeof(CLSCompliantAttribute))]
- [InlineData(typeof(DebuggableAttribute))]
[InlineData(typeof(Attr))]
public void GetCustomAttributesData(Type attrType)
{
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<!-- Disable nullability public only feature for NullabilityInfoContextTests -->
<Features>$(Features.Replace('nullablePublicOnly', '')</Features>
+
+ <!-- The test is looking for debugger attributes we would have stripped with NativeAOT -->
+ <IlcKeepManagedDebuggerSupport>true</IlcKeepManagedDebuggerSupport>
</PropertyGroup>
<!--