summaryrefslogtreecommitdiff
path: root/src/ToolBox
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2019-01-09 03:00:36 +0100
committerGitHub <noreply@github.com>2019-01-09 03:00:36 +0100
commit5a0144e70f412178615e3e69f2256ffd695d2189 (patch)
tree5d9d9329c3457861db110d822015d50cdfd365b4 /src/ToolBox
parent687ba57ae4e3df6aaa539898dea99ac2d918554a (diff)
downloadcoreclr-5a0144e70f412178615e3e69f2256ffd695d2189.tar.gz
coreclr-5a0144e70f412178615e3e69f2256ffd695d2189.tar.bz2
coreclr-5a0144e70f412178615e3e69f2256ffd695d2189.zip
Enable FinalizeQueue SOS command for Unix (#21876)
The command is very useful and there seems to be no reason for it to not to be enabled on Unix.
Diffstat (limited to 'src/ToolBox')
-rw-r--r--src/ToolBox/SOS/Strike/sos_unixexports.src1
-rw-r--r--src/ToolBox/SOS/Strike/sosdocsunix.txt27
-rw-r--r--src/ToolBox/SOS/Strike/strike.cpp5
-rw-r--r--src/ToolBox/SOS/lldbplugin/soscommand.cpp1
4 files changed, 26 insertions, 8 deletions
diff --git a/src/ToolBox/SOS/Strike/sos_unixexports.src b/src/ToolBox/SOS/Strike/sos_unixexports.src
index ac27c02a71..84af3dab6c 100644
--- a/src/ToolBox/SOS/Strike/sos_unixexports.src
+++ b/src/ToolBox/SOS/Strike/sos_unixexports.src
@@ -29,6 +29,7 @@ EEHeap
GCWhere
EEStack
EHInfo
+FinalizeQueue
FindAppDomain
GCInfo
GCRoot
diff --git a/src/ToolBox/SOS/Strike/sosdocsunix.txt b/src/ToolBox/SOS/Strike/sosdocsunix.txt
index d014df7c4d..d4333cfff2 100644
--- a/src/ToolBox/SOS/Strike/sosdocsunix.txt
+++ b/src/ToolBox/SOS/Strike/sosdocsunix.txt
@@ -30,9 +30,9 @@ DumpDelegate (dumpdelegate) u (clru)
DumpStackObjects (dso) DumpStack (dumpstack)
DumpHeap (dumpheap) EEStack (eestack)
DumpVC CLRStack (clrstack)
-GCRoot (gcroot) GCInfo
-PrintException (pe) EHInfo
- bpmd (bpmd)
+FinalizeQueue (finalizequeue) GCInfo
+GCRoot (gcroot) EHInfo
+PrintException (pe) bpmd (bpmd)
Examining CLR data structures Diagnostic Utilities
----------------------------- -----------------------------
@@ -432,6 +432,27 @@ DumpVC is quite a specialized function. Some managed programs make heavy use
of value classes, while others do not.
\\
+COMMAND: finalizequeue
+FinalizeQueue [-detail] | [-allReady] [-short]
+
+Displays all objects registered for finalization.
+The "-detail" option displays extra information about any SyncBlocks that need
+to be cleaned up. This data structure is cached and cleaned up by the
+finalizer thread when it runs.
+
+The "-allReady" option displays all objects that are ready for finalization,
+regardless of whether they are already marked by the garbage collection
+as such, or will be marked by the next garbage collection. The objects that
+are in the "ready for finalization" list are finalizable objects that are
+no longer rooted. This option can be very expensive, because it verifies
+whether all the objects in the finalizable queues are still rooted.
+
+The "-short" option limits the output to the address of each object. If it is
+used in conjunction with -allReady, it enumerates all objects that have
+a finalizer that are no longer rooted. If it is used independently, it lists
+all objects in the finalizable and "ready for finalization" queues.
+\\
+
COMMAND: gcroot.
GCRoot [-nostacks] <Object address>
diff --git a/src/ToolBox/SOS/Strike/strike.cpp b/src/ToolBox/SOS/Strike/strike.cpp
index 8ce5be246c..e2c77e47ba 100644
--- a/src/ToolBox/SOS/Strike/strike.cpp
+++ b/src/ToolBox/SOS/Strike/strike.cpp
@@ -5663,8 +5663,6 @@ DECLARE_API(SyncBlk)
return Status;
}
-#ifndef FEATURE_PAL
-
#ifdef FEATURE_COMINTEROP
struct VisitRcwArgs
{
@@ -5750,7 +5748,6 @@ DECLARE_API(RCWCleanupList)
}
#endif // FEATURE_COMINTEROP
-
/**********************************************************************\
* Routine Description: *
* *
@@ -5893,8 +5890,6 @@ DECLARE_API(FinalizeQueue)
return Status;
}
-#endif // FEATURE_PAL
-
enum {
// These are the values set in m_dwTransientFlags.
// Note that none of these flags survive a prejit save/restore.
diff --git a/src/ToolBox/SOS/lldbplugin/soscommand.cpp b/src/ToolBox/SOS/lldbplugin/soscommand.cpp
index 3565b9eebe..da352afd62 100644
--- a/src/ToolBox/SOS/lldbplugin/soscommand.cpp
+++ b/src/ToolBox/SOS/lldbplugin/soscommand.cpp
@@ -141,6 +141,7 @@ sosCommandInitialize(lldb::SBDebugger debugger)
interpreter.AddCommand("dso", new sosCommand("DumpStackObjects"), "Displays all managed objects found within the bounds of the current stack.");
interpreter.AddCommand("eeheap", new sosCommand("EEHeap"), "Displays info about process memory consumed by internal runtime data structures.");
interpreter.AddCommand("eestack", new sosCommand("EEStack"), "Runs dumpstack on all threads in the process.");
+ interpreter.AddCommand("finalizequeue", new sosCommand("FinalizeQueue"), "Displays all objects registered for finalization.");
interpreter.AddCommand("gcroot", new sosCommand("GCRoot"), "Displays info about references (or roots) to an object at the specified address.");
interpreter.AddCommand("ip2md", new sosCommand("IP2MD"), "Displays the MethodDesc structure at the specified address in code that has been JIT-compiled.");
interpreter.AddCommand("name2ee", new sosCommand("Name2EE"), "Displays the MethodTable structure and EEClass structure for the specified type or method in the specified module.");