Skip to content

Command groups to support duplicate command names and better help support - #4285

Merged
mikem8361 merged 6 commits into
dotnet:mainfrom
mikem8361:extensions6
Oct 4, 2023
Merged

mikem8361 merged 6 commits into
dotnet:mainfrom
mikem8361:extensions6

Conversation

@mikem8361

Copy link
Copy Markdown
Contributor

Add extension load testing that includes duplicate command names.

Add internal CommandGroup class to CommandService

dotnet-dump analyze -c/--command will exit on any parsing errors or exceptions in the command

command help not displayed on parsing errors/invalid options

Add INIT_API_CHECK_MANAGED native SOS command macro

Rename clrmodules command to assemblies and keep clrmodules as an alias

Support static HelpInvoke/FilterInvoke methods

Add command service testing

Better command service help interface. Returns help text instead of printing it on the console directly. ICommandService.DisplayHelp() => GetHelpText(). Better help sorting.

Fix some SOS scripts

Return error code for command line option errors in native SOS

Load next to executing assembly first when hosted under desktop Framework

Test using "clrthreads" instead of "Threads"

Replace testing "u" with "clru"

Add more general command filter mechanism. Add FilterType property to Command attribute. Remove OS filter command flags.

NativeAddressHelper service work

Move Windows managed command stubs to separate file

Add SOS.Hosting services to SOS.Extensions for better native command help. This requires the special ManagedOnlyCommandFilter service to prevent recursion of the C++ commands. On Windows this recursion is from "C++ command" -> "checking if managed version" -> "executing the command in SOS.Hosting" -> "C++ command".

Help is now uniform across managed/native, alphabetized and filtered by the current runtime.

@mikem8361
mikem8361 requested review from hoyosjs and leculver October 3, 2023 00:28
@mikem8361
mikem8361 requested a review from a team as a code owner October 3, 2023 00:28
@mikem8361 mikem8361 self-assigned this Oct 3, 2023
Add extension load testing

Add internal CommandGroup class to CommandService

dotnet-dump analyze -c/--command will exit on any parsing errors or exceptions in the command

command help not displayed on parsing errors/invalid options

Add INIT_API_CHECK_MANAGED native SOS command macro

Rename clrmodules command to assemblies and keep clrmodules as an alias

Support static HelpInvoke/FilterInvoke methods

Add command service testing

Better command service help interface

Returns help text instead of printing it on the console directly.

ICommandService.DisplayHelp() => GetHelpText()

Fix some SOS scripts

Return error code for command line option errors in native SOS

Load next to executing assembly first when hosted under desktop Framework

Test using "clrstack" instead of "Threads"

Replace testing u with clru

Remove old runtime dumps from DebugServices tests. Skip tests that load 6.0 runtime/DAC because of injection activation DAC bug.

Add more general command filter mechanism

Add FilterType property to Command attribute

Remove OS filter command flags

NativeAddressHelper service work

Better help sorting

Move Windows managed command stubs to separate file

Add SOS.Hosting services to SOS.Extensions for better native command help. This requires the special ManagedOnlyCommandFilter service
to prevent recursion of the C++ commands. On Windows this recursion is from "C++ command" -> "checking if managed version" ->
"executing the command in SOS.Hosting" -> "C++ command".

Help is now uniform across managed/native, alphabetized and filtered by the current runtime.

@leculver leculver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a lot of comments and suggestions, but I don't think anything in particular is wrong or blocking so I'm marking this approved. Feel free to implement these suggestions, or not. I will take another look if you push any changes in response here.

I'm not sure I understand what happens if two commands with the same name all pass the filter by mistake. Otherwise I think this is a good direction.

Comment thread src/Microsoft.Diagnostics.ExtensionCommands/ClrRuntimeCommandBase.cs Outdated
Comment thread src/Microsoft.Diagnostics.ExtensionCommands/DumpAsyncCommand.cs
Comment thread src/Microsoft.Diagnostics.ExtensionCommands/NativeAddressHelper.cs
Comment thread src/Microsoft.Diagnostics.ExtensionCommands/NativeAddressHelper.cs
Comment thread src/SOS/SOS.Extensions/DebuggerServices.cs
Comment thread src/SOS/SOS.Hosting/SOSHost.cs
Comment thread src/SOS/SOS.Hosting/SOSLibrary.cs
Comment thread src/SOS/SOS.UnitTests/Scripts/ConcurrentDictionaries.script Outdated
Comment thread src/SOS/Strike/gchist.cpp Outdated
Comment thread src/Microsoft.Diagnostics.ExtensionCommands/GCToNativeCommand.cs Outdated
Comment thread src/Microsoft.Diagnostics.ExtensionCommands/Host/HelpCommand.cs Outdated
Comment thread src/Microsoft.Diagnostics.ExtensionCommands/Host/HelpCommand.cs
Comment thread src/Microsoft.Diagnostics.ExtensionCommands/MAddressCommand.cs Outdated
@mikem8361
mikem8361 merged commit bbf3e7b into dotnet:main Oct 4, 2023
@mikem8361
mikem8361 deleted the extensions6 branch October 4, 2023 23:17
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants