PDT - Program Database Toolkit -

Program Database Toolkit

PDT's PDB file format definition


Table of Contents

File Header - Header information included in each pdb file.
Source Files - This tag records the each pdb files.
Routines - This tag records each routine declared in the source file.
Types - This tag records each Type declared in the source file.
Locations - This simple tag is used to store a location in a source file. Used only within other tags, not found by itself.
Statements - This simple tag is used to record a statement in the source file. Used only within other tags, not found by itself.
Groups - This simple tag is used to record a group (classes in C) in the source code.
Templates - These tags record templates in the source files.
Namespaces - These tags record the namespaces inside the source file.
Macros - These tags record each occurance of a marco in the source file.
Pragmas - These tags record every Pragma within the source file.

1. PDB examples

PDB files are designed to translate line-by-line source files recording the the important information. A simple example is a statement in the source file, for example:

return true;

Should be translated as:

rstmt st#0 return so#1 7 5 so#1 7 16 NA NA

This line says that it records statments within a routine (rstmt), gives it a idenifier (0), the records it name (return). This line also lists this statements location in the source file, (source file 1, start at line 7 column 5, ends at line 7 column 16. The next two word relate to other statements in this routine. The rest of the routine is:

					{
						if (i == 0)
							return true;
						else
							return false;
					}
			

The pdb file reads:

rstmt st#0 return so#1 7 5 so#1 7 16 NA NA
rstmt st#1 block NULL 0 0 NULL 0 0 NA st#0
rstmt st#2 return so#1 9 5 so#1 9 17 NA NA
rstmt st#3 block NULL 0 0 NULL 0 0 NA st#2
rstmt st#4 if so#1 6 4 so#1 9 17 NA st#1 st#3
rstmt st#5 block so#1 5 3 so#1 10 3 NA st#4
			

The first statement is records the 'return true' statement and the last two words point to the next statement and the down statement (none in both cases.) The second statement is the block which encapsulates the 'return true' statement (notice the last word points to that statement.) The third statement is the other return statement. The fourth statement is, likewise, the block that incloses it. The fifth statement is the if statement and points to the 'return true' as down and 'return false' as the extra statement. The last statement is the block that enclose all these statement (down points to the 'if' statement.)