Leaf Indices Referenced from Symbols

(0x1001) Type Modifier

This record is used to indicate the const,r volatile and unaligned properties for any particular type.

2

4

2

LF_MODIFIER

@index

attribute


@index type index of the modified type

attribute const :1 const attribute.
volatile :1 volatile attribute.
unaligned :1 unaligned attribute.

reserved :13

(0x1002) Pointer

This record is the generic pointer type record. It supports the C++ reference type, pointer to data member, and pointer to method. It also conveys the const and volatile pointer information

.

2

4

4

*

LF_POINTER

@type

attribute

variant


@type

Type index of object pointed to

attribute

Consists of five bit fields:

ptrtype

:5

Ordinal specifying mode of pointer

0

Near

1

Far

2

Huge

3

Based on segment (OBSOLETE)

4

Based on value

5

Based on segment of value (OBSOLETE)

6

Based on address of symbol (OBSOLETE)

7

Based on segment of symbol address (OBSOLETE)

8

Based on type

9

Based on self (OBSOLETE)

10

Near 32 bit pointer

11

Far 32 bit pointer

12

64 bit pointer

13-31

Reserved

ptrmode

:3

Ordinal specifying pointer mode

0

Pointer

1

Reference

2

Pointer to data member

3

Pointer to method

4-7

Reserved

isflat32

:1

True if 16:32 pointer

volatile

:1

True if pointer is volatile

const

:1

True if pointer is const

unaligned

:1

True if pointer is unaligned

restrict

:1

True if pointer is restricted

unused

:19

Unused and reserved

variant

variant portion of the record, depending upon the pointer type

based on segment - Segment value

based on type- Index of type followed by length-prefixed name

based on self - Nothing

based on symbol - Copy of symbol record including length field

pointer to data member - Union specifying pointer to data member

pointer to method- Union specifying pointer to method


The union specifying the pointer to data member has the format:

4

2

@class

format


class Type index of containing class

format 0 16:16 data for class with no virtual functions or virtual bases.

1 16:16 data for class with virtual functions.

2 16:16 data for class with virtual bases.

3 16:32 data for classes w/wo virtual functions and no virtual bases

4 16:32 data for class with virtual bases.

5 16:16 near method nonvirtual bases with single address point

6 16:16 near method nonvirtual bases with multiple address points

7 16:16 near method with virtual bases

8 16:16 far method nonvirtual bases with single address point

9 16:16 far method nonvirtual bases with multiple address points

10 16:16 far method with virtual bases

11 16:32 method nonvirtual bases with single address point

12 16:32 method nonvirtual bases with multiple address points

13 16:32 method with virtual bases

The pointer to data member and pointer to method have the following formats in memory. In the following descriptions of the format and value of the NULL pointer, * means any value.

Ø (00) 16:16 pointer to data member for a class with no virtual functions or bases.

2

mdisp


mdisp Displacement to data. NULL is 0xffff

Ø (01) 16:16 pointer to data member for a class with virtual functions.

2

mdisp


mdisp Displacement to data. NULL is 0

Ø (02) 16:16 pointer to data member for a class with virtual bases.

2

2

2

mdisp

pdisp

vdisp


mdisp displacement to data

pdisp this pointer displacement to virtual base table pointer

vdisp displacement within virtual base table. NULL value is (,,0xffff)

Ø (03) 16:32 near pointer to data member for a class with and without virtual functions and no virtual bases

4

mdisp


mdisp Displacement to data. NULL is 0x80000000

Ø (04) 16:32 near pointer to data member for a class with virtual bases.

4

4

4

mdisp

pdisp

vdisp


mdisp displacement to data

pdisp this pointer displacement to virtual base table pointer

vdisp displacement within virtual base table. NULL value is (,,0xffffffff)

Ø (05) 16:16 pointer to near member function for a class with no virtual functions or bases and a single address point

2

off


off near address of method. NULL is 0

Ø (06) 16:32 pointer to near member function for a class with no virtual bases with multiple address points

2

2

off

disp


off offset of function

disp displacement of address point. NULL is (0,*)

Ø (07) 16:16 pointer to near member function for a class with virtual bases

2

2

2

2

off

mdisp

pdisp

vdisp


off offset of function

mdisp displacement to data

pdisp this pointer displacement to virtual base table pointer

vdisp displacement within virtual base table. NULL value is (0,*,*,*)

Ø (08) 16:16 pointer to far member function for a class with no virtual bases and a single address point

2

2

off

seg


off offset of function

disp displacement of address point. NULL is (0:0)

Ø (09) 16:16 pointer to far member function for a class with no virtual bases and multiple address points

2

2

2

off

seg

disp


off offset of function

seg segment of function

disp displacement of address point. NULL is (0:0,*)

Ø (10) 16:16 pointer to far member function for a class with virtual bases

