Compartilhar via


PDB Downloader

 

What are PDBs?

A Program Database (.pdb) file, also called a symbol file, maps the identifiers that you create in source files for classes, methods, and other code to the identifiers that are used in the compiled executables of your project.

The file also maps the statements in the source code to the execution instructions in the executables. The debugger will then use this information to determine the 2 key pieces of information:

  1. The source file with the line number that is displayed in any code editor
  2. The location in the executable to stop at when you set a breakpoint

You will often need .pdb files which contain symbols for Microsoft DLLs, or other 3rd Party libraries to debug a multitude of issues.

Ok, but why do I need them?

Taking an example, we run into scenarios on a daily basis wherein we need to inject a breakpoint in Microsoft code to capture memory dumps. To inject that breakpoint, we typically get a manual dump of the process, and use Debug Diagnostics, or the Visual Studio Debugger, to download them.

These debuggers will attempt to download all the symbols for libraries used within the application. This is a very time consuming process because it downloads PDBs for ALL libraries, while we need the PDB file for say, one specific library in which the breakpoint is to be injected. Not to mention the PDBs for all libraries in a process can get very large in size.

Why PDB Downloader?

PDB downloader downloads specific symbol files only for the libraries you want - reducing time, and space.

It is a small standalone executable (< 200KB) that just needs the DLL as an input.

Advantages

  • No debuggers are required to download the symbols.
  • You do not need admin access.
  • Supports both managed and native libraries/executables
  • No need to install the tool -  it’s a standalone executable.
  • You can download symbols which are required by debugger for breakpoints.
  • The tool reduces 90% of symbol download time.
  • Disk space utilization is minimal.
  • Open source, free to download and modify
  • Log file support to troubleshoot issues with the tool
  • Downloads:
    • Microsoft Symbol Server symbols.
    • Symbols from most external symbol servers, like Google, Adobe, etc.
    • Private symbols if the symbols servers are configured for HTTP.
    • Symbols for 32-bit and 64-bit architecture.

Cool, where do I get it from and how do I use it?

The tool can be downloaded from the open source github repo:

https://github.com/rajkumar-rangaraj/PDB-Downloader/releases/download/v1.0/PDBDownloader.exe

The GUI has a fairly simple layout with an option to input assembly file(s) using the file browser and enumerates them as a list (1).

Step 1

Click Open File(s), navigate to the folder containing the assembly and select the file

Step1

Step 2 (Optional Step)

You may modify the download path by clicking the “Saving to” link and selecting a folder of your choice. It will be a good idea to ensure that the folder you select has adequate NTFS permissions to write files.

Step 3

Clicking the start button probes the symbol server and downloads the .pdb file for your assembly.

Step2

And that’s all, you have your PDB downloaded!

Any pre-requisites?

OS: Windows Vista & above
.NET Framework : 4.5.2 & above

Note: You can always copy the library in question to a machine which fits the above requirements and use the tool there to download the symbols you need.

Using 3rd Party/Custom Symbol Server

If you want to use the PDB Downloader to download symbol files from 3rd Party symbol servers, all you need to do is create a simple configuration file named PDBDownloader.exe.config, and place it in the same folder as the tool, and add the below content:

<?xml version="1.0" encoding="utf-8" ?><configuration><appSettings><add key="SymbolServer" value="https://symbols.mozilla.org/firefox"/></appSettings></configuration>

The SymbolServer key here would be modified to reflect the URL of the symbol server you are targeting.

------------------------------------------------------------------------------------------------------------------------------------------

We are always interested to get feedback and know about any bugs that you may encounter when using the application, shoot an email to us using the Feedback/Bug link at the bottom of the tool and we’ll look into the problem (4).

------------------------------------------------------------------------------------------------------------------------------------------

 

Technorati Tags: pdb,symbols

Comments

  • Anonymous
    March 07, 2016
    Very helpful tool and well written article.

  • Anonymous
    March 09, 2016
    Nice!

  • Anonymous
    September 26, 2016
    Thanks so much for the tool. Worked great!!

  • Anonymous
    February 02, 2017
    WebRoot identifies this EXE as malware, and I have no control to turn that off on my machine. Arg! This tool would be perfect.

    • Anonymous
      February 02, 2017
      I ran the application under SandBoxie and it worked perfectly fine and left nothing extra after exit. So it appears to be harmless.
  • Anonymous
    February 02, 2017
    I ran the exe under SandBoxie on another machine and it download the PDB perfectly fine. After exiting the application, the sandboxie contained no signs of malware. So it is probably safe to use the EXE, false alarm. Thank you, this application is perfect!