Skip to content

Commit

Permalink
Use CommandPlatform on Windows specific commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mikem8361 committed Dec 12, 2019
1 parent bcd3d8d commit 29e0f63
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 30 deletions.
3 changes: 1 addition & 2 deletions src/Tools/dotnet-dump/Analyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> Analyze(FileInfo dump_path, string[] command)
Expand Down
16 changes: 15 additions & 1 deletion src/Tools/dotnet-dump/Commands/SOSCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
27 changes: 0 additions & 27 deletions src/Tools/dotnet-dump/Commands/SOSCommandForWindows.cs

This file was deleted.

0 comments on commit 29e0f63

Please sign in to comment.