VirtualBox

Changeset 58662 in vbox for trunk/include/iprt/formats


Ignore:
Timestamp:
Nov 11, 2015 2:58:00 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104079
Message:

rtdbg: Moved the codeview structures into iprt/formats/codeview.h and added some new CV8(?) bits. Made the codeview reader able to handle bs3kit symbol files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/formats/codeview.h

    r56291 r58662  
    3535 * @{
    3636 */
     37
     38
     39/**
     40 * CodeView Header.  There are two of this, base header at the start of the debug
     41 * information and a trailing header at the end.
     42 */
     43typedef struct RTCVHDR
     44{
     45    /** The magic ('NBxx'), see RTCVHDR_MAGIC_XXX. */
     46    uint32_t    u32Magic;
     47    /**
     48     * Base header: Subsection directory offset relative to this header (start).
     49     * Trailing header: Offset of the base header relative to the end of the file.
     50     *
     51     * Called lfoBase, lfaBase, lfoDirectory, lfoDir and probably other things in
     52     * the various specs/docs available. */
     53    uint32_t    off;
     54} RTCVHDR;
     55/** Pointer to a CodeView header. */
     56typedef RTCVHDR *PRTCVHDR;
     57
     58/** @name CodeView magic values (RTCVHDR::u32Magic).
     59 * @{  */
     60/** CodeView from Visual C++ 5.0.  Specified in the 2001 MSDN specs.chm file. */
     61#define RTCVHDR_MAGIC_NB11  RT_MAKE_U32_FROM_U8('N', 'B', '1', '1')
     62/** External PDB reference (often referred to as PDB 2.0). */
     63#define RTCVHDR_MAGIC_NB10  RT_MAKE_U32_FROM_U8('N', 'B', '1', '0')
     64/** CodeView v4.10, packed. Specified in the TIS document. */
     65#define RTCVHDR_MAGIC_NB09  RT_MAKE_U32_FROM_U8('N', 'B', '0', '9')
     66/** CodeView v4.00 thru v4.05.  Specified in the TIS document?  */
     67#define RTCVHDR_MAGIC_NB08  RT_MAKE_U32_FROM_U8('N', 'B', '0', '8')
     68/** Quick C for Windows 1.0 debug info. */
     69#define RTCVHDR_MAGIC_NB07  RT_MAKE_U32_FROM_U8('N', 'B', '0', '7')
     70/** Emitted by ILINK indicating incremental link. Comparable to NB05?  */
     71#define RTCVHDR_MAGIC_NB06  RT_MAKE_U32_FROM_U8('N', 'B', '0', '6')
     72/** Emitted by LINK version 5.20 and later before packing. */
     73#define RTCVHDR_MAGIC_NB05  RT_MAKE_U32_FROM_U8('N', 'B', '0', '5')
     74/** Emitted by IBM ILINK for HLL (similar to NB02 in many ways). */
     75#define RTCVHDR_MAGIC_NB04  RT_MAKE_U32_FROM_U8('N', 'B', '0', '4')
     76/** Emitted by LINK version 5.10 (or similar OMF linkers), as shipped with
     77 * Microsoft C v6.0 for example.  More or less entirely 16-bit. */
     78#define RTCVHDR_MAGIC_NB02  RT_MAKE_U32_FROM_U8('N', 'B', '0', '2')
     79/* No idea what NB03 might have been. */
     80/** AIX debugger format according to "IBM OS/2 16/32-bit Object Module Format
     81 *  (OMF) and Linear eXecutable Module Format (LX)" revision 10 (LXOMF.PDF). */
     82#define RTCVHDR_MAGIC_NB01  RT_MAKE_U32_FROM_U8('N', 'B', '0', '1')
     83/** Ancient CodeView format according to LXOMF.PDF. */
     84#define RTCVHDR_MAGIC_NB00  RT_MAKE_U32_FROM_U8('N', 'B', '0', '0')
     85/** @} */
     86
     87
     88/** @name CV directory headers.
     89 * @{ */
     90
     91/**
     92 * Really old CV directory header used with NB00 and NB02.
     93 *
     94 * Uses 16-bit directory entires (RTCVDIRENT16).
     95 */
     96typedef struct RTCVDIRHDR16
     97{
     98    /** The number of directory entries. */
     99    uint16_t        cEntries;
     100} RTCVDIRHDR16;
     101/** Pointer to a old CV directory header. */
     102typedef RTCVDIRHDR16 *PRTCVDIRHDR16;
     103
     104/**
     105 * Simple 32-bit CV directory base header, used by NB04 (aka IBM HLL).
     106 */
     107typedef struct RTCVDIRHDR32
     108{
     109    /** The number of bytes of this header structure. */
     110    uint16_t        cbHdr;
     111    /** The number of bytes per entry. */
     112    uint16_t        cbEntry;
     113    /** The number of directory entries. */
     114    uint32_t        cEntries;
     115} RTCVDIRHDR32;
     116/** Pointer to a 32-bit CV directory header. */
     117typedef RTCVDIRHDR32 *PRTCVDIRHDR32;
     118
     119/**
     120 * Extended 32-bit CV directory header as specified in the TIS doc.
     121 * The two extra fields seems to never have been assigned any official purpose.
     122 */
     123typedef struct RTCVDIRHDR32EX
     124{
     125    /** This starts the same way as the NB04 header. */
     126    RTCVDIRHDR32    Core;
     127    /** Tentatively decleared as the offset to the next directory generated by
     128     * the incremental linker.  Haven't seen this used yet. */
     129    uint32_t        offNextDir;
     130    /** Flags, non defined apparently, so MBZ. */
     131    uint32_t        fFlags;
     132} RTCVDIRHDR32EX;
     133/** Pointer to an extended 32-bit CV directory header. */
     134typedef RTCVDIRHDR32EX *PRTCVDIRHDR32EX;
     135
     136/** @} */
     137
     138
     139/**
     140 * 16-bit CV directory entry used with NB00 and NB02.
     141 */
     142typedef struct RTCVDIRENT16
     143{
     144    /** Subsection type (RTCVSST). */
     145    uint16_t        uSubSectType;
     146    /** Which module (1-based, 0xffff is special). */
     147    uint16_t        iMod;
     148    /** The lowe offset of this subsection relative to the base CV header. */
     149    uint16_t        offLow;
     150    /** The high part of the subsection offset. */
     151    uint16_t        offHigh;
     152    /** The size of the subsection. */
     153    uint16_t        cb;
     154} RTCVDIRENT16;
     155AssertCompileSize(RTCVDIRENT16, 10);
     156/** Pointer to a 16-bit CV directory entry. */
     157typedef RTCVDIRENT16 *PRTCVDIRENT16;
     158
     159
     160/**
     161 * 32-bit CV directory entry used starting with NB04.
     162 */
     163typedef struct RTCVDIRENT32
     164{
     165    /** Subsection type (RTCVSST). */
     166    uint16_t        uSubSectType;
     167    /** Which module (1-based, 0xffff is special). */
     168    uint16_t        iMod;
     169    /** The offset of this subsection relative to the base CV header. */
     170    uint32_t        off;
     171    /** The size of the subsection. */
     172    uint32_t        cb;
     173} RTCVDIRENT32;
     174AssertCompileSize(RTCVDIRENT32, 12);
     175/** Pointer to a 32-bit CV directory entry. */
     176typedef RTCVDIRENT32 *PRTCVDIRENT32;
     177/** Pointer to a const 32-bit CV directory entry. */
     178typedef RTCVDIRENT32 const *PCRTCVDIRENT32;
     179
     180
     181/**
     182 * CodeView subsection types.
     183 */
     184typedef enum RTCVSST
     185{
     186    /** @name NB00, NB02 and NB04 subsection types.
     187     * The actual format of each subsection varies between NB04 and the others,
     188     * and it may further vary in NB04 depending on the module type.
     189     * @{ */
     190    kCvSst_OldModule    = 0x101,
     191    kCvSst_OldPublic,
     192    kCvSst_OldTypes,
     193    kCvSst_OldSymbols,
     194    kCvSst_OldSrcLines,
     195    kCvSst_OldLibraries,
     196    kCvSst_OldImports,
     197    kCvSst_OldCompacted,
     198    kCvSst_OldSrcLnSeg = 0x109,
     199    kCvSst_OldSrcLines3 = 0x10b,
     200    /** @} */
     201
     202    /** @name NB09, NB11 (and possibly NB05, NB06, NB07, and NB08) subsection types.
     203     * @{ */
     204    kCvSst_Module    = 0x120,
     205    kCvSst_Types,
     206    kCvSst_Public,
     207    kCvSst_PublicSym,
     208    kCvSst_Symbols,
     209    kCvSst_AlignSym,
     210    kCvSst_SrcLnSeg,
     211    kCvSst_SrcModule,
     212    kCvSst_Libraries,
     213    kCvSst_GlobalSym,
     214    kCvSst_GlobalPub,
     215    kCvSst_GlobalTypes,
     216    kCvSst_MPC,
     217    kCvSst_SegMap,
     218    kCvSst_SegName,
     219    kCvSst_PreComp,
     220    kCvSst_PreCompMap,
     221    kCvSst_OffsetMap16,
     222    kCvSst_OffsetMap32,
     223    kCvSst_FileIndex = 0x133,
     224    kCvSst_StaticSym
     225    /** @} */
     226} RTCVSST;
     227/** Pointer to a CV subsection type value.  */
     228typedef RTCVSST *PRTCVSST;
     229/** Pointer to a const CV subsection type value.  */
     230typedef RTCVSST const *PCRTCVSST;
     231
     232
     233/**
     234 * CV4 module segment info.
     235 */
     236typedef struct RTCVMODSEGINFO32
     237{
     238    /** The segment number. */
     239    uint16_t        iSeg;
     240    /** Explicit padding. */
     241    uint16_t        u16Padding;
     242    /** Offset into the segment. */
     243    uint32_t        off;
     244    /** The size of the contribution. */
     245    uint32_t        cb;
     246} RTCVMODSEGINFO32;
     247typedef RTCVMODSEGINFO32 *PRTCVMODSEGINFO32;
     248typedef RTCVMODSEGINFO32 const *PCRTCVMODSEGINFO32;
     249
     250
     251/**
     252 * CV4 segment map header.
     253 */
     254typedef struct RTCVSEGMAPHDR
     255{
     256    /** Number of segments descriptors in the table. */
     257    uint16_t        cSegs;
     258    /** Number of logical segment descriptors. */
     259    uint16_t        cLogSegs;
     260} RTCVSEGMAPHDR;
     261/** Pointer to a CV4 segment map header. */
     262typedef RTCVSEGMAPHDR *PRTCVSEGMAPHDR;
     263/** Pointer to a const CV4 segment map header. */
     264typedef RTCVSEGMAPHDR const *PCRTCVSEGMAPHDR;
     265
     266/**
     267 * CV4 Segment map descriptor entry.
     268 */
     269typedef struct RTCVSEGMAPDESC
     270{
     271    /** Segment flags. */
     272    uint16_t        fFlags;
     273    /** The overlay number. */
     274    uint16_t        iOverlay;
     275    /** Group index into this segment descriptor array. 0 if not relevant.
     276     * The group descriptors are found in the second half of the table.  */
     277    uint16_t        iGroup;
     278    /** Complicated. */
     279    uint16_t        iFrame;
     280    /** Offset (byte) into the kCvSst_SegName table of the segment name, or
     281     * 0xffff. */
     282    uint16_t        offSegName;
     283    /** Offset (byte) into the kCvSst_SegName table of the class name, or 0xffff. */
     284    uint16_t        offClassName;
     285    /** Offset into the physical segment. */
     286    uint32_t        off;
     287    /** Size of segment. */
     288    uint32_t        cb;
     289} RTCVSEGMAPDESC;
     290/** Pointer to a segment map descriptor entry. */
     291typedef RTCVSEGMAPDESC *PRTCVSEGMAPDESC;
     292/** Pointer to a const segment map descriptor entry. */
     293typedef RTCVSEGMAPDESC const *PCRTCVSEGMAPDESC;
     294
     295/** @name RTCVSEGMAPDESC_F_XXX - RTCVSEGMAPDESC::fFlags values.
     296 * @{ */
     297#define RTCVSEGMAPDESC_F_READ       UINT16_C(0x0001)
     298#define RTCVSEGMAPDESC_F_WRITE      UINT16_C(0x0002)
     299#define RTCVSEGMAPDESC_F_EXECUTE    UINT16_C(0x0004)
     300#define RTCVSEGMAPDESC_F_32BIT      UINT16_C(0x0008)
     301#define RTCVSEGMAPDESC_F_SEL        UINT16_C(0x0100)
     302#define RTCVSEGMAPDESC_F_ABS        UINT16_C(0x0200)
     303#define RTCVSEGMAPDESC_F_GROUP      UINT16_C(0x1000)
     304#define RTCVSEGMAPDESC_F_RESERVED   UINT16_C(0xecf0)
     305/** @} */
     306
     307/**
     308 * CV4 segment map subsection.
     309 */
     310typedef struct RTCVSEGMAP
     311{
     312    /** The header. */
     313    RTCVSEGMAPHDR   Hdr;
     314    /** Descriptor array. */
     315    RTCVSEGMAPDESC  aDescs[1];
     316} RTCVSEGMAP;
     317/** Pointer to a segment map subsection. */
     318typedef RTCVSEGMAP *PRTCVSEGMAP;
     319/** Pointer to a const segment map subsection. */
     320typedef RTCVSEGMAP const *PCRTCVSEGMAP;
     321
     322
     323/**
     324 * Global symbol table header, used by kCvSst_GlobalSym and kCvSst_GlobalPub.
     325 */
     326typedef struct RTCVGLOBALSYMTABHDR
     327{
     328    /** The symbol hash function. */
     329    uint16_t        uSymHash;
     330    /** The address hash function. */
     331    uint16_t        uAddrHash;
     332    /** The amount of symbol information following immediately after the header. */
     333    uint32_t        cbSymbols;
     334    /** The amount of symbol hash tables following the symbols. */
     335    uint32_t        cbSymHash;
     336    /** The amount of address hash tables following the symbol hash tables. */
     337    uint32_t        cbAddrHash;
     338} RTCVGLOBALSYMTABHDR;
     339/** Pointer to a global symbol table header. */
     340typedef RTCVGLOBALSYMTABHDR *PRTCVGLOBALSYMTABHDR;
     341/** Pointer to a const global symbol table header. */
     342typedef RTCVGLOBALSYMTABHDR const *PCRTCVGLOBALSYMTABHDR;
     343
     344
     345typedef enum RTCVSYMTYPE
     346{
     347    /** @name Symbols that doesn't change with compilation model or target machine.
     348     * @{ */
     349    kCvSymType_Compile = 0x0001,
     350    kCvSymType_Register,
     351    kCvSymType_Constant,
     352    kCvSymType_UDT,
     353    kCvSymType_SSearch,
     354    kCvSymType_End,
     355    kCvSymType_Skip,
     356    kCvSymType_CVReserve,
     357    kCvSymType_ObjName,
     358    kCvSymType_EndArg,
     359    kCvSymType_CobolUDT,
     360    kCvSymType_ManyReg,
     361    kCvSymType_Return,
     362    kCvSymType_EntryThis,
     363    /** @}  */
     364
     365    /** @name Symbols with 16:16 addresses.
     366     * @{ */
     367    kCvSymType_BpRel16 = 0x0100,
     368    kCvSymType_LData16,
     369    kCvSymType_GData16,
     370    kCvSymType_Pub16,
     371    kCvSymType_LProc16,
     372    kCvSymType_GProc16,
     373    kCvSymType_Thunk16,
     374    kCvSymType_BLock16,
     375    kCvSymType_With16,
     376    kCvSymType_Label16,
     377    kCvSymType_CExModel16,
     378    kCvSymType_VftPath16,
     379    kCvSymType_RegRel16,
     380    /** @}  */
     381
     382    /** @name Symbols with 16:32 addresses.
     383     * @{ */
     384    kCvSymType_BpRel32 = 0x0200,
     385    kCvSymType_LData32,
     386    kCvSymType_GData32,
     387    kCvSymType_Pub32,
     388    kCvSymType_LProc32,
     389    kCvSymType_GProc32,
     390    kCvSymType_Thunk32,
     391    kCvSymType_Block32,
     392    kCvSymType_With32,
     393    kCvSymType_Label32,
     394    kCvSymType_CExModel32,
     395    kCvSymType_VftPath32,
     396    kCvSymType_RegRel32,
     397    kCvSymType_LThread32,
     398    kCvSymType_GThread32,
     399    /** @}  */
     400
     401    /** @name Symbols for MIPS.
     402     * @{ */
     403    kCvSymType_LProcMips = 0x0300,
     404    kCvSymType_GProcMips,
     405    /** @} */
     406
     407    /** @name Symbols for Microsoft CodeView.
     408     * @{ */
     409    kCvSymType_ProcRef = 0x0400,
     410    kCvSymType_DataRef,
     411    kCvSymType_Align,
     412    kCvSymType_LProcRef,
     413    /** @} */
     414
     415    /** @name Symbols with 32-bit address (I think) and 32-bit type indices.
     416     * @{ */
     417    kCvSymType_V2_Register = 0x1001,
     418    kCvSymType_V2_Constant,
     419    kCvSymType_V2_Udt,
     420    kCvSymType_V2_CobolUdt,
     421    kCvSymType_V2_ManyReg,
     422    kCvSymType_V2_BpRel,
     423    kCvSymType_V2_LData,
     424    kCvSymType_V2_GData,
     425    kCvSymType_V2_Pub,
     426    kCvSymType_V2_LProc,
     427    kCvSymType_V2_GProc,
     428    kCvSymType_V2_VftTable,
     429    kCvSymType_V2_RegRel,
     430    kCvSymType_V2_LThread,
     431    kCvSymType_V2_GThread,
     432    kCvSymType_V2_Unknown_1010,
     433    kCvSymType_V2_Unknown_1011,
     434    kCvSymType_V2_FrameInfo,
     435    kCvSymType_V2_Compliand,
     436    /** @} */
     437
     438    /** @name Version 3 symbol types.
     439     * @{ */
     440    /** Name of the object file, preceded by a 4-byte language type (ASM=0) */
     441    kCvSymType_V3_Compliand = 0x1101,
     442    kCvSymType_V3_Thunk,
     443    kCvSymType_V3_Block,
     444    kCvSymType_V3_Unknown_1104,
     445    kCvSymType_V3_Label,                /**< RTCVSYMV3LABEL */
     446    kCvSymType_V3_Register,
     447    kCvSymType_V3_Constant,
     448    kCvSymType_V3_Udt,
     449    kCvSymType_V3_Unknown_1109,
     450    kCvSymType_V3_Unknown_110a,
     451    kCvSymType_V3_BpRel,
     452    kCvSymType_V3_LData,               /**< RTCVSYMV3TYPEDNAME */
     453    kCvSymType_V3_GData,               /**< RTCVSYMV3TYPEDNAME */
     454    kCvSymType_V3_Pub,
     455    kCvSymType_V3_LProc,
     456    kCvSymType_V3_GProc,
     457    kCvSymType_V3_RegRel,
     458    kCvSymType_V3_LThread,
     459    kCvSymType_V3_GThread,
     460    kCvSymType_V3_Unknown_1114,
     461    kCvSymType_V3_Unknown_1115,
     462    kCvSymType_V3_MSTool,               /**< RTCVSYMV3MSTOOL */
     463
     464    kCvSymType_V3_PubFunc1 = 0x1125,
     465    kCvSymType_V3_PubFunc2 = 0x1127,
     466    kCvSymType_V3_SectInfo = 0x1136,
     467    kCvSymType_V3_SubSectInfo,
     468    kCvSymType_V3_Entrypoint,
     469    kCvSymType_V3_Unknown_1139,
     470    kCvSymType_V3_SecuCookie,
     471    kCvSymType_V3_Unknown_113b,
     472    kCvSymType_V3_MsToolInfo,
     473    kCvSymType_V3_MsToolEnv,
     474
     475    kCvSymType_VS2013_Local,
     476    kCvSymType_VS2013_FpOff = 0x1144,
     477    kCvSymType_VS2013_LProc32 = 0x1146,
     478    kCvSymType_VS2013_GProc32,
     479    /** @} */
     480
     481    kCvSymType_EndOfValues
     482} RTCVSYMTYPE;
     483AssertCompile(kCvSymType_V3_Udt == 0x1108);
     484AssertCompile(kCvSymType_V3_GProc == 0x1110);
     485AssertCompile(kCvSymType_V3_MSTool == 0x1116);
     486AssertCompile(kCvSymType_VS2013_Local == 0x113E);
     487typedef RTCVSYMTYPE *PRTCVSYMTYPE;
     488typedef RTCVSYMTYPE const *PCRTCVSYMTYPE;
     489
     490
     491/**
     492 * kCvSymType_V3_MSTool format.
     493 */
     494typedef struct RTCVSYMV3MSTOOL
     495{
     496    /** Language or tool ID (3 == masm). */
     497    uint32_t    uLanguage;
     498    /** Target CPU (0xd0 == AMD64). */
     499    uint32_t    uTargetCpu;
     500    /** Flags. */
     501    uint32_t    fFlags;
     502    /** Version.   */
     503    uint32_t    uVersion;
     504    /** The creator name, zero terminated.
     505     *
     506     * It is followed by key/value pairs of zero terminated strings giving more
     507     * details about the current directory ('cwd'), compiler executable ('cl'),
     508     * full command line ('cmd'), source path relative to cwd ('src'), the
     509     * full program database path ('pdb'), and possibly others.  Terminated by a
     510     * pair of empty strings, usually. */
     511    char        szCreator[1];
     512} RTCVSYMV3MSTOOL;
     513typedef RTCVSYMV3MSTOOL *PRTCVSYMV3MSTOOL;
     514typedef RTCVSYMV3MSTOOL const *PCRTCVSYMV3MSTOOL;
     515
     516/**
     517 * kCvSymType_V3_Label format.
     518 */
     519typedef struct RTCVSYMV3LABEL
     520{
     521    /** Offset into iSection of this symbol. */
     522    uint32_t        offSection;
     523    /** The index of the section where the symbol lives. */
     524    uint16_t        iSection;
     525    /** Flags or something. */
     526    uint8_t         fFlags;
     527    /** Zero terminated symbol name (variable length). */
     528    char            szName[1];
     529} RTCVSYMV3LABEL;
     530AssertCompileSize(RTCVSYMV3LABEL, 8);
     531typedef RTCVSYMV3LABEL *PRTCVSYMV3LABEL;
     532typedef RTCVSYMV3LABEL const *PCRTCVSYMV3LABEL;
     533
     534/**
     535 * kCvSymType_V3_LData and kCvSymType_V3_GData format.
     536 */
     537typedef struct RTCVSYMV3TYPEDNAME
     538{
     539    /** The type ID. */
     540    uint32_t        idType;
     541    /** Offset into iSection of this symbol. */
     542    uint32_t        offSection;
     543    /** The index of the section where the symbol lives. */
     544    uint16_t        iSection;
     545    /** Zero terminated symbol name (variable length). */
     546    char            szName[2];
     547} RTCVSYMV3TYPEDNAME;
     548AssertCompileSize(RTCVSYMV3TYPEDNAME, 12);
     549typedef RTCVSYMV3TYPEDNAME *PRTCVSYMV3TYPEDNAME;
     550typedef RTCVSYMV3TYPEDNAME const *PCRTCVSYMV3TYPEDNAME;
     551
     552/**
     553 * kCvSymType_V3_LProc and kCvSymType_V3_GProc format.
     554 */
     555typedef struct RTCVSYMV3PROC
     556{
     557    /** Lexical scope linking: Parent. */
     558    uint32_t        uParent;
     559    /** Lexical scope linking: End. */
     560    uint32_t        uEnd;
     561    /** Lexical scope linking: Next. */
     562    uint32_t        uNext;
     563    /** The procedure length. */
     564    uint32_t        cbProc;
     565    /** Offset into the procedure where the stack frame has been setup and is an
     566     * excellent position for a function breakpoint. */
     567    uint32_t        offDebugStart;
     568    /** Offset into the procedure where the procedure is ready to return and has a
     569     * return value (if applicable). */
     570    uint32_t        offDebugEnd;
     571    /** The type ID for the procedure. */
     572    uint32_t        idType;
     573    /** Offset into iSection of this procedure. */
     574    uint32_t        offSection;
     575    /** The index of the section where the procedure lives. */
     576    uint16_t        iSection;
     577    /** Flags.   */
     578    uint8_t         fFlags;
     579    /** Zero terminated procedure name (variable length). */
     580    char            szName[1];
     581} RTCVSYMV3PROC;
     582AssertCompileSize(RTCVSYMV3PROC, 36);
     583typedef RTCVSYMV3PROC *PRTCVSYMV3PROC;
     584typedef RTCVSYMV3PROC const *PCRTCVSYMV3PROC;
     585
     586
     587/** @name $$SYMBOLS signatures.
     588 * @{ */
     589/** The $$SYMBOL table signature for CV4. */
     590#define RTCVSYMBOLS_SIGNATURE_CV4   UINT32_C(0x00000001)
     591/** The $$SYMBOL table signature for CV8 (MSVC 8/2005).
     592 * Also seen with MSVC 2010 using -Z7, so maybe more appropriate to call it
     593 * CV7? */
     594#define RTCVSYMBOLS_SIGNATURE_CV8   UINT32_C(0x00000004)
     595/** @} */
     596
     597
     598/**
     599 * CV8 $$SYMBOLS block header.
     600 */
     601typedef struct RTCV8SYMBOLSBLOCK
     602{
     603    /** BLock type (RTCV8SYMBLOCK_TYPE_XXX). */
     604    uint32_t    uType;
     605    /** The block length, including this header? */
     606    uint32_t    cb;
     607} RTCV8SYMBOLSBLOCK;
     608AssertCompileSize(RTCV8SYMBOLSBLOCK, 8);
     609typedef RTCV8SYMBOLSBLOCK *PRTCV8SYMBOLSBLOCK;
     610typedef RTCV8SYMBOLSBLOCK const *PCRTCV8SYMBOLSBLOCK;
     611
     612/** @name RTCV8SYMBLOCK_TYPE_XXX - CV8 (MSVC 8/2005) $$SYMBOL table types.
     613 * @{ */
     614/** Symbol information.
     615 * Sequence of types.  Each type entry starts with a 16-bit length followed
     616 * by a 16-bit RTCVSYMTYPE value.  Just like CV4/5, but with C-strings
     617 * instead of pascal. */
     618#define RTCV8SYMBLOCK_TYPE_SYMBOLS        UINT32_C(0x000000f1)
     619/** Line numbers for a section. */
     620#define RTCV8SYMBLOCK_TYPE_SECT_LINES     UINT32_C(0x000000f2)
     621/** Source file string table.
     622 * The strings are null terminated. Indexed by RTCV8SYMBLOCK_TYPE_SRC_INFO. */
     623#define RTCV8SYMBLOCK_TYPE_SRC_STR        UINT32_C(0x000000f3)
     624/** Source file information. */
     625#define RTCV8SYMBLOCK_TYPE_SRC_INFO       UINT32_C(0x000000f4)
     626/** @} */
     627
     628/**
     629 * Line number header found in a RTCV8SYMBLOCK_TYPE_SECT_LINES block.
     630 *
     631 * This is followed by a sequence of RTCV8LINESSRCMAP structures.
     632 */
     633typedef struct RTCV8LINESHDR
     634{
     635    /** Offset into the section. */
     636    uint32_t    offSection;
     637    /** The section number.  */
     638    uint16_t    iSection;
     639    /** Padding/zero/maybe-previous-member-is-a-32-bit-value. */
     640    uint16_t    u16Padding;
     641    /** Number of bytes covered by this table, starting at offSection. */
     642    uint32_t    cbSectionCovered;
     643} RTCV8LINESHDR;
     644AssertCompileSize(RTCV8LINESHDR, 12);
     645typedef RTCV8LINESHDR *PRTCV8LINESHDR;
     646typedef RTCV8LINESHDR const *PCRTCV8LINESHDR;
     647
     648/**
     649 * CV8 (MSVC 8/2005) line number source map.
     650 *
     651 * This is followed by an array of RTCV8LINEPAIR.
     652 */
     653typedef struct RTCV8LINESSRCMAP
     654{
     655    /** The source file name, given as an offset into the string table
     656     * (RTCV8SYMBLOCK_TYPE_SRC_STR). */
     657    uint32_t    offSourceName;
     658    /** Number of line numbers following this structure. */
     659    uint32_t    cLines;
     660    /** The size of this source map. */
     661    uint32_t    cb;
     662} RTCV8LINESSRCMAP;
     663AssertCompileSize(RTCV8LINESSRCMAP, 12);
     664typedef RTCV8LINESSRCMAP *PRTCV8LINESSRCMAP;
     665typedef RTCV8LINESSRCMAP const *PCRTCV8LINESSRCMAP;
     666
     667/**
     668 * One line number.
     669 */
     670typedef struct RTCV8LINEPAIR
     671{
     672    /** Offset into the section of this line number. */
     673    uint32_t    offSection;
     674    /** The line number. */
     675    uint32_t    uLineNumber : 30;
     676    /** Indicates that it's not possible to set breakpoint? */
     677    uint32_t    fEndOfStatement : 1;
     678} RTCV8LINEPAIR;
     679AssertCompileSize(RTCV8LINEPAIR, 8);
     680typedef RTCV8LINEPAIR *PRTCV8LINEPAIR;
     681typedef RTCV8LINEPAIR const *PCRTCV8LINEPAIR;
     682
     683/**
     684 * Source file information found in a RTCV8SYMBLOCK_TYPE_SRC_INFO block.
     685 */
     686typedef struct RTCV8SRCINFO
     687{
     688    /** The source file name, given as an offset into the string table
     689     * (RTCV8SYMBLOCK_TYPE_SRC_STR). */
     690    uint32_t    offSourceName;
     691    /** Digest/checksum type. */
     692    uint16_t    uDigestType;
     693    union
     694    {
     695        /** RTCV8SRCINFO_DIGEST_TYPE_MD5. */
     696        struct
     697        {
     698            /** The digest. */
     699            uint8_t ab[16];
     700            /** Structur alignment padding. */
     701            uint8_t abPadding[2];
     702        } md5;
     703        /** RTCV8SRCINFO_DIGEST_TYPE_NONE: Padding. */
     704        uint8_t abNone[2];
     705    } Digest;
     706} RTCV8SRCINFO;
     707AssertCompileSize(RTCV8SRCINFO, 24);
     708typedef RTCV8SRCINFO *PRTCV8SRCINFO;
     709typedef RTCV8SRCINFO const *PCRTCV8SRCINFO;
     710
     711/** @name  RTCV8SRCINFO_DIGEST_TYPE_XXX - CV8 source digest types.
     712 * Used by RTCV8SRCINFO::uDigestType.
     713 * @{ */
     714#define RTCV8SRCINFO_DIGEST_TYPE_NONE   UINT16_C(0x0000)
     715#define RTCV8SRCINFO_DIGEST_TYPE_MD5    UINT16_C(0x0110)
     716/** @} */
     717
     718
     719
    37720/**
    38721 * PDB v2.0 in image debug info.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette