-
Notifications
You must be signed in to change notification settings - Fork 374
[cDAC] Add switch to load cDAC directly #5373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I was planning to do this work myself later this week or next. This PR does have some considerable issues like all the code changes under "Strike\platform" are only used to fallback when there isn't a managed host. We use the CLRMD runtime enumeration to find a "runtime" and to create the IXCLRDataProcess instance for managed code. And using an env var to control loading the CDAC isn't the direction I want to go in. I haven't completely thought this out but the !runtime command can be used to control this. And we may want to have the CLRMA code use the CDAC and the rest of SOS to still use the regular DAC. |
I'm not saying most of this work will be needed like adding ICLRContractLocator and the implementation. |
Agreed on the env variable. A command would be preferable. I was looking into the difference between managed/native hosting and have tested this on Windows-x64 for the managed hosting. The native hosting I set up some interfaces but didn't implement We can discuss this tomorrow at the cDAC meeting. I'm happy to change this how you prefer or drop part of it. |
} | ||
else | ||
{ | ||
OSPlatform platform = Target.OperatingSystem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, this should use the RuntimeInformation.IsOSPlatform() because we need the OS we are loading the module on not the target OS. We can load Linux dumps on Windows with windbg or dotnet-dump.
|
||
if (val == 0) | ||
{ | ||
_dacFilePath ??= GetLibraryPath(DebugLibraryKind.Dac); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably will just add another value to DebugLibraryKind for the CDAC in CLRMD. CLRMD needs some of these changes and more to find a CDAC compatible runtime, load it and create the instance.
Depends on cDAC changes dotnet/runtime#113899
ICLRContractLocator
COM interface which is passed to DAC/cDAC instantiation. Fetches the contract descriptor location. New cDAC entrypoint depends on this API.DOTNET_SOS_LOAD_CDAC
is setICLRContractLocator
using existingIExportSymbol
serviceDOTNET_SOS_LOAD_CDAC
is setICLRContractLocator
. The existing symbol lookup defers to WinDBG for Windows and uses parsers for MachO/ELF. However, only one of these is built at a time depending on the host platform. Todo: figure out cross-platform native symbol reading.