diff --git a/src/Tools/dotnet-dump/Analyzer.cs b/src/Tools/dotnet-dump/Analyzer.cs index 5e1637eef5..77c33c3414 100644 --- a/src/Tools/dotnet-dump/Analyzer.cs +++ b/src/Tools/dotnet-dump/Analyzer.cs @@ -41,8 +41,7 @@ public Analyzer() { _serviceProvider = new ServiceProvider(); _consoleProvider = new ConsoleProvider(); - Type type = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? typeof(SOSCommandForWindows) : typeof(SOSCommand); - _commandProcessor = new CommandProcessor(_serviceProvider, _consoleProvider, new Assembly[] { typeof(Analyzer).Assembly }, new Type[] { type }); + _commandProcessor = new CommandProcessor(_serviceProvider, _consoleProvider, new Assembly[] { typeof(Analyzer).Assembly }); } public async Task Analyze(FileInfo dump_path, string[] command) diff --git a/src/Tools/dotnet-dump/Commands/SOSCommand.cs b/src/Tools/dotnet-dump/Commands/SOSCommand.cs index 7845d601f4..639693eb5d 100644 --- a/src/Tools/dotnet-dump/Commands/SOSCommand.cs +++ b/src/Tools/dotnet-dump/Commands/SOSCommand.cs @@ -48,7 +48,21 @@ namespace Microsoft.Diagnostics.Tools.Dump [Command(Name = "histobjfind", AliasExpansion = "HistObjFind", Help = "Displays all the log entries that reference an object at the specified address.")] [Command(Name = "histroot", AliasExpansion = "HistRoot", Help = "Displays information related to both promotions and relocations of the specified root.")] [Command(Name = "setsymbolserver", AliasExpansion = "SetSymbolServer", Help = "Enables the symbol server support ")] - internal class SOSCommand : CommandBase + [Command(Name = "dumprcw", AliasExpansion = "DumpRCW", Platform = CommandPlatform.Windows, Help = "Displays information about a Runtime Callable Wrapper.")] + [Command(Name = "dumpccw", AliasExpansion = "DumpCCW", Platform = CommandPlatform.Windows, Help = "Displays information about a COM Callable Wrapper.")] + [Command(Name = "dumppermissionset",AliasExpansion = "DumpPermissionSet", Platform = CommandPlatform.Windows, Help = "Displays a PermissionSet object (debug build only).")] + [Command(Name = "traverseheap", AliasExpansion = "TraverseHeap", Platform = CommandPlatform.Windows, Help = "Writes out a file in a format understood by the CLR Profiler.")] + [Command(Name = "analyzeoom", AliasExpansion = "AnalyzeOOM", Platform = CommandPlatform.Windows, Help = "Displays the info of the last OOM occurred on an allocation request to the GC heap.")] + [Command(Name = "verifyobj", AliasExpansion = "VerifyObj", Platform = CommandPlatform.Windows, Help = "Checks the object for signs of corruption.")] + [Command(Name = "listnearobj", AliasExpansion = "ListNearObj", Platform = CommandPlatform.Windows, Help = "Displays the object preceding and succeeding the address specified.")] + [Command(Name = "gcheapstat", AliasExpansion = "GCHeapStat", Platform = CommandPlatform.Windows, Help = "Display various GC heap stats.")] + [Command(Name = "watsonbuckets", AliasExpansion = "WatsonBuckets", Platform = CommandPlatform.Windows, Help = "Displays the Watson buckets.")] + [Command(Name = "threadpool", AliasExpansion = "ThreadPool", Platform = CommandPlatform.Windows, Help = "Lists basic information about the thread pool.")] + [Command(Name = "comstate", AliasExpansion = "COMState", Platform = CommandPlatform.Windows, Help = "Lists the COM apartment model for each thread.")] + [Command(Name = "gchandles", AliasExpansion = "GCHandles", Platform = CommandPlatform.Windows, Help = "Provides statistics about GCHandles in the process.")] + [Command(Name = "objsize", AliasExpansion = "ObjSize", Platform = CommandPlatform.Windows, Help = "Lists the sizes of the all the objects found on managed threads.")] + [Command(Name = "gchandleleaks", AliasExpansion = "GCHandleLeaks", Platform = CommandPlatform.Windows, Help = "Helps in tracking down GCHandle leaks")] + public class SOSCommand : CommandBase { [Argument(Name = "arguments", Help = "Arguments to SOS command.")] public string[] Arguments { get; set; } diff --git a/src/Tools/dotnet-dump/Commands/SOSCommandForWindows.cs b/src/Tools/dotnet-dump/Commands/SOSCommandForWindows.cs deleted file mode 100644 index 36acf694e9..0000000000 --- a/src/Tools/dotnet-dump/Commands/SOSCommandForWindows.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Diagnostics.Repl; -using System.CommandLine; - -namespace Microsoft.Diagnostics.Tools.Dump -{ - [Command(Name = "dumprcw", AliasExpansion = "DumpRCW", Help = "Displays information about a Runtime Callable Wrapper.")] - [Command(Name = "dumpccw", AliasExpansion = "DumpCCW", Help = "Displays information about a COM Callable Wrapper.")] - [Command(Name = "dumppermissionset", AliasExpansion = "DumpPermissionSet", Help = "Displays a PermissionSet object (debug build only).")] - [Command(Name = "traverseheap", AliasExpansion = "TraverseHeap", Help = "Writes out a file in a format understood by the CLR Profiler.")] - [Command(Name = "analyzeoom", AliasExpansion = "AnalyzeOOM", Help = "Displays the info of the last OOM occurred on an allocation request to the GC heap.")] - [Command(Name = "verifyobj", AliasExpansion = "VerifyObj", Help = "Checks the object for signs of corruption.")] - [Command(Name = "listnearobj", AliasExpansion = "ListNearObj", Help = "Displays the object preceding and succeeding the address specified.")] - [Command(Name = "gcheapstat", AliasExpansion = "GCHeapStat", Help = "Display various GC heap stats.")] - [Command(Name = "watsonbuckets", AliasExpansion = "WatsonBuckets", Help = "Displays the Watson buckets.")] - [Command(Name = "threadpool", AliasExpansion = "ThreadPool", Help = "Lists basic information about the thread pool.")] - [Command(Name = "comstate", AliasExpansion = "COMState", Help = "Lists the COM apartment model for each thread.")] - [Command(Name = "gchandles", AliasExpansion = "GCHandles", Help = "Provides statistics about GCHandles in the process.")] - [Command(Name = "objsize", AliasExpansion = "ObjSize", Help = "Lists the sizes of the all the objects found on managed threads.")] - [Command(Name = "gchandleleaks", AliasExpansion = "GCHandleLeaks", Help = "Helps in tracking down GCHandle leaks")] - internal class SOSCommandForWindows : SOSCommand - { - } -}