6.1.2 Debug Type

The following values are defined for the Debug Type field of the debug directory:

Constant Value Description
IMAGE_DEBUG_TYPE_UNKNOWN 0 Unknown value, ignored by all tools.
IMAGE_DEBUG_TYPE_COFF 1 COFF debug information (line numbers, symbol table, and string table). This type of debug information is also pointed to by fields in the file headers.
IMAGE_DEBUG_TYPE_CODEVIEW 2 CodeView debug information. The format of the data block is described by the CV4 specification.
IMAGE_DEBUG_TYPE_FPO 3 Frame Pointer Omission (FPO) information. This information tells the debugger how to interpret non-standard stack frames, which use the EBP register for a purpose other than as a frame pointer.
IMAGE_DEBUG_TYPE_MISC 4
IMAGE_DEBUG_TYPE_EXCEPTION 5
IMAGE_DEBUG_TYPE_FIXUP 6
IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
IMAGE_DEBUG_TYPE_BORLAND 9

If Debug Type is set to IMAGE_DEBUG_TYPE_FPO, the debug raw data is an array in which each member describes the stack frame of a function. Not every function in the image file need have FPO information defined for it, even though debug type is FPO. Those functions that do not have FPO information are assumed to have normal stack frames. The format for FPO information is defined as follows:

#define FRAME_FPO   0
#define FRAME_TRAP  1
#define FRAME_TSS   2

typedef struct _FPO_DATA { DWORD ulOffStart; // offset 1st byte of function code DWORD cbProcSize; // # bytes in function DWORD cdwLocals; // # bytes in locals/4 WORD cdwParams; // # bytes in params/4
WORD cbProlog : 8; // # bytes in prolog WORD cbRegs : 3; // # regs saved WORD fHasSEH : 1; // TRUE if SEH in func WORD fUseBP : 1; // TRUE if EBP has been allocated WORD reserved : 1; // reserved for future use WORD cbFrame : 2; // frame type } FPO_DATA;