Skip to content

Support Single File Diagnostics #45382

@tommcdon

Description

@tommcdon

This issue is tracking the work necessary to support single-file diagnostics. Our goal is to deliver parity with debugging and profiling with framework dependent applications where applicable.

  • Reduce long term maintenance by moving to the dotnet/diagnostics repo
  • dbgshim needs an ELF parser to identify if a module is CoreCLR + extract the DAC/DBI keys. There's currently a copy in use in the runtime for createdump and the DAC on Linux dumps and one used in SOS for OpenVirtualProcess.
  • dbgshim OVP needs updated ILibraryProvider callback interface that accepts buildid information for DAC/DBI. This receives the DAC/DBI keys that were retrieved.
  • dbgshim live debugging case needs to integrate ILibraryProvider so that the caller can locate DAC/DBI instead of dbgshim.
    • We search for CoreCLR in the module list. On Linux and macOS we have the PAL runtime startup helper:
      PAL_ERROR InvokeStartupCallback()
    • Use the path to coreclr as a lookup location for DBI: F:\github\coreclr\src\dlls\dbgshim\dbgshim.cpp:382
    • provide the coreclr base address to DBI:
      mscordbi!Cordb::SetTargetCLR 
      mscordbi!CoreCLRCreateCordbObjectEx 
      mscordbi!CoreCLRCreateCordbObject dbgshim!CreateCoreDbgWithoutSandboxSupport 
      dbgshim!CreateCoreDbg dbgshim!RuntimeStartupHelper::InvokeStartupCallback 
      dbgshim!RuntimeStartupHandler 
      dbgshim!InvokeStartupCallback dbgshim!StartupHelperThread
      
  • createdump and a portion of the DAC need to be linked into the host
  • The linked version of createdump needs to be modified to use a linked in DAC rather than searching for it.
  • F:\github\coreclr\src\debug\createdump\crashinfo.cpp(374) - cache coreclr path unneeded
  • F:\github\coreclr\src\debug\createdump\crashinfo.cpp(620) - add alternate path to construct pfnCLRDataCreateInstance
  • Mac OS superhost debugging support Change DAC to use MachOReader to lookup "g_dacTable" symbol instead of the rva header file hack #38901
  • Link DotNetRuntimeInfo into the superhost Debugging singlefile deployment: Failed to find runtime module (libcoreclr.so), 0x80004005 diagnostics#1764
  • Watson support for single-file apps diagnostics#2438 (comment)

Metadata

Metadata

Assignees

Labels

area-Diagnostics-coreclrenhancementProduct code improvement that does NOT require public API changes/additions

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions