From: Stephen Toub Date: Thu, 28 Feb 2019 03:38:57 +0000 (-0500) Subject: Fix DumpAsync to understand ContinuationWrapper X-Git-Tag: submit/tizen/20190813.035844~54^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0faffeed160bf87bc41b21e2906f77a62b1f881;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Fix DumpAsync to understand ContinuationWrapper --- diff --git a/src/SOS/Strike/strike.cpp b/src/SOS/Strike/strike.cpp index 7f8a56ee0..43bc0eeb9 100644 --- a/src/SOS/Strike/strike.cpp +++ b/src/SOS/Strike/strike.cpp @@ -4270,13 +4270,32 @@ void ResolveContinuation(CLRDATA_ADDRESS* contAddr) } } - // If it was, or if it's storing an action, try to follow through to the action's target. + // If we now have an Action, try to follow through to the delegate's target. if ((offset = GetObjFieldOffset(contObj.GetAddress(), contObj.GetMT(), W("_target"))) != 0) { MOVE(*contAddr, contObj.GetAddress() + offset); if (sos::IsObject(*contAddr, false)) { contObj = TO_TADDR(*contAddr); + + // In some cases, the delegate's target might be a ContinuationWrapper, in which case we want to unwrap that as well. + if (_wcsncmp(contObj.GetTypeName(), W("System.Runtime.CompilerServices.AsyncMethodBuilderCore+ContinuationWrapper"), 74) == 0 && + (offset = GetObjFieldOffset(contObj.GetAddress(), contObj.GetMT(), W("_continuation"))) != 0) + { + MOVE(*contAddr, contObj.GetAddress() + offset); + if (sos::IsObject(*contAddr, false)) + { + contObj = TO_TADDR(*contAddr); + if ((offset = GetObjFieldOffset(contObj.GetAddress(), contObj.GetMT(), W("_target"))) != 0) + { + MOVE(*contAddr, contObj.GetAddress() + offset); + if (sos::IsObject(*contAddr, false)) + { + contObj = TO_TADDR(*contAddr); + } + } + } + } } } }