Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Enable FinalizeQueue SOS command for Unix (#21876)
Browse files Browse the repository at this point in the history
The command is very useful and there seems to be no reason for it to not to be enabled on Unix.
  • Loading branch information
janvorli authored Jan 9, 2019
1 parent 687ba57 commit 5a0144e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/ToolBox/SOS/Strike/sos_unixexports.src
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ EEHeap
GCWhere
EEStack
EHInfo
FinalizeQueue
FindAppDomain
GCInfo
GCRoot
Expand Down
27 changes: 24 additions & 3 deletions src/ToolBox/SOS/Strike/sosdocsunix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------------- -----------------------------
Expand Down Expand Up @@ -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>

Expand Down
5 changes: 0 additions & 5 deletions src/ToolBox/SOS/Strike/strike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5663,8 +5663,6 @@ DECLARE_API(SyncBlk)
return Status;
}

#ifndef FEATURE_PAL

#ifdef FEATURE_COMINTEROP
struct VisitRcwArgs
{
Expand Down Expand Up @@ -5750,7 +5748,6 @@ DECLARE_API(RCWCleanupList)
}
#endif // FEATURE_COMINTEROP


/**********************************************************************\
* Routine Description: *
* *
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/ToolBox/SOS/lldbplugin/soscommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 5a0144e

Please sign in to comment.