mscvpdb.h revision e65978fd37c355c3912e08ed9a253c3b652d36e5
/*
* MS debug information definitions.
*
* Copyright (C) 1996 Eric Youngdale
* Copyright (C) 1999-2000 Ulrich Weigand
* Copyright (C) 2004 Eric Pouech
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Sun elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
/* MS has stored all its debug information in a set of structures
* which has been rather consistent across the years (ie you can grasp
* some continuity, and not so many drastic changes).
*
* A bit of history on the various formats
* MSVC 1.0 PDB v1 (new format for debug info)
* MSVC 2.0 Inclusion in link of debug info (PDB v2)
* MSVC 5.0 Types are 24 bits (instead of 16 for <= 4.x)
* MSVC x.0 PDB (change in internal streams layout)
*
* .DBG Contains COFF, FPO and Codeview info
* .PDB New format for debug info (information is
* derived from Codeview information)
* VCx0.PDB x major MSVC number, stores types, while
* <project>.PDB stores symbols.
*
* Debug information can either be found in the debug section of a PE
* module (in something close to a .DBG file), or the debug section
* can actually refer to an external file, which can be in turn,
* either a .DBG or .PDB file.
*
* Regarding PDB files:
* -------------------
* They are implemented as a set of internal files (as a small file
* system). The file is split into blocks, an internal file is made
* of a set of blocks. Internal files are accessed through
* numbers. For example,
* 1/ is the ROOT (basic information on the file)
* 2/ is the Symbol information (global symbols, local variables...)
* 3/ is the Type internal file (each the symbols can have type
* information associated with it).
*
* Over the years, three formats existed for the PDB:
* - ?? was rather linked to 16 bit code (our support shall be rather
* bad)
* - JG: it's the signature embedded in the file header. This format
* has been used in MSVC 2.0 => 5.0.
* - DS: it's the signature embedded in the file header. It's the
* current format supported my MS.
*
* Types internal stream
* ---------------------
* Types (from the Type internal file) have existed in three flavors
* (note that those flavors came as historical evolution, but there
* isn't a one to one link between types evolution and PDB formats'
* evolutions:
* - the first flavor (suffixed by V1 in this file), where the types
* and subtypes are 16 bit entities; and where strings are in Pascal
* format (first char is their length and are not 0 terminated)
* - the second flavor (suffixed by V2) differs from first flavor with
* types and subtypes as 32 bit entities. This forced some
* reordering of fields in some types
* - the third flavor (suffixed by V3) differs from second flavor with
* strings stored as C strings (ie are 0 terminated, instead of
* length prefixed)
* The different flavors can coexist in the same file (is this really
* true ??)
*
* For the evolution of types, the need of the second flavor was the
* number of types to be defined (limited to 0xFFFF, including the C
* basic types); the need of the third flavor is the increase of
* symbol size (to be greater than 256), which was likely needed for
* complex C++ types (nested + templates).
*
* It's somehow difficult to represent the layout of those types on
* disk because:
* - some integral values are stored as numeric leaf, which size is
* variable depending on its value
*
* Symbols internal stream
* -----------------------
* Here also we find three flavors (that we've suffixed with _V1, _V2
* and _V3) even if their evolution is closer to the evolution of
* types, they are not completely linked together.
*/
#include "pshpack1.h"
/* ======================================== *
* Type information
* ======================================== */
struct p_string
{
unsigned char namelen;
char name[1];
};
union codeview_type
{
struct
{
unsigned short int len;
short int id;
} generic;
struct
{
unsigned short int len;
short int id;
short int attribute;
short int type;
} modifier_v1;
struct
{
unsigned short int len;
short int id;
int type;
short int attribute;
} modifier_v2;
struct
{
unsigned short int len;
short int id;
short int attribute;
short int datatype;
} pointer_v1;
struct
{
unsigned short int len;
short int id;
unsigned int datatype;
unsigned int attribute;
} pointer_v2;
struct
{
unsigned short int len;
short int id;
short int elemtype;
short int idxtype;
unsigned short int arrlen; /* numeric leaf */
#if 0
#endif
} array_v1;
struct
{
unsigned short int len;
short int id;
unsigned int elemtype;
unsigned int idxtype;
unsigned short int arrlen; /* numeric leaf */
#if 0
#endif
} array_v2;
struct
{
unsigned short int len;
short int id;
unsigned int elemtype;
unsigned int idxtype;
unsigned short int arrlen; /* numeric leaf */
#if 0
char name[1];
#endif
} array_v3;
struct
{
unsigned short int len;
short int id;
short int n_element;
short int fieldlist;
short int property;
short int derived;
short int vshape;
unsigned short int structlen; /* numeric leaf */
#if 0
#endif
} struct_v1;
struct
{
unsigned short int len;
short int id;
short int n_element;
short int property;
unsigned int fieldlist;
unsigned int derived;
unsigned int vshape;
unsigned short int structlen; /* numeric leaf */
#if 0
#endif
} struct_v2;
struct
{
unsigned short int len;
short int id;
short int n_element;
short int property;
unsigned int fieldlist;
unsigned int derived;
unsigned int vshape;
unsigned short int structlen; /* numeric leaf */
#if 0
char name[1];
#endif
} struct_v3;
struct
{
unsigned short int len;
short int id;
short int count;
short int fieldlist;
short int property;
unsigned short int un_len; /* numeric leaf */
#if 0
#endif
} union_v1;
struct
{
unsigned short int len;
short int id;
short int count;
short int property;
unsigned int fieldlist;
unsigned short int un_len; /* numeric leaf */
#if 0
#endif
} union_v2;
struct
{
unsigned short int len;
short int id;
short int count;
short int property;
unsigned int fieldlist;
unsigned short int un_len; /* numeric leaf */
#if 0
char name[1];
#endif
} union_v3;
struct
{
unsigned short int len;
short int id;
short int count;
short int type;
short int fieldlist;
short int property;
struct
{
unsigned short int len;
short int id;
short int count;
short int property;
unsigned int type;
unsigned int fieldlist;
struct
{
unsigned short int len;
short int id;
short int count;
short int property;
unsigned int type;
unsigned int fieldlist;
char name[1];
struct
{
unsigned short int len;
short int id;
unsigned short int rvtype;
unsigned char call;
unsigned char reserved;
unsigned short int params;
unsigned short int arglist;
} procedure_v1;
struct
{
unsigned short int len;
short int id;
unsigned int rvtype;
unsigned char call;
unsigned char reserved;
unsigned short int params;
unsigned int arglist;
} procedure_v2;
struct
{
unsigned short int len;
short int id;
unsigned short int rvtype;
unsigned short int class_type;
unsigned short int this_type;
unsigned char call;
unsigned char reserved;
unsigned short int params;
unsigned short int arglist;
unsigned int this_adjust;
} mfunction_v1;
struct
{
unsigned short int len;
short int id;
unsigned int rvtype;
unsigned int class_type;
unsigned this_type;
unsigned char call;
unsigned char reserved;
unsigned short params;
unsigned int arglist;
unsigned int this_adjust;
} mfunction_v2;
};
union codeview_reftype
{
struct
{
unsigned short int len;
short int id;
} generic;
struct
{
unsigned short int len;
short int id;
unsigned char list[1];
} fieldlist;
struct
{
unsigned short int len;
short int id;
unsigned char nbits;
unsigned char bitoff;
unsigned short type;
} bitfield_v1;
struct
{
unsigned short int len;
short int id;
unsigned int type;
unsigned char nbits;
unsigned char bitoff;
} bitfield_v2;
struct
{
unsigned short int len;
short int id;
unsigned short num;
unsigned short args[1];
} arglist_v1;
struct
{
unsigned short int len;
short int id;
unsigned num;
unsigned args[1];
} arglist_v2;
struct
{
unsigned short int len;
short int id;
unsigned short num;
unsigned short drvdcls[1];
} derived_v1;
struct
{
unsigned short int len;
short int id;
unsigned num;
unsigned drvdcls[1];
} derived_v2;
};
union codeview_fieldtype
{
struct
{
short int id;
} generic;
struct
{
short int id;
short int type;
short int attribute;
unsigned short int offset; /* numeric leaf */
} bclass_v1;
struct
{
short int id;
short int attribute;
unsigned int type;
unsigned short int offset; /* numeric leaf */
} bclass_v2;
struct
{
short int id;
short int btype;
short int vbtype;
short int attribute;
unsigned short int vbpoff; /* numeric leaf */
#if 0
unsigned short int vboff; /* numeric leaf */
#endif
} vbclass_v1;
struct
{
short int id;
short int attribute;
unsigned int btype;
unsigned int vbtype;
unsigned short int vbpoff; /* numeric leaf */
#if 0
unsigned short int vboff; /* numeric leaf */
#endif
} vbclass_v2;
struct
{
short int id;
short int attribute;
unsigned short int value; /* numeric leaf */
#if 0
#endif
} enumerate_v1;
struct
{
short int id;
short int attribute;
unsigned short int value; /* numeric leaf */
#if 0
char name[1];
#endif
} enumerate_v3;
struct
{
short int id;
short int type;
} friendfcn_v1;
struct
{
short int id;
short int _pad0;
unsigned int type;
} friendfcn_v2;
struct
{
short int id;
short int type;
short int attribute;
unsigned short int offset; /* numeric leaf */
#if 0
#endif
} member_v1;
struct
{
short int id;
short int attribute;
unsigned int type;
unsigned short int offset; /* numeric leaf */
#if 0
#endif
} member_v2;
struct
{
short int id;
short int attribute;
unsigned int type;
unsigned short int offset; /* numeric leaf */
#if 0
unsigned char name[1];
#endif
}
struct
{
short int id;
short int type;
short int attribute;
} stmember_v1;
struct
{
short int id;
short int attribute;
unsigned int type;
} stmember_v2;
struct
{
short int id;
short int attribute;
unsigned int type;
char name[1];
} stmember_v3;
struct
{
short int id;
short int count;
short int mlist;
} method_v1;
struct
{
short int id;
short int count;
unsigned int mlist;
} method_v2;
struct
{
short int id;
short int count;
unsigned int mlist;
char name[1];
} method_v3;
struct
{
short int id;
short int type;
} nesttype_v1;
struct
{
short int id;
short int _pad0;
unsigned int type;
} nesttype_v2;
struct
{
short int id;
short int _pad0;
unsigned int type;
char name[1];
} nesttype_v3;
struct
{
short int id;
short int type;
} vfunctab_v1;
struct
{
short int id;
short int _pad0;
unsigned int type;
} vfunctab_v2;
struct
{
short int id;
short int type;
} friendcls_v1;
struct
{
short int id;
short int _pad0;
unsigned int type;
} friendcls_v2;
struct
{
short int id;
short int attribute;
short int type;
} onemethod_v1;
struct
{
short int id;
short int attribute;
unsigned int type;
} onemethod_v2;
struct
{
short int id;
short int attribute;
unsigned int type;
char name[1];
} onemethod_v3;
struct
{
short int id;
short int attribute;
short int type;
unsigned int vtab_offset;
struct
{
short int id;
short int attribute;
unsigned int type;
unsigned int vtab_offset;
struct
{
short int id;
short int attribute;
unsigned int type;
unsigned int vtab_offset;
char name[1];
struct
{
short int id;
short int type;
unsigned int offset;
} vfuncoff_v1;
struct
{
short int id;
short int _pad0;
unsigned int type;
unsigned int offset;
} vfuncoff_v2;
struct
{
short int id;
short int attribute;
short int type;
struct
{
short int id;
short int attribute;
unsigned int type;
struct
{
short int id;
short int attribute;
unsigned int type;
};
/*
* This covers the basic datatypes that VC++ seems to be using these days.
* 32 bit mode only. There are additional numbers for the pointers in 16
* bit mode. There are many other types listed in the documents, but these
* are apparently not used by the compiler, or represent pointer types
* that are not used.
*
* Official MS documentation says that type (< 0x4000, so 12 bits) is made of:
* +----------+------+------+----------+------+
* | 11 | 10-8 | 7-4 | 3 | 2-0 |
* +----------+------+------+----------+------+
* | reserved | mode | type | reserved | size |
* +----------+------+------+----------+------+
* In recent PDB files, type 8 exists, and is seen as an HRESULT... So we've
* added this basic type... as if bit 3 had been integrated into the size field
*/
/* the type number of a built-in type is a 16-bit value specified in the following format:
bit # | 11 | 10-8 | 7-4 | 3 | 2-0 |
field | reserved | mode | type | reserved | size |
where
<type> is one of the following types:
0x00 Special
0x01 Signed integral value
0x02 Unsigned integral value
0x03 Boolean
0x04 Real
0x05 Complex
0x06 Special2
0x07 Real int value
0x08 Reserved
0x09 Reserved
0x0a Reserved
0x0b Reserved
0x0c Reserved
0x0d Reserved
0x0e Reserved
0x0f Reserved for debugger expression evaluator
<size> is an enumerated value for each of the types.
Type = special
0x00 No type
0x01 Absolute symbol
0x02 Segment
0x03 Void
0x04 Basic 8-byte currency value
0x05 Near Basic string
0x06 Far Basic string
0x07 Untranslated type from previous Microsoft symbol formats
0x00 1 byte
0x01 2 byte
0x02 4 byte
0x03 8 byte
0x04 Reserved
0x05 Reserved
0x06 Reserved
0x07 Reserved
Type = real and complex
0x00 32 bit
0x01 64 bit
0x02 80 bit
0x03 128 bit
0x04 48 bit
0x05 Reserved
0x06 Reserved
0x07 Reserved
Type = special2
0x00 Bit
0x01 Pascal CHAR
Type = Real int
0x00 Char
0x01 Wide character
0x02 2-byte signed integer
0x03 2-byte unsigned integer
0x04 4-byte signed integer
0x05 4-byte unsigned integer
0x06 8-byte signed integer
0x07 8-byte unsigned integer
<mode> is the pointer mode:
0x00 Direct; not a pointer
0x01 Near pointer
0x02 Far pointer
0x03 Huge pointer
0x04 32-bit near pointer
0x05 32-bit far pointer
0x06 64-bit near pointer
0x07 Reserved
*/
/* basic types */
/* near pointers to basic types */
/* far pointers to basic types */
/* huge pointers to basic types */
/* 32-bit near pointers to basic types */
/* 32-bit far pointers to basic types */
/* counts, bit masks, and shift values needed to access various parts of the built-in type numbers */
#define T_BASICTYPE_MASK 0x00ff /* mask of bits that can potentially identify a non-pointer basic type */
/* bit patterns for the <mode> portion of a built-in type number */
#define T_NEARPTR_BITS 0x0100
#define T_FARPTR_BITS 0x0200
#define T_HUGEPTR_BITS 0x0300
#define T_NEAR32PTR_BITS 0x0400
#define T_FAR32PTR_BITS 0x0500
#define T_NEAR64PTR_BITS 0x0600
#define LF_MODIFIER_V1 0x0001
#define LF_POINTER_V1 0x0002
#define LF_ARRAY_V1 0x0003
#define LF_CLASS_V1 0x0004
#define LF_STRUCTURE_V1 0x0005
#define LF_UNION_V1 0x0006
#define LF_ENUM_V1 0x0007
#define LF_PROCEDURE_V1 0x0008
#define LF_MFUNCTION_V1 0x0009
#define LF_VTSHAPE_V1 0x000a
#define LF_COBOL0_V1 0x000b
#define LF_COBOL1_V1 0x000c
#define LF_BARRAY_V1 0x000d
#define LF_LABEL_V1 0x000e
#define LF_NULL_V1 0x000f
#define LF_NOTTRAN_V1 0x0010
#define LF_DIMARRAY_V1 0x0011
#define LF_VFTPATH_V1 0x0012
#define LF_PRECOMP_V1 0x0013
#define LF_ENDPRECOMP_V1 0x0014
#define LF_OEM_V1 0x0015
#define LF_TYPESERVER_V1 0x0016
#define LF_POINTER_V2 0x1002
#define LF_ARRAY_V2 0x1003
#define LF_CLASS_V2 0x1004
#define LF_STRUCTURE_V2 0x1005
#define LF_UNION_V2 0x1006
#define LF_ENUM_V2 0x1007
#define LF_PROCEDURE_V2 0x1008
#define LF_MFUNCTION_V2 0x1009
#define LF_COBOL0_V2 0x100a
#define LF_BARRAY_V2 0x100b
#define LF_DIMARRAY_V2 0x100c
#define LF_VFTPATH_V2 0x100d
#define LF_PRECOMP_V2 0x100e
#define LF_OEM_V2 0x100f
#define LF_SKIP_V1 0x0200
#define LF_ARGLIST_V1 0x0201
#define LF_DEFARG_V1 0x0202
#define LF_LIST_V1 0x0203
#define LF_FIELDLIST_V1 0x0204
#define LF_DERIVED_V1 0x0205
#define LF_BITFIELD_V1 0x0206
#define LF_METHODLIST_V1 0x0207
#define LF_DIMCONU_V1 0x0208
#define LF_DIMCONLU_V1 0x0209
#define LF_DIMVARU_V1 0x020a
#define LF_DIMVARLU_V1 0x020b
#define LF_REFSYM_V1 0x020c
#define LF_ARGLIST_V2 0x1201
#define LF_DEFARG_V2 0x1202
#define LF_FIELDLIST_V2 0x1203
#define LF_DERIVED_V2 0x1204
#define LF_BITFIELD_V2 0x1205
#define LF_METHODLIST_V2 0x1206
#define LF_DIMCONU_V2 0x1207
#define LF_DIMCONLU_V2 0x1208
#define LF_DIMVARU_V2 0x1209
#define LF_DIMVARLU_V2 0x120a
/* Field lists */
#define LF_BCLASS_V1 0x0400
#define LF_VBCLASS_V1 0x0401
#define LF_IVBCLASS_V1 0x0402
#define LF_ENUMERATE_V1 0x0403
#define LF_FRIENDFCN_V1 0x0404
#define LF_INDEX_V1 0x0405
#define LF_MEMBER_V1 0x0406
#define LF_STMEMBER_V1 0x0407
#define LF_METHOD_V1 0x0408
#define LF_NESTTYPE_V1 0x0409
#define LF_VFUNCTAB_V1 0x040a
#define LF_FRIENDCLS_V1 0x040b
#define LF_ONEMETHOD_V1 0x040c
#define LF_VFUNCOFF_V1 0x040d
#define LF_NESTTYPEEX_V1 0x040e
#define LF_MEMBERMODIFY_V1 0x040f
#define LF_VBCLASS_V2 0x1401
#define LF_IVBCLASS_V2 0x1402
#define LF_FRIENDFCN_V2 0x1403
#define LF_INDEX_V2 0x1404
#define LF_MEMBER_V2 0x1405
#define LF_STMEMBER_V2 0x1406
#define LF_METHOD_V2 0x1407
#define LF_NESTTYPE_V2 0x1408
#define LF_VFUNCTAB_V2 0x1409
#define LF_FRIENDCLS_V2 0x140a
#define LF_ONEMETHOD_V2 0x140b
#define LF_VFUNCOFF_V2 0x140c
#define LF_NESTTYPEEX_V2 0x140d
#define LF_ENUMERATE_V3 0x1502
#define LF_ARRAY_V3 0x1503
#define LF_CLASS_V3 0x1504
#define LF_STRUCTURE_V3 0x1505
#define LF_UNION_V3 0x1506
#define LF_ENUM_V3 0x1507
#define LF_MEMBER_V3 0x150d
#define LF_STMEMBER_V3 0x150e
#define LF_METHOD_V3 0x150f
#define LF_NESTTYPE_V3 0x1510
#define LF_ONEMETHOD_V3 0x1511
#define LF_CHAR 0x8000
#define LF_SHORT 0x8001
#define LF_USHORT 0x8002
#define LF_LONG 0x8003
#define LF_ULONG 0x8004
#define LF_REAL32 0x8005
#define LF_REAL64 0x8006
#define LF_REAL80 0x8007
#define LF_REAL128 0x8008
#define LF_QUADWORD 0x8009
#define LF_UQUADWORD 0x800a
#define LF_REAL48 0x800b
#define LF_COMPLEX32 0x800c
#define LF_COMPLEX64 0x800d
#define LF_COMPLEX80 0x800e
#define LF_COMPLEX128 0x800f
#define LF_VARSTRING 0x8010
/* ======================================== *
* Symbol information
* ======================================== */
union codeview_symbol
{
struct
{
short int len;
short int id;
} generic;
struct
{
short int len;
short int id;
unsigned int offset;
unsigned short segment;
unsigned short symtype;
} data_v1;
struct
{
short int len;
short int id;
unsigned int symtype;
unsigned int offset;
unsigned short segment;
} data_v2;
struct
{
short int len;
short int id;
unsigned int symtype;
unsigned int offset;
unsigned short segment;
char name[1];
} data_v3;
struct
{
short int len;
short int id;
unsigned int pparent;
unsigned int pend;
unsigned int next;
unsigned int offset;
unsigned short segment;
unsigned short thunk_len;
unsigned char thtype;
} thunk_v1;
struct
{
short int len;
short int id;
unsigned int pparent;
unsigned int pend;
unsigned int next;
unsigned int offset;
unsigned short segment;
unsigned short thunk_len;
unsigned char thtype;
char name[1];
} thunk_v3;
struct
{
short int len;
short int id;
unsigned int pparent;
unsigned int pend;
unsigned int next;
unsigned int proc_len;
unsigned int debug_start;
unsigned int debug_end;
unsigned int offset;
unsigned short segment;
unsigned short proctype;
unsigned char flags;
} proc_v1;
struct
{
short int len;
short int id;
unsigned int pparent;
unsigned int pend;
unsigned int next;
unsigned int proc_len;
unsigned int debug_start;
unsigned int debug_end;
unsigned int proctype;
unsigned int offset;
unsigned short segment;
unsigned char flags;
} proc_v2;
struct
{
short int len;
short int id;
unsigned int pparent;
unsigned int pend;
unsigned int next;
unsigned int proc_len;
unsigned int debug_start;
unsigned int debug_end;
unsigned int proctype;
unsigned int offset;
unsigned short segment;
unsigned char flags;
char name[1];
} proc_v3;
struct
{
short int len;
short int id;
unsigned int symtype;
unsigned int offset;
unsigned short segment;
} public_v2;
struct
{
short int len;
short int id;
unsigned int symtype;
unsigned int offset;
unsigned short segment;
char name[1];
} public_v3;
struct
{
short int len; /* Total length of this entry */
short int id; /* Always S_BPREL_V1 */
unsigned int offset; /* Stack offset relative to BP */
unsigned short symtype;
} stack_v1;
struct
{
short int len; /* Total length of this entry */
short int id; /* Always S_BPREL_V2 */
unsigned int offset; /* Stack offset relative to EBP */
unsigned int symtype;
} stack_v2;
struct
{
short int len; /* Total length of this entry */
short int id; /* Always S_BPREL_V3 */
int offset; /* Stack offset relative to BP */
unsigned int symtype;
char name[1];
} stack_v3;
struct
{
short int len; /* Total length of this entry */
short int id; /* Always S_BPREL_V3 */
int offset; /* Stack offset relative to BP */
unsigned int symtype;
unsigned short unknown;
char name[1];
struct
{
short int len; /* Total length of this entry */
short int id; /* Always S_REGISTER */
unsigned short type;
unsigned short reg;
/* don't handle register tracking */
} register_v1;
struct
{
short int len; /* Total length of this entry */
short int id; /* Always S_REGISTER_V2 */
unsigned int type; /* check whether type & reg are correct */
unsigned short reg;
/* don't handle register tracking */
} register_v2;
struct
{
short int len; /* Total length of this entry */
short int id; /* Always S_REGISTER_V3 */
unsigned int type; /* check whether type & reg are correct */
unsigned short reg;
char name[1];
/* don't handle register tracking */
} register_v3;
struct
{
short int len;
short int id;
unsigned int parent;
unsigned int end;
unsigned int length;
unsigned int offset;
unsigned short segment;
} block_v1;
struct
{
short int len;
short int id;
unsigned int parent;
unsigned int end;
unsigned int length;
unsigned int offset;
unsigned short segment;
char name[1];
} block_v3;
struct
{
short int len;
short int id;
unsigned int offset;
unsigned short segment;
unsigned char flags;
} label_v1;
struct
{
short int len;
short int id;
unsigned int offset;
unsigned short segment;
unsigned char flags;
char name[1];
} label_v3;
struct
{
short int len;
short int id;
unsigned short type;
unsigned short cvalue; /* numeric leaf */
#if 0
#endif
} constant_v1;
struct
{
short int len;
short int id;
unsigned type;
unsigned short cvalue; /* numeric leaf */
#if 0
#endif
} constant_v2;
struct
{
short int len;
short int id;
unsigned type;
unsigned short cvalue;
#if 0
char name[1];
#endif
} constant_v3;
struct
{
short int len;
short int id;
unsigned short type;
} udt_v1;
struct
{
short int len;
short int id;
unsigned type;
} udt_v2;
struct
{
short int len;
short int id;
unsigned int type;
char name[1];
} udt_v3;
struct
{
short int len;
short int id;
char signature[4];
} objname_v1;
struct
{
short int len;
short int id;
unsigned int unknown;
} compiland_v1;
struct
{
short int len;
short int id;
unsigned unknown1[4];
unsigned short unknown2;
} compiland_v2;
struct
{
short int len;
short int id;
unsigned int unknown;
char name[1];
} compiland_v3;
struct
{
short int len;
short int id;
unsigned int offset;
unsigned short segment;
} ssearch_v1;
struct
{
short int len;
short int id;
unsigned int offset;
unsigned int unknown;
struct
{
short int len;
short int id;
unsigned int unknown1; /* maybe size (of what ?) */
unsigned int unknown2;
unsigned int unknown3;
unsigned int unknown4; /* maybe size (of what ?) */
unsigned int unknown5; /* maybe address <offset and segment> (of what ?) */
unsigned short unknown6;
unsigned short flags;
unsigned int unknown7;
} func_info_v2;
};
#define S_COMPILAND_V1 0x0001
#define S_REGISTER_V1 0x0002
#define S_CONSTANT_V1 0x0003
#define S_UDT_V1 0x0004
#define S_SSEARCH_V1 0x0005
#define S_END_V1 0x0006
#define S_SKIP_V1 0x0007
#define S_CVRESERVE_V1 0x0008
#define S_OBJNAME_V1 0x0009
#define S_ENDARG_V1 0x000a
#define S_COBOLUDT_V1 0x000b
#define S_MANYREG_V1 0x000c
#define S_RETURN_V1 0x000d
#define S_ENTRYTHIS_V1 0x000e
#define S_BPREL_V1 0x0200
#define S_LDATA_V1 0x0201
#define S_GDATA_V1 0x0202
#define S_PUB_V1 0x0203
#define S_LPROC_V1 0x0204
#define S_GPROC_V1 0x0205
#define S_THUNK_V1 0x0206
#define S_BLOCK_V1 0x0207
#define S_WITH_V1 0x0208
#define S_LABEL_V1 0x0209
#define S_CEXMODEL_V1 0x020a
#define S_VFTPATH_V1 0x020b
#define S_REGREL_V1 0x020c
#define S_LTHREAD_V1 0x020d
#define S_GTHREAD_V1 0x020e
#define S_PROCREF_V1 0x0400
#define S_DATAREF_V1 0x0401
#define S_ALIGN_V1 0x0402
#define S_LPROCREF_V1 0x0403
#define S_CONSTANT_V2 0x1002
#define S_UDT_V2 0x1003
#define S_COBOLUDT_V2 0x1004
#define S_MANYREG_V2 0x1005
#define S_BPREL_V2 0x1006
#define S_LDATA_V2 0x1007
#define S_GDATA_V2 0x1008
#define S_PUB_V2 0x1009
#define S_LPROC_V2 0x100a
#define S_GPROC_V2 0x100b
#define S_VFTTABLE_V2 0x100c
#define S_REGREL_V2 0x100d
#define S_LTHREAD_V2 0x100e
#define S_GTHREAD_V2 0x100f
#define S_FUNCINFO_V2 0x1012
#define S_COMPILAND_V2 0x1013
#define S_COMPILAND_V3 0x1101
#define S_THUNK_V3 0x1102
#define S_BLOCK_V3 0x1103
#define S_LABEL_V3 0x1105
#define S_REGISTER_V3 0x1106
#define S_CONSTANT_V3 0x1107
#define S_UDT_V3 0x1108
#define S_BPREL_V3 0x110B
#define S_LDATA_V3 0x110C
#define S_GDATA_V3 0x110D
#define S_PUB_V3 0x110E
#define S_LPROC_V3 0x110F
#define S_GPROC_V3 0x1110
#define S_PUB_FUNC2_V3 0x1127
#define S_SECTINFO_V3 0x1136
#define S_SUBSECTINFO_V3 0x1137
#define S_ENTRYPOINT_V3 0x1138
#define S_SECUCOOKIE_V3 0x113A
#define S_MSTOOLINFO_V3 0x113C
#define S_MSTOOLENV_V3 0x113D
/* ======================================== *
* Line number information
* ======================================== */
struct codeview_linetab_block
{
unsigned short seg;
unsigned short num_lines;
/* unsigned short linenos[]; */
};
struct startend
{
unsigned int start;
unsigned int end;
};
/* there's a new line tab structure from MS Studio 2005 and after
* it's made of:
* DWORD 000000f4
* DWORD lineblk_offset (counting bytes after this field)
* an array of codeview_linetab2_file structures
* an array (starting at <lineblk_offset>) of codeview_linetab2_block structures
*/
struct codeview_linetab2_file
{
};
struct codeview_linetab2_block
{
struct {
} l[1]; /* actually array of <nlines> */
};
/* ======================================== *
* PDB file information
* ======================================== */
struct PDB_FILE
{
};
struct PDB_JG_HEADER
{
CHAR ident[40];
};
struct PDB_DS_HEADER
{
char signature[32];
};
struct PDB_JG_TOC
{
};
struct PDB_DS_TOC
{
};
struct PDB_JG_ROOT
{
};
struct PDB_DS_ROOT
{
};
typedef struct _PDB_TYPES_OLD
{
typedef struct _PDB_TYPES
{
} PDB_TYPES, *PPDB_TYPES;
typedef struct _PDB_SYMBOL_RANGE
{
typedef struct _PDB_SYMBOL_RANGE_EX
{
typedef struct _PDB_SYMBOL_FILE
{
typedef struct _PDB_SYMBOL_FILE_EX
{
typedef struct _PDB_SYMBOL_SOURCE
{
typedef struct _PDB_SYMBOL_IMPORT
{
typedef struct _PDB_SYMBOLS_OLD
{
typedef struct _PDB_SYMBOLS
{
} PDB_SYMBOLS, *PPDB_SYMBOLS;
#include "poppack.h"
/* ----------------------------------------------
* Information used for parsing
* ---------------------------------------------- */
typedef struct
{
} OMAP_DATA;
struct msc_debug_info
{
int nsect;
const IMAGE_SECTION_HEADER* sectp;
int nomap;
};
/* coff.c */
/* ===================================================
* The old CodeView stuff (for NB09 and NB11)
* =================================================== */
#define sstModule 0x120
#define sstTypes 0x121
#define sstPublic 0x122
#define sstPublicSym 0x123
#define sstSymbols 0x124
#define sstAlignSym 0x125
#define sstSrcLnSeg 0x126
#define sstSrcModule 0x127
#define sstLibraries 0x128
#define sstGlobalSym 0x129
#define sstGlobalPub 0x12a
#define sstGlobalTypes 0x12b
#define sstMPC 0x12c
#define sstSegMap 0x12d
#define sstSegName 0x12e
#define sstPreComp 0x12f
#define sstFileIndex 0x133
#define sstStaticSym 0x134
/* overall structure information */
typedef struct OMFSignature
{
char Signature[4];
long filepos;
} OMFSignature;
typedef struct OMFSignatureRSDS
{
char Signature[4];
typedef struct _CODEVIEW_PDB_DATA
{
char Signature[4];
long filepos;
typedef struct OMFDirHeader
{
} OMFDirHeader;
typedef struct OMFDirEntry
{
} OMFDirEntry;
/* sstModule subsection */
typedef struct OMFSegDesc
{
} OMFSegDesc;
typedef struct OMFModule
{
char Style[2];
/*
OMFSegDesc SegInfo[cSeg];
p_string Name;
*/
} OMFModule;
typedef struct OMFGlobalTypes
{
/*
DWORD offset[cTypes];
types_record[];
*/
/* sstGlobalPub section */
/* Header for symbol table */
typedef struct OMFSymHash
{
unsigned short symhash;
unsigned short addrhash;
unsigned long cbSymbol;
unsigned long cbHSym;
unsigned long cbHAddr;
} OMFSymHash;
/* sstSegMap section */
typedef struct OMFSegMapDesc
{
unsigned short flags;
unsigned short ovl;
unsigned short group;
unsigned short frame;
unsigned short iSegName;
unsigned short iClassName;
unsigned long offset;
unsigned long cbSeg;
typedef struct OMFSegMap
{
unsigned short cSeg;
unsigned short cSegLog;
/* OMFSegMapDesc rgDesc[0];*/
} OMFSegMap;
/* sstSrcModule section */
typedef struct OMFSourceLine
{
unsigned short Seg;
unsigned short cLnOff;
unsigned long offset[1];
unsigned short lineNbr[1];
typedef struct OMFSourceFile
{
unsigned short cSeg;
unsigned short reserved;
unsigned long baseSrcLn[1];
unsigned short cFName;
char Name;
typedef struct OMFSourceModule
{
unsigned short cFile;
unsigned short cSeg;
unsigned long baseSrcFile[1];