Skip to content

manison/PdbSourceIndexer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDB Source Indexer

Extensible and easy to use PDB source indexer written in C#.

Highlights

  • Easy to integrate with your CI workflow.
  • Easily extensible to fit your needs.
  • Handles projects with Git submodules.

Usage

> PdbSourceIndexer <global options> <provider> <provider options>

Global options

option description
--tools-path <tools-path> Debugging Tools for Windows installation path. Specifies location of pdbstr.exe and srctool.exe utils. These are part of the Windows SDK. Usually will be something like C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\srcsrv. Use this argument if PdbSourceIndexer cannot find the tools automatically.
--symbol-root <symbol-root> Specifies directory where the PDBs to index are located.
--recursive Search symbol files recursively.

Provider

Specifies the source server provider to use. The following providers are currently available:

provider source server
gitlab GitLab

GitLab provider

option description
--server-url <server-url> GitLab server URL (e.g. https://mygitlab.example.com).

When using the GitLab provider the git repository origin url must point to GitLab server URL (i.e. either git@mygitlab.example.com:/project.git or https://mygitlab.example.com/project.git). This is ok when indexing PDBs under GitLab-CI. Also when using the indexed PDB under debugger, the GITLAB_SRCSRV_TOKEN variable in user's srvsrv.ini must be set to repository read access PAT (see below). Also due to the inability of source server to download files from URLs with the query part you will have to install the wget utility somewhere on the %PATH% or point the srcsrv.ini to it.

Example

PdbSourceIndexer --symbol-root D:\MyProject\bin\Debug gitlab --server-url %CI_SERVER_URL%

Debugger Setup

Some source server providers require additional setup for the debugger. E.g. the GitLab source server provider requires the user's personal access token to authenticate and download the specific source file from the repository.

WinDbg

The source server is controlled through the srcsrv.ini file. Its location is specified by the SRCSRV_INI_FILE environment variable. So set the variable to e.g. C:\SrcSrv\srcsrv.ini, create that INI file in that location and set its content to (for GitLab source provider)

[variables]
GITLAB_SRCSRV_TOKEN=AaBbCcDdEeFf12345678

where the value is personal access token with at least the read_repository scope. The token can be created in user's GitLab settings page.

In this case you may want to save the file into your profile directory so other users can't access your PAT.

If the source server provider uses external program to extract the source file from the version control system you may want to specify the path to the utility in the srcsrv.ini. E.g. the GitLab provider uses wget to download the source file, you tell source server where to find wget as follows:

[trusted commands]
wget=C:\wget\wget.exe

Visual Studio

Besides authoring the srcsrv.ini file as above you also have to enable source server support in Visual Studio. Check the Tools > Options > Debugging > Enable source server support checkbox.