Skip to main content
Email Password   helpLost your password?
PdbInspectorSnapshot.jpg

Introduction

As Windows software developers, we all extensively use Visual Studio and/or WinDbg to step into our code, set breakpoints, watch variables and perform many other useful tasks related to the debugging of applications. We somehow know that an internal mechanism exists in order to enable the debuggers to map source code to binary and step into many of the available runtime libraries. For this purpose, debuggers use Program Database (PDB) files for managed as well as for unmanaged code. PDB for managed code contains less debug information since these are located in the metadata section of the PE sections.

This article has several goals:

Background

A native C++ PDB file contains a lot of information:

A .NET PDB only contains two pieces of information:

All the other information is already in the .NET metadata so there is no need to duplicate the same information in a PDB file.

For those of you not familiar with the Windows Debug Interface Access, Program Database (PDB) and the basic ideas presented here, a few essential links:

When compiled with debugging information, an executable file contains two references to the associated PDB file:

Pe_and_pdb.jpg

When a program to be debugged is launched, the debugger goes into the executable file and tries to locate the correct PDB file to proceed to the debugging session. The links above explain these along with how to setup a Symbols server.

Using the Code

The PDB project presented here consists of three parts:

Environment

The project has been developed and tested on Windows Vista Ultimate 32bit only.

Classes Hierarchy

As mentioned earlier, the Microsoft DIA SDK is a COM-based interface to handle PDB files. The problem with this SDK is that it consists of a tremendous collections of interfaces and functions. The PdbParser presented here abstracts these details and offers a simple task oriented set of interfaces. In this version, the PdbPaser concentrates on the collection of modules. The PdbParser is organized into a set of abstract layers. Opening a PDB file is made in two steps:

In order to retrieve details about a specific module referenced in a PDB file, one has to go through three additional steps:

In order to retrieve the source file names of a specific module, one has to go through three steps:

When appropriated, the resources allocated by the PdbParser are freed using one last step.

The image below shows the accessors-based hierarchy:

InterfacesHierarchy.jpg

History

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
QuestionNo module found Pin
Eastier
23:20 29 Jun '09  
AnswerRe: No module found Pin
Eastier
0:32 30 Jun '09  
GeneralRe: No module found Pin
ochsenmeier marc
0:36 30 Jun '09  
GeneralRe: No module found Pin
Eastier
0:53 30 Jun '09  
GeneralRe: No module found Pin
ochsenmeier marc
1:02 30 Jun '09  
AnswerRe: No module found Pin
ochsenmeier marc
0:34 30 Jun '09  
Generalhow to run Pin
dan o
23:00 22 Jun '09  
GeneralRe: how to run Pin
breakpoints
23:29 22 Jun '09  
GeneralRe: how to run Pin
breakpoints
23:38 22 Jun '09  
GeneralRe: how to run Pin
breakpoints
0:53 23 Jun '09  
GeneralRe: how to run Pin
dan o
2:37 23 Jun '09  
GeneralRe: how to run Pin
breakpoints
3:26 23 Jun '09  
GeneralYou learn something new every day, thanks Pin
Gilad Novik
12:36 22 Jun '09  
GeneralRe: You learn something new every day, thanks Pin
breakpoints
20:15 22 Jun '09  
GeneralNice Article Pin
Stuart Dootson
14:22 19 Jun '09  
GeneralRe: Nice Article Pin
breakpoints
9:00 20 Jun '09  


Last Updated 4 Jul 2009 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009