Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
b88c3e9
Update dependencies from https://github.com/dotnet/arcade build 20221…
dotnet-maestro[bot] Dec 5, 2022
ef545d3
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Dec 6, 2022
ada9e0d
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Dec 6, 2022
5472240
Update dependencies from https://github.com/dotnet/installer build 20…
dotnet-maestro[bot] Dec 6, 2022
433fd6a
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Dec 7, 2022
844aa3d
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Dec 8, 2022
5002b6c
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Dec 9, 2022
0e31743
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Dec 10, 2022
5f3265c
Update dependencies from https://github.com/dotnet/installer build 20…
dotnet-maestro[bot] Dec 12, 2022
8649157
Update dependencies from https://github.com/dotnet/arcade build 20221…
dotnet-maestro[bot] Dec 12, 2022
38396f7
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Dec 13, 2022
f0bca05
Update tutorial scenario - App is experiencing intermittent exception…
MarioHewardt Dec 14, 2022
e60cf93
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Dec 14, 2022
87475a8
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Dec 15, 2022
f1e33ea
Update dependencies from https://github.com/microsoft/clrmd build 202…
dotnet-maestro[bot] Dec 15, 2022
60cdc98
Change metrics parsing to use InvariantCulture (#3558)
ghord Dec 16, 2022
b1941f2
Update dependencies from https://github.com/microsoft/clrmd build 202…
dotnet-maestro[bot] Dec 16, 2022
87cb178
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Dec 17, 2022
9f173f5
Update dependencies from https://github.com/dotnet/arcade build 20221…
dotnet-maestro[bot] Dec 19, 2022
289be98
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Dec 20, 2022
56d6c65
Sync eng/native from dotnet/runtime (#3564)
am11 Dec 21, 2022
2ddc648
Update dependencies from https://github.com/microsoft/clrmd build 202…
dotnet-maestro[bot] Dec 22, 2022
0007661
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Dec 23, 2022
a9f5c10
Update dependencies from https://github.com/dotnet/arcade build 20221…
dotnet-maestro[bot] Dec 26, 2022
942c25d
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Dec 27, 2022
1d1154f
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Dec 28, 2022
8eee1ce
Update dependencies from https://github.com/microsoft/clrmd build 202…
dotnet-maestro[bot] Jan 1, 2023
2854ea8
Update dependencies from https://github.com/dotnet/arcade build 20221…
dotnet-maestro[bot] Jan 2, 2023
4de9fe6
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Jan 3, 2023
284d8c7
Update dependencies from https://github.com/microsoft/clrmd build 202…
dotnet-maestro[bot] Jan 4, 2023
671da06
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Jan 4, 2023
dd343e7
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Jan 4, 2023
839361d
Port GCDump fixes from PerfView (#3475)
davmason Jan 5, 2023
b164cb7
Add missing keepnativesymbols option in build.sh (#3571)
JongHeonChoi Jan 5, 2023
390e0c1
add souce-build pre-built detection (#3583)
oleksandr-didyk Jan 5, 2023
c96daf8
Update dependencies from https://github.com/microsoft/clrmd build 202…
dotnet-maestro[bot] Jan 6, 2023
87ed467
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Jan 6, 2023
ca352e2
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Jan 7, 2023
c70d9b2
Update dependencies from https://github.com/dotnet/installer build 20…
dotnet-maestro[bot] Jan 9, 2023
c508735
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Jan 10, 2023
574923f
Change tool TFMs to net6.0 and drop 3.1 hosting support (#3588)
hoyosjs Jan 10, 2023
21dbb38
Add private gc events to the gc-collect profile (#3531)
dramos020 Jan 10, 2023
f66f2a9
[main] Update dependencies from dotnet/symstore (#3598)
dotnet-maestro[bot] Jan 11, 2023
949c4e4
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Jan 14, 2023
325d1b4
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Jan 17, 2023
080108c
chore(readme): fix Debugging CoreCLR link (#3606)
vaind Jan 17, 2023
271f5b7
Fix environment variable name (#3604)
ltrzesniewski Jan 18, 2023
c34194e
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Jan 24, 2023
ad34fb5
[main] Update dependencies from dotnet/installer (#3603)
dotnet-maestro[bot] Jan 24, 2023
1671b50
Dev/mirogers/kudu console (#3083)
mikelle-rogers Jan 25, 2023
e83a272
Fix/disable nullable warnings treated as errors with newer SDKs insta…
Jan 26, 2023
a2aa40a
Remove duplicate SOS command docs (#3612)
Jan 26, 2023
216a579
Remove singlefile OSX tool versions
hoyosjs Jan 27, 2023
ab4b95e
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Jan 27, 2023
17e5e14
Update dependencies from https://github.com/dotnet/installer build 20…
dotnet-maestro[bot] Jan 30, 2023
615b21d
Add support for System.Diagnostics.Metrics in dotnet-monitor's collec…
wiktork Jan 30, 2023
26f08b8
Update dependencies from https://github.com/microsoft/clrmd build 202…
dotnet-maestro[bot] Jan 31, 2023
89eb703
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Jan 31, 2023
dd957c7
Updated version of TraceEvent to 3.7 (#3611)
dramos020 Jan 31, 2023
6e6025d
Updated default runtime version in dotnet-counters and add support up…
dramos020 Jan 31, 2023
2938f1c
Update dependencies from https://github.com/dotnet/symstore build 202…
dotnet-maestro[bot] Feb 1, 2023
ca36e64
Cap node processing at 10mil and log issue (#3628)
hoyosjs Feb 1, 2023
9d61ee4
Update major version to 7.0 (#3629)
hoyosjs Feb 1, 2023
f27aa9f
Merge remote-tracking branch 'origin/main' into release/stable
hoyosjs Feb 1, 2023
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
Prev Previous commit
Next Next commit
Fix/disable nullable warnings treated as errors with newer SDKs insta…
…lled (#3616)

* Fix/disable nullable warnings treated as errors with newer SDKs installed

* Missed a test cs file
  • Loading branch information
Mike McLaughlin authored Jan 26, 2023
commit e83a272a48942fc8d1d383783a31b7ec859030a8
97 changes: 54 additions & 43 deletions src/Microsoft.Diagnostics.ExtensionCommands/DumpAsyncCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ bool ShouldIncludeStack(AsyncObject obj)
// <summary>Outputs a line of information for each instance field on the object.</summary>
void RenderFields(IAddressableTypedEntity? obj, int depth)
{
if (obj is not null)
if (obj?.Type is not null)
{
string depthTab = new string(' ', depth * TabWidth);

Expand Down Expand Up @@ -489,33 +489,36 @@ void RenderFields(IAddressableTypedEntity? obj, int depth)
// <summary>Gets a printable description for the specified object.</summary>
string Describe(ClrObject obj)
{
// Default the description to the type name.
string description = obj.Type.Name;

if (IsStateMachineBox(obj.Type))
string description = string.Empty;
if (obj.Type?.Name is not null)
{
// Remove the boilerplate box type from the name.
int pos = description.IndexOf("StateMachineBox<", StringComparison.Ordinal);
if (pos >= 0)
// Default the description to the type name.
description = obj.Type.Name;

if (IsStateMachineBox(obj.Type))
{
ReadOnlySpan<char> slice = description.AsSpan(pos + "StateMachineBox<".Length);
slice = slice.Slice(0, slice.Length - 1); // remove trailing >
description = slice.ToString();
// Remove the boilerplate box type from the name.
int pos = description.IndexOf("StateMachineBox<", StringComparison.Ordinal);
if (pos >= 0)
{
ReadOnlySpan<char> slice = description.AsSpan(pos + "StateMachineBox<".Length);
slice = slice.Slice(0, slice.Length - 1); // remove trailing >
description = slice.ToString();
}
}
}
else if (TryGetValidObjectField(obj, "m_action", out ClrObject taskDelegate))
{
// If we can figure out what the task's delegate points to, append the method signature.
if (TryGetMethodFromDelegate(runtime, taskDelegate, out ClrMethod? method))
else if (TryGetValidObjectField(obj, "m_action", out ClrObject taskDelegate))
{
// If we can figure out what the task's delegate points to, append the method signature.
if (TryGetMethodFromDelegate(runtime, taskDelegate, out ClrMethod? method))
{
description = $"{description} {{{method!.Signature}}}";
}
}
else if (obj.Address != 0 && taskCompletionSentinel.Address == obj.Address)
{
description = $"{description} {{{method!.Signature}}}";
description = "TaskCompletionSentinel";
}
}
else if (obj.Address != 0 && taskCompletionSentinel.Address == obj.Address)
{
description = "TaskCompletionSentinel";
}

return description;
}

Expand All @@ -527,14 +530,17 @@ bool IncludeInOutput(ClrObject obj)
return false;
}

if (MethodTableAddress is ulong mt && obj.Type.MethodTable != mt)
if (obj.Type is not null)
{
return false;
}
if (MethodTableAddress is ulong mt && obj.Type.MethodTable != mt)
{
return false;
}

if (NameSubstring is not null && !obj.Type.Name.Contains(NameSubstring))
{
return false;
if (NameSubstring is not null && obj.Type.Name is not null && !obj.Type.Name.Contains(NameSubstring))
{
return false;
}
}

return true;
Expand Down Expand Up @@ -655,37 +661,42 @@ Dictionary<ClrObject, AsyncObject> CollectObjects()
// </remarks>
void AddContinuation(ClrObject continuation, List<ClrObject> continuations)
{
if (continuation.Type.Name.StartsWith("System.Collections.Generic.List<", StringComparison.Ordinal))
if (continuation.Type is not null)
{
if (continuation.Type.GetFieldByName("_items") is ClrInstanceField itemsField)
if (continuation.Type.Name is not null &&
continuation.Type.Name.StartsWith("System.Collections.Generic.List<", StringComparison.Ordinal))
{
ClrObject itemsObj = itemsField.ReadObject(continuation.Address, interior: false);
if (!itemsObj.IsNull)
if (continuation.Type.GetFieldByName("_items") is ClrInstanceField itemsField)
{
ClrArray items = itemsObj.AsArray();
if (items.Rank == 1)
ClrObject itemsObj = itemsField.ReadObject(continuation.Address, interior: false);
if (!itemsObj.IsNull)
{
for (int i = 0; i < items.Length; i++)
ClrArray items = itemsObj.AsArray();
if (items.Rank == 1)
{
if (items.GetObjectValue(i) is ClrObject { IsValid: true } c)
for (int i = 0; i < items.Length; i++)
{
continuations.Add(ResolveContinuation(c));
if (items.GetObjectValue(i) is ClrObject { IsValid: true } c)
{
continuations.Add(ResolveContinuation(c));
}
}
}
}
}
}
}
else
{
continuations.Add(continuation);
else
{
continuations.Add(continuation);
}
}
}

// <summary>Tries to get the object contents of a Task's continuations field</summary>
bool TryGetContinuation(ClrObject obj, out ClrObject continuation)
{
if (obj.Type.GetFieldByName("m_continuationObject") is ClrInstanceField continuationObjectField &&
if (obj.Type is not null &&
obj.Type.GetFieldByName("m_continuationObject") is ClrInstanceField continuationObjectField &&
continuationObjectField.ReadObject(obj.Address, interior: false) is ClrObject { IsValid: true } continuationObject)
{
continuation = ResolveContinuation(continuationObject);
Expand Down Expand Up @@ -888,7 +899,7 @@ private void WriteCodeLink(ulong address)
}

/// <summary>Gets whether the specified type is an AsyncStateMachineBox{T}.</summary>
private static bool IsStateMachineBox(ClrType type)
private static bool IsStateMachineBox(ClrType? type)
{
// Ideally we would compare the metadata token and module for the generic template for the type,
// but that information isn't fully available via ClrMd, nor can it currently find DebugFinalizableAsyncStateMachineBox
Expand Down
5 changes: 5 additions & 0 deletions src/SOS/SOS.UnitTests/SOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
using Xunit.Abstractions;
using Xunit.Extensions;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

[Collection("Windows Dump Generation")]
public class SOS
{
public SOS(ITestOutputHelper output)
Expand Down
4 changes: 4 additions & 0 deletions src/tests/DbgShim.UnitTests/DbgShimTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
using Xunit.Abstractions;
using Xunit.Extensions;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics
{
public class DbgShimTests : IDisposable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
using Xunit.Abstractions;
using Xunit.Extensions;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics.DebugServices.UnitTests
{
public class DebugServicesTests : IDisposable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
using Xunit.Extensions;
using TestRunner = Microsoft.Diagnostics.CommonTestRunner.TestRunner;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics.Monitoring.EventPipe.UnitTests
{
public class EventCounterPipelineUnitTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
using Xunit.Extensions;
using TestRunner = Microsoft.Diagnostics.CommonTestRunner.TestRunner;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics.Monitoring.EventPipe.UnitTests
{
public class EventCounterTriggerTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
using Xunit.Extensions;
using TestRunner = Microsoft.Diagnostics.CommonTestRunner.TestRunner;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics.Monitoring.EventPipe.UnitTests
{
public class EventLogsPipelineUnitTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
using Xunit.Extensions;
using TestRunner = Microsoft.Diagnostics.CommonTestRunner.TestRunner;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics.Monitoring.EventPipe.UnitTests
{
public class EventTracePipelineUnitTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
using Xunit.Extensions;
using TestRunner = Microsoft.Diagnostics.CommonTestRunner.TestRunner;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics.NETCore.Client
{
public class EventPipeSessionTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
using Xunit.Extensions;
using TestRunner = Microsoft.Diagnostics.CommonTestRunner.TestRunner;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics.NETCore.Client
{
public class ProcessEnvironmentTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
using Xunit.Extensions;
using TestRunner = Microsoft.Diagnostics.CommonTestRunner.TestRunner;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics.NETCore.Client
{
public class GetProcessInfoTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
using Microsoft.Diagnostics.TestHelpers;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
using Xunit.Extensions;
using TestRunner = Microsoft.Diagnostics.CommonTestRunner.TestRunner;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics.NETCore.Client
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
using Xunit.Extensions;
using TestRunner = Microsoft.Diagnostics.CommonTestRunner.TestRunner;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics.NETCore.Client
{
public class ReversedServerTests
Expand Down
3 changes: 2 additions & 1 deletion src/tests/dotnet-counters/JSONExporterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

using System;
using System.IO;
using System.Collections.Generic;
using Xunit;
using Microsoft.Diagnostics.Tools.Counters.Exporters;
using Newtonsoft.Json;
using Microsoft.Diagnostics.Tools.Counters;

#pragma warning disable CA1507 // Use nameof to express symbol names

namespace DotnetCounters.UnitTests
{
/// <summary>
Expand Down
5 changes: 4 additions & 1 deletion src/tests/dotnet-trace/ChildProcessTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
using Xunit.Extensions;
using TestRunner = Microsoft.Diagnostics.CommonTestRunner.TestRunner;

// Newer SDKs flag MemberData(nameof(Configurations)) with this error
// Avoid unnecessary zero-length array allocations. Use Array.Empty<object>() instead.
#pragma warning disable CA1825

namespace Microsoft.Diagnostics.Tools.Trace
{

public class ChildProcessTests
{
public static IEnumerable<object[]> Configurations => TestRunner.Configurations;
Expand Down