2

2

2

2

2

off

seg

mdisp

pdisp

vdisp


off offset of function

seg segment of function

mdisp displacement to data

pdisp this pointer displacement to virtual base table pointer

vdisp displacement within virtual base table. NULL value is (0,*,*,*)

Ø (11) 16:32 pointer to member function for a class with no virtual bases and a single address point

4

off


off offset of function. NULL is 0L

Ø (012) 16:32 pointer to member function for a class with no virtual bases and multiple address points

4

4

off

disp


off offset of function

disp displacement of address point. NULL is (0L:0L)

Ø (13) 16:32 pointer to member function for a class with virtual bases

4

4

4

4

off

mdisp

pdisp

vdisp


off offset of function

mdisp displacement to data

pdisp this pointer displacement to virtual base table pointer

vdisp displacement within virtual base table. NULL value is (0L,*,*,*)

(0x1003) Simple Array

2

4

4

*

*

LF_ARRAY

@elemtype

@idxtype

length

name


@elemtype Type index of each array element

@idxtype Type index of indexing variable

length Length of array in bytes

name Length-prefixed name of array

(0x1004) Classes

The format for and classes is as follows:

2

2

2

42

4

4

*

*

leaf

count

property

@field

@dList

@vshape

length

name


leaf LF_CLASS or LF_STRUCTURE

count Number of elements in the class or structure. This count includes direct, virtual, and indirect virtual bases, and methods including overloads, data members, static data members, friends, and so on.

property Property bit field

packed :1 Structure is packed
ctor :1 Class has constructors and/or destructors
overops :1 Class has overloaded operators
isnested :1 Class is a nested class
cnested :1 Class contains nested classes
opassign :1 Class has overloaded assignment
opcast :1 Class has casting methods

fwdref :1 Class/structure is a forward (incomplete) reference

scoped :1 This is a scoped definition
reserved:8

@field Type index of the field list for this class.

@dList Type index of the derivation list. This is output by the compiler as 0x0000 and is filled in by the CVPACK utility to a LF_DERIVED record containing the type indices of those classes which immediately inherit the current class. A zero index indicates that no derivation information is available. A LF_NULL index indicates that the class is not inherited by other classes.

@vshape Type index of the virtual function table shape descriptor

length Numeric leaf specifying size in bytes of the structure

name Length-prefixed name this type

(0x1005) Structures

Structures have the same format as classes. Structure type records are used exclusively by the C compiler. The C++ compiler emits both class and structure records depending upon the declaration.

(0x1006) Unions

The format for a Union is as follows:

2

2

2

42

*

*

LF_UNION

count

property

@field

length

name


count Number of fields in the union

property Property bit field.

@field Type index of field list.

length Numeric leaf specifying size in bytes of the union

name Length-prefixed name of union

(0x1007) Enumeration

The format for an enum is as follows:

2

2

2

4

4

*

LF_ENUM

count

property

@type

@fList

name


count Number of enumerates

property Property bit field.

@type Underlying type of enum

@field Type index of field list.

name Length-prefixed name of enum

(0x1008) Procedure

2

4

1

1

2

4

LF_PROCEDURE

@rvtype

call

reserved

#parms

@arglist


@rvtype Type index of the value returned by the procedure

call Calling convention of the procedure

0 Near C (arguments pushed right to left, caller pops arguments)

1 Far C

2 Near pascal (arguments pushed left to right, callee pops arguments)

3 Far pascal

4 Near fastcall

5 Far fastcall

6 Reserved

7 Near stdcall

8 Far stdcall

9 Near syscall

10 Far syscall

11 This call

12 MIPS call

13 Generic

14-255 Reserved

#parms Number of parameters

@arglist Type index of argument list type record

(0x1009) Member Function

2

4

4

4

1

1

LF_MFUNCTION

@rvtype

@class

@this

call

res

->


2

4

4

#parms

@arglist

thisadjust


@rvtype Type index of the value returned by the procedure

@class Type index of the containing class of the function

@this Type index of the this parameter of the member function. A type of void indicates that the member function is static and has no this parameter.

call Calling convention of the procedure. See Procedure description.

res Reserved. Must be emitted as zero.

#parms Number of parameters. This count does not include the this parameter.

arglist List of parameter specifiers. This list does not include the this parameter.

thisadjust Logical this adjustor for the method. Whenever a class element is referenced via the this pointer, thisadjust will be added to the resultant offset before referencing the element.

(0x000a) Virtual Function Table Shape

This record describes the format of a virtual function table. This record is accessed via the vfunctabptr in the member list of the class which introduces the virtual function. The vfunctabptr is defined either by the LF_VFUNCTAB or LF_VFUNCOFF member record. If LF_VFUNCTAB record is used, then vfunctabptr is at the address point of the class. If LF_VFUNCOFF record is used, then vfunctabptr is at the specified offset from the class address point. The underlying type of the pointer is a VTShape type record. This record describes how to interpret the memory at the location pointed to by the virtual function table pointer.

