Skip to content

Add a NuGet package README for Microsoft.DiaSymReader - #469

Open
officialasishkumar wants to merge 1 commit into
dotnet:mainfrom
officialasishkumar:package-readme
Open

officialasishkumar wants to merge 1 commit into
dotnet:mainfrom
officialasishkumar:package-readme

Conversation

@officialasishkumar

Copy link
Copy Markdown

The Microsoft.DiaSymReader package doesn't ship a readme, so nuget.org shows no usage information for it, and #291 asks how to use the library to examine a Windows PDB.

This adds src/Microsoft.DiaSymReader/PACKAGE.md, laid out like the PACKAGE.md files in dotnet/runtime libraries, and packs it as the package readme via PackageReadmeFile. It covers:

  • what the package provides, and that the implementations come from Microsoft.DiaSymReader.Native (Windows PDBs) and Microsoft.DiaSymReader.PortablePdb (Portable PDBs), with System.Reflection.Metadata recommended for new code that reads Portable PDBs
  • a complete example that opens a Windows PDB with SymUnmanagedReaderFactory, implements ISymReaderMetadataProvider on top of System.Reflection.Metadata, prints documents, sequence points and local variable scopes using the SymUnmanagedExtensions helpers, and releases the reader with ISymUnmanagedDispose.Destroy
  • where the factory looks for Microsoft.DiaSymReader.Native.{platform}.dll, the UseAlternativeLoadPath and UseComRegistry options, and a short note on writing PDBs with SymUnmanagedWriterFactory

I packed the library locally and checked that PACKAGE.md ends up at the package root with <readme>PACKAGE.md</readme> in the nuspec. I also built the sample against the resulting package and ran its ISymReaderMetadataProvider against a real assembly.

If #454 lands, the sentence about where the Windows implementation comes from should be updated the same way as in README.md.

Fixes #291

The Microsoft.DiaSymReader package doesn't ship a readme, so nuget.org
shows no usage information for it, and the question raised in dotnet#291 of
how to examine a Windows PDB with this library has no documented answer.

Add src/Microsoft.DiaSymReader/PACKAGE.md, following the PACKAGE.md
layout used by dotnet/runtime libraries, and pack it as the package
readme via PackageReadmeFile.

The readme explains that the package only defines the interfaces and
where the implementations come from (Microsoft.DiaSymReader.Native for
Windows PDBs, Microsoft.DiaSymReader.PortablePdb for Portable PDBs), and
recommends System.Reflection.Metadata for new code that reads Portable
PDBs. It includes a complete example that:

- opens a Windows PDB with SymUnmanagedReaderFactory.CreateReader,
- implements ISymReaderMetadataProvider on top of
  System.Reflection.Metadata,
- enumerates documents, sequence points and local variable scopes
  using the SymUnmanagedExtensions helpers, and
- releases the reader with ISymUnmanagedDispose.Destroy.

It also documents where the factory looks for the native library, the
UseAlternativeLoadPath and UseComRegistry options, and how PDBs are
written with SymUnmanagedWriterFactory.

Fixes dotnet#291
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sample code

1 participant