namespace Microsoft.Diagnostics.ExtensionCommands
{
- [Command(Name = "sosstatus", Help = "Displays internal status or resets the internal cached state.")]
+ [Command(Name = "sosstatus", Help = "Displays internal status.")]
+ [Command(Name = "sosflush", DefaultOptions = "--reset", Help = "Resets the internal cached state.")]
public class StatusCommand : CommandBase
{
[ServiceImport]
[ServiceImport]
public ISymbolService SymbolService { get; set; }
- [Option(Name = "-reset", Help = "Reset all the cached internal state.")]
+ [Option(Name = "--reset", Aliases = new[] { "-reset" }, Help = "Resets the internal cached state.")]
public bool Reset { get; set; }
public override void Invoke()
if (m_netcore != nullptr) {
m_netcore->Flush();
}
-#ifndef FEATURE_PAL
+#ifdef FEATURE_PAL
+ FlushMetadataRegions();
+#else
if (m_desktop != nullptr) {
m_desktop->Flush();
}
runtimes
StopOnCatch
SetClrPath
-SOSFlush
SOSStatus
+SOSFlush
runtimes
SuppressJitOptimization
SyncBlk
HistInit SetHostRuntime (sethostruntime)
HistRoot SetSymbolServer (setsymbolserver)
HistObj SetClrPath (setclrpath)
-HistObjFind SOSFlush
+HistObjFind SOSFlush (sosflush)
HistClear SOSStatus (sosstatus)
FAQ
Help (soshelp)
-reset - reset all the cached internal SOS state.
-Display internal SOS status, reset the internal cached state, or change between the desktop .NET framework
-or .NET Core runtimes when both are loaded in the process or dump.
+Displays internal SOS status or resets the internal cached state.
0:000> !sosstatus
Target platform: 8664 Context size 04d0
Server: http://msdl.microsoft.com/download/symbols/
\\
+COMMAND: sosflush.
+!sosflush
+
+Resets the internal cached state.
+\\
+
COMMAND: setclrpath.
!setclrpath <path-to-runtime>
-reset - reset all the cached internal SOS state.
-Display internal SOS status or reset the internal cached state.
+Displays internal SOS status or resets the internal cached state.
+\\
+
+COMMAND: sosflush.
+sosflush
+
+Resets the internal cached state.
\\
COMMAND: setclrpath.
}
if (bReset)
{
- ReleaseTarget();
- ExtOut("SOS state reset\n");
+ ITarget* target = GetTarget();
+ if (target != nullptr)
+ {
+ target->Flush();
+ }
+ ExtOut("Internal cached state reset\n");
return S_OK;
}
Target::DisplayStatus();
DECLARE_API(SOSFlush)
{
- INIT_API_EXT();
- ITarget* target = GetTarget();
- if (target != nullptr)
+ INIT_API_NOEE();
+
+ IHostServices* hostServices = GetHostServices();
+ if (hostServices != nullptr)
{
- target->Flush();
+ Status = hostServices->DispatchCommand("sosflush", args);
+ }
+ else
+ {
+ ITarget* target = GetTarget();
+ if (target != nullptr)
+ {
+ target->Flush();
+ }
+ ExtOut("Internal cached state reset\n");
+ return S_OK;
}
return Status;
}
g_services->AddManagedCommand("setsymbolserver", "Enables the symbol server support ");
g_services->AddCommand("soshelp", new sosCommand("Help"), "Displays all available commands when no parameter is specified, or displays detailed help information about the specified command: 'soshelp <command>'.");
g_services->AddCommand("sosstatus", new sosCommand("SOSStatus"), "Displays the global SOS status.");
- g_services->AddCommand("sosflush", new sosCommand("SOSFlush"), "Flushes the DAC caches.");
+ g_services->AddCommand("sosflush", new sosCommand("SOSFlush"), "Resets the internal cached state.");
g_services->AddCommand("syncblk", new sosCommand("SyncBlk"), "Displays the SyncBlock holder info.");
g_services->AddCommand("threadpool", new sosCommand("ThreadPool"), "Displays info about the runtime thread pool.");
g_services->AddCommand("threadstate", new sosCommand("ThreadState"), "Pretty prints the meaning of a threads state.");