6.1.1 Debug Directory (Image Only)

Image files contain an optional "debug directory" indicating what form of debug information is present and where it is. This directory consists of an array of "debug directory entries" whose location and size are indicated in the image optional header.

The debug directory may be in a discardable .debug section (if one exists) or it may be included in any other section in the image file, or not in a section at all.

Each debug directory entry identifies the location and size of a block of debug information. The RVA specified may be 0 if the debug information is not covered by a section header (i.e., it resides in the image file and is not mapped into the run-time address space). If it is mapped, the RVA is its address.

Here is the format of a debug directory entry:

Offset Size Field Description
0 4 Characteristics A reserved field intended to be used for flags, set to zero for now.
4 4 TimeDateStamp Time and date the debug data was created.
8 2 MajorVersion Major version number of the debug data format.
10 2 MinorVersion Minor version number of the debug data format.
12 4 Type Format of debugging information: this field enables support of multiple debuggers. See Section 6.1.2, "Debug Type," for more information.
16 4 SizeOfData Size of the debug data (not including the debug directory itself).
20 4 AddressOfRawData Address of the debug data when loaded, relative to the image base.
24 4 PointerToRawData File pointer to the debug data.