Skip to content

Commit

Permalink
Fix LoadNativeSymbols for cross-dac (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdmaclea authored Mar 19, 2020
1 parent d097a4a commit 3c99b4b
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit 3c99b4b

Please sign in to comment.