2

2

4 bits

LF_VTSHAPE

count

descriptor

repeated


count Number of descriptors

descriptor A four-bit ordinal describing the entry in the virtual table
0 Near
1 Far
2 Thin
3 Address point displacement to outermost class. This is at entry[-1] from table address
4 Far pointer to metaclass descriptor. This is at entry[-2] from table address

5 Near32

6 Far32
7 - 15 Reserved

(0x100a) Cobol0

This record has been reserved for the Microfocus COBOL compiler.

2

4

*

LF_COBOL0

@parent

data


@parent Type index of the parent type

data Data

(0x000c) Cobol1

This record has been reserved for the Microfocus COBOL compiler.

2

*

LF_COBOL1

data


data Data

(0x100b) Basic Array

2

4

LF_BARRAY

@ type


type Type of each element of the array

(0x000e) Label

This is used for assembler labels where there is no typing information about the label.

2

2

LF_LABEL

mode


mode Addressing mode of the label

0 Near label

4 Far label

(0x000f) Null

This is used where the symbol requires a type record but the data content is null.

2

LF_NULL


(0x0010) Not Translated

This is used when CVPACK encounters a type record that has no equivalent in the CV4.0 format.

2

LF_NOTTRANS


(0x100c) Multiply Dimensioned Array

This record is used to describe a multiply dimensioned array.

2

4

4

*

LF_DIMARRAY

@utype

@diminfo

name


@utype Underlying type of the array

@diminfo Index of the type record containing the dimension information

name Length-prefixed name of the array

(0x100d) Path to Virtual Function Table

This record is used to describe the path to the virtual function table.

2

4

4 * count

LF_VFTPATH

count

bases


count Count of number of bases in the path to the virtual function table

bases Type indices of the base classes in the path

(0x0013) Reference Precompiled Types

This record specifies that the type records are included from the precompiled types contained in another module in the executable. A module that contains this type record is considered to be a user of the precompiled types. When emitting to a COFF object the section name should be .debug$P rather than .debug$T. All other attributes should be the same.

2

4

4

4

*

LF_PRECOMP

start

count

signature

name


start Starting type index that is included. This number must correspond to the current type index in the current module

count count of the number of type indices included. After including the precompiled types, the type index must be start + count

signature Signature for the precompiled types being referencedbythis module. The signature will be checked against the signature in the S_OBJNAME symbol record and the LF_ENDPRECOMP type record contained in the $$TYPES table of the creator of the precompiled types. The signature check is used to detect recompilation of the supplier of the precompiled types without recompilation of all of the users of the precompiled types. The method for computing the signature is unspecified. It should be sufficiently robust to detect failures to recompile.

name Name of the module containing the precompiled types. This name must match the module name in the S_OBJNAME symbol emitted by the compiler for the object file containing the precompiled types.

(0x0014) End of Precompiled Types

This record specifies that the preceding type records in this module can be referenced by another module in the executable. A module that contains this type record is considered to be the creator of the precompiled types. The subsection index for the $$TYPES segment for a precompiled types creator is emitted as sstPreComp instead of sstTypes so that the CVPACK can pack the precompiled types creators before the users. Precompiled types must be emitted as the first type records within the $$TYPES segment and must be self-contained. That is, they cannot reference a type record whose index is greater than or equal to the type index of the LF_ENDPRECOMP type record.

2

4

LF_ENDPRECOMP

signature


signature Signature of the precompiled types. The signatures in the S_OBJNAME symbol record, the LF_PRECOMP type record and this signature must match.

(0x100f) OEM Generic Type

This record is supplied to allow third party compiler vendors to emit debug OMF information in an arbitrary format and still allow CVPACK to be able to process the record. CVPACK processes this record by performing a left to right depth first recursive pack of the records specified by indices below. The remainder of the data is copied without alteration.

2

2

2

4

4 * count

*

LF_OEM

OEM

recOEM

count

indices

data


OEM Microsoft assigned OEM identifier

recOEM OEM assigned record identifier. These record identifiers are unique per assigned OEM.

count number of type indices that follow

indices Type indices

data remainder of type record.

(0x0016) Reference Typeserver

This type record is used to indicate that all type records must be retrieved from the specified Program Data Base (PDB).

2

4

4

*

LF_TYPESERVER

signature

age

name


signature Signature of the PDB. The method of computing this signature is unspecified. The signature must be verified against the signature in the PDB by using the TypesQuerySignature API call.

age Age of program data base The method of computing this age is unspecified. The age must be verified against the age in the PDB by using the TypesQueryAge API call.

name Length prefixed full path name of program data base