Repository navigation
Teach the DAC how to unwrap ComWrappers-based CCWs #36048
Description
Activity
- addeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on May 7, 2020 @jkoritzinsky Thanks for filing this. Can you elaborate on what information would be helpful? The details that are in the
ComWrappersRCW/CCW are vastly different than the built in ones.For the stowed exception scenario in particular, the DAC needs to be able to identity an interface pointer as a ComWrappers CCW interface pointer, retrieve the managed object, and dump the managed object.
The implementations of
are what we need to enlighten.runtime/src/coreclr/src/inc/sospriv.idl
Lines 299 to 304 in b48900f
// COM HRESULT GetRCWData(CLRDATA_ADDRESS addr, struct DacpRCWData *data); HRESULT GetRCWInterfaces(CLRDATA_ADDRESS rcw, unsigned int count, struct DacpCOMInterfacePointerData *interfaces, unsigned int *pNeeded); HRESULT GetCCWData(CLRDATA_ADDRESS ccw, struct DacpCCWData *data); HRESULT GetCCWInterfaces(CLRDATA_ADDRESS ccw, unsigned int count, struct DacpCOMInterfacePointerData *interfaces, unsigned int *pNeeded); HRESULT TraverseRCWCleanupList(CLRDATA_ADDRESS cleanupListPtr, VISITRCWFORCLEANUP pCallback, LPVOID token); In particular,
GetCCWDataatis the function that the "dump stowed exception" path uses to unwrap the stowed exception object and get the information for the user.runtime/src/coreclr/src/debug/daccess/request.cpp
Line 4069 in b48900f
HRESULT ClrDataAccess::GetCCWData(CLRDATA_ADDRESS ccw, struct DacpCCWData *ccwData) If we implement all of the mentioned functions for the DAC, I think that will enable all of the CCW/RCW related SOS commands for ComWrappers CCWs and RCWs as well.
This is going to be unfortunate. I was hoping to avoid having a DAC build of the interoplib. We might want to redesign some of the data structures so the header contains everything. Don't know if that has already been done.
- removeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on May 8, 2020 - ghost locked as resolved and limited conversation to collaborators
on Dec 9, 2020
To ensure that we get an accurate diagnostics experience for RCWs and CCWs that use the new ComWrappers APIs, we should enlighten the DAC to how to discover them and dump them.
Additionally, this work should include updating the DAC's support for dumping a stowed exception to be able to unwrap ComWrappers-based CCW stowed exceptions.
Related: microsoft/CsWinRT#201, #35318