summaryrefslogtreecommitdiff
path: root/src/ToolBox
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2019-05-22 22:56:33 -0400
committerStephen Toub <stoub@microsoft.com>2019-05-28 06:05:33 -0400
commit66134f6e3646f22ac551fb5d720033d26d4cbf8d (patch)
treecf1cd8b30814855a3ce1879a58e0d16341e8816c /src/ToolBox
parent4a1275434fff99206f2a28f5f0e87f124069eb7f (diff)
downloadcoreclr-66134f6e3646f22ac551fb5d720033d26d4cbf8d.tar.gz
coreclr-66134f6e3646f22ac551fb5d720033d26d4cbf8d.tar.bz2
coreclr-66134f6e3646f22ac551fb5d720033d26d4cbf8d.zip
Display state machine fields in DumpAsync for -stacks
Currently the DumpAsync -fields option just impacts whether the state machine fields are output for the top-level state machines. We received feedback that it would be more expected for -fields to also cause the fields to be output for all state machines listed as part of continuation chains. This does that.
Diffstat (limited to 'src/ToolBox')
-rw-r--r--src/ToolBox/SOS/Strike/strike.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/ToolBox/SOS/Strike/strike.cpp b/src/ToolBox/SOS/Strike/strike.cpp
index b25d340771..3e4f1668fa 100644
--- a/src/ToolBox/SOS/Strike/strike.cpp
+++ b/src/ToolBox/SOS/Strike/strike.cpp
@@ -4419,6 +4419,18 @@ void ExtOutTaskStateFlagsDescription(int stateFlags)
ExtOut("\n");
}
+void ExtOutStateMachineFields(AsyncRecord& ar)
+{
+ DacpMethodTableData mtabledata;
+ DacpMethodTableFieldData vMethodTableFields;
+ if (mtabledata.Request(g_sos, ar.StateMachineMT) == S_OK &&
+ vMethodTableFields.Request(g_sos, ar.StateMachineMT) == S_OK &&
+ vMethodTableFields.wNumInstanceFields + vMethodTableFields.wNumStaticFields > 0)
+ {
+ DisplayFields(ar.StateMachineMT, &mtabledata, &vMethodTableFields, (DWORD_PTR)ar.StateMachineAddr, TRUE, ar.IsValueType);
+ }
+}
+
DECLARE_API(DumpAsync)
{
INIT_API();
@@ -4687,19 +4699,14 @@ DECLARE_API(DumpAsync)
// Output the state machine's details as a single line.
sos::Object obj = TO_TADDR(arIt->second.Address);
- DacpMethodTableData mtabledata;
- DacpMethodTableFieldData vMethodTableFields;
- if (arIt->second.IsStateMachine &&
- mtabledata.Request(g_sos, arIt->second.StateMachineMT) == S_OK &&
- vMethodTableFields.Request(g_sos, arIt->second.StateMachineMT) == S_OK &&
- vMethodTableFields.wNumInstanceFields + vMethodTableFields.wNumStaticFields > 0)
+ if (arIt->second.IsStateMachine)
{
// This has a StateMachine. Output its details.
sos::MethodTable mt = TO_TADDR(arIt->second.StateMachineMT);
DMLOut("%s %s %8d ", DMLAsync(obj.GetAddress()), DMLDumpHeapMT(obj.GetMT()), obj.GetSize());
if (includeCompleted) ExtOut("%8s ", GetAsyncRecordStatusDescription(arIt->second));
ExtOut("%10d %S\n", arIt->second.StateValue, mt.GetName());
- if (dumpFields) DisplayFields(arIt->second.StateMachineMT, &mtabledata, &vMethodTableFields, (DWORD_PTR)arIt->second.StateMachineAddr, TRUE, arIt->second.IsValueType);
+ if (dumpFields) ExtOutStateMachineFields(arIt->second);
}
else
{
@@ -4762,6 +4769,7 @@ DECLARE_API(DumpAsync)
sos::MethodTable contMT = TO_TADDR(contAsyncRecord->second.StateMachineMT);
if (contAsyncRecord->second.IsStateMachine) ExtOut("(%d) ", contAsyncRecord->second.StateValue);
ExtOut("%S\n", contMT.GetName());
+ if (contAsyncRecord->second.IsStateMachine && dumpFields) ExtOutStateMachineFields(contAsyncRecord->second);
}
else
{