diagnostics
diagnostics copied to clipboard
[SymbolStore] Add support to index .NET Framework Runtime debugging modules
SymbolStoreKey generators (*FileKeyGenerator) currently do not support .NET Framework scenarios which contain a different runtime module (clr.dll) than .NET Core scenarios (coreclr.dll). This PR aims to update the PEFileKeyGenerator to support generating SymbolStoreKeys for debugging modules used to debug the .NET Framework clr.dll runtime.
Before
var keygen = new PEFileKeyGenerator(tracer, pefile, filename);
Console.WriteLine("ClrKeys");
foreach (var key in keygen.GetKeys(KeyTypeFlags.ClrKeys))
{
Console.WriteLine(key.Index);
}
Console.WriteLine("End");
// $dotnet run -- <path-to-clr.dll>
//
// ClrKeys
// End
After
var keygen = new PEFileKeyGenerator(tracer, pefile, filename);
Console.WriteLine("ClrKeys");
foreach (var key in keygen.GetKeys(KeyTypeFlags.ClrKeys))
{
Console.WriteLine(key.Index);
}
Console.WriteLine("End");
// $dotnet run -- <path-to-clr.dll>
//
// ClrKeys
// <sos_long_name_index>
// <dac_index>
// <dac_long_name_index>
// <dbi_index>
// End
This PR does the following:
- Refactors
GetSpecialFileslogic- Splits grabbing DAC/DBI special files and SOS special files into separate steps
- Refactor logic to generate valid special file long name variants into a separate helper method.
- Add support for .NET Framework DAC special files
- Removes SOS key generation from .NET Core logic
- Adds mock PE files to test ClrKey generation for .NET Framework
- No longer considers
sos.dllas a "special file" as it is not indexed under runtime module properties
.NET Framework runtime module, DAC module, DBI module, SOS module indexing
clr.dll - identity
mscordbi.dll - identity + clr properties
mscordacwks.dll - identity + clr properties
mscordacwks_
.NET Core runtime module, DAC module, DBI module indexing
coreclr.dll - identity
mscordbi.dll - identity + coreclr properties
mscordacwks.dll - identity + coreclr properties
mscordacwks_
Running dotnet-symbol on SOS.DotnetDumpCommands.Heap.dumpgen.dmp
Downloading from https://symweb/
Writing files to mihw_dotnet_symbol
ERROR: Not Found: DotnetDumpCommands.exe - 'https://symweb/dotnetdumpcommands.exe/94C48F736000/dotnetdumpcommands.exe'
ERROR: Not Found: DotnetDumpCommands.pdb - 'https://symweb/dotnetdumpcommands.pdb/259bd51db1d64df89a4e33ec340748c31/dotnetdumpcommands.pdb'
Writing: mihw_dotnet_symbol\ntdll.dll
Writing: mihw_dotnet_symbol\ntdll.pdb
Writing: mihw_dotnet_symbol\mscoree.dll
Writing: mihw_dotnet_symbol\mscoree.pdb
Writing: mihw_dotnet_symbol\kernel32.dll
Writing: mihw_dotnet_symbol\kernel32.pdb
Writing: mihw_dotnet_symbol\KERNELBASE.dll
Writing: mihw_dotnet_symbol\kernelbase.pdb
Writing: mihw_dotnet_symbol\advapi32.dll
Writing: mihw_dotnet_symbol\advapi32.pdb
Writing: mihw_dotnet_symbol\msvcrt.dll
Writing: mihw_dotnet_symbol\msvcrt.pdb
Writing: mihw_dotnet_symbol\sechost.dll
Writing: mihw_dotnet_symbol\sechost.pdb
Writing: mihw_dotnet_symbol\bcrypt.dll
Writing: mihw_dotnet_symbol\bcrypt.pdb
Writing: mihw_dotnet_symbol\rpcrt4.dll
Writing: mihw_dotnet_symbol\rpcrt4.pdb
Writing: mihw_dotnet_symbol\mscoreei.dll
Writing: mihw_dotnet_symbol\mscoreei.pdb
Writing: mihw_dotnet_symbol\shlwapi.dll
Writing: mihw_dotnet_symbol\shlwapi.pdb
Writing: mihw_dotnet_symbol\kernel.appcore.dll
Writing: mihw_dotnet_symbol\Kernel.Appcore.pdb
Writing: mihw_dotnet_symbol\version.dll
Writing: mihw_dotnet_symbol\version.pdb
Writing: mihw_dotnet_symbol\clr.dll
Writing: mihw_dotnet_symbol\clr.pdb
Writing: mihw_dotnet_symbol\SOS_amd64_amd64_4.8.9232.00.dll
ERROR: Not Found: mscordacwks.dll - 'https://symweb/mscordacwks.dll/65EFB9129a4000/mscordacwks.dll'
Writing: mihw_dotnet_symbol\mscordbi.dll
Writing: mihw_dotnet_symbol\mscordacwks_amd64_amd64_4.8.9232.00.dll
Writing: mihw_dotnet_symbol\user32.dll
Writing: mihw_dotnet_symbol\user32.pdb
Writing: mihw_dotnet_symbol\win32u.dll
Writing: mihw_dotnet_symbol\win32u.pdb
Writing: mihw_dotnet_symbol\gdi32.dll
Writing: mihw_dotnet_symbol\gdi32.pdb
Writing: mihw_dotnet_symbol\gdi32full.dll
Writing: mihw_dotnet_symbol\gdi32full.pdb
Writing: mihw_dotnet_symbol\msvcp_win.dll
Writing: mihw_dotnet_symbol\msvcp_win.pdb
Writing: mihw_dotnet_symbol\ucrtbase.dll
Writing: mihw_dotnet_symbol\ucrtbase.pdb
Writing: mihw_dotnet_symbol\VCRUNTIME140_CLR0400.dll
Writing: mihw_dotnet_symbol\vcruntime140_clr0400.amd64.pdb
Writing: mihw_dotnet_symbol\VCRUNTIME140_1_CLR0400.dll
Writing: mihw_dotnet_symbol\vcruntime140_1_clr0400.amd64.pdb
Writing: mihw_dotnet_symbol\ucrtbase_clr0400.dll
Writing: mihw_dotnet_symbol\ucrtbase_clr0400.amd64.pdb
Writing: mihw_dotnet_symbol\imm32.dll
Writing: mihw_dotnet_symbol\imm32.pdb
Writing: mihw_dotnet_symbol\psapi.dll
Writing: mihw_dotnet_symbol\psapi.pdb
ERROR: Not Found: mscorlib.ni.dll - 'https://symweb/mscorlib.ni.dll/65EFB8AD160f000/mscorlib.ni.dll'
ERROR: Not Found: mscorlib.ni.pdb - 'https://symweb/mscorlib.ni.pdb/448a486950dceb6a540939cbe7df7d2c1/mscorlib.ni.pdb'
Writing: mihw_dotnet_symbol\mscorlib.pdb
Writing: mihw_dotnet_symbol\ole32.dll
Writing: mihw_dotnet_symbol\ole32.pdb
Writing: mihw_dotnet_symbol\combase.dll
Writing: mihw_dotnet_symbol\combase.pdb
Writing: mihw_dotnet_symbol\bcryptPrimitives.dll
Writing: mihw_dotnet_symbol\bcryptprimitives.pdb
Writing: mihw_dotnet_symbol\cryptsp.dll
Writing: mihw_dotnet_symbol\cryptsp.pdb
Writing: mihw_dotnet_symbol\rsaenh.dll
Writing: mihw_dotnet_symbol\rsaenh.pdb
Writing: mihw_dotnet_symbol\CRYPTBASE.dll
Writing: mihw_dotnet_symbol\cryptbase.pdb
Writing: mihw_dotnet_symbol\clrjit.dll
Writing: mihw_dotnet_symbol\clrjit.pdb
ERROR: Not Found: System.ni.dll - 'https://symweb/system.ni.dll/65F11862c1e000/system.ni.dll'
ERROR: Not Found: System.ni.pdb - 'https://symweb/system.ni.pdb/95d0282b6c6403bae690dcd3e65e7fad1/system.ni.pdb'
Writing: mihw_dotnet_symbol\System.pdb
ERROR: Not Found: System.Core.ni.dll - 'https://symweb/system.core.ni.dll/65F11851a86000/system.core.ni.dll'
ERROR: Not Found: System.Core.ni.pdb - 'https://symweb/system.core.ni.pdb/a85edf146d386a1d27e22549b5e480431/system.core.ni.pdb'
Writing: mihw_dotnet_symbol\System.Core.pdb
C:\Users\mihw\Source\Repos\mdh1418\diagnostics\artifacts\bin\dotnet-symbol\Debug\net6.0\dotnet-symbol.exe (process 43788) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
You may have already down this, but one way to test this end to end (at for downloading), is the run all the diagnostics repo tests on Windows with test.cmd. That creates some .NET Framework dumps in diagnostics\artifacts\tmp\Debug\dumps\Desktop\net462. Then take the dotnet-symbol built with your changes and run it (dotnet artifacts\bin\dotnet-symbol\Debug\shims\net6.0\dotnet-symbol.dll -o <path-to-put-files> <dump-file>). "clr.dll", "sos.dll" and "mscordacwks.dll" should be downloaded. You may have to use the --internal-server option to download from symweb.
@hoyosjs @noahfalk Thanks for the feedback, could I get another review?
I believe the failures are unrelated, created issues https://github.com/dotnet/diagnostics/issues/4654, https://github.com/dotnet/diagnostics/issues/4655, and one Socket connection issue that might be the same as https://github.com/dotnet/diagnostics/issues/1742