Skip to content

Teach the DAC how to unwrap ComWrappers-based CCWs #36048

Description

@jkoritzinsky

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

Activity

  1. jkoritzinsky commented on May 7, 2020

    @jkoritzinsky
    MemberAuthor
  2. AaronRobinsonMSFT commented on May 7, 2020

    @AaronRobinsonMSFT
    Member

    @jkoritzinsky Thanks for filing this. Can you elaborate on what information would be helpful? The details that are in the ComWrappers RCW/CCW are vastly different than the built in ones.

  3. jkoritzinsky commented on May 8, 2020

    @jkoritzinsky
    MemberAuthor

    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

    // 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);
    are what we need to enlighten.

    In particular, GetCCWData at

    HRESULT ClrDataAccess::GetCCWData(CLRDATA_ADDRESS ccw, struct DacpCCWData *ccwData)
    is the function that the "dump stowed exception" path uses to unwrap the stowed exception object and get the information for the user.

  4. jkoritzinsky commented on May 8, 2020

    @jkoritzinsky
    MemberAuthor

    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.

  5. AaronRobinsonMSFT commented on May 8, 2020

    @AaronRobinsonMSFT
    Member

    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.

  6. tommcdon commented on May 8, 2020

    @tommcdon
    Member
  7. removed
    untriagedNew issue has not been triaged by the area owner
    on May 8, 2020
  8. added this to the 5.0 milestone on May 8, 2020
  9. ghost locked as resolved and limited conversation to collaborators on Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions