dotnet / diagnostics

This repository contains the source code for various .NET Core runtime diagnostic tools and documents.
MIT License
1.19k stars 356 forks source link

Fix SOS single file support #2515

Open mikem8361 opened 3 years ago

mikem8361 commented 3 years ago

There are various single file issues that need to be fixed in SOS/dotnet-dump:

The clrmd PE symbol export work should mitigate the need for the DOTNET_ENABLE_SOS_SINGLEFILE env var which was added because the dbgeng symbol lookup was so slow.

mikem8361 commented 3 years ago

Some details on the clrmd ELF reader single file base address issue:

                Start                 End         Page Offset
    0x000055cc59e80000  0x000055cc59e82000  0x0000000000001e42          <-- the base address what the clrmd ELF reader returns
        /mnt/c/Users/mikem/OneDrive - Microsoft/save/wsl2/builds/singlefile/bin/Debug/net6.0/linux-x64/publish/singlefile
    0x000055cc59e90000  0x000055cc5a618000  0x0000000000001e42
        /mnt/c/Users/mikem/OneDrive - Microsoft/save/wsl2/builds/singlefile/bin/Debug/net6.0/linux-x64/publish/singlefile
    0x000055cc5a627000  0x000055cc5a871000  0x00000000000025c9
        /mnt/c/Users/mikem/OneDrive - Microsoft/save/wsl2/builds/singlefile/bin/Debug/net6.0/linux-x64/publish/singlefile
    ...
    0x000055cc5aeeb000  0x000055cc5aeec000  0x0000000000003446
        /mnt/c/Users/mikem/OneDrive - Microsoft/save/wsl2/builds/singlefile/bin/Debug/net6.0/linux-x64/publish/singlefile
    0x000055ccd398c000  0x000055ccd3a11000  0x0000000000000000          <-- the actual base address
        /mnt/c/Users/mikem/OneDrive - Microsoft/save/wsl2/builds/singlefile/bin/Debug/net6.0/linux-x64/publish/singlefile
    0x000055ccd3a11000  0x000055ccd3c23000  0x0000000000000085

Single file dumps under lldb and windbg (cross-DAC) do work because they both use the DSO chain to enumerate the native modules.