Skip to content

Add new COM interface provided by test host to support cDAC #113168

Closed
@max-charlamb

Description

@max-charlamb

The COM interfaces provided by SOS/WinDBG lack some functionality required to launch the cDAC.

Currently SOS currently provides:

  • ICLRDataTarget
  • ICLRDataTarget2
  • ICLRDataTarget4
  • ICLRMetadataLocator
  • ICLRRuntimeLocator

WinDBG provides a similar, but smaller group of interfaces.

  1. Fetching export symbol information from the executable file.
    1. Required to find the cDAC contract descriptor. Stored at symbol with name DotNetRuntimeContractDescriptor.
    2. This was handled on the DAC by parsing the executable file. We can reimplement this in the cDAC, but it would make more sense for the test host, which already can parse symbols, to provide this.
  2. OS information. The DAC and legacy cDAC ingest a different ICorDebugMutableDataTarget/ICorDebugDataTarget which is shimmed in datatargetadapter.cpp. This interface implements HRESULT GetPlatform(CorDebugPlatform* platform) which gives the platforms architecture and operating system. The underlying interfaces give the architecture, but not the OS. Instead, this is hardcoded using defines. This is not a viable option for the cDAC, but there are several options we can take.
    1. Don't implement this function. From what I can tell we don't actually care about the OS.
    2. Add a new COM interface which provides just the OS. This can be combined with the existing GetMachineType to implement GetPlatform
    3. Add a new COM interface which provides both the OS and architecture reusing the existing enum, but duplicating the architecture lookup functionality.
    4. Add the OS information to the cDAC contract.

Interface Proposal 1 - Only symbol lookup

interface ICLRSymbolLookup : IUnknown
{
    /*
     * Returns the address of the specified symbol.
     */
    HRESULT LookupSymbol([in] LPCSTR symbolName,
                         [out] CLRDATA_ADDRESS* address);
};

Interface Proposal 2 - Separate interfaces

interface ICLRSymbolLookup : IUnknown
{
    /*
     * Returns the address of the specified symbol.
     */
    HRESULT LookupSymbol([in] LPCSTR symbolName,
                         [out] CLRDATA_ADDRESS* address);
};

interface ICLRDataTargetPlatform: IUnknown
{
    /*
     * Returns the the target platform.
     */
    HRESULT GetPlatform([out] int* platform);
};

Interface Proposal 3 - Combined interface

interface ICLRDataTarget4: IUnknown
{
    /*
     * Returns the address of the specified symbol.
     */
    HRESULT LookupSymbol([in] LPCSTR symbolName,
                         [out] CLRDATA_ADDRESS* address);

    /*
     * Returns the the target platform.
     */
    HRESULT GetPlatform([out] int* platform);
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Diagnostics-coreclrenhancementProduct code improvement that does NOT require public API changes/additions

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions