demangle_datatype: delete superflous free().
[wine] / tools / winedump / cvinclude.h
1 /*
2  * CodeView 4 Debug format - declarations
3  *
4  * (based on cvinfo.h and cvexefmt.h from the Win32 SDK)
5  *
6  * Copyright 2000 John R. Sheets for Codeweavers
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #define sstModule           0x120
24 #define sstAlignSym         0x125
25 #define sstSrcModule        0x127
26 #define sstLibraries        0x128
27 #define sstGlobalSym        0x129
28 #define sstGlobalPub        0x12a
29 #define sstGlobalTypes      0x12b
30 #define sstSegMap           0x12d
31 #define sstFileIndex        0x133
32 #define sstStaticSym        0x134
33
34 #if 0
35 /* Old, crusty value */
36 #define S_PUB32             0x0203
37 #endif
38
39 #define S_PUB32             0x1009
40
41 #include "pshpack1.h"
42
43 /*
44  * CodeView headers
45  */
46
47 typedef struct OMFSignature
48 {
49     char        Signature[4];
50     long        filepos;
51 } OMFSignature;
52
53 typedef struct OMFDirHeader
54 {
55     unsigned short  cbDirHeader;
56     unsigned short  cbDirEntry;
57     unsigned long   cDir;
58     long            lfoNextDir;
59     unsigned long   flags;
60 } OMFDirHeader;
61
62 typedef struct OMFDirEntry
63 {
64     unsigned short  SubSection;
65     unsigned short  iMod;
66     long            lfo;
67     unsigned long   cb;
68 } OMFDirEntry;
69
70
71 /*
72  * sstModule subsection
73  */
74
75 typedef struct OMFSegDesc
76 {
77     unsigned short  Seg;
78     unsigned short  pad;
79     unsigned long   Off;
80     unsigned long   cbSeg;
81 } OMFSegDesc;
82
83 /* Must chop off the OMFSegDesc* field, because we need to write this
84  * struct out to a file.  If we write the whole struct out, we'll end up
85  * with (*OMFSegDesc), not (OMFSegDesc).  See OMFModuleFull.
86  */
87 typedef struct OMFModule
88 {
89     unsigned short  ovlNumber;
90     unsigned short  iLib;
91     unsigned short  cSeg;
92     char            Style[2];
93 } OMFModule;
94
95 /* Full version, with memory pointers, too.  Use OMFModule for writing out to
96  * a file, and OMFModuleFull for reading.  If offsetof() were available, we
97  * could use that instead.
98  */
99 typedef struct OMFModuleFull
100 {
101     unsigned short  ovlNumber;
102     unsigned short  iLib;
103     unsigned short  cSeg;
104     char            Style[2];
105     OMFSegDesc      *SegInfo;
106     char            *Name;
107 } OMFModuleFull;
108
109
110 /*
111  * sstGlobalPub section
112  */
113
114 /* Header for symbol table.
115  */
116 typedef struct OMFSymHash
117 {
118     unsigned short  symhash;
119     unsigned short  addrhash;
120     unsigned long   cbSymbol;
121     unsigned long   cbHSym;
122     unsigned long   cbHAddr;
123 } OMFSymHash;
124
125 /* Symbol table entry.
126  */
127 typedef struct DATASYM32
128 {
129     unsigned short  reclen;
130     unsigned short  rectyp;
131     unsigned long   typind;
132     unsigned long   off;
133     unsigned short  seg;
134 } DATASYM32;
135 typedef DATASYM32 PUBSYM32;
136
137 /*
138  * sstSegMap section
139  */
140
141 typedef struct OMFSegMapDesc
142 {
143     unsigned short  flags;
144     unsigned short  ovl;
145     unsigned short  group;
146     unsigned short  frame;
147     unsigned short  iSegName;
148     unsigned short  iClassName;
149     unsigned long   offset;
150     unsigned long   cbSeg;
151 } OMFSegMapDesc;
152
153 typedef struct OMFSegMap
154 {
155     unsigned short  cSeg;
156     unsigned short  cSegLog;
157 /*    OMFSegMapDesc   rgDesc[0];*/
158 } OMFSegMap;
159
160
161 /*
162  * sstSrcModule section
163  */
164
165 typedef struct OMFSourceLine
166 {
167     unsigned short  Seg;
168     unsigned short  cLnOff;
169     unsigned long   offset[1];
170     unsigned short  lineNbr[1];
171 } OMFSourceLine;
172
173 typedef struct OMFSourceFile
174 {
175     unsigned short  cSeg;
176     unsigned short  reserved;
177     unsigned long   baseSrcLn[1];
178     unsigned short  cFName;
179     char            Name;
180 } OMFSourceFile;
181
182 typedef struct OMFSourceModule
183 {
184     unsigned short  cFile;
185     unsigned short  cSeg;
186     unsigned long   baseSrcFile[1];
187 } OMFSourceModule;