Description
Issue description
Add a command to SOS to display the profiler's state in a process (whether it is attached, and what configuration flags it was set up with).
The task should be fairly straightforward, as all the information that SOS needs to display is already stored in the g_profControlBlock struct. My estimation is roughly 3-4 hours for someone who's not already familiar with the codebase.
This issue is originally from: https://github.com/dotnet/coreclr/issues/12719 (partially)
A little bit of background
SOS (Son of Strike) is a debugging extension that allows us to debug managed applications running on top of CLR. You can find the source in the src/ToolBox/SOS
directory.
To see how to use SOS to debug managed code, you can follow the instructions here:
https://github.com/dotnet/coreclr/blob/master/Documentation/building/debugging-instructions.md
Little bit more push on the back to get started
To add a SOS command to do this, you will need to add a function to src/ToolBox/SOS/Strike/strike.cpp
with a suitable SOS command name. (i.e. DumpProfilerState
).
You can follow the code path for other SOS commands that are already implemented (i.e. DumpHeap, ClrStack) to see how they are implemented as a reference.