The eight tables
The tables use the same row format as the .NET metadata tables: columns one after another, little-endian, heap indexes of 2 or 4 bytes (by HeapSizes), table indexes of 2 or 4 bytes. A column that names a table of the assembly (MethodDef) takes its width from the row count in the #Pdb stream, because the PDB has no such table. The row counts of MethodDebugInformation normally equal the assembly’s MethodDef count: row n belongs to method n.
| Table | Column | Size | Holds |
|---|---|---|---|
| 0x30 Document | Name | #Blob | The document path: a separator character, then the parts as indexes into the #Blob heap. |
| HashAlgorithm | #GUID | Which hash the Hash column holds (SHA-1, SHA-256 or MD5, each a well-known GUID), or none. | |
| Hash | #Blob | The hash of the source file. | |
| Language | #GUID | The language (C#, VB, F# have their own GUIDs). | |
| 0x31 MethodDebugInformation | Document | index | The document if the method has a single one, else 0. |
| SequencePoints | #Blob | The sequence points: IL offset deltas, line and column deltas, hidden points. | |
| 0x32 LocalScope | Method | index | The MethodDef the scope is in. |
| ImportScope | index | The imports in effect. | |
| VariableList | index | The first LocalVariable of the scope. | |
| ConstantList | index | The first LocalConstant. | |
| StartOffset | 4 | The IL offset where the scope starts. | |
| Length | 4 | Its length in IL bytes. | |
| 0x33 LocalVariable | Attributes | 2 | 0x1 DebuggerHidden. |
| Index | 2 | The slot in the method’s local signature. | |
| Name | #Strings | The variable name. | |
| 0x34 LocalConstant | Name | #Strings | The constant’s name. |
| Signature | #Blob | Its type and value. | |
| 0x35 ImportScope | Parent | index | The enclosing ImportScope, or 0. |
| Imports | #Blob | The imported namespaces, aliases and types. | |
| 0x36 StateMachineMethod | MoveNextMethod | index | The compiler-generated MoveNext of an async or iterator state machine. |
| KickoffMethod | index | The method the programmer wrote, which starts the state machine. | |
| 0x37 CustomDebugInformation | Parent | coded | HasCustomDebugInformation: any row of the assembly’s tables or of the debug tables. |
| Kind | #GUID | Which kind of information: SourceLink, embedded source, state machine hoisted locals, and others, each a GUID. | |
| Value | #Blob | The data. |
Not described
Known, not yet covered
- Reference: the encoding of the Name, SequencePoints, Imports and Value blobs and the GUIDs of the well-known kinds, hash algorithms and languages.
- Viewer: those columns show as a byte count and the first bytes; the tables themselves are read and compared with Microsoft’s reader row by row.
Links
Reference
- Portable PDB v1.0: Format specification – the tables and their blobs