Skip to content
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

Fix LoadNativeSymbols for cross-dac #929

Merged
merged 1 commit into from
Mar 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/SOS/SOS.NETCore/SymbolReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,16 @@ public static void LoadNativeSymbols(SymbolFileCallback callback, IntPtr paramet
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
var peFile = new PEFile(new StreamAddressSpace(stream), true);
generator = new PEFileKeyGenerator(s_tracer, peFile, moduleFilePath);
if (peFile.IsValid())
{
generator = new PEFileKeyGenerator(s_tracer, peFile, moduleFilePath);
}
else
{
// Support loading ELF files on Windows for the cross-dac
var elfFile = new ELFFile(new StreamAddressSpace(stream), 0, true);
generator = new ELFFileKeyGenerator(s_tracer, elfFile, moduleFilePath);
}
}
else {
return;
Expand Down