Closed
Description
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.
- Fetching export symbol information from the executable file.
- Required to find the cDAC contract descriptor. Stored at symbol with name
DotNetRuntimeContractDescriptor
. - 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.
- Required to find the cDAC contract descriptor. Stored at symbol with name
- OS information. The DAC and legacy cDAC ingest a different
ICorDebugMutableDataTarget
/ICorDebugDataTarget
which is shimmed indatatargetadapter.cpp
. This interface implementsHRESULT 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.- Don't implement this function. From what I can tell we don't actually care about the OS.
- Add a new COM interface which provides just the OS. This can be combined with the existing
GetMachineType
to implementGetPlatform
- Add a new COM interface which provides both the OS and architecture reusing the existing enum, but duplicating the architecture lookup functionality.
- 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);
};