Big picture on Symbol APIs

Here's how the managed symbol API fits into the overall symbol-store / PDB picture, courtesy of Steve Steiner and Curtis Man.

There's a basic uniform low level storage for both managed and native symbols. The low-level API is private, and then there are public higher level APIs that build on top of that.
Here's everything in table form:

public API dll What it does: Dependencies Used by:
low-level API, non-public MsPdb80 Read + write general symbols   used by VS native-debugger
DIA interaces, a COM-classic (unmanaged) API. MsDia80 read-only general symbols. static link to mspdb80 VS managed-debugger, Windbg
DbgHelp, C-style (unmanaged) API. Dbghelp.dll read native symbols uses DIA api, static link msdia, mspdb public tools to manipulate native symbols.
CorSym.idl, a COM-classic (unmanaged) API DiaSymReader.dll reader + writer for managed symbols reader statically links msdia80.
writer statically links mspdb80.
Managed-tools including: CLR, StackTrace class, .NET compilers, MDbg, ILasm/ILdasm, Reflection-emit

System.Diagnostics.SymbolStore interfaces in mscorlib.
managed wrappers for CorSym.idl

Get from mscorlib, lives in ISymWrapper.dll wrapper for reader for managed symbols. dynamically links diasymreader.dll Similar users as CorSym.idl. 
The ISymWrapper is used by Reflection-Emit to let users emit sequence points in their newly generated code.
These are MC++ wrappers and are mostly incomplete, especially on the writer.
FWIW, we would like to deprecate these .
MDbg wrappers for System.Diagnostics.SymbolStore 
interfaces in managed wrappers for CorSym.idl
MDbg wrappers. See MDbg source. wrapper for reader for managed symbols. CoCreates

Similar same users as CorSym.idl.  MDbg wrappers are used by MDbg. These are COM-interop based wrappers. I personally would encourage folks to use these wrappers instead of the ISymWrapper ones for their own private tools. They're more complete than ISymWrapper.dll. Since Mdbg source ships as a public sample, the source is also available.


Comments (2)

  1. Alan Cyment says:

    Mike: I guess I don’t understand the last table row. Aren’t Mdbg wrappers a replacement for those in System.Diagnostics.SymbolStore? I thought these two were competing approaches, but after reading this entry I get to think that Mdbg actually uses System.Diagnostics.SymbolStore. Is that so?

  2. System.Diagnostics.SymbolStore defines a set of interfaces that are the managed equivalent to CorSym.idl.

    There are 2 competing implementations of those interfaces:

    – ISymWrapper has a MC++ impl. This implementation also lives in the S.D.SS namespace, even though it’s implemented in a different dll than where the interfaces are defined.

    – MDbg has a COM-interop based impl.

Skip to main content