Provides support for reading Portable PDB files, specifically line information resolution for functions.
Portable PDB is a debugging information file format for Common Language Infrastructure (CLI) languages. It is an extension of the ECMA-335 format.
Functionality
- Parse Portable PDB files with [
PortablePdb::parse]. - Convert Portable PDB files to
PortablePdbCacheswith [PortablePdbCacheConverter::process_portable_pdb]. - Serialize
PortablePdbCacheswith [PortablePdbCacheConverter::serialize] and parse them with [PortablePdbCache::parse]. - Look up line information for a function on a
PortablePdbCachewith [PortablePdbCache::lookup].
Example
use fixture;
use ;
let buf = read.unwrap;
let pdb = parse.unwrap;
let mut converter = new;
converter.process_portable_pdb.unwrap;
let mut buf = Vecnew;
converter.serialize.unwrap;
let cache = parse.unwrap;
let line_info = cache.lookup.unwrap;
assert_eq!;
Structure of a Portable PDB file
An ECMA-335 file is divided into sections called streams. The possible streams are:
#~("metadata"), comprising information about classes, methods, modules, &c., organized into tables adhering to various schemas. The original ECMA-335 tables are described in Section II.22 of the ECMA-335 spec, the tables added by Portable PDB are described in the Portable PDB spec. TheMethodDebugInformationtable is of particular interest tosymbolic, as it contains line information for functions.#Strings, comprising null-terminated UTF-8 strings.#GUID, a list of GUIDs.#US("user strings"), comprising UTF-16 encoded strings.#Blob, comprising blobs of data that don't fit in any of the other streams.
The Portable PDB format extends ECMA-335 by the addition of another steam, #PDB, as well
as several tables to the #~ stream.